Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update all uses of pallet-aura to disallow multiple blocks per slot #2707

Merged
merged 4 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pallets/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use super::*;
use crate as collator_selection;
use frame_support::{
ord_parameter_types, parameter_types,
traits::{ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration},
traits::{ConstBool, ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration},
PalletId,
};
use frame_system as system;
Expand Down Expand Up @@ -128,6 +128,7 @@ impl pallet_aura::Config for Test {
type AuthorityId = sp_consensus_aura::sr25519::AuthorityId;
type MaxAuthorities = ConstU32<100_000>;
type DisabledValidators = ();
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

sp_runtime::impl_opaque_keys! {
Expand Down
3 changes: 2 additions & 1 deletion parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
weights::{
constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient,
WeightToFeeCoefficients, WeightToFeePolynomial,
Expand Down Expand Up @@ -422,6 +422,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
6 changes: 5 additions & 1 deletion parachains/runtimes/assets/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter},
traits::{
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
InstanceFilter,
},
weights::{ConstantMultiplier, Weight},
PalletId, RuntimeDebug,
};
Expand Down Expand Up @@ -582,6 +585,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
6 changes: 5 additions & 1 deletion parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter},
traits::{
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse,
InstanceFilter,
},
weights::{ConstantMultiplier, Weight},
PalletId, RuntimeDebug,
};
Expand Down Expand Up @@ -599,6 +602,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
5 changes: 3 additions & 2 deletions parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ use frame_support::{
dispatch::DispatchClass,
parameter_types,
traits::{
tokens::nonfungibles_v2::Inspect, AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8,
InstanceFilter,
tokens::nonfungibles_v2::Inspect, AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64,
ConstU8, InstanceFilter,
},
weights::{ConstantMultiplier, Weight},
BoundedVec, PalletId, RuntimeDebug,
Expand Down Expand Up @@ -558,6 +558,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
3 changes: 2 additions & 1 deletion parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
weights::{ConstantMultiplier, Weight},
PalletId,
};
Expand Down Expand Up @@ -342,6 +342,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
traits::{ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything},
weights::{ConstantMultiplier, Weight},
PalletId,
};
Expand Down Expand Up @@ -342,6 +342,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
3 changes: 2 additions & 1 deletion parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU32, ConstU64, ConstU8, Everything},
traits::{ConstBool, ConstU32, ConstU64, ConstU8, Everything},
weights::{ConstantMultiplier, Weight},
PalletId,
};
Expand Down Expand Up @@ -346,6 +346,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU16, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter},
traits::{ConstBool, ConstU16, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter},
weights::{ConstantMultiplier, Weight},
PalletId, RuntimeDebug,
};
Expand Down Expand Up @@ -415,6 +415,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
3 changes: 2 additions & 1 deletion parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use frame_support::{
construct_runtime,
dispatch::DispatchClass,
parameter_types,
traits::{ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Everything},
traits::{ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Everything},
weights::{ConstantMultiplier, Weight},
PalletId,
};
Expand Down Expand Up @@ -310,6 +310,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
3 changes: 2 additions & 1 deletion parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use frame_support::{
dispatch::DispatchClass,
pallet_prelude::Weight,
parameter_types,
traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, Everything},
traits::{AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, Everything},
weights::{
constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, FeePolynomial,
WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
Expand Down Expand Up @@ -506,6 +506,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
Expand Down
5 changes: 3 additions & 2 deletions parachains/runtimes/testing/rococo-parachain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub use frame_support::{
dispatch::DispatchClass,
match_types, parameter_types,
traits::{
AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, IsInVec,
Nothing, Randomness,
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything,
IsInVec, Nothing, Randomness,
},
weights::{
constants::{
Expand Down Expand Up @@ -554,6 +554,7 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

construct_runtime! {
Expand Down