From 7d52dbb55570fa7c047af3ed1733ca1b3ca30f0e Mon Sep 17 00:00:00 2001 From: linning Date: Mon, 29 Jul 2024 21:07:03 +0800 Subject: [PATCH 1/2] Add pallet-utility to the evm and auto-id domain runtime Signed-off-by: linning --- Cargo.lock | 2 ++ domains/runtime/auto-id/Cargo.toml | 5 ++++- domains/runtime/auto-id/src/lib.rs | 8 ++++++++ domains/runtime/evm/Cargo.toml | 3 +++ domains/runtime/evm/src/lib.rs | 8 ++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index be42f65e86..5ef59303f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,6 +1133,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-transporter", + "pallet-utility", "parity-scale-codec", "scale-info", "sp-api", @@ -3452,6 +3453,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-transporter", + "pallet-utility", "parity-scale-codec", "scale-info", "sp-api", diff --git a/domains/runtime/auto-id/Cargo.toml b/domains/runtime/auto-id/Cargo.toml index 8bc5bbb14c..d698ece1c5 100644 --- a/domains/runtime/auto-id/Cargo.toml +++ b/domains/runtime/auto-id/Cargo.toml @@ -35,6 +35,7 @@ pallet-timestamp = { default-features = false, git = "https://github.com/subspac pallet-transaction-payment = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } pallet-transporter = { version = "0.1.0", path = "../../pallets/transporter", default-features = false } +pallet-utility = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } scale-info = { version = "2.11.2", default-features = false, features = ["derive"] } sp-api = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } sp-block-builder = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } @@ -85,6 +86,7 @@ std = [ "pallet-transaction-payment/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transporter/std", + "pallet-utility/std", "scale-info/std", "sp-api/std", "sp-block-builder/std", @@ -120,5 +122,6 @@ runtime-benchmarks = [ "pallet-auto-id/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-messenger/runtime-benchmarks", - "pallet-domain-id/runtime-benchmarks" + "pallet-domain-id/runtime-benchmarks", + "pallet-utility/runtime-benchmarks" ] diff --git a/domains/runtime/auto-id/src/lib.rs b/domains/runtime/auto-id/src/lib.rs index 2469d48f77..6814ff7155 100644 --- a/domains/runtime/auto-id/src/lib.rs +++ b/domains/runtime/auto-id/src/lib.rs @@ -469,6 +469,13 @@ impl pallet_domain_sudo::Config for Runtime { type IntoRuntimeCall = IntoRuntimeCall; } +impl pallet_utility::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PalletsOrigin = OriginCaller; + type WeightInfo = pallet_utility::weights::SubstrateWeight; +} + // Create the runtime by composing the FRAME pallets that were previously configured. // // NOTE: Currently domain runtime does not naturally support the pallets with inherent extrinsics. @@ -481,6 +488,7 @@ construct_runtime!( // extrinsic. Timestamp: pallet_timestamp = 1, ExecutivePallet: domain_pallet_executive = 2, + Utility: pallet_utility = 8, // monetary stuff Balances: pallet_balances = 20, diff --git a/domains/runtime/evm/Cargo.toml b/domains/runtime/evm/Cargo.toml index e58dfdec4c..6e53479fc5 100644 --- a/domains/runtime/evm/Cargo.toml +++ b/domains/runtime/evm/Cargo.toml @@ -45,6 +45,7 @@ pallet-timestamp = { default-features = false, git = "https://github.com/subspac pallet-transaction-payment = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } pallet-transporter = { version = "0.1.0", path = "../../pallets/transporter", default-features = false } +pallet-utility = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } scale-info = { version = "2.11.2", default-features = false, features = ["derive"] } sp-api = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } sp-block-builder = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "0cbfcb0232bbf71ac5b14cc8c99bf043cec420ef" } @@ -105,6 +106,7 @@ std = [ "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-transporter/std", + "pallet-utility/std", "scale-info/std", "sp-api/std", "sp-block-builder/std", @@ -139,6 +141,7 @@ runtime-benchmarks = [ "pallet-ethereum/runtime-benchmarks", "pallet-evm/runtime-benchmarks", "pallet-messenger/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "sp-storage", ] diff --git a/domains/runtime/evm/src/lib.rs b/domains/runtime/evm/src/lib.rs index 59459bbd06..4b04aa538a 100644 --- a/domains/runtime/evm/src/lib.rs +++ b/domains/runtime/evm/src/lib.rs @@ -743,6 +743,13 @@ impl pallet_domain_sudo::Config for Runtime { type IntoRuntimeCall = IntoRuntimeCall; } +impl pallet_utility::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PalletsOrigin = OriginCaller; + type WeightInfo = pallet_utility::weights::SubstrateWeight; +} + // Create the runtime by composing the FRAME pallets that were previously configured. // // NOTE: Currently domain runtime does not naturally support the pallets with inherent extrinsics. @@ -755,6 +762,7 @@ construct_runtime!( // extrinsic. Timestamp: pallet_timestamp = 1, ExecutivePallet: domain_pallet_executive = 2, + Utility: pallet_utility = 8, // monetary stuff Balances: pallet_balances = 20, From def9968c24047be449785ab0d3557eb0e93492ab Mon Sep 17 00:00:00 2001 From: linning Date: Mon, 29 Jul 2024 21:07:51 +0800 Subject: [PATCH 2/2] Bump the evm and auto-id domain runtime spec version Signed-off-by: linning --- domains/runtime/auto-id/src/lib.rs | 2 +- domains/runtime/evm/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/domains/runtime/auto-id/src/lib.rs b/domains/runtime/auto-id/src/lib.rs index 6814ff7155..8e2d4ed0ff 100644 --- a/domains/runtime/auto-id/src/lib.rs +++ b/domains/runtime/auto-id/src/lib.rs @@ -120,7 +120,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("subspace-auto-id-domain"), impl_name: create_runtime_str!("subspace-auto-id-domain"), authoring_version: 0, - spec_version: 0, + spec_version: 1, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0, diff --git a/domains/runtime/evm/src/lib.rs b/domains/runtime/evm/src/lib.rs index 4b04aa538a..35097cc9ac 100644 --- a/domains/runtime/evm/src/lib.rs +++ b/domains/runtime/evm/src/lib.rs @@ -247,7 +247,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("subspace-evm-domain"), impl_name: create_runtime_str!("subspace-evm-domain"), authoring_version: 0, - spec_version: 1, + spec_version: 2, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0,