diff --git a/docs/frame/evm.md b/docs/frame/evm.md index fc87908a29..0133e387c3 100644 --- a/docs/frame/evm.md +++ b/docs/frame/evm.md @@ -42,4 +42,4 @@ any Ethereum transaction into a transaction compatible with this module. The gas configurations are configurable. Right now, a pre-defined -London hard fork configuration option is provided. +Shanghai hard fork configuration option is provided. diff --git a/frame/ethereum/src/tests/eip1559.rs b/frame/ethereum/src/tests/eip1559.rs index 7f99cbf5a9..8a55e33033 100644 --- a/frame/ethereum/src/tests/eip1559.rs +++ b/frame/ethereum/src/tests/eip1559.rs @@ -327,7 +327,7 @@ fn transaction_should_generate_correct_gas_used() { let (pairs, mut ext) = new_test_ext(1); let alice = &pairs[0]; - let expected_gas = U256::from(893928); + let expected_gas = U256::from(894198); ext.execute_with(|| { let t = eip1559_erc20_creation_transaction(alice); diff --git a/frame/ethereum/src/tests/eip2930.rs b/frame/ethereum/src/tests/eip2930.rs index 644052cd97..56543f62dc 100644 --- a/frame/ethereum/src/tests/eip2930.rs +++ b/frame/ethereum/src/tests/eip2930.rs @@ -259,7 +259,7 @@ fn transaction_should_generate_correct_gas_used() { let (pairs, mut ext) = new_test_ext(1); let alice = &pairs[0]; - let expected_gas = U256::from(893928); + let expected_gas = U256::from(894198); ext.execute_with(|| { let t = eip2930_erc20_creation_transaction(alice); diff --git a/frame/ethereum/src/tests/legacy.rs b/frame/ethereum/src/tests/legacy.rs index 648f418012..777ff1bb88 100644 --- a/frame/ethereum/src/tests/legacy.rs +++ b/frame/ethereum/src/tests/legacy.rs @@ -259,7 +259,7 @@ fn transaction_should_generate_correct_gas_used() { let (pairs, mut ext) = new_test_ext(1); let alice = &pairs[0]; - let expected_gas = U256::from(893928); + let expected_gas = U256::from(894198); ext.execute_with(|| { let t = legacy_erc20_creation_transaction(alice); diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index f46d0e4e8e..abaa1a3189 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -166,7 +166,7 @@ pub mod pallet { /// EVM config used in the module. fn config() -> &'static EvmConfig { - &LONDON_CONFIG + &SHANGHAI_CONFIG } } @@ -694,7 +694,7 @@ impl GasWeightMapping for FixedGasWeightMapping { } } -static LONDON_CONFIG: EvmConfig = EvmConfig::london(); +static SHANGHAI_CONFIG: EvmConfig = EvmConfig::shanghai(); impl Pallet { /// Check whether an account is empty. diff --git a/primitives/evm/src/validation.rs b/primitives/evm/src/validation.rs index 046d60be5b..3627f1d64d 100644 --- a/primitives/evm/src/validation.rs +++ b/primitives/evm/src/validation.rs @@ -227,7 +227,7 @@ mod tests { InvalidChainId, } - static LONDON_CONFIG: evm::Config = evm::Config::london(); + static SHANGHAI_CONFIG: evm::Config = evm::Config::shanghai(); impl From for TestError { fn from(e: InvalidEvmTransactionError) -> Self { @@ -293,7 +293,7 @@ mod tests { } = input; CheckEvmTransaction::::new( CheckEvmTransactionConfig { - evm_config: &LONDON_CONFIG, + evm_config: &SHANGHAI_CONFIG, block_gas_limit: blockchain_gas_limit, base_fee: blockchain_base_fee, chain_id: blockchain_chain_id, diff --git a/ts-tests/tests/test-execute.ts b/ts-tests/tests/test-execute.ts index ce0700e214..43bf103d41 100644 --- a/ts-tests/tests/test-execute.ts +++ b/ts-tests/tests/test-execute.ts @@ -158,7 +158,7 @@ describeWithFrontier("Frontier RPC (RPC execution)", (context) => { }, ]); - expect(result.result).to.be.equal("0x3043a"); + expect(result.result).to.be.equal("0x30464"); }); step("should estimateGas with gas limit up to 10x block gas limit", async function () { @@ -170,7 +170,7 @@ describeWithFrontier("Frontier RPC (RPC execution)", (context) => { }, ]); - expect(result.result).to.be.equal("0x3043a"); + expect(result.result).to.be.equal("0x30464"); }); step("shouldn't estimateGas with gas limit up higher than 10x block gas limit", async function () { diff --git a/ts-tests/tests/test-fee-history.ts b/ts-tests/tests/test-fee-history.ts index 2677d39ab7..e75edf9f97 100644 --- a/ts-tests/tests/test-fee-history.ts +++ b/ts-tests/tests/test-fee-history.ts @@ -74,7 +74,7 @@ describeWithFrontier("Frontier RPC (Fee History)", (context) => { // baseFeePerGas is always the requested block range + 1 (the next derived base fee). expect(result.baseFeePerGas.length).to.be.eq(blockCount + 1); // gasUsedRatio for the requested block range. - expect(result.gasUsedRatio).to.be.deep.eq(Array(blockCount).fill(0.03575712)); + expect(result.gasUsedRatio).to.be.deep.eq(Array(blockCount).fill(0.03576792)); // two-dimensional reward list for the requested block range. expect(result.reward.length).to.be.eq(blockCount); // each block has a reward list which's size is the requested percentile list. diff --git a/ts-tests/tests/test-gas.ts b/ts-tests/tests/test-gas.ts index 7d98982581..c3a6481b4f 100644 --- a/ts-tests/tests/test-gas.ts +++ b/ts-tests/tests/test-gas.ts @@ -42,7 +42,7 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => { it("eth_estimateGas for contract creation", async function () { // The value returned as an estimation by the evm with estimate mode ON. - let oneOffEstimation = 196657; + let oneOffEstimation = 196701; let binarySearchEstimation = binarySearch(oneOffEstimation); // Sanity check expect a variance of 10%. expect(estimationVariance(binarySearchEstimation, oneOffEstimation)).to.be.lessThan(1); @@ -105,7 +105,7 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => { it("eth_estimateGas should handle AccessList alias", async function () { // The value returned as an estimation by the evm with estimate mode ON. // 4300 == 1900 for one key and 2400 for one storage. - let oneOffEstimation = 196657 + 4300; + let oneOffEstimation = 196701 + 4300; let binarySearchEstimation = binarySearch(oneOffEstimation); // Sanity check expect a variance of 10%. expect(estimationVariance(binarySearchEstimation, oneOffEstimation)).to.be.lessThan(1); @@ -132,12 +132,12 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => { data: Test.bytecode, gasPrice: "0x0", }); - expect(result).to.equal(197690); + expect(result).to.equal(197732); result = await context.web3.eth.estimateGas({ from: GENESIS_ACCOUNT, data: Test.bytecode, }); - expect(result).to.equal(197690); + expect(result).to.equal(197732); }); it("tx gas limit below ETH_BLOCK_GAS_LIMIT", async function () {