diff --git a/crates/consensus/src/block/header.rs b/crates/consensus/src/block/header.rs index 9f95d30f100..e2d4565b63a 100644 --- a/crates/consensus/src/block/header.rs +++ b/crates/consensus/src/block/header.rs @@ -2,6 +2,7 @@ use crate::constants::{EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH}; use alloc::vec::Vec; use alloy_eips::{ eip1559::{calc_next_block_base_fee, BaseFeeParams}, + eip1898::BlockWithParent, eip4844::{calc_blob_gasprice, calc_excess_blob_gas}, merge::ALLOWED_FUTURE_BLOCK_TIME_SECONDS, BlockNumHash, @@ -319,6 +320,13 @@ impl Header { BlockNumHash { number: self.number, hash: self.hash_slow() } } + /// Returns the block's number and hash with the parent hash. + /// + /// Note: this hashes the header. + pub fn num_hash_with_parent_slow(&self) -> BlockWithParent { + BlockWithParent::new(self.parent_hash, self.num_hash_slow()) + } + /// Checks if the block's difficulty is set to zero, indicating a Proof-of-Stake header. /// /// This function is linked to EIP-3675, proposing the consensus upgrade to Proof-of-Stake: