Skip to content

Commit 7a09697

Browse files
authored
chore: remove experimental feature (#729)
Fixes KILTprotocol/ticket#3593. Removing the feature everywhere and using the pallet implementation without the feature is equivalent to the current solution. What the aura pallet does without the feature enabled is taking the `MinimumPeriod` as returned by the timestamp pallet, and multiply that by two: see code [here](https://github.com/paritytech/polkadot-sdk/blob/09df373db9cd5dfed82c5cdb0736d417d54249e6/substrate/frame/aura/src/lib.rs#L252). Everywhere, we set `SlotDuration` to be exactly 2x `MinimumPeriod` (which is 6s), totalling 12s. So basically the net result is that `SlotDuration` is set to `12s` everywhere. Current values of `MinimuPeriod` are: * DIP consumer template: https://github.com/KILTprotocol/kilt-node/blob/d9552b70160465eaedd7263db450aa70f49667df/dip-template/runtimes/dip-consumer/src/lib.rs#L275 * DIP provider template: https://github.com/KILTprotocol/kilt-node/blob/d9552b70160465eaedd7263db450aa70f49667df/dip-template/runtimes/dip-provider/src/lib.rs#L276 * Kestrel (minimum period 0,5 s, block time 1s): https://github.com/KILTprotocol/kilt-node/blob/d9552b70160465eaedd7263db450aa70f49667df/runtimes/kestrel/src/lib.rs#L230 * Peregrine: https://github.com/KILTprotocol/kilt-node/blob/d9552b70160465eaedd7263db450aa70f49667df/runtimes/peregrine/src/lib.rs#L178 * Spiritnet: https://github.com/KILTprotocol/kilt-node/blob/d9552b70160465eaedd7263db450aa70f49667df/runtimes/spiritnet/src/lib.rs#L177C11-L177C62 I invite the reviewer to double-check that.
1 parent d9552b7 commit 7a09697

File tree

13 files changed

+10
-16
lines changed

13 files changed

+10
-16
lines changed

dip-template/runtimes/dip-consumer/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ frame-executive = { workspace = true }
3333
frame-support = { workspace = true }
3434
frame-system = { workspace = true }
3535
frame-system-rpc-runtime-api = { workspace = true }
36-
pallet-aura = { workspace = true, features = ["experimental"] }
36+
pallet-aura = { workspace = true }
3737
pallet-authorship = { workspace = true }
3838
pallet-balances = { workspace = true }
3939
pallet-session = { workspace = true }

dip-template/runtimes/dip-consumer/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ impl pallet_aura::Config for Runtime {
367367
type AuthorityId = AuraId;
368368
type DisabledValidators = ();
369369
type MaxAuthorities = ConstU32<100_000>;
370-
type SlotDuration = ConstU64<SLOT_DURATION>;
371370
}
372371

373372
impl cumulus_pallet_aura_ext::Config for Runtime {}

dip-template/runtimes/dip-provider/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ frame-executive = { workspace = true }
3333
frame-support = { workspace = true }
3434
frame-system = { workspace = true }
3535
frame-system-rpc-runtime-api = { workspace = true }
36-
pallet-aura = { workspace = true, features = ["experimental"] }
36+
pallet-aura = { workspace = true }
3737
pallet-authorship = { workspace = true }
3838
pallet-balances = { workspace = true }
3939
pallet-session = { workspace = true }

dip-template/runtimes/dip-provider/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ impl pallet_aura::Config for Runtime {
368368
type AuthorityId = AuraId;
369369
type DisabledValidators = ();
370370
type MaxAuthorities = ConstU32<100_000>;
371-
type SlotDuration = ConstU64<SLOT_DURATION>;
372371
}
373372

374373
impl cumulus_pallet_aura_ext::Config for Runtime {}

integration-tests/emulated/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version = { workspace = true }
1212

1313
[dependencies]
1414
asset-hub-rococo-emulated-chain = { workspace = true, default-features = true }
15-
asset-hub-rococo-runtime = { workspace = true, default-features = true, features = ["experimental"] }
15+
asset-hub-rococo-runtime = { workspace = true, default-features = true }
1616
attestation = { workspace = true, default-features = true }
1717
ctype = { workspace = true, default-features = true }
1818
cumulus-primitives-core = { workspace = true, default-features = true }

pallets/parachain-staking/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version = { workspace = true }
1212

1313
[dev-dependencies]
1414
kilt-support = { workspace = true, features = ["mock", "try-runtime"] }
15-
pallet-aura = { workspace = true, features = ["experimental", "std"] }
15+
pallet-aura = { workspace = true, features = ["std"] }
1616
pallet-timestamp = { workspace = true, features = ["std"] }
1717
sp-consensus-aura = { workspace = true, features = ["std"] }
1818
sp-core = { workspace = true, features = ["std"] }

pallets/parachain-staking/src/mock.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use frame_support::{
2828
use frame_system::pallet_prelude::BlockNumberFor;
2929
use pallet_authorship::EventHandler;
3030
use sp_consensus_aura::sr25519::AuthorityId;
31-
use sp_core::{ConstBool, ConstU64, H256};
31+
use sp_core::{ConstBool, H256};
3232
use sp_runtime::{
3333
impl_opaque_keys,
3434
testing::UintAuthorityId,
@@ -120,7 +120,6 @@ impl pallet_aura::Config for Test {
120120
type DisabledValidators = ();
121121
type MaxAuthorities = MaxCollatorCandidates;
122122
type AllowMultipleBlocksPerSlot = ConstBool<false>;
123-
type SlotDuration = ConstU64<2>;
124123
}
125124

126125
impl pallet_authorship::Config for Test {

runtimes/kestrel/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pallet-transaction-payment-rpc-runtime-api = { workspace = true }
4242
frame-executive = { workspace = true }
4343
frame-support = { workspace = true }
4444
frame-system = { workspace = true }
45-
pallet-aura = { workspace = true, features = ["experimental"] }
45+
pallet-aura = { workspace = true }
4646
pallet-authorship = { workspace = true }
4747
pallet-balances = { workspace = true }
4848
pallet-grandpa = { workspace = true }

runtimes/kestrel/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ impl pallet_aura::Config for Runtime {
211211
type DisabledValidators = ();
212212
type MaxAuthorities = MaxAuthorities;
213213
type AllowMultipleBlocksPerSlot = ConstBool<false>;
214-
type SlotDuration = ConstU64<1000>;
215214
}
216215

217216
impl pallet_grandpa::Config for Runtime {

runtimes/peregrine/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ frame-executive = { workspace = true }
7070
frame-support = { workspace = true }
7171
frame-system = { workspace = true }
7272
pallet-assets = { workspace = true }
73-
pallet-aura = { workspace = true, features = ["experimental"] }
73+
pallet-aura = { workspace = true }
7474
pallet-authorship = { workspace = true }
7575
pallet-balances = { workspace = true }
7676
pallet-collective = { workspace = true }

runtimes/peregrine/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned};
4242
use pallet_asset_switch::xcm::{AccountId32ToAccountId32JunctionConverter, MatchesSwitchPairXcmFeeFungibleAsset};
4343
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
4444
use sp_api::impl_runtime_apis;
45-
use sp_core::{ConstBool, ConstU64, OpaqueMetadata};
45+
use sp_core::{ConstBool, OpaqueMetadata};
4646
use sp_runtime::{
4747
create_runtime_str, generic, impl_opaque_keys,
4848
traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, OpaqueKeys},
@@ -295,7 +295,6 @@ impl pallet_aura::Config for Runtime {
295295
type DisabledValidators = ();
296296
type MaxAuthorities = MaxAuthorities;
297297
type AllowMultipleBlocksPerSlot = ConstBool<false>;
298-
type SlotDuration = ConstU64<SLOT_DURATION>;
299298
}
300299

301300
parameter_types! {

runtimes/spiritnet/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ frame-executive = { workspace = true }
7070
frame-support = { workspace = true }
7171
frame-system = { workspace = true }
7272
pallet-assets = { workspace = true }
73-
pallet-aura = { workspace = true, features = ["experimental"] }
73+
pallet-aura = { workspace = true }
7474
pallet-authorship = { workspace = true }
7575
pallet-balances = { workspace = true }
7676
pallet-collective = { workspace = true }

runtimes/spiritnet/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned};
4242
use pallet_asset_switch::xcm::{AccountId32ToAccountId32JunctionConverter, MatchesSwitchPairXcmFeeFungibleAsset};
4343
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
4444
use sp_api::impl_runtime_apis;
45-
use sp_core::{ConstBool, ConstU64, OpaqueMetadata};
45+
use sp_core::{ConstBool, OpaqueMetadata};
4646
use sp_runtime::{
4747
create_runtime_str, generic, impl_opaque_keys,
4848
traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, OpaqueKeys},
@@ -288,7 +288,6 @@ impl pallet_aura::Config for Runtime {
288288
type DisabledValidators = ();
289289
type MaxAuthorities = MaxAuthorities;
290290
type AllowMultipleBlocksPerSlot = ConstBool<false>;
291-
type SlotDuration = ConstU64<SLOT_DURATION>;
292291
}
293292

294293
parameter_types! {

0 commit comments

Comments
 (0)