From fb962fcd1b1725ffa4ac9edb087f8c173119a0bf Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 13 Dec 2024 19:48:57 +0100 Subject: [PATCH] chore: rm blob_versioned_hashes (#13390) --- bin/reth-bench/src/bench/new_payload_fcu.rs | 2 +- bin/reth-bench/src/bench/new_payload_only.rs | 2 +- crates/engine/local/src/miner.rs | 13 ++++++------- crates/primitives/src/block.rs | 6 ------ 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/bin/reth-bench/src/bench/new_payload_fcu.rs b/bin/reth-bench/src/bench/new_payload_fcu.rs index 9e573a8957e1..141620209f99 100644 --- a/bin/reth-bench/src/bench/new_payload_fcu.rs +++ b/bin/reth-bench/src/bench/new_payload_fcu.rs @@ -79,7 +79,7 @@ impl Command { let block_number = block.header.number; let versioned_hashes: Vec = - block.body.blob_versioned_hashes().into_iter().copied().collect(); + block.body.blob_versioned_hashes_iter().copied().collect(); let parent_beacon_block_root = block.parent_beacon_block_root; let payload = block_to_payload(block); diff --git a/bin/reth-bench/src/bench/new_payload_only.rs b/bin/reth-bench/src/bench/new_payload_only.rs index 0611faabf101..c76870568c8b 100644 --- a/bin/reth-bench/src/bench/new_payload_only.rs +++ b/bin/reth-bench/src/bench/new_payload_only.rs @@ -63,7 +63,7 @@ impl Command { let gas_used = block.gas_used; let versioned_hashes: Vec = - block.body.blob_versioned_hashes().into_iter().copied().collect(); + block.body.blob_versioned_hashes_iter().copied().collect(); let parent_beacon_block_root = block.parent_beacon_block_root; let payload = block_to_payload(block); diff --git a/crates/engine/local/src/miner.rs b/crates/engine/local/src/miner.rs index 29418c0b714c..d66c188d643c 100644 --- a/crates/engine/local/src/miner.rs +++ b/crates/engine/local/src/miner.rs @@ -211,13 +211,12 @@ where let block = payload.block(); - let cancun_fields = self - .provider - .chain_spec() - .is_cancun_active_at_timestamp(block.timestamp) - .then(|| CancunPayloadFields { - parent_beacon_block_root: block.parent_beacon_block_root.unwrap(), - versioned_hashes: block.body.blob_versioned_hashes().into_iter().copied().collect(), + let cancun_fields = + self.provider.chain_spec().is_cancun_active_at_timestamp(block.timestamp).then(|| { + CancunPayloadFields { + parent_beacon_block_root: block.parent_beacon_block_root.unwrap(), + versioned_hashes: block.body.blob_versioned_hashes_iter().copied().collect(), + } }); let (tx, rx) = oneshot::channel(); diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index 14ed9081730c..c17cb6186919 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -604,12 +604,6 @@ impl BlockBody { .filter_map(|tx| tx.as_eip4844().map(|blob_tx| &blob_tx.blob_versioned_hashes)) .flatten() } - - /// Returns all blob versioned hashes from the block body. - #[inline] - pub fn blob_versioned_hashes(&self) -> Vec<&B256> { - self.blob_versioned_hashes_iter().collect() - } } impl BlockBody {