-
Notifications
You must be signed in to change notification settings - Fork 745
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
Fix parent_beacon_block_root
during proposer prep
#4703
Fix parent_beacon_block_root
during proposer prep
#4703
Conversation
parent_beacon_block_root
during prep/reorgparent_beacon_block_root
during proposer prep
a026353
to
3eb39ad
Compare
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.
Nice find, I reviewed the 4788 changes but missed this one!
Looks good to me 👍
Looks like we have the exact same logic in lighthouse/beacon_node/execution_layer/src/test_utils/mock_builder.rs Lines 405 to 425 in 7d468cb
|
Ah, that's probably why the builder Deneb test is failing. Although weirdly it succeeds when I run it locally. I'll push that change tomorrow with a test |
Ah, awesome! Was struggling to figure this one out yesterday. Thanks Michael! |
That failing test (
|
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've re-reviewed the changes, looks good!
Oh, there seems to be some issues with expected withdrawals amount mismatch in the failing tests. |
Yeah, looking into that now |
Too hard. I give up.
Ok, I reverted the check that I added to the execution block hash generator, as it wasn't correct in the presence of slashable blocks. The check I added was trying to verify that all payload attributes with the same |
Issue Addressed
Fix a bug whereby Lighthouse would send the wrong
parent_beacon_block_root
in the payload attributes when preparing a payload.We were sending the root of the parent of the canonical head block in all cases, which is wrong most of the time when we want to build upon the canonical head. In this case, we should send the root of the canonical head block itself (this is specced in EIP-4788). Using the parent root happened to be correct in the case of a single-slot re-org, although this was just a happy accident.
The bug only has low impact because when we actually request a payload we use the correct parent block root, here:
lighthouse/beacon_node/beacon_chain/src/execution_payload.rs
Lines 428 to 429 in 1360653
So we get a payload ID cache miss almost every slot, and force the EL to build a payload last-minute off the new (correct) payload attributes.
Proposed changes
Additional Info
Thanks to @pinges for bringing this to our attention. Besu (correctly) assumed that the
headBlockHash
should determine theparentBeaconBlockRoot
, and was failing to produce blocks with Lighthouse as a result. Besu merged a workaround (which is probably a good defensive measure) in hyperledger/besu#5843.