Enable Moonbase elastic scaling#3792
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR updates the CLI block authoring duration parameter to accept up to 6,000ms, increments the Moonbase runtime spec version to 4500, and reconfigures relay-chain async backing timing constants with increased velocity and computed segment capacity, making these constants publicly accessible. ChangesConfiguration Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Enables elastic scaling on Moonbase so the parachain can produce multiple blocks per relay-chain slot (async backing / fixed-velocity consensus), instead of a single block every ~6s.
spec_versionfrom 4400 to 4500.BLOCK_PROCESSING_VELOCITYfrom 1 to 3 (target minimum block time ~2s:6000ms / 3).UNINCLUDED_SEGMENT_CAPACITYto 12 using(3 + RELAY_PARENT_OFFSET) * BLOCK_PROCESSING_VELOCITY, withRELAY_PARENT_OFFSEThardcoded to1for now (build one slot behind the relay chain).--block-authoring-durationupper bound from 2s to 6s so collators can align with relay slot timing when authoring faster blocks.Relay-parent offset is ultimately provided by
pallet_async_backingin moonkit (type RelayParentOffset = AsyncBackingoncumulus_pallet_parachain_system::Config). This PR still uses a localRELAY_PARENT_OFFSETconstant only in the unincluded-segment capacity formula; we can drop that const once we wire the capacity calculation to moonkit’s offset API.Moonbeam and Moonriver are unchanged (velocity 1, capacity 3).
Motivation
Elastic scaling lets Moonbase keep up with higher throughput on testnet while staying within relay-chain inclusion rules. Moonbase is the first runtime in this repo to adopt the higher velocity and segment capacity.
Technical details
BLOCK_PROCESSING_VELOCITYUNINCLUDED_SEGMENT_CAPACITY(3 + 1) × 3 = 12RELAY_PARENT_OFFSET(local, for capacity only)1(hardcoded)Consensus hook remains
FixedVelocityConsensusHookwithRELAY_CHAIN_SLOT_DURATION_MILLIS = 6000.Test plan
cargo b -r--authoring=slot-based; confirm blocks are produced at ~2s intervals when elastic scaling is active (after callingsudo( coretime.assignCore(core, 0, [[{ task: para }, 57600]], null) )on relay).Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.