diff --git a/Cargo.lock b/Cargo.lock index 6e872d2550..78c121232d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3395,7 +3395,7 @@ dependencies = [ [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "clap", "ethereum-types", @@ -3413,7 +3413,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "async-trait", "fp-consensus", @@ -3429,7 +3429,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "async-trait", "ethereum", @@ -3459,7 +3459,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "fc-db", "fc-storage", @@ -3482,7 +3482,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "ethereum-types", @@ -3532,7 +3532,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "ethereum-types", @@ -3545,7 +3545,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "ethereum-types", @@ -3725,7 +3725,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "hex", "impl-serde", @@ -3744,7 +3744,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "parity-scale-codec", @@ -3756,7 +3756,7 @@ dependencies = [ [[package]] name = "fp-dynamic-fee" version = "1.0.0" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "async-trait", "sp-core", @@ -3766,7 +3766,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "ethereum-types", @@ -3780,7 +3780,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "evm", "frame-support", @@ -3795,7 +3795,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "ethereum-types", @@ -3812,7 +3812,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "frame-support", "parity-scale-codec", @@ -3824,7 +3824,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "parity-scale-codec", "serde", @@ -7037,7 +7037,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "fp-evm", "frame-support", @@ -7282,7 +7282,7 @@ dependencies = [ [[package]] name = "pallet-dynamic-fee" version = "4.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "fp-dynamic-fee", "fp-evm", @@ -7352,7 +7352,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "ethereum", "ethereum-types", @@ -7375,7 +7375,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "environmental", "evm", @@ -7400,7 +7400,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "frame-support", "frame-system", @@ -7411,7 +7411,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "fp-evm", "num", @@ -7420,7 +7420,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "fp-evm", "tiny-keccak", @@ -7429,7 +7429,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "fp-evm", "ripemd", @@ -7480,7 +7480,7 @@ dependencies = [ [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" -source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#b3a129f054ccaa0ed2ecf0cf4779e193cae32f5a" +source = "git+https://github.com/moondance-labs/frontier?branch=tanssi-polkadot-v0.9.43#ddfcb0419654c91b80eac6ecf38203a8b57deb92" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/container-chains/templates/frontier/runtime/src/lib.rs b/container-chains/templates/frontier/runtime/src/lib.rs index 2e8cee09ea..c744d7be23 100644 --- a/container-chains/templates/frontier/runtime/src/lib.rs +++ b/container-chains/templates/frontier/runtime/src/lib.rs @@ -33,7 +33,6 @@ pub mod xcm_config; use { crate::precompiles::FrontierPrecompiles, - core::marker::PhantomData, cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases, fp_account::EthereumSignature, fp_evm::weight_per_gas, @@ -43,8 +42,8 @@ use { dispatch::{DispatchClass, GetDispatchInfo}, parameter_types, traits::{ - ConstU32, ConstU64, ConstU8, Contains, Currency as CurrencyT, FindAuthor, Imbalance, - OnFinalize, OnUnbalanced, + ConstU32, ConstU64, ConstU8, Contains, Currency as CurrencyT, Imbalance, OnFinalize, + OnUnbalanced, }, weights::{ constants::{ @@ -54,7 +53,6 @@ use { ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }, - ConsensusEngineId, }, frame_system::{ limits::{BlockLength, BlockWeights}, @@ -71,7 +69,7 @@ use { parity_scale_codec::{Decode, Encode}, smallvec::smallvec, sp_api::impl_runtime_apis, - sp_core::{crypto::ByteArray, Get, OpaqueMetadata, H160, H256, U256}, + sp_core::{Get, OpaqueMetadata, H160, H256, U256}, sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ @@ -298,7 +296,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frontier-template"), impl_name: create_runtime_str!("frontier-template"), authoring_version: 1, - spec_version: 100, + spec_version: 101, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -344,8 +342,8 @@ const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, ); -/// We allow for 2000ms of compute with a 6 second average block time. -pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2000; +/// We allow for 500ms of compute with a 12 second average block time. +pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = 500; /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] @@ -585,24 +583,11 @@ impl pallet_cc_authorities_noting::Config for Runtime { type WeightInfo = pallet_cc_authorities_noting::weights::SubstrateWeight; } -const BLOCK_GAS_LIMIT: u64 = 75_000_000; +// To match ethereum expectations +const BLOCK_GAS_LIMIT: u64 = 15_000_000; impl pallet_evm_chain_id::Config for Runtime {} -pub struct FindAuthorTruncated(PhantomData); -impl> FindAuthor for FindAuthorTruncated { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = AuthoritiesNoting::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} - parameter_types! { pub BlockGasLimit: U256 = U256::from(BLOCK_GAS_LIMIT); pub PrecompilesValue: FrontierPrecompiles = FrontierPrecompiles::<_>::new(); @@ -654,7 +639,7 @@ impl pallet_dynamic_fee::Config for Runtime { } parameter_types! { - pub DefaultBaseFeePerGas: U256 = U256::from(1_000_000_000); + pub DefaultBaseFeePerGas: U256 = U256::from(2_000_000_000); pub DefaultElasticity: Permill = Permill::from_parts(125_000); } diff --git a/container-chains/templates/simple/runtime/src/lib.rs b/container-chains/templates/simple/runtime/src/lib.rs index 03c49a2ae3..507f77be37 100644 --- a/container-chains/templates/simple/runtime/src/lib.rs +++ b/container-chains/templates/simple/runtime/src/lib.rs @@ -186,7 +186,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("container-chain-template"), impl_name: create_runtime_str!("container-chain-template"), authoring_version: 1, - spec_version: 100, + spec_version: 101, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/test/suites/dev-frontier-template/test-eth-block/test-eth-block-pending.ts b/test/suites/dev-frontier-template/test-eth-block/test-eth-block-pending.ts index 72056381e9..de4087b94c 100644 --- a/test/suites/dev-frontier-template/test-eth-block/test-eth-block-pending.ts +++ b/test/suites/dev-frontier-template/test-eth-block/test-eth-block-pending.ts @@ -21,12 +21,13 @@ describeSuite({ test: async function () { let nonce = 0; let sendTransaction = async () => { + const gasPrice = (await context.polkadotJs().rpc.eth.gasPrice()).toBigInt(); const tx = await context.web3().eth.accounts.signTransaction( { from: ALITH_ADDRESS, to: TEST_ACCOUNT, value: "0x200", // Must be higher than ExistentialDeposit - gasPrice: "0x3B9ACA00", + gasPrice: gasPrice, gas: "0x100000", nonce: nonce, },