diff --git a/crates/interpreter/Cargo.toml b/crates/interpreter/Cargo.toml index e7116a9865..945314e874 100644 --- a/crates/interpreter/Cargo.toml +++ b/crates/interpreter/Cargo.toml @@ -48,7 +48,6 @@ dev = [ "optional_gas_refund", "optional_no_base_fee", "optional_beneficiary_reward", - "optional_nonce_check", ] memory_limit = ["revm-primitives/memory_limit"] optional_balance_check = ["revm-primitives/optional_balance_check"] @@ -57,4 +56,3 @@ optional_eip3607 = ["revm-primitives/optional_eip3607"] optional_gas_refund = ["revm-primitives/optional_gas_refund"] optional_no_base_fee = ["revm-primitives/optional_no_base_fee"] optional_beneficiary_reward = ["revm-primitives/optional_beneficiary_reward"] -optional_nonce_check = ["revm-primitives/optional_nonce_check"] diff --git a/crates/precompile/src/modexp.rs b/crates/precompile/src/modexp.rs index 8de53cc486..37981e321b 100644 --- a/crates/precompile/src/modexp.rs +++ b/crates/precompile/src/modexp.rs @@ -346,7 +346,7 @@ mod tests { let expected = hex::decode(test.expected).unwrap(); assert_eq!( res.0, test_gas, - "used gas not maching for test: {}", + "used gas not matching for test: {}", test.name ); assert_eq!(res.1, expected, "test:{}", test.name); @@ -361,7 +361,7 @@ mod tests { let expected = hex::decode(test.expected).unwrap(); assert_eq!( res.0, test_gas, - "used gas not maching for test: {}", + "used gas not matching for test: {}", test.name ); assert_eq!(res.1, expected, "test:{}", test.name); diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index f94a68aefc..b50815fec2 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -79,7 +79,6 @@ dev = [ "optional_gas_refund", "optional_no_base_fee", "optional_beneficiary_reward", - "optional_nonce_check", ] memory_limit = [] optional_balance_check = [] @@ -88,7 +87,6 @@ optional_eip3607 = [] optional_gas_refund = [] optional_no_base_fee = [] optional_beneficiary_reward = [] -optional_nonce_check = [] # See comments in `revm-precompile` c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more"] diff --git a/crates/primitives/src/env.rs b/crates/primitives/src/env.rs index 2f720af3e8..bd0e52ce52 100644 --- a/crates/primitives/src/env.rs +++ b/crates/primitives/src/env.rs @@ -201,18 +201,16 @@ impl Env { } // Check that the transaction's nonce is correct - if !self.cfg.is_nonce_check_disabled() { - if let Some(tx) = self.tx.nonce { - let state = account.info.nonce; - match tx.cmp(&state) { - Ordering::Greater => { - return Err(InvalidTransaction::NonceTooHigh { tx, state }); - } - Ordering::Less => { - return Err(InvalidTransaction::NonceTooLow { tx, state }); - } - _ => {} + if let Some(tx) = self.tx.nonce { + let state = account.info.nonce; + match tx.cmp(&state) { + Ordering::Greater => { + return Err(InvalidTransaction::NonceTooHigh { tx, state }); } + Ordering::Less => { + return Err(InvalidTransaction::NonceTooLow { tx, state }); + } + _ => {} } } @@ -301,9 +299,6 @@ pub struct CfgEnv { /// By default, it is set to `false`. #[cfg(feature = "optional_beneficiary_reward")] pub disable_beneficiary_reward: bool, - /// Skip nonce checks if true. - #[cfg(feature = "optional_nonce_check")] - pub disable_nonce_check: bool, } impl CfgEnv { @@ -366,16 +361,6 @@ impl CfgEnv { pub fn is_beneficiary_reward_disabled(&self) -> bool { false } - - #[cfg(feature = "optional_nonce_check")] - pub fn is_nonce_check_disabled(&self) -> bool { - self.disable_nonce_check - } - - #[cfg(not(feature = "optional_nonce_check"))] - pub fn is_nonce_check_disabled(&self) -> bool { - false - } } impl Default for CfgEnv { @@ -400,8 +385,6 @@ impl Default for CfgEnv { disable_base_fee: false, #[cfg(feature = "optional_beneficiary_reward")] disable_beneficiary_reward: false, - #[cfg(feature = "optional_nonce_check")] - disable_nonce_check: false, } } } diff --git a/crates/revm/Cargo.toml b/crates/revm/Cargo.toml index a5670a6a73..5eca3309dd 100644 --- a/crates/revm/Cargo.toml +++ b/crates/revm/Cargo.toml @@ -90,7 +90,6 @@ dev = [ "optional_gas_refund", "optional_no_base_fee", "optional_beneficiary_reward", - "optional_nonce_check", ] memory_limit = ["revm-interpreter/memory_limit"] optional_balance_check = ["revm-interpreter/optional_balance_check"] @@ -99,7 +98,6 @@ optional_eip3607 = ["revm-interpreter/optional_eip3607"] optional_gas_refund = ["revm-interpreter/optional_gas_refund"] optional_no_base_fee = ["revm-interpreter/optional_no_base_fee"] optional_beneficiary_reward = ["revm-interpreter/optional_beneficiary_reward"] -optional_nonce_check = ["revm-interpreter/optional_nonce_check"] # See comments in `revm-precompile` secp256k1 = ["revm-precompile/secp256k1"]