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

Check for Genesis before Clearing payload_commitment_and_metadata #2276

Merged
merged 5 commits into from
Dec 22, 2023

Conversation

bfish713
Copy link
Collaborator

@bfish713 bfish713 commented Dec 22, 2023

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

@bfish713 bfish713 self-assigned this Dec 22, 2023
@bfish713 bfish713 changed the title Bf/genesis fix Check for Genesis before Clearing payload_commitment_and_metadata Dec 22, 2023
@bfish713 bfish713 marked this pull request as ready for review December 22, 2023 15:31
rob-maron
rob-maron previously approved these changes Dec 22, 2023
Comment on lines 241 to 244
let genesis_commitment = vid_commitment(
&genesis_payload.encode().unwrap().collect(),
self.quorum_membership.total_nodes(),
);
Copy link
Member

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Collaborator

@rob-maron rob-maron left a 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

@bfish713
Copy link
Collaborator Author

Looks good, want to make sure the CI passes first though

Same, passed on the last commit and this should improve things

@bfish713 bfish713 merged commit 7ceac89 into main Dec 22, 2023
7 of 8 checks passed
@bfish713 bfish713 deleted the bf/genesis-fix branch December 22, 2023 17:38
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