-
Notifications
You must be signed in to change notification settings - Fork 1.1k
slot-based-collator: Allow multiple blocks per slot #7569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/cmd prdoc --audience node_operator --bump major |
cumulus/zombienet/zombienet-sdk/src/elastic_scaling_multiple_blocks_per_slot.rs
Show resolved
Hide resolved
michalkucharczyk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1st round, will get back to it.
cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs
Show resolved
Hide resolved
Co-authored-by: Michal Kucharczyk <[email protected]>
cumulus/client/consensus/aura/src/collators/slot_based/slot_timer.rs
Outdated
Show resolved
Hide resolved
|
/cmd fmt |
cumulus/client/consensus/aura/src/collators/slot_based/slot_timer.rs
Outdated
Show resolved
Hide resolved
|
nit: maybe mentioning some recommended values in PR description for the following items would make it easier to integrate?
|
Summary: This PR enables authoring of multiple blocks in one AURA slot in the slot-based collator and stabilizes the slot-based collator.
CLI Changes
The flag
--experimental-use-slot-basedis now marked as deprecated. I opted to introduce--authoring slot-basedinstead of just removing theexperimentalprefix. By introducing theauthoringvariant, we get some future-proofing in case we want to introduce further options.Change Description
With elastic-scaling, we are able to author multiple blocks with a single relay-chain parent. In the initial iteration, the interval between two blocks was determined by the
slot_durationof the parachain. This PR introduces a more flexible model, where we try to author multiple blocks in a single slot if the runtime allows it.The block authoring loop is largely the same. The
SlotTimernow lives in a separate module and is updated with the last seen core count. It will then trigger rounds in the block-building loop based on the core count.This allows some flexibility where elastic-scaling chains can run on a single core in quiet times. Previously, running on 1 core with a 3-core elastic-scaling chain would result in authors getting skipped because the
slot_durationwas too low.Parameter Considerations
The core logic does not change, so there are a few things to consider:
ConsensusHookimplementation still determines how many blocks are allowed per relay-chain block. So if you add arbitrary cores to an async-backing, 6-second parachain,can_build_uponin the runtime will deny block-building of additional blocks.MINIMUM_PERIODin the runtime needs to be configured to allow enough blocks in the slot. A "classic" configuration ofSLOT_DURATION/2will lead to slot mismatches when running with 3 cores.