Skip to content

Commit 94fb9db

Browse files
authored
fix: async backing (#713)
Making sure our codebase matches steps 1-2 of the [async backing migration guide](https://wiki.polkadot.network/docs/maintain-guides-async-backing).
1 parent e53370b commit 94fb9db

File tree

14 files changed

+17
-11
lines changed

14 files changed

+17
-11
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 }
36+
pallet-aura = { workspace = true, features = ["experimental"] }
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,6 +367,7 @@ 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>;
370371
}
371372

372373
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 }
36+
pallet-aura = { workspace = true, features = ["experimental"] }
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,6 +368,7 @@ 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>;
371372
}
372373

373374
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 }
15+
asset-hub-rococo-runtime = { workspace = true, default-features = true, features = ["experimental"] }
1616
attestation = { workspace = true, default-features = true }
1717
ctype = { workspace = true, default-features = true }
1818
cumulus-primitives-core = { workspace = true, default-features = true }

nodes/parachain/src/service.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use substrate_prometheus_endpoint::Registry;
4747

4848
use runtime_common::{AccountId, AuthorityId, Balance, BlockNumber, Hash, Nonce};
4949

50-
pub const AUTHORING_DURATION: u64 = 500;
50+
pub const AUTHORING_DURATION: u64 = 1500;
5151
pub const TASK_MANAGER_IDENTIFIER: &str = "aura";
5252

5353
type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>;

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 = ["std"] }
15+
pallet-aura = { workspace = true, features = ["experimental", "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

+2-1
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, H256};
31+
use sp_core::{ConstBool, ConstU64, H256};
3232
use sp_runtime::{
3333
impl_opaque_keys,
3434
testing::UintAuthorityId,
@@ -120,6 +120,7 @@ impl pallet_aura::Config for Test {
120120
type DisabledValidators = ();
121121
type MaxAuthorities = MaxCollatorCandidates;
122122
type AllowMultipleBlocksPerSlot = ConstBool<false>;
123+
type SlotDuration = ConstU64<2>;
123124
}
124125

125126
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 }
45+
pallet-aura = { workspace = true, features = ["experimental"] }
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
@@ -209,6 +209,7 @@ impl pallet_aura::Config for Runtime {
209209
type DisabledValidators = ();
210210
type MaxAuthorities = MaxAuthorities;
211211
type AllowMultipleBlocksPerSlot = ConstBool<false>;
212+
type SlotDuration = ConstU64<1000>;
212213
}
213214

214215
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 }
73+
pallet-aura = { workspace = true, features = ["experimental"] }
7474
pallet-authorship = { workspace = true }
7575
pallet-balances = { workspace = true }
7676
pallet-collective = { workspace = true }

runtimes/peregrine/src/lib.rs

+2-1
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, OpaqueMetadata};
45+
use sp_core::{ConstBool, ConstU64, OpaqueMetadata};
4646
use sp_runtime::{
4747
create_runtime_str, generic, impl_opaque_keys,
4848
traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, OpaqueKeys},
@@ -295,6 +295,7 @@ impl pallet_aura::Config for Runtime {
295295
type DisabledValidators = ();
296296
type MaxAuthorities = MaxAuthorities;
297297
type AllowMultipleBlocksPerSlot = ConstBool<false>;
298+
type SlotDuration = ConstU64<SLOT_DURATION>;
298299
}
299300

300301
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 }
73+
pallet-aura = { workspace = true, features = ["experimental"] }
7474
pallet-authorship = { workspace = true }
7575
pallet-balances = { workspace = true }
7676
pallet-collective = { workspace = true }

runtimes/spiritnet/src/lib.rs

+2-1
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, OpaqueMetadata};
45+
use sp_core::{ConstBool, ConstU64, OpaqueMetadata};
4646
use sp_runtime::{
4747
create_runtime_str, generic, impl_opaque_keys,
4848
traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, OpaqueKeys},
@@ -288,6 +288,7 @@ impl pallet_aura::Config for Runtime {
288288
type DisabledValidators = ();
289289
type MaxAuthorities = MaxAuthorities;
290290
type AllowMultipleBlocksPerSlot = ConstBool<false>;
291+
type SlotDuration = ConstU64<SLOT_DURATION>;
291292
}
292293

293294
parameter_types! {

0 commit comments

Comments
 (0)