From 6df6b1da57b1f61a62c040a40bec46d76d3183ee Mon Sep 17 00:00:00 2001 From: tgmichel Date: Fri, 3 Dec 2021 22:40:15 +0100 Subject: [PATCH] Switch to london evm configuration (#532) * Switch to london evm configuration * Update descriptions * Update tests --- docs/frame/evm.md | 2 +- frame/ethereum/src/tests/eip1559.rs | 2 +- frame/ethereum/src/tests/eip2930.rs | 2 +- frame/ethereum/src/tests/legacy.rs | 2 +- frame/evm/README.md | 2 +- frame/evm/src/lib.rs | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/frame/evm.md b/docs/frame/evm.md index 5a4668346452d..fc87908a294b7 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 -Istanbul hard fork configuration option is provided. +London hard fork configuration option is provided. diff --git a/frame/ethereum/src/tests/eip1559.rs b/frame/ethereum/src/tests/eip1559.rs index 7d8f8675d992a..9d9095a27bfd2 100644 --- a/frame/ethereum/src/tests/eip1559.rs +++ b/frame/ethereum/src/tests/eip1559.rs @@ -228,7 +228,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(891328); + let expected_gas = U256::from(893928); 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 3d41fc16ff30d..ee0f4580f6902 100644 --- a/frame/ethereum/src/tests/eip2930.rs +++ b/frame/ethereum/src/tests/eip2930.rs @@ -228,7 +228,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(891328); + let expected_gas = U256::from(893928); 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 310dc98f12e3c..fccef62f41489 100644 --- a/frame/ethereum/src/tests/legacy.rs +++ b/frame/ethereum/src/tests/legacy.rs @@ -228,7 +228,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(891328); + let expected_gas = U256::from(893928); ext.execute_with(|| { let t = legacy_erc20_creation_transaction(alice); diff --git a/frame/evm/README.md b/frame/evm/README.md index 5bef73cf73fc3..d93474346b819 100644 --- a/frame/evm/README.md +++ b/frame/evm/README.md @@ -24,6 +24,6 @@ Observable differences include: We currently do not aim to make unobservable behaviors, such as state root, to be the same. We also don't aim to follow the exact same transaction / receipt format. However, given one Ethereum transaction and one Substrate account's private key, one should be able to convert any Ethereum transaction into a transaction compatible with this module. -The gas configurations are configurable. Right now, a pre-defined Istanbul hard fork configuration option is provided. +The gas configurations are configurable. Right now, a pre-defined London hard fork configuration option is provided. License: Apache-2.0 \ No newline at end of file diff --git a/frame/evm/src/lib.rs b/frame/evm/src/lib.rs index 7685fd82effdb..c1264a134da6c 100644 --- a/frame/evm/src/lib.rs +++ b/frame/evm/src/lib.rs @@ -48,7 +48,7 @@ //! the exact same transaction / receipt format. However, given one Ethereum transaction and one Substrate account's //! private key, one should be able to convert any Ethereum transaction into a transaction compatible with this pallet. //! -//! The gas configurations are configurable. Right now, a pre-defined Istanbul hard fork configuration option is provided. +//! The gas configurations are configurable. Right now, a pre-defined London hard fork configuration option is provided. // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] @@ -145,7 +145,7 @@ pub mod pallet { /// EVM config used in the module. fn config() -> &'static EvmConfig { - &ISTANBUL_CONFIG + &LONDON_CONFIG } } @@ -571,7 +571,7 @@ impl GasWeightMapping for () { } } -static ISTANBUL_CONFIG: EvmConfig = EvmConfig::istanbul(); +static LONDON_CONFIG: EvmConfig = EvmConfig::london(); #[cfg(feature = "std")] #[derive(Clone, Eq, PartialEq, Encode, Decode, Debug, Serialize, Deserialize)]