From 64832fb648c7b2740dffe9f6a8c82d4d1ef8f8e6 Mon Sep 17 00:00:00 2001 From: Wet Date: Fri, 19 Sep 2025 09:28:59 +0800 Subject: [PATCH] chore(consensus): replace the hardcoded 1024 with GAS_LIMIT_BOUND_DIVISOR --- crates/consensus/consensus/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/consensus/consensus/src/lib.rs b/crates/consensus/consensus/src/lib.rs index 6dd7a0bcf53..47c37b4b3a3 100644 --- a/crates/consensus/consensus/src/lib.rs +++ b/crates/consensus/consensus/src/lib.rs @@ -16,7 +16,7 @@ use alloy_consensus::Header; use alloy_primitives::{BlockHash, BlockNumber, Bloom, B256}; use reth_execution_types::BlockExecutionResult; use reth_primitives_traits::{ - constants::{MAXIMUM_GAS_LIMIT_BLOCK, MINIMUM_GAS_LIMIT}, + constants::{GAS_LIMIT_BOUND_DIVISOR, MAXIMUM_GAS_LIMIT_BLOCK, MINIMUM_GAS_LIMIT}, transaction::error::InvalidTransactionError, Block, GotExpected, GotExpectedBoxed, NodePrimitives, RecoveredBlock, SealedBlock, SealedHeader, @@ -348,7 +348,7 @@ pub enum ConsensusError { }, /// Error when the child gas limit exceeds the maximum allowed increase. - #[error("child gas_limit {child_gas_limit} max increase is {parent_gas_limit}/1024")] + #[error("child gas_limit {child_gas_limit} is exceed the max allowed increase ({parent_gas_limit}/{GAS_LIMIT_BOUND_DIVISOR})")] GasLimitInvalidIncrease { /// The parent gas limit. parent_gas_limit: u64, @@ -377,7 +377,7 @@ pub enum ConsensusError { }, /// Error when the child gas limit exceeds the maximum allowed decrease. - #[error("child gas_limit {child_gas_limit} max decrease is {parent_gas_limit}/1024")] + #[error("child gas_limit {child_gas_limit} is below the max allowed decrease ({parent_gas_limit}/{GAS_LIMIT_BOUND_DIVISOR})")] GasLimitInvalidDecrease { /// The parent gas limit. parent_gas_limit: u64,