lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Add requests root to the EL block root computation

Open pawanjay176 opened this issue 1 year ago • 4 comments

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

pawanjay176 avatar Sep 24 '24 23:09 pawanjay176

I'd like to take this up

varun-doshi avatar Sep 25 '24 08:09 varun-doshi

@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

pawanjay176 avatar Sep 25 '24 23:09 pawanjay176

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

varun-doshi avatar Sep 26 '24 12:09 varun-doshi

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

pawanjay176 avatar Sep 27 '24 22:09 pawanjay176

Would like to work on this one.

Gua00va avatar Nov 05 '24 15:11 Gua00va

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?

Gua00va avatar Nov 09 '24 12:11 Gua00va

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 avatar Nov 09 '24 13:11 pawanjay176

@pawanjay176 so this is closed then i think.

Gua00va avatar Nov 09 '24 13:11 Gua00va

Yep, sorry

pawanjay176 avatar Nov 09 '24 14:11 pawanjay176

@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

pawanjay176 avatar Nov 10 '24 08:11 pawanjay176