feat(general-runtime): UNINCLUDED_SEGMENT_CAPACITY=2 + spec 21→22 (async backing pipelining)#39
Merged
Conversation
… backing Restores capacity=2 now that paritytech#4937 is backported (commit b72ff06). With paritytech#4937's fork-aware fragment-chain, capacity=2 no longer triggers the para stall in small/uniform topologies. Effect: - Pre-flip: synchronous-backing tempo ~12-18s/para-block (E.1 + Path B-6val evidence) - Post-flip: async backing pipelining → ~6s/para-block (target — to be verified by rehearsal) Mechanism: - capacity=2 lets cumulus FixedVelocityConsensusHook::can_build_upon return true while previous candidate is being included on relay - collator produces N+1 candidate while N is in inclusion pipeline - 1 candidate per relay slot = 6s THXLAB AI Team
Required for runtime upgrade triggered by UNINCLUDED_SEGMENT_CAPACITY 1→2 flip (previous commit). Substrate executive fires on_runtime_upgrade only when spec_version changes; this bump ensures the new capacity takes effect on existing parachain state. No migration body needed — capacity is a compile-time const, not storage. The spec bump is purely the trigger. Production rollout: cumulus 2-step setCode (sudo authorize + enactAuthorizedUpgrade) on each leafchain after PR-1 (binary swap) is fully deployed across relay validators. THXLAB AI Team
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two-commit runtime upgrade for general-runtime (the parachain runtime shared by all 9 leafchains). Flips
UNINCLUDED_SEGMENT_CAPACITYfrom 1 (the prior workaround) to 2, enabling async backing pipelining now that the relay-side fragment-chain bug is fixed.Commits
feat(leafchain)flip UNINCLUDED_SEGMENT_CAPACITY 1→2 to engage async backingbump(general-runtime)spec_version 21 → 22This PR MUST be merged AND deployed AFTER PR #38 (
feat(node): backport polkadot-sdk#4937).Reason:
UNINCLUDED_SEGMENT_CAPACITY=2requires the relay-side fragment-chain rework from PR paritytech#4937 (in PR #38) to safely handle fork candidates at same parent. Without paritytech#4937 deployed on relay validators, capacity=2 causes the documented stall (para stuck at ~13-30 blocks) in any topology where backing latency briefly exceeds 1 relay slot.Operational sequence:
general-runtimeWhat this enables
Para block production at ~6s/para-block sustained — async backing pipelining engaged. Source comment at
thxnet/leafchain/runtime/general/src/lib.rs:357explains the mechanism:Prior behaviour at capacity=1: synchronous-backing tempo ~12-18s/para-block (3× slower).
Validation
EnableAsyncBackingAndCoretime: num_cores=1, lookahead=2, async_backing=(depth=3, ancestry=2), node_features[0,1,3]=true, AvailabilityCores freed, ClaimQueue cleared, active_validators=6Spec bump
general-runtimespec_version21 → 22. Required to triggeron_runtime_upgrade()so the new constants take effect on existing parachain state. No migration body is needed (capacity is a compile-time const, not storage).Production rollout
Per-leafchain cumulus 2-step setCode:
After enact + ~36s, para spec_version bumps 21 → 22, capacity=2 takes effect, async backing pipelining engages, block rate moves to ~6s/block.
Rollback plan
If 6s/block reveals an unforeseen edge case at production scale (mainnet 16 vals, testnet 19 vals), rollback is a runtime downgrade:
general-runtimeat spec 21 (capacity=1 — current main)PR #38 binary stays deployed (it's backwards-compatible with capacity=1 runtime).
Risk
Test plan
cargo build --release -p general-runtimeproduces wasm at expected spec=22THXLAB AI Team