-
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
base: unstable
Are you sure you want to change the base?
Changes from 3 commits
77cb635
59b873b
e9b7a51
5aba2ec
ffe1c82
5fcaeb2
3520fa4
fc3a5e9
59cbaba
f3f94b3
a4ab920
6ce8fd8
97da066
3171c12
a9ff728
ff5edd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -103,14 +103,6 @@ fn try_proposer_duties_from_cache<T: BeaconChainTypes>( | |||||||||||||||||||||||||||
let head_block = &head.snapshot.beacon_block; | ||||||||||||||||||||||||||||
let head_block_root = head.head_block_root(); | ||||||||||||||||||||||||||||
let head_epoch = head_block.slot().epoch(T::EthSpec::slots_per_epoch()); | ||||||||||||||||||||||||||||
let head_decision_root = head | ||||||||||||||||||||||||||||
.snapshot | ||||||||||||||||||||||||||||
.beacon_state | ||||||||||||||||||||||||||||
.proposer_shuffling_decision_root(head_block_root, &chain.spec) | ||||||||||||||||||||||||||||
.map_err(warp_utils::reject::beacon_state_error)?; | ||||||||||||||||||||||||||||
let execution_optimistic = chain | ||||||||||||||||||||||||||||
.is_optimistic_or_invalid_head_block(head_block) | ||||||||||||||||||||||||||||
.map_err(warp_utils::reject::unhandled_error)?; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
// This code path can't handle requests for past epochs. | ||||||||||||||||||||||||||||
if head_epoch > request_epoch { | ||||||||||||||||||||||||||||
|
@@ -119,6 +111,15 @@ fn try_proposer_duties_from_cache<T: BeaconChainTypes>( | |||||||||||||||||||||||||||
))); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
let head_decision_root = head | ||||||||||||||||||||||||||||
.snapshot | ||||||||||||||||||||||||||||
.beacon_state | ||||||||||||||||||||||||||||
.proposer_shuffling_decision_root_at_epoch(request_epoch, head_block_root, &chain.spec) | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Using There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||||||||||||||||||||||||||||
.map_err(warp_utils::reject::beacon_state_error)?; | ||||||||||||||||||||||||||||
let execution_optimistic = chain | ||||||||||||||||||||||||||||
.is_optimistic_or_invalid_head_block(head_block) | ||||||||||||||||||||||||||||
.map_err(warp_utils::reject::unhandled_error)?; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
chain | ||||||||||||||||||||||||||||
.beacon_proposer_cache | ||||||||||||||||||||||||||||
.lock() | ||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.