Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings updates from d-voting's Pedersen DKG into
dela/dkg/pedersen, together with the minimal generic helpers needed for d-voting to use DELA directly without accessing private DKG state.Some changes come from d-voting, while others are new helpers added to DELA so d-voting does not need to access private DKG state.
closes #44
Peer public-key discovery
Adds
GetPeerPubKey/GetPeerPubKeyRespandSetupWithPlayers(mino.Players, int).DELA's current
Setup(coAuth, threshold)expects the caller to already know the DKG public key of every participant. d-voting already solved this by asking every peer for its public key before starting the DKG.SetupWithPlayersnow does this in DELA:SetupThe existing
Setupmethod stays unchanged.This flow was originally added in d-voting by Noémien Kocher in commit
4ac9e957(Updates the election flow).Actor persistence
Adds
MarshalBinary()andRestore(mino.Mino, []byte)so a DKG actor can be saved and restored after a restart.d-voting already had persistence for its DKG state using
HandlerDataandMarshalJSON. This work was added by Auguste Baum in commits:fefc7fbed572abe242dd96f0The DELA version follows the same idea but is made generic:
m.GetAddressFactory()when restoringOnly stable
initialandcertifiedstates can be saved.sharingandresharingare rejected.The snapshot contains private DKG state, so it must be stored securely.
Helpers that make d-voting work but may not be used by DELA
Local partial decryption
Adds
DecryptShare(K, C).d-voting needs each node to calculate its own partial decryption before publishing it. Its current implementation does this directly using
privShare.V.DELA already does the same calculation internally during decryption, but there was no actor method for doing it locally.
DecryptShareexposes this operation without exposing the private share itself. It only returns the share index and the partial decryption.This is new in DELA and is not directly ported from d-voting.
Shared decrypt helper
The existing network decrypt path and the new
DecryptSharemethod now both use the same internaldecryptSharehelper.This is just a small refactor so both paths use the same calculation.
Tests
go test ./dkg/... -count=1And a d-voting temorrary adapter was tested with the new dela changes. All pass.