-
Notifications
You must be signed in to change notification settings - Fork 925
More proposer shuffling cleanup #8130
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
Open
michaelsproul
wants to merge
16
commits into
sigp:unstable
Choose a base branch
from
michaelsproul:proposer-shuffling-cleanup
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+355
−59
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
77cb635
More proposer shuffling cleanup (WIP)
michaelsproul 59b873b
Doc lint
michaelsproul e9b7a51
Use explicit epoch in compute_proposer_duties_from_head
michaelsproul 5aba2ec
Update the state advance
michaelsproul ffe1c82
Start reverting the extra advance added in #8121
michaelsproul 5fcaeb2
Spicy test and fix fork_at_epoch (I think)
michaelsproul 3520fa4
Improve cache miss logging
michaelsproul fc3a5e9
State advance more aggressively
michaelsproul 59cbaba
Remove unused errors
michaelsproul f3f94b3
Merge remote-tracking branch 'origin/unstable' into proposer-shufflin…
michaelsproul a4ab920
Add more instrumentation for op pool
michaelsproul 6ce8fd8
Merge remote-tracking branch 'origin/unstable' into proposer-shufflin…
michaelsproul 97da066
Add regression test for tolerant current epoch case
michaelsproul 3171c12
Add some tests at Gloas fork epoch
michaelsproul a9ff728
Merge remote-tracking branch 'origin/unstable' into proposer-shufflin…
michaelsproul ff5edd0
Fix lints
michaelsproul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
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 had regressed here (in 8101) when I removed this code:
lighthouse/beacon_node/http_api/src/proposer_duties.rs
Lines 114 to 126 in cfb1f73
My intent was to replace the manual calculation of the dependent root with the unified
proposer_shuffling_decision_root_at_epoch
function, but I mistakenly kept using theproposer_shuffling_decision_root
function which computes the decision root for the state's current epoch. At epoch boundaries, this codepath could be called withrequest_epoch == head_epoch + 1
, in which caseproposer_shuffling_decision_root
would be wrong (it would be the decision block for the current epoch instead of the next).Using
proposer_shuffling_decision_root_at_epoch
fixes this, and is generic over pre-Fulu vs post-Fulu. It uses the request epoch to determine the decision slot, and then uses either the passed inhead_block_root
or state's block roots to compute the correct root.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.
The impact of this is that in v8.0.0-rc.0 we might return the wrong duties for an epoch, and put a nonsensical entry into the cache. This could lead to a block proposal failure in the worst case (the VC would make a request for a block when it isn't actually the proposer), which would be caught by the proposer index checks in
produce_block
(which are not buggy). If the same VC holds the key for the true proposer then it might miss the proposal for that true proposer.I think this is low impact enough that it is OK not to delay v8.0.0-rc.0 over, although we should fix it soon!
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.
For this to return the wrong duties in practice requires that there be an entry for
(current_epoch_decision_block_root, request_epoch)
in the cache. This should not happen, unless there's another bug somewhere that would add a value for this pair to the cache. As far as I can tell, there isn't (need to check the state advance).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.
The other way we could end up with an entry for that key is if there's a long skip on an alternate chain using that shuffling. This is also quite unlikely, but I guess could be triggered intentionally by an attacker to force some LH proposers to fail proposing temporarily.
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.
Test added in 97da066. I confirmed that this test fails when reverting this change.