From 3d26834a95b6d11894a81814d8b603ef6a3bfa2d Mon Sep 17 00:00:00 2001 From: vedhavyas Date: Wed, 3 Apr 2024 12:40:45 +0530 Subject: [PATCH] remove unused config types --- crates/subspace-runtime/src/lib.rs | 6 ++---- domains/pallets/messenger/src/lib.rs | 2 -- domains/pallets/messenger/src/mock.rs | 6 ------ domains/runtime/auto-id/src/lib.rs | 2 -- domains/runtime/evm/src/lib.rs | 2 -- domains/test/runtime/evm/src/lib.rs | 3 --- test/subspace-test-runtime/src/lib.rs | 6 ++---- 7 files changed, 4 insertions(+), 23 deletions(-) diff --git a/crates/subspace-runtime/src/lib.rs b/crates/subspace-runtime/src/lib.rs index f60ed11e2f..97b0db0c64 100644 --- a/crates/subspace-runtime/src/lib.rs +++ b/crates/subspace-runtime/src/lib.rs @@ -246,7 +246,7 @@ const_assert!(solution_range_to_sectors(sectors_to_solution_range(5)) == 5); parameter_types! { pub const Version: RuntimeVersion = VERSION; - pub const BlockHashCount: BlockNumber = 2400; + pub const BlockHashCount: BlockNumber = 250; /// We allow for 2 seconds of compute with a 6 second average block time. pub SubspaceBlockWeights: BlockWeights = BlockWeights::with_sensible_defaults(BLOCK_WEIGHT_FOR_2_SEC, NORMAL_DISPATCH_RATIO); /// We allow for 3.75 MiB for `Normal` extrinsic with 5 MiB maximum block length. @@ -288,7 +288,7 @@ impl frame_system::Config for Runtime { /// The ubiquitous origin type. type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = ConstU32<250>; + type BlockHashCount = BlockHashCount; /// The weight of database operations that the runtime can invoke. type DbWeight = ParityDbWeight; /// Version of the runtime. @@ -480,7 +480,6 @@ impl pallet_sudo::Config for Runtime { } parameter_types! { - pub const RelayConfirmationDepth: BlockNumber = 18; pub const SelfChainId: ChainId = ChainId::Consensus; } @@ -548,7 +547,6 @@ impl pallet_messenger::Config for Runtime { } type Currency = Balances; - type ConfirmationDepth = RelayConfirmationDepth; type WeightInfo = pallet_messenger::weights::SubstrateWeight; type WeightToFee = IdentityFee; type OnXDMRewards = OnXDMRewards; diff --git a/domains/pallets/messenger/src/lib.rs b/domains/pallets/messenger/src/lib.rs index 71ff264b46..03bfd5ca2a 100644 --- a/domains/pallets/messenger/src/lib.rs +++ b/domains/pallets/messenger/src/lib.rs @@ -178,8 +178,6 @@ mod pallet { type Currency: Mutate + InspectHold + MutateHold; - /// Confirmation depth for XDM coming from chains. - type ConfirmationDepth: Get>; /// Weight information for extrinsics in this pallet. type WeightInfo: WeightInfo; /// Weight to fee conversion. diff --git a/domains/pallets/messenger/src/mock.rs b/domains/pallets/messenger/src/mock.rs index c10486c287..b1e8468318 100644 --- a/domains/pallets/messenger/src/mock.rs +++ b/domains/pallets/messenger/src/mock.rs @@ -83,11 +83,6 @@ macro_rules! impl_runtime { pub const ExistentialDeposit: u64 = 1; } - parameter_types! { - pub const ConfirmedStateRootsBound: u32 = 2; - pub const RelayerConfirmationDepth: u64 = 2; - } - parameter_types! { pub SelfChainId: ChainId = $chain_id.into(); pub const ChannelReserveFee: Balance = 10; @@ -114,7 +109,6 @@ macro_rules! impl_runtime { type RuntimeEvent = RuntimeEvent; type SelfChainId = SelfChainId; type Currency = Balances; - type ConfirmationDepth = RelayerConfirmationDepth; type WeightInfo = (); type WeightToFee = frame_support::weights::IdentityFee; type OnXDMRewards = (); diff --git a/domains/runtime/auto-id/src/lib.rs b/domains/runtime/auto-id/src/lib.rs index fe0eb6fc36..e090eb221f 100644 --- a/domains/runtime/auto-id/src/lib.rs +++ b/domains/runtime/auto-id/src/lib.rs @@ -296,7 +296,6 @@ impl pallet_sudo::Config for Runtime { } parameter_types! { - pub const RelayConfirmationDepth: BlockNumber = 18; pub SelfChainId: ChainId = SelfDomainId::self_domain_id().into(); } @@ -382,7 +381,6 @@ impl pallet_messenger::Config for Runtime { } type Currency = Balances; - type ConfirmationDepth = RelayConfirmationDepth; type WeightInfo = pallet_messenger::weights::SubstrateWeight; type WeightToFee = IdentityFee; type OnXDMRewards = OnXDMRewards; diff --git a/domains/runtime/evm/src/lib.rs b/domains/runtime/evm/src/lib.rs index 27411ee6aa..e2d06c4201 100644 --- a/domains/runtime/evm/src/lib.rs +++ b/domains/runtime/evm/src/lib.rs @@ -410,7 +410,6 @@ impl pallet_sudo::Config for Runtime { } parameter_types! { - pub const RelayConfirmationDepth: BlockNumber = 18; pub SelfChainId: ChainId = SelfDomainId::self_domain_id().into(); } @@ -496,7 +495,6 @@ impl pallet_messenger::Config for Runtime { } type Currency = Balances; - type ConfirmationDepth = RelayConfirmationDepth; type WeightInfo = pallet_messenger::weights::SubstrateWeight; type WeightToFee = IdentityFee; type OnXDMRewards = OnXDMRewards; diff --git a/domains/test/runtime/evm/src/lib.rs b/domains/test/runtime/evm/src/lib.rs index 01a9ccd0d5..37f99987c4 100644 --- a/domains/test/runtime/evm/src/lib.rs +++ b/domains/test/runtime/evm/src/lib.rs @@ -396,8 +396,6 @@ impl pallet_sudo::Config for Runtime { } parameter_types! { - pub const StateRootsBound: u32 = 50; - pub const RelayConfirmationDepth: BlockNumber = 1; pub SelfChainId: ChainId = SelfDomainId::self_domain_id().into(); } @@ -483,7 +481,6 @@ impl pallet_messenger::Config for Runtime { } type Currency = Balances; - type ConfirmationDepth = RelayConfirmationDepth; type WeightInfo = pallet_messenger::weights::SubstrateWeight; type WeightToFee = IdentityFee; type OnXDMRewards = OnXDMRewards; diff --git a/test/subspace-test-runtime/src/lib.rs b/test/subspace-test-runtime/src/lib.rs index 91e13f218c..8cf9e83283 100644 --- a/test/subspace-test-runtime/src/lib.rs +++ b/test/subspace-test-runtime/src/lib.rs @@ -196,7 +196,7 @@ const MAX_OBJECT_MAPPING_RECURSION_DEPTH: u16 = 5; parameter_types! { pub const Version: RuntimeVersion = VERSION; - pub const BlockHashCount: BlockNumber = 2400; + pub const BlockHashCount: BlockNumber = 250; /// We allow for 2 seconds of compute with a 6 second average block time. pub SubspaceBlockWeights: BlockWeights = BlockWeights::with_sensible_defaults(BLOCK_WEIGHT_FOR_2_SEC, NORMAL_DISPATCH_RATIO); /// We allow for 3.75 MiB for `Normal` extrinsic with 5 MiB maximum block length. @@ -235,7 +235,7 @@ impl frame_system::Config for Runtime { /// The ubiquitous origin type. type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = ConstU32<250>; + type BlockHashCount = BlockHashCount; /// The weight of database operations that the runtime can invoke. type DbWeight = ParityDbWeight; /// Version of the runtime. @@ -533,7 +533,6 @@ impl pallet_sudo::Config for Runtime { } parameter_types! { - pub const RelayConfirmationDepth: BlockNumber = 18; pub SelfChainId: ChainId = ChainId::Consensus; } @@ -590,7 +589,6 @@ impl pallet_messenger::Config for Runtime { } type Currency = Balances; - type ConfirmationDepth = RelayConfirmationDepth; type WeightInfo = pallet_messenger::weights::SubstrateWeight; type WeightToFee = IdentityFee; type OnXDMRewards = ();