From 007720880e3fd0f856cdd7b6a54426f34f7fdcbf Mon Sep 17 00:00:00 2001 From: jaxter03 Date: Tue, 14 Jul 2026 17:02:13 +0530 Subject: [PATCH] feat(hyperbridge): allow Technical Committee alongside Root for ismp origins Widen AdminOrigin (pallet_ismp), RootOrigin (ismp_grandpa) and CreateOrigin (pallet_hyper_fungible_token) from EnsureRoot-only to EitherOfDiverse> so governance dispatches can drive consensus-client management and token registration without going through sudo. Sudo remains as an emergency lever. * cere: N = 3 (matches other governance origins in runtime/cere) * cere-dev: N = 2 (matches runtime/cere-dev pattern) cere-dev's CreateOrigin was previously EnsureSigned (permissive devnet); it is tightened to Root+TC here to match the mainnet governance shape. spec_version bumped 73157 -> 73158; transaction_version unchanged (call encodings are the same, only origin resolution changes). Co-Authored-By: Claude Opus 4.7 Claude-Session: https://claude.ai/code/session_01WXaw8xZuZK3Lkx9XA7Cvwv --- runtime/cere-dev/src/hyperbridge_ismp.rs | 15 ++++++++------- runtime/cere-dev/src/lib.rs | 2 +- runtime/cere/src/hyperbridge_ismp.rs | 12 ++++++++---- runtime/cere/src/lib.rs | 2 +- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/runtime/cere-dev/src/hyperbridge_ismp.rs b/runtime/cere-dev/src/hyperbridge_ismp.rs index 77733b4c5..d97e9470d 100644 --- a/runtime/cere-dev/src/hyperbridge_ismp.rs +++ b/runtime/cere-dev/src/hyperbridge_ismp.rs @@ -25,11 +25,12 @@ use polkadot_sdk::frame_support::{ traits::{ fungibles::{self, Dust, Unbalanced}, tokens::{DepositConsequence, Fortitude, Preservation, Provenance, WithdrawConsequence}, - Get, + EitherOfDiverse, Get, }, weights::WeightToFee, }; use polkadot_sdk::frame_system::EnsureRoot; +use polkadot_sdk::pallet_collective::EnsureMembers; use polkadot_sdk::sp_core::H256; use polkadot_sdk::sp_runtime::{DispatchError, DispatchResult, Weight}; @@ -65,7 +66,8 @@ impl WeightToFee for IsmpWeightToFee { } impl pallet_ismp::Config for Runtime { - type AdminOrigin = EnsureRoot; + type AdminOrigin = + EitherOfDiverse, EnsureMembers>; type HostStateMachine = HostStateMachine; type Coprocessor = Coprocessor; type TimestampProvider = Timestamp; @@ -87,7 +89,8 @@ impl pallet_ismp::Config for Runtime { impl ismp_grandpa::Config for Runtime { type IsmpHost = pallet_ismp::Pallet; type WeightInfo = crate::weights::ismp_grandpa::WeightInfo; - type RootOrigin = EnsureRoot; + type RootOrigin = + EitherOfDiverse, EnsureMembers>; } parameter_types! { @@ -109,10 +112,8 @@ impl pallet_hyper_fungible_token::Config for Runtime { type Assets = MockAssets; type NativeCurrency = Balances; type NativeAssetId = HftNativeAssetId; - // cere-dev is the devnet runtime — permissive so any signed account can - // register an asset for testing without needing sudo. cere mainnet keeps - // EnsureRoot. Preserved from the runtime baseline. - type CreateOrigin = polkadot_sdk::frame_system::EnsureSigned; + type CreateOrigin = + EitherOfDiverse, EnsureMembers>; type Decimals = HftDecimals; type EvmToSubstrate = (); type WeightInfo = (); diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index c78598c59..4ec586a0e 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -167,7 +167,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 73157, + spec_version: 73158, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 25, diff --git a/runtime/cere/src/hyperbridge_ismp.rs b/runtime/cere/src/hyperbridge_ismp.rs index 66fcc707e..cd95fa960 100644 --- a/runtime/cere/src/hyperbridge_ismp.rs +++ b/runtime/cere/src/hyperbridge_ismp.rs @@ -25,11 +25,12 @@ use polkadot_sdk::frame_support::{ traits::{ fungibles::{self, Dust, Unbalanced}, tokens::{DepositConsequence, Fortitude, Preservation, Provenance, WithdrawConsequence}, - Get, + EitherOfDiverse, Get, }, weights::WeightToFee, }; use polkadot_sdk::frame_system::EnsureRoot; +use polkadot_sdk::pallet_collective::EnsureMembers; use polkadot_sdk::sp_core::H256; use polkadot_sdk::sp_runtime::{DispatchError, DispatchResult, Weight}; @@ -64,7 +65,8 @@ impl WeightToFee for IsmpWeightToFee { } impl pallet_ismp::Config for Runtime { - type AdminOrigin = EnsureRoot; + type AdminOrigin = + EitherOfDiverse, EnsureMembers>; type HostStateMachine = HostStateMachine; type Coprocessor = Coprocessor; type TimestampProvider = Timestamp; @@ -86,7 +88,8 @@ impl pallet_ismp::Config for Runtime { impl ismp_grandpa::Config for Runtime { type IsmpHost = pallet_ismp::Pallet; type WeightInfo = crate::weights::ismp_grandpa::WeightInfo; - type RootOrigin = EnsureRoot; + type RootOrigin = + EitherOfDiverse, EnsureMembers>; } parameter_types! { @@ -108,7 +111,8 @@ impl pallet_hyper_fungible_token::Config for Runtime { type Assets = MockAssets; type NativeCurrency = Balances; type NativeAssetId = HftNativeAssetId; - type CreateOrigin = EnsureRoot; + type CreateOrigin = + EitherOfDiverse, EnsureMembers>; type Decimals = HftDecimals; type EvmToSubstrate = (); type WeightInfo = (); diff --git a/runtime/cere/src/lib.rs b/runtime/cere/src/lib.rs index 774324cb7..5f9a68b34 100644 --- a/runtime/cere/src/lib.rs +++ b/runtime/cere/src/lib.rs @@ -163,7 +163,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 73157, + spec_version: 73158, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 25,