Skip to content

feat(general-runtime): UNINCLUDED_SEGMENT_CAPACITY=2 + spec 21→22 (async backing pipelining)#39

Merged
kumanoko24 merged 2 commits into
release/v1.12.0from
feat/backport-pr4937-runtime
May 7, 2026
Merged

feat(general-runtime): UNINCLUDED_SEGMENT_CAPACITY=2 + spec 21→22 (async backing pipelining)#39
kumanoko24 merged 2 commits into
release/v1.12.0from
feat/backport-pr4937-runtime

Conversation

@kumanoko24

Copy link
Copy Markdown

Summary

Two-commit runtime upgrade for general-runtime (the parachain runtime shared by all 9 leafchains). Flips UNINCLUDED_SEGMENT_CAPACITY from 1 (the prior workaround) to 2, enabling async backing pipelining now that the relay-side fragment-chain bug is fixed.

Commits

SHA Subject
feat(leafchain) flip UNINCLUDED_SEGMENT_CAPACITY 1→2 to engage async backing
bump(general-runtime) spec_version 21 → 22

⚠️ Dependency on PR #38 (binary upgrade)

This PR MUST be merged AND deployed AFTER PR #38 (feat(node): backport polkadot-sdk#4937).

Reason: UNINCLUDED_SEGMENT_CAPACITY=2 requires 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:

  1. Merge & deploy PR feat(node): backport polkadot-sdk#4937 (prospective-parachains rework) + 6-val dev set #38 (binary swap on all relay validators + collators)
  2. Verify fleet is fully on new binary
  3. Merge this PR (runtime artefact)
  4. Sudo cumulus 2-step setCode for each leafchain (sand-testnet, ecq-{mainnet,testnet}, lmt-{mainnet,testnet}, thx-{mainnet,testnet}, izutsuya-testnet, avatect-mainnet) — they all share general-runtime

What this enables

Para block production at ~6s/para-block sustained — async backing pipelining engaged. Source comment at thxnet/leafchain/runtime/general/src/lib.rs:357 explains the mechanism:

With capacity=2 + node-side paritytech#4937, async backing pipelining engages:
slot N: produce candidate; slot N: backed; slot N+1: produce next candidate while previous is being included → 1 candidate per relay slot = ~6s/para-block

Prior behaviour at capacity=1: synchronous-backing tempo ~12-18s/para-block (3× slower).

Validation

Spec bump

general-runtime spec_version 21 → 22. Required to trigger on_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:

sudo(parachainSystem.authorizeUpgrade(blake2_256(general_runtime.compact.compressed.wasm), false))
parachainSystem.enactAuthorizedUpgrade(general_runtime.compact.compressed.wasm)

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:

  • Build artefact of general-runtime at spec 21 (capacity=1 — current main)
  • Sudo cumulus 2-step setCode back to spec 21
  • Para reverts to ~12-18s/block, no stall

PR #38 binary stays deployed (it's backwards-compatible with capacity=1 runtime).

Risk

  • New runtime artefact builds + try-runtime-live should pass (no migration body, just spec bump)
  • Production-scale topology (16-19 vals) likely yields better than forknet's 6.2s/block average — backing groups bigger, more pipelining margin
  • bridge-hub-westend-runtime pre-existing workspace check failure is unrelated (Westend testnet runtime, not in our deployment)

Test plan

THXLAB AI Team

kumanoko24 added 2 commits May 7, 2026 15:03
… 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
@kumanoko24 kumanoko24 merged commit a9a75e7 into release/v1.12.0 May 7, 2026
32 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant