diff --git a/crates/consensus/src/header.rs b/crates/consensus/src/header.rs index 68a8590e3b8..a3bae669db0 100644 --- a/crates/consensus/src/header.rs +++ b/crates/consensus/src/header.rs @@ -115,12 +115,12 @@ pub struct Header { /// The beacon roots contract handles root storage, enhancing Ethereum's functionalities. #[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))] pub parent_beacon_block_root: Option, - /// The Keccak 256-bit hash of the root node of the trie structure populated with each + /// The Keccak 256-bit hash of the an RLP encoded list with each /// [EIP-7685] request in the block body. /// /// [EIP-7685]: https://eips.ethereum.org/EIPS/eip-7685 #[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))] - pub requests_root: Option, + pub requests_hash: Option, /// An arbitrary byte array containing data relevant to this block. This must be 32 bytes or /// fewer; formally Hx. pub extra_data: Bytes, @@ -155,7 +155,7 @@ impl Default for Header { blob_gas_used: None, excess_blob_gas: None, parent_beacon_block_root: None, - requests_root: None, + requests_hash: None, } } } @@ -310,7 +310,7 @@ impl Header { length += parent_beacon_block_root.length(); } - // Encode requests root length. + // Encode requests hash length. // // If new fields are added, the above pattern will // need to be repeated and placeholder length added. Otherwise, it's impossible to @@ -319,8 +319,8 @@ impl Header { // * A header is created with a withdrawals root, but no base fee. Shanghai blocks are // post-London, so this is technically not valid. However, a tool like proptest would // generate a block like this. - if let Some(requests_root) = self.requests_root { - length += requests_root.length(); + if let Some(requests_hash) = self.requests_hash { + length += requests_hash.length(); } length @@ -436,7 +436,7 @@ impl Encodable for Header { parent_beacon_block_root.encode(out); } - // Encode requests root. + // Encode requests hash. // // If new fields are added, the above pattern will need to // be repeated and placeholders added. Otherwise, it's impossible to tell _which_ @@ -445,8 +445,8 @@ impl Encodable for Header { // * A header is created with a withdrawals root, but no base fee. Shanghai blocks are // post-London, so this is technically not valid. However, a tool like proptest would // generate a block like this. - if let Some(ref requests_root) = self.requests_root { - requests_root.encode(out); + if let Some(ref requests_hash) = self.requests_hash { + requests_hash.encode(out); } } @@ -486,7 +486,7 @@ impl Decodable for Header { blob_gas_used: None, excess_blob_gas: None, parent_beacon_block_root: None, - requests_root: None, + requests_hash: None, }; if started_len - buf.len() < rlp_head.payload_length { @@ -585,7 +585,7 @@ pub(crate) const fn generate_valid_header( } // Placeholder for future EIP adjustments - header.requests_root = None; + header.requests_hash = None; header } @@ -615,7 +615,7 @@ impl<'a> arbitrary::Arbitrary<'a> for Header { blob_gas_used: u.arbitrary()?, excess_blob_gas: u.arbitrary()?, parent_beacon_block_root: u.arbitrary()?, - requests_root: u.arbitrary()?, + requests_hash: u.arbitrary()?, withdrawals_root: u.arbitrary()?, }; @@ -688,8 +688,8 @@ pub trait BlockHeader { /// Retrieves the parent beacon block root of the block, if available fn parent_beacon_block_root(&self) -> Option; - /// Retrieves the requests root of the block, if available - fn requests_root(&self) -> Option; + /// Retrieves the requests hash of the block, if available + fn requests_hash(&self) -> Option; /// Retrieves the block's extra data field fn extra_data(&self) -> &Bytes; @@ -772,8 +772,8 @@ impl BlockHeader for Header { self.parent_beacon_block_root } - fn requests_root(&self) -> Option { - self.requests_root + fn requests_hash(&self) -> Option { + self.requests_hash } fn extra_data(&self) -> &Bytes { diff --git a/crates/rpc-types-eth/src/block.rs b/crates/rpc-types-eth/src/block.rs index 2a150fede93..a75cf4cb551 100644 --- a/crates/rpc-types-eth/src/block.rs +++ b/crates/rpc-types-eth/src/block.rs @@ -144,9 +144,9 @@ pub struct Header { /// EIP-4788 parent beacon block root #[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))] pub parent_beacon_block_root: Option, - /// EIP-7685 requests root. + /// EIP-7685 requests hash. #[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))] - pub requests_root: Option, + pub requests_hash: Option, } impl Header { @@ -199,7 +199,7 @@ impl TryFrom
for alloy_consensus::Header { blob_gas_used, excess_blob_gas, parent_beacon_block_root, - requests_root, + requests_hash, // not included in the consensus header hash: _hash, total_difficulty: _total_difficulty, @@ -224,7 +224,7 @@ impl TryFrom
for alloy_consensus::Header { blob_gas_used, excess_blob_gas, parent_beacon_block_root, - requests_root, + requests_hash, extra_data, }) } @@ -442,7 +442,7 @@ mod tests { blob_gas_used: None, excess_blob_gas: None, parent_beacon_block_root: None, - requests_root: None, + requests_hash: None, }, uncles: vec![B256::with_last_byte(17)], transactions: vec![B256::with_last_byte(18)].into(), @@ -485,7 +485,7 @@ mod tests { blob_gas_used: None, excess_blob_gas: None, parent_beacon_block_root: None, - requests_root: None, + requests_hash: None, }, uncles: vec![], transactions: BlockTransactions::Uncle, @@ -528,7 +528,7 @@ mod tests { blob_gas_used: None, excess_blob_gas: None, parent_beacon_block_root: None, - requests_root: None, + requests_hash: None, }, uncles: vec![B256::with_last_byte(17)], transactions: vec![B256::with_last_byte(18)].into(),