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

Ferveo state machine #63

Closed
wants to merge 4 commits into from
Closed

Ferveo state machine #63

wants to merge 4 commits into from

Conversation

Acentelles
Copy link

@Acentelles Acentelles commented Aug 18, 2021

This PR implements the necessary changes to reflect the following diagram

Screenshot 2021-08-19 at 15 27 38

The initialisation of a DKG instance sets its state to Init. It then waits for 2/3 of the validators to send a deal message with their respective PVSS. Once this threshold is matched, the state machine moves to the Dealt state, where the DKG generates a transcript and sends the decryption shares to the participants. In this Shared state, the DKG waits for a node (likely the block proposer) to send an aggregate message. Once it arrives, validators check this message. The final state of the DKG, Success or Invalid, depend of the outcome of this final validation phase.

The announce message and Announce phase have been removed. We'll likely read the validators stakes from storage.

  • Read validators stakes from storage
  • Handle invalid case, that is, when the aggregated share is not valid.

@Acentelles Acentelles marked this pull request as draft August 18, 2021 12:36
@Acentelles Acentelles requested review from a user and batconjurer August 18, 2021 16:09
Copy link
Member

@batconjurer batconjurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the dkg state machine doens't need to store the announce messages at all. Also, not related, but can we get rid of use crate::* and explicitly import in everything that is used. I wanted to see what file partition_domain was in and the imports in src/dkg/pv.rs didn't tell so I had to go searching.

me: 0, // TODO: invalid value
//final_state: None,
local_shares: vec![],
// TODO: Validators don't announce themselves through DKG
// TODO: Instead, we read stakes from storage
announce_messages: vec![],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need to store these anymore? I don't think so. I think we can pass this information into finalize_announcement below as a parameter. All we really need stored here is the participants

@@ -91,17 +93,13 @@ where
/// Call `finish_announce` once the Announcement phase is complete
/// Partitions the share domain among the announced participants
/// and begins the sharing phase of the DKG
/// TODO: Since announce is no longer a phase, do we still need this?
pub fn finish_announce(&mut self) -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's pass the announcements in here as a parameter. And maybe we should just rename announcements to stakes or something since we are announcing anything anymore, just querying the tendermint node.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, maybe we should rename this function to create_weight_shares or something.

@ggkitsas
Copy link
Contributor

Seems this has been included in #62. (e80d2e4)

Have we moved working on this PR to #62 @Acentelles ?
If so we could close this (unmerged).

@Acentelles
Copy link
Author

Yes, thank you!

@Acentelles Acentelles closed this Sep 20, 2021
cygnusv pushed a commit to cygnusv/ferveo that referenced this pull request Jul 28, 2023
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.

3 participants