reth_optimism_consensus/validation/
canyon.rs
1use alloy_consensus::BlockHeader;
4use alloy_trie::EMPTY_ROOT_HASH;
5use reth_consensus::ConsensusError;
6use reth_primitives_traits::GotExpected;
7
8#[inline]
11pub fn ensure_empty_withdrawals_root<H: BlockHeader>(header: &H) -> Result<(), ConsensusError> {
12 let header_withdrawals_root =
14 &header.withdrawals_root().ok_or(ConsensusError::WithdrawalsRootMissing)?;
15
16 if *header_withdrawals_root != EMPTY_ROOT_HASH {
18 return Err(ConsensusError::BodyWithdrawalsRootDiff(
19 GotExpected { got: *header_withdrawals_root, expected: EMPTY_ROOT_HASH }.into(),
20 ));
21 }
22
23 Ok(())
24}