5

We are configuring the block time to be 6 seconds in our parachain and yet in Polkadot apps it reliably creates blocks every 12 seconds. Is there something I'm missing here?

enter image description here

The code we are using in the runtime:

/// This determines the average expected block time that we are targeting.
/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`.
/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked
/// up by `pallet_aura` to implement `fn slot_duration()`.
///
/// Change this to adjust the block time.
pub const MILLISECS_PER_BLOCK: u64 = 6_000;

pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;

// Time is measured by number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;

The link to the runtime code itself: https://github.com/webb-tools/dkg-substrate/blob/drew/parachain/parachain/runtime/rococo/src/lib.rs

1 Answer 1

8

The block time of Parachains are currently restricted to 12 seconds. This is a limitation of the current Parachains consensus implementation in the relay chain. In the future with asynchronous backing this limitation will be lifted. Then Parachain block times faster than the relay chain block time will be possible.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.