Skip to content

Commit

Permalink
remove unused config types and update block hash count
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Apr 3, 2024
1 parent a254a67 commit f130c72
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 23 deletions.
3 changes: 0 additions & 3 deletions crates/subspace-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ const_assert!(solution_range_to_sectors(sectors_to_solution_range(5)) == 5);

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
pub const BlockHashCount: BlockNumber = 2400;
/// 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.
Expand Down Expand Up @@ -480,7 +479,6 @@ impl pallet_sudo::Config for Runtime {
}

parameter_types! {
pub const RelayConfirmationDepth: BlockNumber = 18;
pub const SelfChainId: ChainId = ChainId::Consensus;
}

Expand Down Expand Up @@ -548,7 +546,6 @@ impl pallet_messenger::Config for Runtime {
}

type Currency = Balances;
type ConfirmationDepth = RelayConfirmationDepth;
type WeightInfo = pallet_messenger::weights::SubstrateWeight<Runtime>;
type WeightToFee = IdentityFee<domain_runtime_primitives::Balance>;
type OnXDMRewards = OnXDMRewards;
Expand Down
2 changes: 0 additions & 2 deletions domains/pallets/messenger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ mod pallet {
type Currency: Mutate<Self::AccountId>
+ InspectHold<Self::AccountId>
+ MutateHold<Self::AccountId>;
/// Confirmation depth for XDM coming from chains.
type ConfirmationDepth: Get<BlockNumberFor<Self>>;
/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;
/// Weight to fee conversion.
Expand Down
6 changes: 0 additions & 6 deletions domains/pallets/messenger/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<u64>;
type OnXDMRewards = ();
Expand Down
4 changes: 1 addition & 3 deletions domains/runtime/auto-id/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
pub const BlockHashCount: BlockNumber = 2400;
pub const BlockHashCount: BlockNumber = 250;
pub RuntimeBlockLength: BlockLength = maximum_block_length();
pub RuntimeBlockWeights: BlockWeights = block_weights();
}
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -382,7 +381,6 @@ impl pallet_messenger::Config for Runtime {
}

type Currency = Balances;
type ConfirmationDepth = RelayConfirmationDepth;
type WeightInfo = pallet_messenger::weights::SubstrateWeight<Runtime>;
type WeightToFee = IdentityFee<Balance>;
type OnXDMRewards = OnXDMRewards;
Expand Down
4 changes: 1 addition & 3 deletions domains/runtime/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
pub const BlockHashCount: BlockNumber = 2400;
pub const BlockHashCount: BlockNumber = 250;

// This part is copied from Substrate's `bin/node/runtime/src/lib.rs`.
// The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -496,7 +495,6 @@ impl pallet_messenger::Config for Runtime {
}

type Currency = Balances;
type ConfirmationDepth = RelayConfirmationDepth;
type WeightInfo = pallet_messenger::weights::SubstrateWeight<Runtime>;
type WeightToFee = IdentityFee<Balance>;
type OnXDMRewards = OnXDMRewards;
Expand Down
3 changes: 0 additions & 3 deletions domains/test/runtime/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -483,7 +481,6 @@ impl pallet_messenger::Config for Runtime {
}

type Currency = Balances;
type ConfirmationDepth = RelayConfirmationDepth;
type WeightInfo = pallet_messenger::weights::SubstrateWeight<Runtime>;
type WeightToFee = IdentityFee<Balance>;
type OnXDMRewards = OnXDMRewards;
Expand Down
3 changes: 0 additions & 3 deletions test/subspace-test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ const MAX_OBJECT_MAPPING_RECURSION_DEPTH: u16 = 5;

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
pub const BlockHashCount: BlockNumber = 2400;
/// 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.
Expand Down Expand Up @@ -533,7 +532,6 @@ impl pallet_sudo::Config for Runtime {
}

parameter_types! {
pub const RelayConfirmationDepth: BlockNumber = 18;
pub SelfChainId: ChainId = ChainId::Consensus;
}

Expand Down Expand Up @@ -590,7 +588,6 @@ impl pallet_messenger::Config for Runtime {
}

type Currency = Balances;
type ConfirmationDepth = RelayConfirmationDepth;
type WeightInfo = pallet_messenger::weights::SubstrateWeight<Runtime>;
type WeightToFee = IdentityFee<domain_runtime_primitives::Balance>;
type OnXDMRewards = ();
Expand Down

0 comments on commit f130c72

Please sign in to comment.