Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol combinators #60

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Protocol combinators #60

wants to merge 3 commits into from

Conversation

fjarri
Copy link
Member

@fjarri fjarri commented Nov 2, 2024

We have several different situations where we need to build on top of an existing protocol or combine several of them:

  1. Modifying messages the node sends, keeping Round::Protocol the same. This is useful for writing tests.
  2. Chaining two protocols together. This is useful e.g. for joining Presigning and Signing in CGGMP.
  3. Executing two independent protocols simultaneously. This is useful e.g. for merging KeyInit and AuxGen in CGGMP. (They don't have to have the same number of round, but their execution graph has to be... compatible? Need to find a formal way to describe that). This will fix Investigate the scenario of merging two protocols #3.
  4. Building on top of an existing protocol, adding features. This is useful e.g. for extending AuxGen to also do KeyRefresh in CGGMP. KeyRefresh needs some intermediate information created during AuxGen (Paillier keys), so the new protocol would have to introspect the AuxGen state, add information to the outgoing messages, extract a part of information from the received messages, and add logic to finalization too.

Status

  • Scenario 1 done as Misbehave. Override macro and its machinery can be removed from testing. Should Misbehave go into testing? Or gated behind the testing feature?
  • Scenario 2 done as Chain, but needs work on round nesting.

Notes:

  • We need to avoid blanket implementations for traits, those can be painful on the users. Better create a newtype wrapper and impl stuff for it. And no macros.
  • All except for scenario 1 will involve creating a new Protocol implementation.
  • It seems that scenario 4 is a superset of scenario 1, but the question is, if we implement it that way, will it add any boilerplate to the usage in tests? If it does, we better keep them separate.
  • Scenario 2 has a problem: all the others do not need to modify round IDs, but this one does, since without it they will surely repeat. We need some mechanism of "nesting" round IDs.
  • Since the overriding methods have to introspect incoming messages, they need access to Deserializer. Should ObjectSafeRound make_* methods take the deserializer too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate the scenario of merging two protocols
1 participant