-
Notifications
You must be signed in to change notification settings - Fork 53
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
Check for Genesis before Clearing payload_commitment_and_metadata
#2276
Conversation
payload_commitment_and_metadata
crates/task-impls/src/consensus.rs
Outdated
let genesis_commitment = vid_commitment( | ||
&genesis_payload.encode().unwrap().collect(), | ||
self.quorum_membership.total_nodes(), | ||
); |
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.
We are computing an extraneous VID commitment every time we receive a vote? We need to cache this somewhere. Or we could add an explicit is_genesis
flag to payload_commitment_and_metadata
, since we should know at the time we set this whether it is the genesis or not
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.
This only happens if the proposal is for view 1 and the genesis flag on the justify QC is set. So it only happens in the first round of voting
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.
We could add a flag to remove this check
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.
Looks good, want to make sure the CI passes first though
Same, passed on the last commit and this should improve things |
This PR:
Fixes a race condition where a node could get it's VID payload commit and metadata before it got the first proposal with genesis qc justification and then would clear the correct data and cause it to not propose.
This PR does not:
Key places to review:
The fix, and in general if the flow of clearing this variable which is set on task creation makes sense