Add requests root to the EL block root computation
Description
Electra adds a new field in the ExecutionBlockHeader for the requests root https://github.com/ethereum/EIPs/blob/032c46504b10568039ba300969010e77c795f43a/EIPS/eip-7685.md#block-header
Our block hash computation needs to be updated to include the new requests_root field here https://github.com/sigp/lighthouse/blob/279270533128ef8069765d04c280db993db12905/consensus/types/src/execution_block_header.rs#L54
I'd like to take this up
@varun-doshi sounds good. We basically have to add a new receipts root optional field to the ExecutionBlockHeader and EncodableExecutionBlockHeader and bubble up all the changes. Let me know if you need any help
So the receipt_root will be of such structure in the struct ExecutionBlockHeader:
pub requests_root: Option<Hash256>
How are we calculating this from the payload we receive?
@pawanjay176
Yep,
The requests_root needs to be calculated from theExecutionPayload's deposit_requests, withdrawal_requests and consolidation_requests fields. Its specified in the Block header section of https://eips.ethereum.org/EIPS/eip-7685
Would like to work on this one.
Would like to work on this one.
@pawanjay176 where is ExecutionPayloadRef struct present. Cant seem to find this in the unstable branch. Does this need to be done on stable?
Sorry forgot to post in the issue 😅 I implemented this as part of the electra alpha 8 specs here https://github.com/sigp/lighthouse/commit/27ce1a08d98e2b3ec1b49af03778d214d9854861
@pawanjay176 so this is closed then i think.
Yep, sorry
@Gua00va wrt your question, ExecutionPayloadRef is generated by the superstruct macro as a reference to the underlying type. See https://sigp.github.io/superstruct/codegen/ref-and-refmut.html for more info