From 99dea6a0bddbae4456aeb80e960b643665c416ae Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 24 Apr 2025 16:50:28 +0200 Subject: [PATCH 01/10] - Enabled GasLimitStorageGrowthRatio --- .../runtime-templates/frontier/src/lib.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chains/container-chains/runtime-templates/frontier/src/lib.rs b/chains/container-chains/runtime-templates/frontier/src/lib.rs index 2ddbc25f1d..1fc614ca76 100644 --- a/chains/container-chains/runtime-templates/frontier/src/lib.rs +++ b/chains/container-chains/runtime-templates/frontier/src/lib.rs @@ -860,6 +860,9 @@ pub const GAS_PER_SECOND: u64 = 40_000_000; /// u64 works for approximations because Weight is a very small unit compared to gas. pub const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND; +/// Block storage limit in bytes. Set to 40 KB. +const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; + parameter_types! { pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS); @@ -867,7 +870,8 @@ parameter_types! { pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); pub SuicideQuickClearLimit: u32 = 0; pub GasLimitPovSizeRatio: u32 = 16; - pub GasLimitStorageGrowthRatio: u64 = 366; + pub GasLimitStorageGrowthRatio: u64 = + BlockGasLimit::get().min(u64::MAX.into()).low_u64().saturating_div(BLOCK_STORAGE_LIMIT); } impl_on_charge_evm_transaction!(); @@ -897,7 +901,7 @@ impl pallet_evm::Config for Runtime { type OnCreate = (); type FindAuthor = FindAuthorAdapter; type GasLimitPovSizeRatio = GasLimitPovSizeRatio; - type GasLimitStorageGrowthRatio = (); + type GasLimitStorageGrowthRatio = GasLimitStorageGrowthRatio; type Timestamp = Timestamp; type WeightInfo = (); } From ff853969fabd736142d70434cd8261e1c0c15be3 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 24 Apr 2025 17:14:20 +0200 Subject: [PATCH 02/10] Update chains/container-chains/runtime-templates/frontier/src/lib.rs Co-authored-by: tmpolaczyk <44604217+tmpolaczyk@users.noreply.github.com> --- chains/container-chains/runtime-templates/frontier/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chains/container-chains/runtime-templates/frontier/src/lib.rs b/chains/container-chains/runtime-templates/frontier/src/lib.rs index 1fc614ca76..cf38d3f835 100644 --- a/chains/container-chains/runtime-templates/frontier/src/lib.rs +++ b/chains/container-chains/runtime-templates/frontier/src/lib.rs @@ -871,7 +871,7 @@ parameter_types! { pub SuicideQuickClearLimit: u32 = 0; pub GasLimitPovSizeRatio: u32 = 16; pub GasLimitStorageGrowthRatio: u64 = - BlockGasLimit::get().min(u64::MAX.into()).low_u64().saturating_div(BLOCK_STORAGE_LIMIT); + BlockGasLimit::get().min(u64::MAX.into()).low_u64() / BLOCK_STORAGE_LIMIT; } impl_on_charge_evm_transaction!(); From 2e1134d6193997ffc659d6638af970a6ae959d95 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Fri, 25 Apr 2025 18:16:31 +0200 Subject: [PATCH 03/10] - Fixed tests --- .../runtime-templates/frontier/src/lib.rs | 23 +++++++++++++---- .../test-contract-deploy-filter.ts | 25 +++++++++++++++---- .../test-eth-rpc-log-filtering.ts | 2 +- .../test-pov/test-evm-over-pov.ts | 4 ++- .../test-pov/test-evm-over-pov2.ts | 4 ++- .../test-pov/test-precompile-over-pov.ts | 6 ++++- .../test-pov/test-precompile-over-pov2.ts | 6 ++++- .../test-precompile-assets-erc20-1.ts | 4 ++- .../test-precompile-assets-erc20-2.ts | 2 +- .../test-precompile-assets-erc20-3.ts | 2 +- .../test-precompile-assets-erc20-4.ts | 2 +- .../test-precompile-assets-erc20-5.ts | 4 ++- .../test-precompile-assets-erc20-6.ts | 4 ++- .../test-precompile-assets-erc20-7.ts | 4 ++- .../test-precompile-assets-erc20-low-level.ts | 4 ++- .../test-precompile-call-permit.ts | 4 ++- .../test-precompile-smart-contract-call.ts | 6 +++-- 17 files changed, 80 insertions(+), 26 deletions(-) diff --git a/chains/container-chains/runtime-templates/frontier/src/lib.rs b/chains/container-chains/runtime-templates/frontier/src/lib.rs index cf38d3f835..d57b1780d2 100644 --- a/chains/container-chains/runtime-templates/frontier/src/lib.rs +++ b/chains/container-chains/runtime-templates/frontier/src/lib.rs @@ -860,9 +860,6 @@ pub const GAS_PER_SECOND: u64 = 40_000_000; /// u64 works for approximations because Weight is a very small unit compared to gas. pub const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND; -/// Block storage limit in bytes. Set to 40 KB. -const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; - parameter_types! { pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS); @@ -870,8 +867,8 @@ parameter_types! { pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); pub SuicideQuickClearLimit: u32 = 0; pub GasLimitPovSizeRatio: u32 = 16; - pub GasLimitStorageGrowthRatio: u64 = - BlockGasLimit::get().min(u64::MAX.into()).low_u64() / BLOCK_STORAGE_LIMIT; + /// Hardcoding the value, since it is computed on block execution. Check calculations in the tests + pub GasLimitStorageGrowthRatio: u64 = 1464; } impl_on_charge_evm_transaction!(); @@ -1848,3 +1845,19 @@ cumulus_pallet_parachain_system::register_validate_block! { CheckInherents = CheckInherents, BlockExecutor = pallet_author_inherent::BlockExecutor::, } + +#[cfg(test)] +mod tests { + use super::*; + + /// Block storage limit in bytes. Set to 40 KB. + const BLOCK_STORAGE_LIMIT: u64 = 40 * 1024; + + #[test] + fn check_ratio_constant() { + assert_eq!( + BlockGasLimit::get().min(u64::MAX.into()).low_u64() / BLOCK_STORAGE_LIMIT, + GasLimitStorageGrowthRatio::get() + ); + } +} diff --git a/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts b/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts index 7ff6294ea4..0480084f3e 100644 --- a/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts +++ b/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts @@ -26,7 +26,10 @@ describeSuite({ contractAddress: contractAddressAlith, hash: contractHashAlith, status: contractStatusAlith, - } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); + } = await deployCreateCompiledContract(context, "Foo", { + privateKey: ALITH_PRIVATE_KEY, + gas: 30000000n, + }); expect(fooAlithAbi).toBeTruthy(); expect(contractAddressAlith).toBeTruthy(); @@ -38,7 +41,10 @@ describeSuite({ contractAddress: contractAddressBaltathar, hash: contractHashBaltathar, status: contractStatusBaltathar, - } = await deployCreateCompiledContract(context, "Foo", { privateKey: BALTATHAR_PRIVATE_KEY }); + } = await deployCreateCompiledContract(context, "Foo", { + privateKey: BALTATHAR_PRIVATE_KEY, + gas: 30000000n, + }); expect(fooBaltatharAbi).toBeTruthy(); expect(contractAddressBaltathar).toBeTruthy(); @@ -82,7 +88,10 @@ describeSuite({ contractAddress: contractAddressAlith, hash: contractHashAlith, status: contractStatusAlith, - } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); + } = await deployCreateCompiledContract(context, "Foo", { + privateKey: ALITH_PRIVATE_KEY, + gas: 30000000n, + }); expect(fooAlithAbi).toBeTruthy(); expect(contractAddressAlith).toBeTruthy(); @@ -114,7 +123,10 @@ describeSuite({ contractAddress: contractFooAddress, hash: contractFooHash, status: contractFooStatus, - } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); + } = await deployCreateCompiledContract(context, "Foo", { + privateKey: ALITH_PRIVATE_KEY, + gas: 30000000n, + }); expect(fooAbi).toBeTruthy(); expect(contractFooAddress).toBeTruthy(); @@ -203,7 +215,10 @@ describeSuite({ contractAddress: contractFooAddress, hash: contractFooHash, status: contractFooStatus, - } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); + } = await deployCreateCompiledContract(context, "Foo", { + privateKey: ALITH_PRIVATE_KEY, + gas: 20000000n, + }); expect(contractFooHash).toBeTruthy(); expect(contractFooStatus).to.eq("success"); diff --git a/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts b/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts index 936a3d0154..1a812385e6 100644 --- a/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts +++ b/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts @@ -41,7 +41,7 @@ describeSuite({ }; beforeAll(async () => { - const { hash } = await deployCreateCompiledContract(context, "EventEmitter"); + const { hash } = await deployCreateCompiledContract(context, "EventEmitter", { gas: 20000000n }); const receipt = await context.viem("public").getTransactionReceipt({ hash }); nonMatchingCases = getNonMatchingCases(receipt); }); diff --git a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts index 482f9a1db2..53de4e2d2f 100644 --- a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts +++ b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts @@ -18,7 +18,9 @@ describeSuite({ const EXPECTED_POV_ROUGH = 40_000; // bytes beforeAll(async () => { - const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder"); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder", { + gas: 2000000n, + }); proxyAddress = contractAddress; proxyAbi = abi; diff --git a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts index 61e82a77a7..e52aa522a0 100644 --- a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts +++ b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts @@ -21,7 +21,9 @@ describeSuite({ // Empty blocks usually do not exceed 50kb emptyBlockProofSize = BigInt(block.proofSize || 50_000); - const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder"); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder", { + gas: 2000000n, + }); proxyAddress = contractAddress; proxyAbi = abi; diff --git a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts index 30421e1830..9956b301ae 100644 --- a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts +++ b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts @@ -22,7 +22,11 @@ describeSuite({ let callData: `0x${string}`; beforeAll(async () => { - const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract(context, "CallForwarder"); + const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract( + context, + "CallForwarder", + { gas: 20000000n } + ); proxyAddress = contractAdd1; proxyAbi = abi; contracts = await deployHeavyContracts(context, 6000, 6000 + MAX_CONTRACTS); diff --git a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts index 3759f47bf2..1e44d37a54 100644 --- a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts +++ b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts @@ -24,7 +24,11 @@ describeSuite({ // Empty blocks usually do not exceed 50kb emptyBlockProofSize = BigInt(block.proofSize || 50_000); - const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract(context, "CallForwarder"); + const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract( + context, + "CallForwarder", + { gas: 20000000n } + ); proxyAddress = contractAdd1; proxyAbi = abi; contracts = await deployHeavyContracts(context, 6000, Number(6000n + MAX_ETH_POV_PER_TX / 24_000n + 1n)); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts index 81f99c3af8..ebe889958a 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts @@ -35,7 +35,9 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 2000000000000000000000n) ); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance", { + gas: 20000000n, + }); erc20Abi = abi; contractInstanceAddress = contractAddress; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts index 13bed002ca..f742f3a26b 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts @@ -42,7 +42,7 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 100000000000000n) ); - const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance", { gas: 20000000n }); erc20Abi = abi; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts index f1f94a1877..68b0110f12 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts @@ -50,7 +50,7 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 100000000000000n) ); - const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance", { gas: 20000000n }); erc20Abi = abi; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts index 3464ac7104..1f169ef45c 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts @@ -31,7 +31,7 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 100000000000000n) ); - const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance", { gas: 20000000n }); erc20Abi = abi; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts index 205396cc72..6455ef35ca 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts @@ -35,7 +35,9 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance", { + gas: 20000000n, + }); erc20Abi = abi; erc20InstanceAddress = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts index c95269553b..e7a1fb4a00 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts @@ -29,7 +29,9 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance", { + gas: 20000000n, + }); erc20InstanceAddress = contractAddress; erc20Abi = abi; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts index fc6ac66734..6ae0715302 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts @@ -18,7 +18,9 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance", { + gas: 20000000n, + }); erc20Abi = abi; erc20InstanceAddress = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts index 429a663683..148a1cbf2c 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts @@ -20,7 +20,9 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance"); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance", { + gas: 20000000n, + }); contractInstanceAddress = contractAddress; contractAbi = abi; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts index 5ed98f75d2..650fa3d9e1 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts @@ -23,7 +23,9 @@ describeSuite({ let callPermitAbi: Abi; beforeAll(async () => { - const { abi: demoAbi, contractAddress } = await context.deployContract("CallPermitDemo"); + const { abi: demoAbi, contractAddress } = await context.deployContract("CallPermitDemo", { + gas: 20000000n, + }); callPermitDemoAbi = demoAbi; callPermitDemoAddr = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts index 72db90726a..df9357fcca 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts @@ -12,10 +12,12 @@ describeSuite({ let multiplyContractAddress: `0x${string}`; beforeAll(async () => { - const { contractAddress: addr1 } = await context.deployContract("SmartContractPrecompileCallTest"); + const { contractAddress: addr1 } = await context.deployContract("SmartContractPrecompileCallTest", { + gas: 20000000n, + }); testContractAddress = addr1; - const { contractAddress: addr3 } = await context.deployContract("MultiplyBy7"); + const { contractAddress: addr3 } = await context.deployContract("MultiplyBy7", { gas: 20000000n }); multiplyContractAddress = addr3; }); it({ From 728361d467468518377e83f2bb2ab8bd75232080 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 28 Apr 2025 18:57:00 +0200 Subject: [PATCH 04/10] - Fixed gas estimation + reverted tests --- .../runtime-templates/frontier/src/lib.rs | 74 ++++++++++++++++--- .../test-contract-deploy-filter.ts | 5 -- .../test-eth-rpc-log-filtering.ts | 2 +- .../test-pov/test-evm-over-pov.ts | 4 +- .../test-pov/test-evm-over-pov2.ts | 4 +- .../test-pov/test-precompile-over-pov.ts | 6 +- .../test-pov/test-precompile-over-pov2.ts | 6 +- .../test-precompile-assets-erc20-1.ts | 11 ++- .../test-precompile-assets-erc20-2.ts | 2 +- .../test-precompile-assets-erc20-3.ts | 2 +- .../test-precompile-assets-erc20-4.ts | 2 +- .../test-precompile-assets-erc20-5.ts | 4 +- .../test-precompile-assets-erc20-6.ts | 4 +- .../test-precompile-assets-erc20-7.ts | 4 +- .../test-precompile-assets-erc20-low-level.ts | 4 +- 15 files changed, 83 insertions(+), 51 deletions(-) diff --git a/chains/container-chains/runtime-templates/frontier/src/lib.rs b/chains/container-chains/runtime-templates/frontier/src/lib.rs index d57b1780d2..625f18fbc4 100644 --- a/chains/container-chains/runtime-templates/frontier/src/lib.rs +++ b/chains/container-chains/runtime-templates/frontier/src/lib.rs @@ -1549,14 +1549,22 @@ impl_runtime_apis! { max_fee_per_gas: Option, max_priority_fee_per_gas: Option, nonce: Option, - _estimate: bool, + estimate: bool, access_list: Option)>>, ) -> Result { + let config = if estimate { + let mut config = ::config().clone(); + config.estimate = true; + Some(config) + } else { + None + }; let is_transactional = false; let validate = true; // Estimated encoded transaction size must be based on the heaviest transaction // type (EIP1559Transaction) to be compatible with all transaction types. + // TODO: remove, since we will get rid of base_cost let mut estimated_transaction_len = data.len() + // pallet ethereum index: 1 // transact call index: 1 @@ -1572,13 +1580,15 @@ impl_runtime_apis! { // 65 bytes signature 258; - if access_list.is_some() { - estimated_transaction_len += access_list.encoded_size(); + if let Some(ref list) = access_list { + estimated_transaction_len += list.encoded_size(); } + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); let without_base_extrinsic_weight = true; - let (weight_limit, proof_size_base_cost) = - match ::GasWeightMapping::gas_to_weight( + + let (weight_limit, proof_size_base_cost) = match + ::GasWeightMapping::gas_to_weight( gas_limit, without_base_extrinsic_weight ) { @@ -1602,7 +1612,7 @@ impl_runtime_apis! { validate, weight_limit, proof_size_base_cost, - ::config(), + config.as_ref().unwrap_or(::config()), ).map_err(|err| err.error.into()) } @@ -1614,25 +1624,67 @@ impl_runtime_apis! { max_fee_per_gas: Option, max_priority_fee_per_gas: Option, nonce: Option, - _estimate: bool, + estimate: bool, access_list: Option)>>, ) -> Result { + let config = if estimate { + let mut config = ::config().clone(); + config.estimate = true; + Some(config) + } else { + None + }; let is_transactional = false; let validate = true; + + let mut estimated_transaction_len = data.len() + + // from: 20 + // value: 32 + // gas_limit: 32 + // nonce: 32 + // 1 byte transaction action variant + // chain id 8 bytes + // 65 bytes signature + 190; + + if max_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if max_priority_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if let Some(ref list) = access_list { + estimated_transaction_len += list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = match + ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + ::Runner::create( from, data, value, - gas_limit.min(u64::MAX.into()).low_u64(), + gas_limit, max_fee_per_gas, max_priority_fee_per_gas, nonce, access_list.unwrap_or_default(), is_transactional, validate, - None, - None, - ::config(), + weight_limit, + proof_size_base_cost, + config.as_ref().unwrap_or(::config()), ).map_err(|err| err.error.into()) } diff --git a/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts b/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts index 0480084f3e..64471b9f6d 100644 --- a/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts +++ b/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts @@ -28,7 +28,6 @@ describeSuite({ status: contractStatusAlith, } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY, - gas: 30000000n, }); expect(fooAlithAbi).toBeTruthy(); @@ -43,7 +42,6 @@ describeSuite({ status: contractStatusBaltathar, } = await deployCreateCompiledContract(context, "Foo", { privateKey: BALTATHAR_PRIVATE_KEY, - gas: 30000000n, }); expect(fooBaltatharAbi).toBeTruthy(); @@ -90,7 +88,6 @@ describeSuite({ status: contractStatusAlith, } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY, - gas: 30000000n, }); expect(fooAlithAbi).toBeTruthy(); @@ -125,7 +122,6 @@ describeSuite({ status: contractFooStatus, } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY, - gas: 30000000n, }); expect(fooAbi).toBeTruthy(); @@ -217,7 +213,6 @@ describeSuite({ status: contractFooStatus, } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY, - gas: 20000000n, }); expect(contractFooHash).toBeTruthy(); diff --git a/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts b/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts index 1a812385e6..936a3d0154 100644 --- a/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts +++ b/test/suites/dev-frontier-template/test-eth-rpc/test-eth-rpc-log-filtering.ts @@ -41,7 +41,7 @@ describeSuite({ }; beforeAll(async () => { - const { hash } = await deployCreateCompiledContract(context, "EventEmitter", { gas: 20000000n }); + const { hash } = await deployCreateCompiledContract(context, "EventEmitter"); const receipt = await context.viem("public").getTransactionReceipt({ hash }); nonMatchingCases = getNonMatchingCases(receipt); }); diff --git a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts index 53de4e2d2f..482f9a1db2 100644 --- a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts +++ b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov.ts @@ -18,9 +18,7 @@ describeSuite({ const EXPECTED_POV_ROUGH = 40_000; // bytes beforeAll(async () => { - const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder", { - gas: 2000000n, - }); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder"); proxyAddress = contractAddress; proxyAbi = abi; diff --git a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts index e52aa522a0..61e82a77a7 100644 --- a/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts +++ b/test/suites/dev-frontier-template/test-pov/test-evm-over-pov2.ts @@ -21,9 +21,7 @@ describeSuite({ // Empty blocks usually do not exceed 50kb emptyBlockProofSize = BigInt(block.proofSize || 50_000); - const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder", { - gas: 2000000n, - }); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "CallForwarder"); proxyAddress = contractAddress; proxyAbi = abi; diff --git a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts index 9956b301ae..30421e1830 100644 --- a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts +++ b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov.ts @@ -22,11 +22,7 @@ describeSuite({ let callData: `0x${string}`; beforeAll(async () => { - const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract( - context, - "CallForwarder", - { gas: 20000000n } - ); + const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract(context, "CallForwarder"); proxyAddress = contractAdd1; proxyAbi = abi; contracts = await deployHeavyContracts(context, 6000, 6000 + MAX_CONTRACTS); diff --git a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts index 1e44d37a54..3759f47bf2 100644 --- a/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts +++ b/test/suites/dev-frontier-template/test-pov/test-precompile-over-pov2.ts @@ -24,11 +24,7 @@ describeSuite({ // Empty blocks usually do not exceed 50kb emptyBlockProofSize = BigInt(block.proofSize || 50_000); - const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract( - context, - "CallForwarder", - { gas: 20000000n } - ); + const { contractAddress: contractAdd1, abi } = await deployCreateCompiledContract(context, "CallForwarder"); proxyAddress = contractAdd1; proxyAbi = abi; contracts = await deployHeavyContracts(context, 6000, Number(6000n + MAX_ETH_POV_PER_TX / 24_000n + 1n)); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts index ebe889958a..7bcefdc080 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts @@ -1,5 +1,5 @@ import "@moonbeam-network/api-augment"; -import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from "@moonwall/cli"; +import { beforeAll, deployCreateCompiledContract, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; import { ALITH_ADDRESS, alith } from "@moonwall/util"; import type { u16 } from "@polkadot/types-codec"; import { RELAY_SOURCE_LOCATION } from "utils"; @@ -35,9 +35,14 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 2000000000000000000000n) ); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance", { - gas: 20000000n, + const estimatedGas = await context.viem().estimateGas({ + account: ALITH_ADDRESS, + data: fetchCompiledContract("ERC20Instance").bytecode, }); + + console.log("estimatedGas: ", estimatedGas); + + const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; contractInstanceAddress = contractAddress; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts index f742f3a26b..13bed002ca 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-2.ts @@ -42,7 +42,7 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 100000000000000n) ); - const { abi } = await deployCreateCompiledContract(context, "ERC20Instance", { gas: 20000000n }); + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts index 68b0110f12..f1f94a1877 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-3.ts @@ -50,7 +50,7 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 100000000000000n) ); - const { abi } = await deployCreateCompiledContract(context, "ERC20Instance", { gas: 20000000n }); + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts index 1f169ef45c..3464ac7104 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-4.ts @@ -31,7 +31,7 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 100000000000000n) ); - const { abi } = await deployCreateCompiledContract(context, "ERC20Instance", { gas: 20000000n }); + const { abi } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; }); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts index 6455ef35ca..205396cc72 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-5.ts @@ -35,9 +35,7 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance", { - gas: 20000000n, - }); + const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; erc20InstanceAddress = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts index e7a1fb4a00..c95269553b 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-6.ts @@ -29,9 +29,7 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance", { - gas: 20000000n, - }); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20InstanceAddress = contractAddress; erc20Abi = abi; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts index 6ae0715302..fc6ac66734 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-7.ts @@ -18,9 +18,7 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance", { - gas: 20000000n, - }); + const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; erc20InstanceAddress = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts index 148a1cbf2c..429a663683 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-low-level.ts @@ -20,9 +20,7 @@ describeSuite({ beforeAll(async () => { assetId = context.polkadotJs().createType("u16", ASSET_ID); - const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance", { - gas: 20000000n, - }); + const { contractAddress, abi } = await deployCreateCompiledContract(context, "ERC20Instance"); contractInstanceAddress = contractAddress; contractAbi = abi; From f66aea0b80c24b876c7c9068b4fde1cfd4feaa07 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 28 Apr 2025 19:05:45 +0200 Subject: [PATCH 05/10] - reverted tests --- .../test-contract-deploy-filter.ts | 20 +++++-------------- .../test-precompile-assets-erc20-1.ts | 9 +-------- .../test-precompile-call-permit.ts | 4 +--- .../test-precompile-smart-contract-call.ts | 6 ++---- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts b/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts index 64471b9f6d..7ff6294ea4 100644 --- a/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts +++ b/test/suites/dev-frontier-template/test-contract/test-contract-deploy-filter.ts @@ -26,9 +26,7 @@ describeSuite({ contractAddress: contractAddressAlith, hash: contractHashAlith, status: contractStatusAlith, - } = await deployCreateCompiledContract(context, "Foo", { - privateKey: ALITH_PRIVATE_KEY, - }); + } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); expect(fooAlithAbi).toBeTruthy(); expect(contractAddressAlith).toBeTruthy(); @@ -40,9 +38,7 @@ describeSuite({ contractAddress: contractAddressBaltathar, hash: contractHashBaltathar, status: contractStatusBaltathar, - } = await deployCreateCompiledContract(context, "Foo", { - privateKey: BALTATHAR_PRIVATE_KEY, - }); + } = await deployCreateCompiledContract(context, "Foo", { privateKey: BALTATHAR_PRIVATE_KEY }); expect(fooBaltatharAbi).toBeTruthy(); expect(contractAddressBaltathar).toBeTruthy(); @@ -86,9 +82,7 @@ describeSuite({ contractAddress: contractAddressAlith, hash: contractHashAlith, status: contractStatusAlith, - } = await deployCreateCompiledContract(context, "Foo", { - privateKey: ALITH_PRIVATE_KEY, - }); + } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); expect(fooAlithAbi).toBeTruthy(); expect(contractAddressAlith).toBeTruthy(); @@ -120,9 +114,7 @@ describeSuite({ contractAddress: contractFooAddress, hash: contractFooHash, status: contractFooStatus, - } = await deployCreateCompiledContract(context, "Foo", { - privateKey: ALITH_PRIVATE_KEY, - }); + } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); expect(fooAbi).toBeTruthy(); expect(contractFooAddress).toBeTruthy(); @@ -211,9 +203,7 @@ describeSuite({ contractAddress: contractFooAddress, hash: contractFooHash, status: contractFooStatus, - } = await deployCreateCompiledContract(context, "Foo", { - privateKey: ALITH_PRIVATE_KEY, - }); + } = await deployCreateCompiledContract(context, "Foo", { privateKey: ALITH_PRIVATE_KEY }); expect(contractFooHash).toBeTruthy(); expect(contractFooStatus).to.eq("success"); diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts index 7bcefdc080..81f99c3af8 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-assets-erc20-1.ts @@ -1,5 +1,5 @@ import "@moonbeam-network/api-augment"; -import { beforeAll, deployCreateCompiledContract, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; +import { beforeAll, deployCreateCompiledContract, describeSuite, expect } from "@moonwall/cli"; import { ALITH_ADDRESS, alith } from "@moonwall/util"; import type { u16 } from "@polkadot/types-codec"; import { RELAY_SOURCE_LOCATION } from "utils"; @@ -35,13 +35,6 @@ describeSuite({ context.polkadotJs().tx.foreignAssets.mint(assetId.toU8a(), ALITH_ADDRESS, 2000000000000000000000n) ); - const estimatedGas = await context.viem().estimateGas({ - account: ALITH_ADDRESS, - data: fetchCompiledContract("ERC20Instance").bytecode, - }); - - console.log("estimatedGas: ", estimatedGas); - const { abi, contractAddress } = await deployCreateCompiledContract(context, "ERC20Instance"); erc20Abi = abi; contractInstanceAddress = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts index 650fa3d9e1..5ed98f75d2 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-call-permit.ts @@ -23,9 +23,7 @@ describeSuite({ let callPermitAbi: Abi; beforeAll(async () => { - const { abi: demoAbi, contractAddress } = await context.deployContract("CallPermitDemo", { - gas: 20000000n, - }); + const { abi: demoAbi, contractAddress } = await context.deployContract("CallPermitDemo"); callPermitDemoAbi = demoAbi; callPermitDemoAddr = contractAddress; diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts index df9357fcca..72db90726a 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-smart-contract-call.ts @@ -12,12 +12,10 @@ describeSuite({ let multiplyContractAddress: `0x${string}`; beforeAll(async () => { - const { contractAddress: addr1 } = await context.deployContract("SmartContractPrecompileCallTest", { - gas: 20000000n, - }); + const { contractAddress: addr1 } = await context.deployContract("SmartContractPrecompileCallTest"); testContractAddress = addr1; - const { contractAddress: addr3 } = await context.deployContract("MultiplyBy7", { gas: 20000000n }); + const { contractAddress: addr3 } = await context.deployContract("MultiplyBy7"); multiplyContractAddress = addr3; }); it({ From 315572116796c209df163f50fb6e44dd87536b17 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 30 Apr 2025 13:45:09 +0200 Subject: [PATCH 06/10] - Added tests for the storage growth --- test/contracts/solidity/Fibonacci.sol | 18 +++ test/contracts/solidity/StorageLoop.sol | 17 +++ .../test-block-storage-growth.ts | 36 +++++ .../test-evm-create-storage-growth.ts | 64 +++++++++ .../test-evm-store-storage-growth.ts | 74 ++++++++++ .../test-precompile-storage-growth.ts | 128 ++++++++++++++++++ 6 files changed, 337 insertions(+) create mode 100644 test/contracts/solidity/Fibonacci.sol create mode 100644 test/contracts/solidity/StorageLoop.sol create mode 100644 test/suites/dev-frontier-template/test-storage-growth/test-block-storage-growth.ts create mode 100644 test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts create mode 100644 test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts create mode 100644 test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts diff --git a/test/contracts/solidity/Fibonacci.sol b/test/contracts/solidity/Fibonacci.sol new file mode 100644 index 0000000000..cf24c7e11e --- /dev/null +++ b/test/contracts/solidity/Fibonacci.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only +pragma solidity >=0.8.3; + +contract Fibonacci { + function fib2(uint256 n) public pure returns (uint256 b) { + if (n == 0) { + return 0; + } + uint256 a = 1; + b = 1; + for (uint256 i = 2; i < n; i++) { + uint256 c = a + b; + a = b; + b = c; + } + return b; + } +} diff --git a/test/contracts/solidity/StorageLoop.sol b/test/contracts/solidity/StorageLoop.sol new file mode 100644 index 0000000000..fcab685996 --- /dev/null +++ b/test/contracts/solidity/StorageLoop.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.8.2 <0.9.0; + +contract StorageLoop { + mapping(uint256 => uint256) public map; + mapping(uint256 => uint256) public map2; + + function store(uint16 n) public { + for (uint16 i = 0; i < n; i++) { + map[i] = i + 1; + } + } + + function store2(uint256 i) public { + map2[i] = i; + } +} diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-block-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-block-storage-growth.ts new file mode 100644 index 0000000000..fb97bffad1 --- /dev/null +++ b/test/suites/dev-frontier-template/test-storage-growth/test-block-storage-growth.ts @@ -0,0 +1,36 @@ +import "@tanssi/api-augment"; +import { describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; +import { createEthersTransaction, sendRawTransaction } from "@moonwall/util"; +import { encodeDeployData } from "viem"; + +describeSuite({ + id: "DE1501", + title: "Storage Block (40kB) - Storage Growth Limit", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + it({ + id: "T01", + title: "should fill a block with 61 tx at most", + test: async () => { + const { abi, bytecode } = fetchCompiledContract("Fibonacci"); + const deployData = encodeDeployData({ + abi, + bytecode, + }); + + for (let i = 0; i < 300; i++) { + const rawTxn = await createEthersTransaction(context, { + data: deployData, + nonce: i, + gasLimit: 969168, // (112[account] + 550[contract]) * 1464[ratio] = 969168 + }); + + await sendRawTransaction(context, rawTxn); + } + + await context.createBlock(); + expect((await context.viem().getBlock()).transactions.length).toBe(61); + }, + }); + }, +}); diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts new file mode 100644 index 0000000000..a47ca4f75c --- /dev/null +++ b/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts @@ -0,0 +1,64 @@ +import "@tanssi/api-augment"; +import { TransactionTypes, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; +import { ALITH_ADDRESS, createEthersTransaction } from "@moonwall/util"; +import { expectEVMResult } from "helpers/eth-transactions"; + +describeSuite({ + id: "DE1502", + title: "Storage growth limit - Contract Creation", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + // This is the gas cost of the transaction that deploys the Fibonacci contract: + // (Account Code Size (112) + Length of the bytecode (550)) * Storage Growth Gas Ratio (1464) + // The length of the bytecode is in the generate Fibonacci.json + // file at 'contract.evm.deployedBytecode.object' + const EXPECTED_STORAGE_GROWTH_GAS = 969168; + for (const txnType of TransactionTypes) { + it({ + id: `T0${TransactionTypes.indexOf(txnType) + 1}`, + title: "should out of gas when gas provided is not enough to cover storage growth", + test: async () => { + const { bytecode } = fetchCompiledContract("Fibonacci"); + // Deploy contract with insufficient gas limit + const rawSigned = await createEthersTransaction(context, { + account: ALITH_ADDRESS, + data: bytecode, + gasLimit: EXPECTED_STORAGE_GROWTH_GAS - 1, + }); + + const { result } = await context.createBlock(rawSigned); + // Check that the transaction failed with an out of gas error + expectEVMResult(result!.events, "Error", "OutOfGas"); + }, + }); + + it({ + id: `T0${TransactionTypes.indexOf(txnType) + 4}`, + title: "should estimate enough gas to cover storage growth", + test: async () => { + const estimatedGas = await context.viem().estimateGas({ + account: ALITH_ADDRESS, + data: fetchCompiledContract("Fibonacci").bytecode, + }); + + expect(estimatedGas).toBeGreaterThanOrEqual(EXPECTED_STORAGE_GROWTH_GAS); + expect(estimatedGas).toBe(1013235n); + }, + }); + + it({ + id: `T0${TransactionTypes.indexOf(txnType) + 7}`, + title: "should deploy contract with enough gas to cover storage growth", + test: async () => { + const contractData = fetchCompiledContract("Fibonacci"); + const callCode = (await context.viem().call({ data: contractData.bytecode, gas: 1013235n })).data; + const { contractAddress, hash } = await context.deployContract!("Fibonacci"); + const { gasUsed } = await context.viem().getTransactionReceipt({ hash }); + expect(gasUsed).toEqual(BigInt(EXPECTED_STORAGE_GROWTH_GAS)); + const deployedCode = await context.viem("public").getBytecode({ address: contractAddress! }); + expect(callCode).to.be.eq(deployedCode); + }, + }); + } + }, +}); diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts new file mode 100644 index 0000000000..7e725ec0ed --- /dev/null +++ b/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts @@ -0,0 +1,74 @@ +import "@tanssi/api-augment"; +import { TransactionTypes, beforeAll, deployCreateCompiledContract, describeSuite } from "@moonwall/cli"; +import { createEthersTransaction } from "@moonwall/util"; +import { expectEVMResult } from "helpers/eth-transactions"; +import { type Abi, encodeFunctionData } from "viem"; + +describeSuite({ + id: "DE1503", + title: "Storage growth limit - New Entries", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + let storageLoopAddress: `0x${string}`; + let storageLoopAbi: Abi; + + beforeAll(async () => { + const { contractAddress, abi } = await deployCreateCompiledContract(context, "StorageLoop"); + storageLoopAddress = contractAddress; + storageLoopAbi = abi; + + await context.createBlock(); + }); + + for (const txnType of TransactionTypes) { + it({ + id: `T0${TransactionTypes.indexOf(txnType) + 1}`, + title: "should out of gas when gas provided is not enough to cover storage growth", + test: async () => { + // Number of bytes added to storage for a new entry. + // const ACCOUNT_STORAGE_SIZE = 116; + // Ratio of gas to storage growth. (BlockGasLimit (15_000_000) / BlockStorageLimit (40kb)) + // const GAS_LIMIT_STORAGE_GROWTH_RATIO = 1464; + // Tx is creating 5 new storage entries. So, required gas is: + // (5 * ACCOUNT_STORAGE_SIZE) * GAS_LIMIT_STORAGE_GROWTH_RATIO = 849_120 + // Execute tx with insufficient gas limit + const rawSigned = await createEthersTransaction(context, { + to: storageLoopAddress, + data: encodeFunctionData({ + abi: storageLoopAbi, + functionName: "store", + // for each transaction type, we add 5 new storage entries + args: [5 + 5 * TransactionTypes.indexOf(txnType)], + }), + gasLimit: 849_120 - 10, + }); + + const { result } = await context.createBlock(rawSigned); + // Check that the transaction failed with an out of gas error + expectEVMResult(result!.events, "Error", "OutOfGas"); + }, + }); + + it({ + id: `T0${TransactionTypes.indexOf(txnType) + 4}`, + title: "should successfully execute when adding 5 new storage entries", + test: async () => { + // Update 5 existing storage entries. So, required gas should be less than 849_120 + const rawSigned = await createEthersTransaction(context, { + to: storageLoopAddress, + data: encodeFunctionData({ + abi: storageLoopAbi, + functionName: "store", + args: [5], + }), + gasLimit: 849_120, + }); + + const { result } = await context.createBlock(rawSigned); + + expectEVMResult(result!.events, "Succeed", "Stopped"); + }, + }); + } + }, +}); diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts new file mode 100644 index 0000000000..57f5cfbafc --- /dev/null +++ b/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts @@ -0,0 +1,128 @@ +import { describeSuite, expect, fetchCompiledContract } from "@moonwall/cli"; +import { + BALTATHAR_ADDRESS, + BALTATHAR_PRIVATE_KEY, + CONTRACT_PROXY_TYPE_ANY, + FAITH_ADDRESS, + PRECOMPILE_NATIVE_ERC20_ADDRESS, + PRECOMPILE_PROXY_ADDRESS, +} from "@moonwall/util"; +import { parseEther } from "ethers"; +import { expectEVMResult } from "helpers/eth-transactions"; +import { encodeFunctionData } from "viem"; + +describeSuite({ + id: "DE1504", + title: "Storage growth limit - Precompiles", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + const newAccount = "0x1ced798a66b803d0dbb665680283980a939a6432"; + // The tx can create an account, so record 148 bytes of storage growth + // Storage growth ratio is 1464 + // expected_gas = 148 * 1464 = 216672 + const expectedGas = 216672n; + + it({ + id: "T01", + title: "should fail transfer due to insufficient gas required to cover the storage growth", + test: async () => { + const { abi: ierc20Abi } = fetchCompiledContract("IERC20"); + + const rawTxn = await context.writeContract?.({ + contractName: "Proxy", + contractAddress: PRECOMPILE_PROXY_ADDRESS, + functionName: "addProxy", + args: [BALTATHAR_ADDRESS, CONTRACT_PROXY_TYPE_ANY, 0], + rawTxOnly: true, + gas: 1_000_000n, + }); + const { result } = await context.createBlock(rawTxn); + expectEVMResult(result?.events, "Succeed"); + + const balBefore = await context.viem().getBalance({ address: FAITH_ADDRESS }); + const rawTxn2 = await context.writeContract?.({ + contractName: "Proxy", + functionName: "proxy", + contractAddress: PRECOMPILE_PROXY_ADDRESS, + args: [ + FAITH_ADDRESS, + PRECOMPILE_NATIVE_ERC20_ADDRESS, + encodeFunctionData({ + abi: ierc20Abi, + functionName: "transfer", + args: [newAccount, parseEther("5")], + }), + ], + privateKey: BALTATHAR_PRIVATE_KEY, + rawTxOnly: true, + gas: 22607n, + }); + + const { result: result2 } = await context.createBlock(rawTxn2); + // Check that the transaction failed with an out of gas error + expect(result2?.successful).to.be.false; + + const balAfter = await context.viem().getBalance({ address: FAITH_ADDRESS }); + expect(balBefore - balAfter).to.equal(0n); + }, + }); + + it({ + id: "T02", + title: "should transfer correctly with the required gas to cover the storage growth", + test: async () => { + const balBefore = await context.viem().getBalance({ address: FAITH_ADDRESS }); + const { abi: ierc20Abi } = fetchCompiledContract("IERC20"); + const { abi: proxyAbi } = fetchCompiledContract("Proxy"); + + const proxyProxyEstimatedGas = await context.viem().estimateGas({ + account: BALTATHAR_ADDRESS, + to: PRECOMPILE_PROXY_ADDRESS, + data: encodeFunctionData({ + abi: proxyAbi, + functionName: "proxy", + args: [ + FAITH_ADDRESS, + PRECOMPILE_NATIVE_ERC20_ADDRESS, + encodeFunctionData({ + abi: ierc20Abi, + functionName: "transfer", + args: [newAccount, parseEther("5")], + }), + ], + }), + }); + + console.log("proxyProxyEstimatedGas: ", proxyProxyEstimatedGas); + + const rawTxn2 = await context.writeContract?.({ + contractName: "Proxy", + functionName: "proxy", + contractAddress: PRECOMPILE_PROXY_ADDRESS, + args: [ + FAITH_ADDRESS, + PRECOMPILE_NATIVE_ERC20_ADDRESS, + encodeFunctionData({ + abi: ierc20Abi, + functionName: "transfer", + args: [newAccount, parseEther("5")], + }), + ], + privateKey: BALTATHAR_PRIVATE_KEY, + rawTxOnly: true, + gas: expectedGas, + }); + + const { result } = await context.createBlock(rawTxn2); + // Check that the transaction failed with an out of gas error + expectEVMResult(result?.events, "Succeed"); + + const { gasUsed } = await context.viem().getTransactionReceipt({ hash: result?.hash as `0x${string}` }); + expect(gasUsed).to.equal(expectedGas); + + const balAfter = await context.viem().getBalance({ address: FAITH_ADDRESS }); + expect(balBefore - balAfter).to.equal(parseEther("5")); + }, + }); + }, +}); From 98ae602a48e6282a71ac6e223a791de08948e63a Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Wed, 30 Apr 2025 14:58:05 +0200 Subject: [PATCH 07/10] - Fixed linter --- .../test-storage-growth/test-evm-create-storage-growth.ts | 6 +++--- .../test-storage-growth/test-evm-store-storage-growth.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts index a47ca4f75c..6697ab3aa1 100644 --- a/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts +++ b/test/suites/dev-frontier-template/test-storage-growth/test-evm-create-storage-growth.ts @@ -28,7 +28,7 @@ describeSuite({ const { result } = await context.createBlock(rawSigned); // Check that the transaction failed with an out of gas error - expectEVMResult(result!.events, "Error", "OutOfGas"); + expectEVMResult(result.events, "Error", "OutOfGas"); }, }); @@ -52,10 +52,10 @@ describeSuite({ test: async () => { const contractData = fetchCompiledContract("Fibonacci"); const callCode = (await context.viem().call({ data: contractData.bytecode, gas: 1013235n })).data; - const { contractAddress, hash } = await context.deployContract!("Fibonacci"); + const { contractAddress, hash } = await context.deployContract("Fibonacci"); const { gasUsed } = await context.viem().getTransactionReceipt({ hash }); expect(gasUsed).toEqual(BigInt(EXPECTED_STORAGE_GROWTH_GAS)); - const deployedCode = await context.viem("public").getBytecode({ address: contractAddress! }); + const deployedCode = await context.viem("public").getBytecode({ address: contractAddress }); expect(callCode).to.be.eq(deployedCode); }, }); diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts index 7e725ec0ed..9f56f9a3f8 100644 --- a/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts +++ b/test/suites/dev-frontier-template/test-storage-growth/test-evm-store-storage-growth.ts @@ -45,7 +45,7 @@ describeSuite({ const { result } = await context.createBlock(rawSigned); // Check that the transaction failed with an out of gas error - expectEVMResult(result!.events, "Error", "OutOfGas"); + expectEVMResult(result.events, "Error", "OutOfGas"); }, }); @@ -66,7 +66,7 @@ describeSuite({ const { result } = await context.createBlock(rawSigned); - expectEVMResult(result!.events, "Succeed", "Stopped"); + expectEVMResult(result.events, "Succeed", "Stopped"); }, }); } From 60ebdecec20847206912595debe1cd9556e25bc5 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 1 May 2025 13:57:47 +0200 Subject: [PATCH 08/10] - Fixed precompiles configuration + tests. --- Cargo.lock | 194 ++++++++++++------ Cargo.toml | 34 +-- .../frontier/src/precompiles.rs | 12 +- .../test-precompiles/test-precompile-proxy.ts | 9 +- .../test-precompile-storage-growth.ts | 31 ++- 5 files changed, 177 insertions(+), 103 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6272f93e29..55dd0807b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -578,7 +578,7 @@ dependencies = [ "frame-support", "frame-system", "frontier-template-emulated-chain", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-balances", "pallet-configuration", "pallet-message-queue", @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "async-backing-primitives" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "sp-api", "sp-consensus-slots", @@ -1698,7 +1698,7 @@ dependencies = [ "dc-orchestrator-chain-interface", "dp-collator-assignment", "dp-core", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", "parity-scale-codec", "scale-info", "sp-consensus-aura", @@ -2106,7 +2106,7 @@ dependencies = [ "log", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "node-common", "pallet-ethereum", "pallet-transaction-payment-rpc", @@ -2192,7 +2192,7 @@ dependencies = [ "log", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "node-common", "parity-scale-codec", "polkadot-cli", @@ -2275,12 +2275,12 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "num_enum", "pallet-asset-rate", "pallet-assets", "pallet-async-backing", - "pallet-author-inherent", + "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-balances", "pallet-base-fee", "pallet-cc-authorities-noting", @@ -2300,7 +2300,7 @@ dependencies = [ "pallet-foreign-asset-creator", "pallet-maintenance-mode", "pallet-message-queue", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-parameters", @@ -2344,7 +2344,7 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "tanssi-runtime-common", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "xcm-runtime-apis", ] @@ -2373,17 +2373,17 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-asset-rate", "pallet-assets", "pallet-async-backing", - "pallet-author-inherent", + "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-balances", "pallet-cc-authorities-noting", "pallet-foreign-asset-creator", "pallet-maintenance-mode", "pallet-message-queue", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-ocw-testing", @@ -2427,7 +2427,7 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "tanssi-runtime-common", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "xcm-runtime-apis", ] @@ -3446,11 +3446,11 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-asset-rate", "pallet-assets", "pallet-async-backing", - "pallet-author-inherent", + "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-author-noting", "pallet-author-noting-runtime-api", "pallet-authority-assignment", @@ -3469,7 +3469,7 @@ dependencies = [ "pallet-invulnerables", "pallet-maintenance-mode", "pallet-message-queue", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-pooled-staking", @@ -3547,7 +3547,7 @@ dependencies = [ "westend-runtime", "westend-runtime-constants", "xcm-emulator", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "xcm-runtime-apis", ] @@ -3563,9 +3563,9 @@ dependencies = [ "dp-consensus", "frame-support", "frame-system", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-async-backing", - "pallet-author-inherent", + "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-authority-mapping", "pallet-data-preservers", "pallet-registrar", @@ -3621,7 +3621,7 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-asset-rate", "pallet-author-noting", "pallet-author-noting-runtime-api", @@ -3653,7 +3653,7 @@ dependencies = [ "pallet-invulnerables", "pallet-membership", "pallet-message-queue", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-migrations 1.0.0", "pallet-mmr", "pallet-multisig", @@ -3910,7 +3910,7 @@ dependencies = [ "dp-core", "futures 0.3.31", "jsonrpsee 0.24.7", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", "parity-scale-codec", "polkadot-overseer", "sc-client-api", @@ -4217,7 +4217,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", "parity-scale-codec", "scale-info", "sp-api", @@ -4271,7 +4271,7 @@ dependencies = [ "dp-consensus", "frame-support", "impls", - "pallet-author-inherent", + "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", "pallet-cc-authorities-noting", "pallet-timestamp", "sp-core", @@ -5168,9 +5168,9 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-async-backing", - "pallet-author-inherent", + "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-author-noting", "pallet-author-noting-runtime-api", "pallet-authority-assignment", @@ -5186,7 +5186,7 @@ dependencies = [ "pallet-initializer", "pallet-invulnerables", "pallet-maintenance-mode", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-proxy", @@ -8892,7 +8892,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "async-backing-primitives", "async-trait", @@ -8905,7 +8905,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.31", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "parity-scale-codec", "parking_lot 0.12.3", "polkadot-node-primitives", @@ -8947,6 +8947,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "nimbus-primitives" +version = "0.9.0" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +dependencies = [ + "async-trait", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-inherents", + "sp-runtime", + "sp-std", +] + [[package]] name = "nix" version = "0.26.4" @@ -9020,7 +9038,7 @@ dependencies = [ "jsonrpsee 0.24.7", "log", "nimbus-consensus", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "parity-scale-codec", "polkadot-cli", "polkadot-primitives", @@ -9465,14 +9483,14 @@ dependencies = [ [[package]] name = "pallet-async-backing" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", "frame-support", "frame-system", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -9491,7 +9509,26 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-inherents", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-author-inherent" +version = "0.9.0" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "parity-scale-codec", "scale-info", "sp-api", @@ -9515,7 +9552,7 @@ dependencies = [ "hex", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", @@ -9854,7 +9891,7 @@ dependencies = [ "frame-system", "hex", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", "parity-scale-codec", "scale-info", "serde", @@ -9997,7 +10034,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "num-traits", "pallet-balances", "parity-scale-codec", @@ -10194,7 +10231,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-balances-erc20" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "fp-evm", "frame-support", @@ -10217,7 +10254,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-batch" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "evm", "fp-evm", @@ -10238,7 +10275,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-call-permit" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "evm", "fp-evm", @@ -10270,7 +10307,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-proxy" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "evm", "fp-evm", @@ -10310,7 +10347,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-xcm" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "cumulus-primitives-core", "evm", @@ -10330,13 +10367,13 @@ dependencies = [ "sp-weights", "staging-xcm", "staging-xcm-executor", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", ] [[package]] name = "pallet-evm-precompile-xcm-utils" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "fp-evm", "frame-support", @@ -10352,13 +10389,13 @@ dependencies = [ "sp-weights", "staging-xcm", "staging-xcm-executor", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", ] [[package]] name = "pallet-evm-precompileset-assets-erc20" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "fp-evm", "frame-support", @@ -10374,7 +10411,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", ] [[package]] @@ -10482,7 +10519,7 @@ dependencies = [ [[package]] name = "pallet-foreign-asset-creator" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "frame-benchmarking", "frame-support", @@ -10652,7 +10689,7 @@ dependencies = [ [[package]] name = "pallet-maintenance-mode" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -10662,7 +10699,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-std", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", ] [[package]] @@ -10716,7 +10753,26 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm-primitives", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", +] + +[[package]] +name = "pallet-migrations" +version = "0.1.0" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", ] [[package]] @@ -11052,7 +11108,7 @@ dependencies = [ [[package]] name = "pallet-relay-storage-roots" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -11062,7 +11118,7 @@ dependencies = [ "frame-system", "hex", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "parity-scale-codec", "scale-info", "serde", @@ -11555,7 +11611,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "num-traits", "pallet-balances", "pallet-xcm", @@ -11600,7 +11656,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", "parity-scale-codec", "scale-info", "serde", @@ -18564,7 +18620,7 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-asset-rate", "pallet-author-noting", "pallet-author-noting-runtime-api", @@ -18595,7 +18651,7 @@ dependencies = [ "pallet-invulnerables", "pallet-membership", "pallet-message-queue", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-migrations 1.0.0", "pallet-mmr", "pallet-multisig", @@ -19325,7 +19381,7 @@ dependencies = [ "dancelight-runtime", "frame-support", "frame-system", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-message-queue", "sc-consensus-grandpa", "snowbridge-beacon-primitives", @@ -19381,7 +19437,7 @@ dependencies = [ "manual-randomness-rpc", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "node-common", "pallet-author-noting-runtime-api", "pallet-collator-assignment-runtime-api", @@ -19661,7 +19717,7 @@ dependencies = [ "pallet-external-validators", "pallet-foreign-asset-creator", "pallet-invulnerables", - "pallet-migrations 0.1.0", + "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "pallet-pooled-staking", "pallet-registrar", "pallet-services-payment", @@ -19727,7 +19783,7 @@ dependencies = [ "futures-timer", "log", "nimbus-consensus", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "orchestra", "pallet-registrar-runtime-api", "pallet-xcm-core-buyer-runtime-api", @@ -19838,7 +19894,7 @@ dependencies = [ "log", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives", + "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", "node-common", "pallet-author-noting-runtime-api", "pallet-data-preservers", @@ -22062,6 +22118,22 @@ dependencies = [ "staging-xcm", ] +[[package]] +name = "xcm-primitives" +version = "0.1.0" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +dependencies = [ + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "primitive-types 0.12.2", + "sp-core", + "sp-runtime", + "sp-std", + "staging-xcm", +] + [[package]] name = "xcm-procedural" version = "7.0.0" diff --git a/Cargo.toml b/Cargo.toml index eff62c097e..228cec69d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -169,23 +169,23 @@ dp-container-chain-genesis-data = { git = "https://github.com/moondance-labs/dan dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412" } # Moonkit (wasm) -async-backing-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -nimbus-consensus = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412" } -nimbus-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-async-backing = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-author-inherent = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompile-balances-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompile-batch = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompile-call-permit = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompile-proxy = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompile-xcm = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompile-xcm-utils = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-evm-precompileset-assets-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-foreign-asset-creator = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-maintenance-mode = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-migrations = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-relay-storage-roots = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } -xcm-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +async-backing-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +nimbus-consensus = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream" } +nimbus-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-async-backing = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-author-inherent = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompile-balances-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompile-batch = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompile-call-permit = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompile-proxy = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompile-xcm = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompile-xcm-utils = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-evm-precompileset-assets-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-foreign-asset-creator = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-maintenance-mode = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-migrations = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-relay-storage-roots = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +xcm-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } # Substrate (wasm) diff --git a/chains/container-chains/runtime-templates/frontier/src/precompiles.rs b/chains/container-chains/runtime-templates/frontier/src/precompiles.rs index 7c18549dd4..da222f95de 100644 --- a/chains/container-chains/runtime-templates/frontier/src/precompiles.rs +++ b/chains/container-chains/runtime-templates/frontier/src/precompiles.rs @@ -19,7 +19,7 @@ use { xcm_config::{AssetId, ForeignAssetsInstance, XcmConfig}, AccountId, Balances, ForeignAssetsCreator, Runtime, }, - frame_support::parameter_types, + frame_support::{parameter_types, traits::ConstU64}, pallet_evm_precompile_balances_erc20::{Erc20BalancesPrecompile, Erc20Metadata}, pallet_evm_precompile_batch::BatchPrecompile, pallet_evm_precompile_call_permit::CallPermitPrecompile, @@ -71,6 +71,10 @@ pub const FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX: &[u8] = &[255u8; 18]; /// Const to identify ERC20_BALANCES_PRECOMPILE address pub const ERC20_BALANCES_PRECOMPILE: u64 = 2048; +/// System account size in bytes = Pallet_Name_Hash (16) + Storage_name_hash (16) + +/// Blake2_128Concat (16) + AccountId (20) + AccountInfo (4 + 12 + AccountData (4* 16)) = 148 +pub const SYSTEM_ACCOUNT_SIZE: u64 = 148; + parameter_types! { pub ForeignAssetPrefix: &'static [u8] = FOREIGN_ASSET_PRECOMPILE_ADDRESS_PREFIX; } @@ -99,7 +103,7 @@ type TemplatePrecompilesAt = ( // Template specific precompiles: PrecompileAt< AddressU64, - Erc20BalancesPrecompile, + Erc20BalancesPrecompile>, (CallableByContract, CallableByPrecompile), >, PrecompileAt, BatchPrecompile, SubcallWithMaxNesting<2>>, @@ -110,8 +114,8 @@ type TemplatePrecompilesAt = ( >, PrecompileAt< AddressU64<2051>, - XcmUtilsPrecompile, - CallableByContract>, + XcmUtilsPrecompile>, + CallableByContract>>, >, PrecompileAt< AddressU64<2052>, diff --git a/test/suites/dev-frontier-template/test-precompiles/test-precompile-proxy.ts b/test/suites/dev-frontier-template/test-precompiles/test-precompile-proxy.ts index 1102eed2b3..de2cc03470 100644 --- a/test/suites/dev-frontier-template/test-precompiles/test-precompile-proxy.ts +++ b/test/suites/dev-frontier-template/test-precompiles/test-precompile-proxy.ts @@ -565,14 +565,13 @@ describeSuite({ .getTransactionReceipt({ hash: result2?.hash as `0x${string}` }); // The tx can create an account, so record 148 bytes of storage growth - // Storage growth ratio is 366 (Not defined in frontier template) - // storage_gas = 148 * 366 = 54168 + // Storage growth ratio is 1464 + // storage_gas = 148 * 1464 = 216672 // pov_gas = 5693 * 16 = 91088 - const expectedGas = 91_088n; + const expectedGas = 216672n; // Allow 10% variance - expect(gasUsed).toBeLessThanOrEqual((expectedGas * 110n) / 100n); - expect(gasUsed).toBeGreaterThanOrEqual((expectedGas * 90n) / 100n); + expect(gasUsed).toEqual(expectedGas); expect(await context.viem().getBalance({ address: randomAccount })).toBe(parseEther("5")); const balAfter = await context.viem().getBalance({ address: DOROTHY_ADDRESS }); diff --git a/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts b/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts index 57f5cfbafc..66f5d05733 100644 --- a/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts +++ b/test/suites/dev-frontier-template/test-storage-growth/test-precompile-storage-growth.ts @@ -3,14 +3,17 @@ import { BALTATHAR_ADDRESS, BALTATHAR_PRIVATE_KEY, CONTRACT_PROXY_TYPE_ANY, + DOROTHY_ADDRESS, + DOROTHY_PRIVATE_KEY, FAITH_ADDRESS, - PRECOMPILE_NATIVE_ERC20_ADDRESS, - PRECOMPILE_PROXY_ADDRESS, } from "@moonwall/util"; import { parseEther } from "ethers"; import { expectEVMResult } from "helpers/eth-transactions"; import { encodeFunctionData } from "viem"; +const PRECOMPILE_NATIVE_ERC20_ADDRESS = "0x0000000000000000000000000000000000000800"; +const PRECOMPILE_PROXY_ADDRESS = "0x0000000000000000000000000000000000000805"; + describeSuite({ id: "DE1504", title: "Storage growth limit - Precompiles", @@ -29,12 +32,12 @@ describeSuite({ const { abi: ierc20Abi } = fetchCompiledContract("IERC20"); const rawTxn = await context.writeContract?.({ - contractName: "Proxy", contractAddress: PRECOMPILE_PROXY_ADDRESS, + contractName: "Proxy", functionName: "addProxy", args: [BALTATHAR_ADDRESS, CONTRACT_PROXY_TYPE_ANY, 0], + privateKey: DOROTHY_PRIVATE_KEY, rawTxOnly: true, - gas: 1_000_000n, }); const { result } = await context.createBlock(rawTxn); expectEVMResult(result?.events, "Succeed"); @@ -45,7 +48,7 @@ describeSuite({ functionName: "proxy", contractAddress: PRECOMPILE_PROXY_ADDRESS, args: [ - FAITH_ADDRESS, + DOROTHY_ADDRESS, PRECOMPILE_NATIVE_ERC20_ADDRESS, encodeFunctionData({ abi: ierc20Abi, @@ -55,12 +58,12 @@ describeSuite({ ], privateKey: BALTATHAR_PRIVATE_KEY, rawTxOnly: true, - gas: 22607n, + gas: 216672n - 10n, // Not enough gas to cover the storage growth }); const { result: result2 } = await context.createBlock(rawTxn2); // Check that the transaction failed with an out of gas error - expect(result2?.successful).to.be.false; + expectEVMResult(result2.events, "Error", "OutOfGas"); const balAfter = await context.viem().getBalance({ address: FAITH_ADDRESS }); expect(balBefore - balAfter).to.equal(0n); @@ -71,7 +74,7 @@ describeSuite({ id: "T02", title: "should transfer correctly with the required gas to cover the storage growth", test: async () => { - const balBefore = await context.viem().getBalance({ address: FAITH_ADDRESS }); + const balanceBefore = await context.viem().getBalance({ address: DOROTHY_ADDRESS }); const { abi: ierc20Abi } = fetchCompiledContract("IERC20"); const { abi: proxyAbi } = fetchCompiledContract("Proxy"); @@ -82,7 +85,7 @@ describeSuite({ abi: proxyAbi, functionName: "proxy", args: [ - FAITH_ADDRESS, + DOROTHY_ADDRESS, PRECOMPILE_NATIVE_ERC20_ADDRESS, encodeFunctionData({ abi: ierc20Abi, @@ -93,14 +96,12 @@ describeSuite({ }), }); - console.log("proxyProxyEstimatedGas: ", proxyProxyEstimatedGas); - const rawTxn2 = await context.writeContract?.({ contractName: "Proxy", functionName: "proxy", contractAddress: PRECOMPILE_PROXY_ADDRESS, args: [ - FAITH_ADDRESS, + DOROTHY_ADDRESS, PRECOMPILE_NATIVE_ERC20_ADDRESS, encodeFunctionData({ abi: ierc20Abi, @@ -110,18 +111,16 @@ describeSuite({ ], privateKey: BALTATHAR_PRIVATE_KEY, rawTxOnly: true, - gas: expectedGas, }); const { result } = await context.createBlock(rawTxn2); - // Check that the transaction failed with an out of gas error expectEVMResult(result?.events, "Succeed"); const { gasUsed } = await context.viem().getTransactionReceipt({ hash: result?.hash as `0x${string}` }); expect(gasUsed).to.equal(expectedGas); - const balAfter = await context.viem().getBalance({ address: FAITH_ADDRESS }); - expect(balBefore - balAfter).to.equal(parseEther("5")); + const balanceAfter = await context.viem().getBalance({ address: DOROTHY_ADDRESS }); + expect(balanceBefore - balanceAfter).to.equal(parseEther("5")); }, }); }, From f14056b5a417afe2ef412323b1eeed9329b2a676 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Thu, 1 May 2025 14:40:32 +0200 Subject: [PATCH 09/10] - Link dancekit to the same branch --- Cargo.lock | 194 +++++++++++++++++------------------------------------ Cargo.toml | 26 +++---- 2 files changed, 74 insertions(+), 146 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55dd0807b1..9be9de730f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -578,7 +578,7 @@ dependencies = [ "frame-support", "frame-system", "frontier-template-emulated-chain", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-balances", "pallet-configuration", "pallet-message-queue", @@ -1689,7 +1689,7 @@ dependencies = [ [[package]] name = "ccp-authorities-noting-inherent" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1698,7 +1698,7 @@ dependencies = [ "dc-orchestrator-chain-interface", "dp-collator-assignment", "dp-core", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "nimbus-primitives", "parity-scale-codec", "scale-info", "sp-consensus-aura", @@ -1717,7 +1717,7 @@ dependencies = [ [[package]] name = "ccp-xcm" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "frame-support", "frame-system", @@ -2106,7 +2106,7 @@ dependencies = [ "log", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "node-common", "pallet-ethereum", "pallet-transaction-payment-rpc", @@ -2192,7 +2192,7 @@ dependencies = [ "log", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "node-common", "parity-scale-codec", "polkadot-cli", @@ -2275,12 +2275,12 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "num_enum", "pallet-asset-rate", "pallet-assets", "pallet-async-backing", - "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-author-inherent", "pallet-balances", "pallet-base-fee", "pallet-cc-authorities-noting", @@ -2300,7 +2300,7 @@ dependencies = [ "pallet-foreign-asset-creator", "pallet-maintenance-mode", "pallet-message-queue", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-parameters", @@ -2344,7 +2344,7 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "tanssi-runtime-common", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", "xcm-runtime-apis", ] @@ -2373,17 +2373,17 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-asset-rate", "pallet-assets", "pallet-async-backing", - "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-author-inherent", "pallet-balances", "pallet-cc-authorities-noting", "pallet-foreign-asset-creator", "pallet-maintenance-mode", "pallet-message-queue", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-ocw-testing", @@ -2427,7 +2427,7 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "tanssi-runtime-common", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", "xcm-runtime-apis", ] @@ -3446,11 +3446,11 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-asset-rate", "pallet-assets", "pallet-async-backing", - "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-author-inherent", "pallet-author-noting", "pallet-author-noting-runtime-api", "pallet-authority-assignment", @@ -3469,7 +3469,7 @@ dependencies = [ "pallet-invulnerables", "pallet-maintenance-mode", "pallet-message-queue", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-pooled-staking", @@ -3547,7 +3547,7 @@ dependencies = [ "westend-runtime", "westend-runtime-constants", "xcm-emulator", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", "xcm-runtime-apis", ] @@ -3563,9 +3563,9 @@ dependencies = [ "dp-consensus", "frame-support", "frame-system", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-async-backing", - "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-author-inherent", "pallet-authority-mapping", "pallet-data-preservers", "pallet-registrar", @@ -3621,7 +3621,7 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-asset-rate", "pallet-author-noting", "pallet-author-noting-runtime-api", @@ -3653,7 +3653,7 @@ dependencies = [ "pallet-invulnerables", "pallet-membership", "pallet-message-queue", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-migrations 1.0.0", "pallet-mmr", "pallet-multisig", @@ -3902,7 +3902,7 @@ dependencies = [ [[package]] name = "dc-orchestrator-chain-interface" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3910,7 +3910,7 @@ dependencies = [ "dp-core", "futures 0.3.31", "jsonrpsee 0.24.7", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "nimbus-primitives", "parity-scale-codec", "polkadot-overseer", "sc-client-api", @@ -4180,7 +4180,7 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dp-chain-state-snapshot" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -4192,7 +4192,7 @@ dependencies = [ [[package]] name = "dp-collator-assignment" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4212,12 +4212,12 @@ dependencies = [ [[package]] name = "dp-consensus" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "nimbus-primitives", "parity-scale-codec", "scale-info", "sp-api", @@ -4229,7 +4229,7 @@ dependencies = [ [[package]] name = "dp-container-chain-genesis-data" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4251,7 +4251,7 @@ dependencies = [ [[package]] name = "dp-core" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4266,12 +4266,12 @@ dependencies = [ [[package]] name = "dp-impl-tanssi-pallets-config" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "dp-consensus", "frame-support", "impls", - "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "pallet-author-inherent", "pallet-cc-authorities-noting", "pallet-timestamp", "sp-core", @@ -4281,7 +4281,7 @@ dependencies = [ [[package]] name = "dp-slot-duration-runtime-api" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -5168,9 +5168,9 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-async-backing", - "pallet-author-inherent 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-author-inherent", "pallet-author-noting", "pallet-author-noting-runtime-api", "pallet-authority-assignment", @@ -5186,7 +5186,7 @@ dependencies = [ "pallet-initializer", "pallet-invulnerables", "pallet-maintenance-mode", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-migrations 1.0.0", "pallet-multisig", "pallet-proxy", @@ -8905,7 +8905,7 @@ dependencies = [ "cumulus-relay-chain-interface", "futures 0.3.31", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "parity-scale-codec", "parking_lot 0.12.3", "polkadot-node-primitives", @@ -8929,24 +8929,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "nimbus-primitives" -version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" -dependencies = [ - "async-trait", - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-inherents", - "sp-runtime", - "sp-std", -] - [[package]] name = "nimbus-primitives" version = "0.9.0" @@ -9038,7 +9020,7 @@ dependencies = [ "jsonrpsee 0.24.7", "log", "nimbus-consensus", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "parity-scale-codec", "polkadot-cli", "polkadot-primitives", @@ -9490,7 +9472,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -9500,25 +9482,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-author-inherent" -version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-inherents", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-author-inherent" version = "0.9.0" @@ -9528,7 +9491,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "parity-scale-codec", "scale-info", "sp-api", @@ -9552,7 +9515,7 @@ dependencies = [ "hex", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", @@ -9878,7 +9841,7 @@ dependencies = [ [[package]] name = "pallet-cc-authorities-noting" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "ccp-authorities-noting-inherent", "cumulus-pallet-parachain-system", @@ -9891,7 +9854,7 @@ dependencies = [ "frame-system", "hex", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "nimbus-primitives", "parity-scale-codec", "scale-info", "serde", @@ -10034,7 +9997,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "num-traits", "pallet-balances", "parity-scale-codec", @@ -10367,7 +10330,7 @@ dependencies = [ "sp-weights", "staging-xcm", "staging-xcm-executor", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", ] [[package]] @@ -10389,7 +10352,7 @@ dependencies = [ "sp-weights", "staging-xcm", "staging-xcm-executor", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", ] [[package]] @@ -10411,7 +10374,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", ] [[package]] @@ -10699,7 +10662,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-std", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", ] [[package]] @@ -10737,25 +10700,6 @@ dependencies = [ "sp-weights", ] -[[package]] -name = "pallet-migrations" -version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", -] - [[package]] name = "pallet-migrations" version = "0.1.0" @@ -10772,7 +10716,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "xcm-primitives 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "xcm-primitives", ] [[package]] @@ -11118,7 +11062,7 @@ dependencies = [ "frame-system", "hex", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "parity-scale-codec", "scale-info", "serde", @@ -11611,7 +11555,7 @@ dependencies = [ "frame-support", "frame-system", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "num-traits", "pallet-balances", "pallet-xcm", @@ -11650,13 +11594,13 @@ dependencies = [ [[package]] name = "pallet-xcm-executor-utils" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412)", + "pallet-migrations 0.1.0", "parity-scale-codec", "scale-info", "serde", @@ -18620,7 +18564,7 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.4", "log", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-asset-rate", "pallet-author-noting", "pallet-author-noting-runtime-api", @@ -18651,7 +18595,7 @@ dependencies = [ "pallet-invulnerables", "pallet-membership", "pallet-message-queue", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-migrations 1.0.0", "pallet-mmr", "pallet-multisig", @@ -19381,7 +19325,7 @@ dependencies = [ "dancelight-runtime", "frame-support", "frame-system", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "pallet-message-queue", "sc-consensus-grandpa", "snowbridge-beacon-primitives", @@ -19437,7 +19381,7 @@ dependencies = [ "manual-randomness-rpc", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "node-common", "pallet-author-noting-runtime-api", "pallet-collator-assignment-runtime-api", @@ -19717,7 +19661,7 @@ dependencies = [ "pallet-external-validators", "pallet-foreign-asset-creator", "pallet-invulnerables", - "pallet-migrations 0.1.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "pallet-migrations 0.1.0", "pallet-pooled-staking", "pallet-registrar", "pallet-services-payment", @@ -19783,7 +19727,7 @@ dependencies = [ "futures-timer", "log", "nimbus-consensus", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "orchestra", "pallet-registrar-runtime-api", "pallet-xcm-core-buyer-runtime-api", @@ -19894,7 +19838,7 @@ dependencies = [ "log", "manual-xcm-rpc", "nimbus-consensus", - "nimbus-primitives 0.9.0 (git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream)", + "nimbus-primitives", "node-common", "pallet-author-noting-runtime-api", "pallet-data-preservers", @@ -19981,7 +19925,7 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#c4dc34eef7d403247b9d8ced221835752e617d1f" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" dependencies = [ "cumulus-primitives-core", "dp-collator-assignment", @@ -22102,22 +22046,6 @@ dependencies = [ "staging-xcm-executor", ] -[[package]] -name = "xcm-primitives" -version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#4742f8fb1a5efc5d165f7cb4137ee2cbdcb2969b" -dependencies = [ - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "primitive-types 0.12.2", - "sp-core", - "sp-runtime", - "sp-std", - "staging-xcm", -] - [[package]] name = "xcm-primitives" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 228cec69d5..ca0b72206b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -150,23 +150,23 @@ tp-xcm-commons = { path = "primitives/xcm-commons", default-features = false } tp-xcm-core-buyer = { path = "primitives/xcm-core-buyer", default-features = false } # Dancekit (wasm) -ccp-authorities-noting-inherent = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -ccp-xcm = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-chain-state-snapshot = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-collator-assignment = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-consensus = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-impl-tanssi-pallets-config = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-slot-duration-runtime-api = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +ccp-authorities-noting-inherent = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +ccp-xcm = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-chain-state-snapshot = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-collator-assignment = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-consensus = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-impl-tanssi-pallets-config = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-slot-duration-runtime-api = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-core = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-cc-authorities-noting = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -pallet-xcm-executor-utils = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-core = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-cc-authorities-noting = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +pallet-xcm-executor-utils = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-container-chain-genesis-data = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-container-chain-genesis-data = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } # Dancekit (client) -dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412" } +dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream" } # Moonkit (wasm) async-backing-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } From b63f6c1a49a98da3885962b1ee6b8eefb62d0d66 Mon Sep 17 00:00:00 2001 From: Evgeny Svirsky Date: Mon, 12 May 2025 10:30:17 +0200 Subject: [PATCH 10/10] - Updated branch for dancekit/moonkit --- Cargo.lock | 102 ++++++++++++++++++++++++++++++++++------------------- Cargo.toml | 60 +++++++++++++++---------------- 2 files changed, 95 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9be9de730f..7fc459a1a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "async-backing-primitives" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "sp-api", "sp-consensus-slots", @@ -1689,7 +1689,7 @@ dependencies = [ [[package]] name = "ccp-authorities-noting-inherent" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1717,7 +1717,7 @@ dependencies = [ [[package]] name = "ccp-xcm" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "frame-support", "frame-system", @@ -2066,7 +2066,7 @@ checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "container-chain-frontier-node" -version = "0.13.0" +version = "0.14.0" dependencies = [ "async-io 1.13.0", "async-trait", @@ -2164,7 +2164,7 @@ dependencies = [ [[package]] name = "container-chain-simple-node" -version = "0.13.0" +version = "0.14.0" dependencies = [ "async-io 1.13.0", "async-trait", @@ -3604,6 +3604,7 @@ dependencies = [ "container-chain-template-frontier-runtime", "container-chain-template-simple-runtime", "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", "cumulus-primitives-core", "dancelight-runtime-constants", "dp-consensus", @@ -3622,6 +3623,7 @@ dependencies = [ "hex-literal 0.3.4", "log", "nimbus-primitives", + "pallet-alt-benchmarks", "pallet-asset-rate", "pallet-author-noting", "pallet-author-noting-runtime-api", @@ -3902,7 +3904,7 @@ dependencies = [ [[package]] name = "dc-orchestrator-chain-interface" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -4180,7 +4182,7 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dp-chain-state-snapshot" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -4192,7 +4194,7 @@ dependencies = [ [[package]] name = "dp-collator-assignment" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4212,7 +4214,7 @@ dependencies = [ [[package]] name = "dp-consensus" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4229,7 +4231,7 @@ dependencies = [ [[package]] name = "dp-container-chain-genesis-data" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4251,7 +4253,7 @@ dependencies = [ [[package]] name = "dp-core" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -4266,7 +4268,7 @@ dependencies = [ [[package]] name = "dp-impl-tanssi-pallets-config" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "dp-consensus", "frame-support", @@ -4281,7 +4283,7 @@ dependencies = [ [[package]] name = "dp-slot-duration-runtime-api" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -8892,7 +8894,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "async-backing-primitives", "async-trait", @@ -8932,7 +8934,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "async-trait", "frame-benchmarking", @@ -9397,6 +9399,30 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "pallet-alt-benchmarks" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rand", + "rand_chacha", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", +] + [[package]] name = "pallet-asset-conversion" version = "10.0.0" @@ -9465,7 +9491,7 @@ dependencies = [ [[package]] name = "pallet-async-backing" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -9485,7 +9511,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "frame-benchmarking", "frame-support", @@ -9841,7 +9867,7 @@ dependencies = [ [[package]] name = "pallet-cc-authorities-noting" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "ccp-authorities-noting-inherent", "cumulus-pallet-parachain-system", @@ -10194,7 +10220,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-balances-erc20" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "fp-evm", "frame-support", @@ -10217,7 +10243,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-batch" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "evm", "fp-evm", @@ -10238,7 +10264,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-call-permit" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "evm", "fp-evm", @@ -10270,7 +10296,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-proxy" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "evm", "fp-evm", @@ -10310,7 +10336,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-xcm" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "cumulus-primitives-core", "evm", @@ -10336,7 +10362,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-xcm-utils" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "fp-evm", "frame-support", @@ -10358,7 +10384,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompileset-assets-erc20" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "fp-evm", "frame-support", @@ -10482,7 +10508,7 @@ dependencies = [ [[package]] name = "pallet-foreign-asset-creator" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "frame-benchmarking", "frame-support", @@ -10652,7 +10678,7 @@ dependencies = [ [[package]] name = "pallet-maintenance-mode" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -10703,7 +10729,7 @@ dependencies = [ [[package]] name = "pallet-migrations" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "frame-benchmarking", "frame-support", @@ -11052,7 +11078,7 @@ dependencies = [ [[package]] name = "pallet-relay-storage-roots" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -11594,7 +11620,7 @@ dependencies = [ [[package]] name = "pallet-xcm-executor-utils" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "frame-benchmarking", "frame-support", @@ -18548,6 +18574,7 @@ dependencies = [ "container-chain-template-frontier-runtime", "container-chain-template-simple-runtime", "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", "cumulus-primitives-core", "dp-consensus", "dp-container-chain-genesis-data", @@ -18565,6 +18592,7 @@ dependencies = [ "hex-literal 0.3.4", "log", "nimbus-primitives", + "pallet-alt-benchmarks", "pallet-asset-rate", "pallet-author-noting", "pallet-author-noting-runtime-api", @@ -19342,7 +19370,7 @@ dependencies = [ [[package]] name = "tanssi-node" -version = "0.13.0" +version = "0.14.0" dependencies = [ "async-io 1.13.0", "async-trait", @@ -19447,7 +19475,7 @@ dependencies = [ [[package]] name = "tanssi-relay" -version = "0.13.0" +version = "0.14.0" dependencies = [ "color-eyre", "polkadot-core-primitives", @@ -19467,7 +19495,7 @@ dependencies = [ [[package]] name = "tanssi-relay-cli" -version = "0.13.0" +version = "0.14.0" dependencies = [ "clap", "frame-benchmarking-cli", @@ -19508,7 +19536,7 @@ dependencies = [ [[package]] name = "tanssi-relay-service" -version = "0.13.0" +version = "0.14.0" dependencies = [ "assert_matches", "async-io 1.13.0", @@ -19812,7 +19840,7 @@ dependencies = [ [[package]] name = "tc-service-container-chain" -version = "0.13.0" +version = "0.14.0" dependencies = [ "async-backing-primitives", "async-trait", @@ -19925,7 +19953,7 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412-update-upstream#db7609065c4ed6b62d53063646f0ba637db4d8fa" +source = "git+https://github.com/moondance-labs/dancekit?branch=tanssi-polkadot-stable2412#837429119497bc2d1f5d3c67ff56fad7391bbf3b" dependencies = [ "cumulus-primitives-core", "dp-collator-assignment", @@ -22049,7 +22077,7 @@ dependencies = [ [[package]] name = "xcm-primitives" version = "0.1.0" -source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412-update-upstream#1988f32c5d967c1552562ca1bfd4fd2b9d4905e6" +source = "git+https://github.com/moondance-labs/moonkit?branch=tanssi-polkadot-stable2412#0e8f58525bd96345a0c5420082833afe2fe39d92" dependencies = [ "frame-support", "impl-trait-for-tuples", diff --git a/Cargo.toml b/Cargo.toml index bfa4f3f579..448c9d7ba2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -151,42 +151,42 @@ tp-xcm-commons = { path = "primitives/xcm-commons", default-features = false } tp-xcm-core-buyer = { path = "primitives/xcm-core-buyer", default-features = false } # Dancekit (wasm) -ccp-authorities-noting-inherent = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -ccp-xcm = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-chain-state-snapshot = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-collator-assignment = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-consensus = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-impl-tanssi-pallets-config = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -dp-slot-duration-runtime-api = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +ccp-authorities-noting-inherent = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +ccp-xcm = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-chain-state-snapshot = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-collator-assignment = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-consensus = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-impl-tanssi-pallets-config = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +dp-slot-duration-runtime-api = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-core = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-cc-authorities-noting = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-xcm-executor-utils = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-core = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-cc-authorities-noting = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-xcm-executor-utils = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } +test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } -dp-container-chain-genesis-data = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +dp-container-chain-genesis-data = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412", default-features = false } # Dancekit (client) -dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412-update-upstream" } +dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-stable2412" } # Moonkit (wasm) -async-backing-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -nimbus-consensus = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream" } -nimbus-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-async-backing = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-author-inherent = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompile-balances-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompile-batch = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompile-call-permit = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompile-proxy = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompile-xcm = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompile-xcm-utils = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-evm-precompileset-assets-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-foreign-asset-creator = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-maintenance-mode = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-migrations = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -pallet-relay-storage-roots = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } -xcm-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412-update-upstream", default-features = false } +async-backing-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +nimbus-consensus = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412" } +nimbus-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-async-backing = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-author-inherent = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompile-balances-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompile-batch = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompile-call-permit = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompile-proxy = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompile-xcm = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompile-xcm-utils = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-evm-precompileset-assets-erc20 = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-foreign-asset-creator = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-maintenance-mode = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-migrations = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +pallet-relay-storage-roots = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } +xcm-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-stable2412", default-features = false } # Substrate (wasm)