You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have reviewed the gRPC API, and worked with it extensively. It's time to work out a better RPC layer for PK. There are several problems to to consider here:
We serialize our PK exceptions and then pass them to the client where it deserializes exceptions
Do we have to consider backwards compatibility here? What happens if the agent side serializes an exception that doesn't exist on the client side code, the client side should gracefully handle this by throwing a generic exception that indicates the client doesn't understand the exception (but provide exception details)
GRPC service version would be independent of the js-polykey version which is independent from the state version, which would give us 3 versions to manage:
pk source version - updated when source code changes, minor is new features, major is any new incompatibility from anywhere: cli, service, node state... etc, e.g. 1.0.0 -> 1.1.0 -> 2.0.0 -> 2.0.1
grpc service version - only major version and only changes on breaking changes, e.g. 1 -> 2 -> 3
node state version - only major version and only changes on breaking changes to the node state, e.g. 1 -> 2 -> 3
We have 2 main proto files:
proto/schemas/Client.proto
proto/schemas/Agent.proto
And a Test.proto as well, this will need to be used to generate the marshaling code.
GRPC Web Proxy to enable Browser Integration and Eliminate Electron IPC #235 - would not be a problem anymore if a web-based transport is enabled, either that or if electron directly bridges into the nodejs runtime (rather than having the FE call into a BE proxy) - this is also relevant to any browser-extensions
Apply timedCancellable to Sigchain such as the deadline in nodes claim process #243 - it's a good idea for the RPC to have timeouts on its calls and to handle such timeouts, in particular we would want to be able to create "custom" protocols on top of any streams, or better would be to "lift" such protocols into the the underlying RPC system such as the nodes claiming process
- Version the Client.proto and Agent.proto with version names and test out multiple-version services, and find out what the client does when the version wanted is not available
- Test out grpc reflection for versioning if necessary
- Update all the primitive types, and any usage of 64 bit int should have the string hint
- Add some benchmarks to the grpc, and check if MAX_CONCURRENT_CONNECTIONS is used
- Consider how to shutdown the grpc server and terminate all client connections as well
- Figure out CQRS, pagination and streaming
- Clean up js-pagination client and server side utilities
- Pagination on unary calls, and streaming calls that can be initialised with a pagination parameters (which would enable some sort of CQRS and event sourcing concepts)
- Review in reference to authentication and sessions
We have reviewed the gRPC API, and worked with it extensively. It's time to work out a better RPC layer for PK. There are several problems to to consider here:
src/clientauthenticator1.0.0 -> 1.1.0 -> 2.0.0 -> 2.0.11 -> 2 -> 31 -> 2 -> 3We have 2 main proto files:
proto/schemas/Client.protoproto/schemas/Agent.protoAnd a
Test.protoas well, this will need to be used to generate the marshaling code.Additional context
timedCancellabletoSigchainsuch as the deadline in nodes claim process #243 - it's a good idea for the RPC to have timeouts on its calls and to handle such timeouts, in particular we would want to be able to create "custom" protocols on top of any streams, or better would be to "lift" such protocols into the the underlying RPC system such as the nodes claiming processTasks
.protodefinition subdomains. #279Client.protoandAgent.protowith version names and test out multiple-version services, and find out what the client does when the version wanted is not availableMAX_CONCURRENT_CONNECTIONSis used1.4.1version has some incompatibility:TypeError: http2Server.on is not a function.