-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
developmentStandard developmentStandard developmentenhancementNew feature or requestNew feature or requestr&d:polykey:core activity 3Peer to Peer Federated HierarchyPeer to Peer Federated Hierarchy
Description
Specification
From original node claims issue: #213 (comment)
Due to intermediate resources being created for this interaction between 2 agents to sign each node, we will need a deadline for each interaction step.
To simplify, you can have a single deadline for the entire interaction from step 2 onwards.
X -> sends notification to (to start cross signing request)( -> Y STEP 2 BEGINS HERE: X <- calls cross signing grpc request and sends its signed claim (intermediate) <- Y (use bidirectional stream and lock the sigchain on Y and X) X -> responds with double signing the Y signed claim, and also bundles it with its own signed claim (intermediate) -> Y X <- responds with double signing the X signed claim <- YBoth X and Y would need a deadline starting from step 2.
To implement a deadline, there are 2 ways:
- Using the underlying GRPC deadline functionality - I've seen this parameter get used in unary calls, but I don't know how that applies to streams, it may not relevant to streams.
- Using racing promises. I've already implemented this pattern in the networking domain. See the usage of
timerStartandtimerStopinsideForwardProxyand thePromise.racecall inConnectionForward. The usage is quite complex in the networking domain, but in the case of this node claims process, the entire usage of theTimertype (insrc/types.ts) should be executed entirely inside theGRPCClientAgentof Y andagentServiceof X. However it is possible to consider the construction and destruction of the timer object in the imperative shell, and then use it in an optional way inside the nodes domain.If the deadline fails it's an exception in the interaction. Upon this exception you need to throw the relevant error to the other side of the interaction, and then finish up and clean up any intermediate resources. Remember to UNLOCK your domains!
This work should be extended into other relevant gRPC calls too.
Additional context
- there's some good discussion and explanation by Roger of his timeout construct from a call we had a little while ago: https://vimeo.com/manage/videos/599995567 see around 13:00
Tasks
- Look into the pre-existing timeout construct
- Add timeout to both client-side and server-side claims process
- Throw relevant exceptions on timeout (close stream, etc)
Metadata
Metadata
Assignees
Labels
developmentStandard developmentStandard developmentenhancementNew feature or requestNew feature or requestr&d:polykey:core activity 3Peer to Peer Federated HierarchyPeer to Peer Federated Hierarchy