-
Notifications
You must be signed in to change notification settings - Fork 262
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
bump nim-eth
, extend empty block fallback for Capella
#4357
Conversation
Implements `emptyPayloadToBlockHeader` for Capella. status-im/nim-eth#562
mixDigest : payload.prev_randao, # EIP-4399 `mixDigest` -> `prevRandao` | ||
nonce : default(BlockNonce), | ||
fee : some payload.base_fee_per_gas, | ||
withdrawalsRoot: withdrawalsRoot) |
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.
Does it work to unconditionally include this, regardless of fork or engine API version?
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.
Yes, the RLP serializer checks whether the field is a some
or a none
, and emits the correct block hash.
I tested the logic using the test script here:
status-im/nim-eth#562 (comment)
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 Capella blocks you need engine API v2 calls. For pre-Capella blocks, you may also use v1 but v2 also works.
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.
Fortunately, once ELs support Capella in any production capacity, then Nimbus can start getting rid of the v1 calls then. Presumably gating on Gnosis capella fork schedule, but fundamentally see no reason to keep using v1 calls, ever, once the ELs support v2 calls.
build_empty_execution_payload[typeof forkyState.data, T]( | ||
forkyState.data, feeRecipient) | ||
when stateFork >= BeaconStateFork.Capella: | ||
raiseAssert $capellaImplementationMissing |
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.
Doesn't this PR add such an implementation?
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 problem here is that the various when
return different types. So, either the entire function needs to change to ForkyState, or there needs to be a ForkedExecutionPayload. Too big to just extend the empty payload fallback.
Also, regardless of empty vs non-empty, we need to pass expected withdrawals into this function so that engine_getPayload or the empty block fallback are correct. Again too big for the scope of this PR.
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.
Plan is to make the whole makeBeaconBlockForHeadAndSlot
call tree generic, avoid yet another forked type.
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.
But, sure, agree with scope of PR.
Implements
emptyPayloadToBlockHeader
for Capella. status-im/nim-eth#562