diff --git a/crates/engine/tree/src/tree/payload_processor/mod.rs b/crates/engine/tree/src/tree/payload_processor/mod.rs index 00407f3def..761f89d2f5 100644 --- a/crates/engine/tree/src/tree/payload_processor/mod.rs +++ b/crates/engine/tree/src/tree/payload_processor/mod.rs @@ -94,17 +94,6 @@ pub const SPARSE_TRIE_MAX_NODES_SHRINK_CAPACITY: usize = 1_000_000; /// 144MB. pub const SPARSE_TRIE_MAX_VALUES_SHRINK_CAPACITY: usize = 1_000_000; -/// Gas used threshold below which prewarming is skipped for small blocks. -/// -/// Based on analysis of 100 mainnet blocks (starting at block 24,425,210), reth's `new_payload` -/// winrate drops from 88% on 40-50M gas blocks to 49% on 0-10M gas blocks. The root cause is the -/// fixed overhead of spawning prewarm workers (building state providers, creating EVM instances, -/// wrapping precompiles) which exceeds execution time on small blocks. -/// -/// 20M gas is used as the threshold because ~23% of recent mainnet blocks fall under this level -/// where prewarming overhead dominates. -pub const SMALL_BLOCK_GAS_THRESHOLD: u64 = 20_000_000; - /// Type alias for [`PayloadHandle`] returned by payload processor spawn methods. type IteratorPayloadHandle = PayloadHandle< WithTxEnv, >::Recovered>, @@ -434,8 +423,7 @@ where where P: BlockReader + StateProviderFactory + StateReader + Clone + 'static, { - let skip_prewarm = self.disable_transaction_prewarming || - (env.gas_used > 0 && env.gas_used < SMALL_BLOCK_GAS_THRESHOLD); + let skip_prewarm = self.disable_transaction_prewarming; let saved_cache = self.disable_state_cache.not().then(|| self.cache_for(env.parent_hash)); @@ -988,10 +976,6 @@ pub struct ExecutionEnv { /// Used to determine parallel worker count for prewarming. /// A value of 0 indicates the count is unknown. pub transaction_count: usize, - /// Total gas used in the block. - /// Used to skip prewarming for small blocks (see [`SMALL_BLOCK_GAS_THRESHOLD`]). - /// A value of 0 indicates the gas used is unknown. - pub gas_used: u64, /// Withdrawals included in the block. /// Used to generate prefetch targets for withdrawal addresses. pub withdrawals: Option>, @@ -1008,7 +992,6 @@ where parent_hash: Default::default(), parent_state_root: Default::default(), transaction_count: 0, - gas_used: 0, withdrawals: None, } } diff --git a/crates/engine/tree/src/tree/payload_validator.rs b/crates/engine/tree/src/tree/payload_validator.rs index 33956591af..4e7aa7aafe 100644 --- a/crates/engine/tree/src/tree/payload_validator.rs +++ b/crates/engine/tree/src/tree/payload_validator.rs @@ -412,7 +412,6 @@ where parent_hash: input.parent_hash(), parent_state_root: parent_block.state_root(), transaction_count: input.transaction_count(), - gas_used: input.gas_used(), withdrawals: input.withdrawals().map(|w| w.to_vec()), }; @@ -1663,17 +1662,6 @@ impl BlockOrPayload { } } - /// Returns the total gas used by all transactions in the payload or block. - pub fn gas_used(&self) -> u64 - where - T::ExecutionData: ExecutionPayload, - { - match self { - Self::Payload(payload) => payload.gas_used(), - Self::Block(block) => block.header().gas_used(), - } - } - /// Returns the withdrawals from the payload or block. pub fn withdrawals(&self) -> Option<&[Withdrawal]> where