diff --git a/Makefile b/Makefile index 76824cb301..26e410ce0b 100644 --- a/Makefile +++ b/Makefile @@ -134,8 +134,7 @@ test-e2e: cargo test --package test-service -- --include-ignored --skip test_full_node_catching_up --skip simple_balances_test .PHONY: test-ts -test-ts: - cargo build --release --features with-mandala-runtime +test-ts: build-mandala-internal-release cd ts-tests && yarn && yarn run build && ACALA_BUILD=release yarn run test .PHONY: test-benchmarking diff --git a/evm-bench b/evm-bench index 5c7084ddd8..1d32bc1f0a 160000 --- a/evm-bench +++ b/evm-bench @@ -1 +1 @@ -Subproject commit 5c7084ddd818498cdd6c8daabc9b2754f4d0b152 +Subproject commit 1d32bc1f0a40107fd64ec2d2212475514878b3d5 diff --git a/modules/evm/src/lib.rs b/modules/evm/src/lib.rs index d8edf61508..9231327a98 100644 --- a/modules/evm/src/lib.rs +++ b/modules/evm/src/lib.rs @@ -100,19 +100,19 @@ pub type NegativeImbalanceOf = pub const RESERVE_ID_STORAGE_DEPOSIT: ReserveIdentifier = ReserveIdentifier::EvmStorageDeposit; pub const RESERVE_ID_DEVELOPER_DEPOSIT: ReserveIdentifier = ReserveIdentifier::EvmDeveloperDeposit; -// Initially based on Istanbul hard fork configuration. +// Initially based on London hard fork configuration. static ACALA_CONFIG: EvmConfig = EvmConfig { refund_sstore_clears: 0, // no gas refund sstore_gas_metering: false, // no gas refund sstore_revert_under_stipend: false, // ignored create_contract_limit: Some(MaxCodeSize::get() as usize), - ..module_evm_utility::evm::Config::istanbul() + ..module_evm_utility::evm::Config::london() }; /// Create an empty contract `contract Empty { }`. pub const BASE_CREATE_GAS: u64 = 67_066; /// Call function that just set a storage `function store(uint256 num) public { number = num; }`. -pub const BASE_CALL_GAS: u64 = 41_602; +pub const BASE_CALL_GAS: u64 = 43_702; /// Helper method to calculate `create` weight. fn create_weight(gas: u64) -> Weight { diff --git a/modules/evm/src/tests.rs b/modules/evm/src/tests.rs index 993593bf84..2eece12b2d 100644 --- a/modules/evm/src/tests.rs +++ b/modules/evm/src/tests.rs @@ -735,7 +735,7 @@ fn publish_factory() { ) .unwrap(); assert_eq!(result.exit_reason, ExitReason::Succeed(ExitSucceed::Returned)); - assert_eq!(result.used_gas.as_u64(), 156_479u64); + assert_eq!(result.used_gas.as_u64(), 155_879u64); assert_eq!(result.used_storage, 461); assert_eq!( balance(alice()), @@ -1698,7 +1698,7 @@ fn evm_execute_mode_should_work() { CallInfo { exit_reason: ExitReason::Succeed(ExitSucceed::Stopped), value: vec![], - used_gas: U256::from(139_845), + used_gas: U256::from(142_445), used_storage: 290, logs: vec![] } @@ -1721,7 +1721,7 @@ fn evm_execute_mode_should_work() { CallInfo { exit_reason: ExitReason::Succeed(ExitSucceed::Stopped), value: vec![], - used_gas: U256::from(256_402), + used_gas: U256::from(259_561), used_storage: 580, logs: vec![] } @@ -1761,7 +1761,7 @@ fn evm_execute_mode_should_work() { CallInfo { exit_reason: ExitReason::Succeed(ExitSucceed::Stopped), value: vec![], - used_gas: U256::from(107_869), + used_gas: U256::from(110_469), used_storage: 290, logs: vec![] } @@ -1789,7 +1789,7 @@ fn evm_execute_mode_should_work() { CallInfo { exit_reason: ExitReason::Succeed(ExitSucceed::Stopped), value: vec![], - used_gas: U256::from(92_869), + used_gas: U256::from(93_369), used_storage: 290, logs: vec![] } diff --git a/predeploy-contracts b/predeploy-contracts index 1a0a4029b9..d6864d6c63 160000 --- a/predeploy-contracts +++ b/predeploy-contracts @@ -1 +1 @@ -Subproject commit 1a0a4029b90b0c781eb448e8686f8818c69b4e98 +Subproject commit d6864d6c6347520a8a4d63e107ea421ea88b8fae diff --git a/runtime/common/src/gas_to_weight_ratio.rs b/runtime/common/src/gas_to_weight_ratio.rs index 138ebfa8dc..cb2ae3047c 100644 --- a/runtime/common/src/gas_to_weight_ratio.rs +++ b/runtime/common/src/gas_to_weight_ratio.rs @@ -16,4 +16,4 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -pub const RATIO: u64 = 9478; +pub const RATIO: u64 = 8683; diff --git a/runtime/common/src/precompile/tests.rs b/runtime/common/src/precompile/tests.rs index 0b27fccd52..e8f6866016 100644 --- a/runtime/common/src/precompile/tests.rs +++ b/runtime/common/src/precompile/tests.rs @@ -508,7 +508,7 @@ fn schedule_precompile_should_work() { run_to_block(5); #[cfg(not(feature = "with-ethereum-compatibility"))] { - assert_eq!(Balances::free_balance(from_account.clone()), 999999972553); + assert_eq!(Balances::free_balance(from_account.clone()), 999999973153); assert_eq!(Balances::reserved_balance(from_account), 0); assert_eq!(Balances::free_balance(to_account), 1000000001000); } diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index adc1b6c3a2..dfeb753d42 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -1532,7 +1532,7 @@ impl> frame_support::traits::Get for TxFeePerGas { } #[cfg(feature = "with-ethereum-compatibility")] -static ISTANBUL_CONFIG: module_evm_utility::evm::Config = module_evm_utility::evm::Config::istanbul(); +static LONDON_CONFIG: module_evm_utility::evm::Config = module_evm_utility::evm::Config::london(); impl module_evm::Config for Runtime { type AddressMapping = EvmAddressMapping; @@ -1561,7 +1561,7 @@ impl module_evm::Config for Runtime { #[cfg(feature = "with-ethereum-compatibility")] fn config() -> &'static module_evm_utility::evm::Config { - &ISTANBUL_CONFIG + &LONDON_CONFIG } } diff --git a/ts-tests/tests/test-bodhi.ts b/ts-tests/tests/test-bodhi.ts index 7d95c41131..2d014e5667 100644 --- a/ts-tests/tests/test-bodhi.ts +++ b/ts-tests/tests/test-bodhi.ts @@ -92,6 +92,6 @@ describeWithAcala("Acala RPC (bodhi.js)", (context) => { expect(data.gas.toNumber()).to.be.eq(22409); expect(data.storage.toNumber()).to.be.eq(0); - expect(data.weightFee.toNumber()).to.be.eq(3999950555912); + expect(data.weightFee.toNumber()).to.be.eq(3999950539134); }); }); diff --git a/ts-tests/tests/test-gas.ts b/ts-tests/tests/test-gas.ts index 90c04ba7bd..7717d28686 100644 --- a/ts-tests/tests/test-gas.ts +++ b/ts-tests/tests/test-gas.ts @@ -47,6 +47,6 @@ describeWithAcala("Acala RPC (Gas)", (context) => { expect(data.gas.toNumber()).to.be.eq(22409); expect(data.storage.toNumber()).to.be.eq(0); - expect(data.weightFee.toNumber()).to.be.eq(3999940939026); + expect(data.weightFee.toNumber()).to.be.eq(3999940905471); }); }); diff --git a/ts-tests/tests/test-precompiles.ts b/ts-tests/tests/test-precompiles.ts index da90dcec48..c1fc045940 100644 --- a/ts-tests/tests/test-precompiles.ts +++ b/ts-tests/tests/test-precompiles.ts @@ -33,7 +33,7 @@ describeWithAcala("Acala RPC (Precompile)", (context) => { from: await alice.getAddress(), confirmations: 0, nonce: 1, - gasLimit: BigNumber.from("30788"), + gasLimit: BigNumber.from("28572"), gasPrice: BigNumber.from("1"), //data: "", value: BigNumber.from(0),