Skip to content

Commit

Permalink
Enhance consensus hook and relay chain configuration in cumulus parac…
Browse files Browse the repository at this point in the history
…hain system (#786)

* fix the hook for the cumulus consensus

* back to Strictly increases
  • Loading branch information
asiniscalchi committed Sep 20, 2024
1 parent f732859 commit e711bbb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion runtime/laos/src/configs/cumulus_parachain_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,27 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type XcmpMessageHandler = XcmpQueue;
type ReservedXcmpWeight = ReservedXcmpWeight;
type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded;
type ConsensusHook = ConsensusHook;
type DmpQueue = frame_support::traits::EnqueueWithOrigin<MessageQueue, RelayOrigin>;
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
}

/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
/// How many parachain blocks are processed by the relay chain per parent. Limits the
/// number of blocks authored per slot.
const BLOCK_PROCESSING_VELOCITY: u32 = 1;
/// Relay chain slot duration, in milliseconds.
const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;

type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
Runtime,
RELAY_CHAIN_SLOT_DURATION_MILLIS,
BLOCK_PROCESSING_VELOCITY,
UNINCLUDED_SEGMENT_CAPACITY,
>;

// This struct is never instantiated, it is only used for the `CheckInherents` implementation.
// It will be deprecated soon:
// https://github.com/moonbeam-foundation/moonbeam/blob/26a88a553563647992f39fbd1cce3d45a363e991/runtime/moonbeam/src/lib.rs#L1585-L1614
Expand Down

0 comments on commit e711bbb

Please sign in to comment.