-
Notifications
You must be signed in to change notification settings - Fork 21
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
Conversation
There was a problem hiding this 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![], |
There was a problem hiding this comment.
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<()> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Seems this has been included in #62. (e80d2e4) Have we moved working on this PR to #62 @Acentelles ? |
Yes, thank you! |
This PR implements the necessary changes to reflect the following diagram
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.