diff --git a/crates/primitives-traits/src/block/mod.rs b/crates/primitives-traits/src/block/mod.rs index 4ef1e3b19c..37b16048e3 100644 --- a/crates/primitives-traits/src/block/mod.rs +++ b/crates/primitives-traits/src/block/mod.rs @@ -114,10 +114,7 @@ pub trait Block: } /// Returns the rlp length of the block with the given header and body. - fn rlp_length(header: &Self::Header, body: &Self::Body) -> usize { - // TODO(mattsse): replace default impl with - header.length() + body.length() - } + fn rlp_length(header: &Self::Header, body: &Self::Body) -> usize; /// Expensive operation that recovers transaction signer. fn recover_signers(&self) -> Result, RecoveryError> @@ -200,6 +197,10 @@ where fn split(self) -> (Self::Header, Self::Body) { (self.header, self.body) } + + fn rlp_length(header: &Self::Header, body: &Self::Body) -> usize { + Self::rlp_length_for(header, body) + } } /// An extension trait for [`Block`]s that allows for mutable access to the block's internals. diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index f16034ab37..35c5e6c07f 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -2,7 +2,6 @@ use crate::transaction::TransactionCompat; use alloy_consensus::{BlockHeader, Sealable}; -use alloy_eips::eip4895::Withdrawals; use alloy_primitives::U256; use alloy_rpc_types_eth::{ Block, BlockTransactions, BlockTransactionsKind, Header, TransactionInfo, @@ -106,11 +105,8 @@ fn from_block_with_transactions( body: B::Body, transactions: BlockTransactions, ) -> Block> { - let withdrawals = header - .withdrawals_root() - .is_some() - .then(|| body.withdrawals().cloned().map(Withdrawals::into_inner).map(Into::into)) - .flatten(); + let withdrawals = + header.withdrawals_root().is_some().then(|| body.withdrawals().cloned()).flatten(); let uncles = body.ommers().map(|o| o.iter().map(|h| h.hash_slow()).collect()).unwrap_or_default();