fix: backport check-weight Mandatory bypass for session-boundary panic (polkadot-sdk #4592)#22
Merged
Conversation
…tory extrinsics (paritytech#4592) Backport of paritytech#4571 --------- Co-authored-by: command-bot <>
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
Cherry-pick of upstream polkadot-sdk PR #4592 (backport of #4571) from the
release-polkadot-v1.12.0maintenance branch.Fixes: Leafchain collator panics with
set_validation_data inherent needs to be present in every block!at every session boundary block after upgrading to polkadot-v1.12.0.Root cause
pallet_session::on_initializeat session boundaries returnsT::BlockWeights::get().max_blockweight, filling the entire PoV budget (proof_size = 5,242,880)check_combined_proof_size(introduced in PRCheckWeightSE: Check for extrinsic length + proof size combined paritytech/polkadot-sdk#4326, 3 days before the v1.12.0 tag) rejects ALL subsequent extrinsics — noDispatchClass::Mandatorybypass existedbasic_authorship::apply_inherentssilently drops the Mandatory inherent as "non-mandatory" due to match arm orderingparachain_system::on_finalizepanics becauseValidationDatawas never setThis is upstream bug polkadot-sdk#4559 — Asset Hub Rococo hit the exact same error after their v1.12.0 upgrade.
Why we didn't have the fix
The
polkadot-v1.12.0tag was cut on 2024-05-16. The fix was merged 11 days later (2024-05-27). Parity never cut av1.12.1patch tag. Our fork was built from the tag, missing all 6 maintenance-branch backports.The fix
~15 lines in
substrate/frame/system/src/extensions/check_weight.rs:info: &DispatchInfoOf<Call>parameter tocheck_combined_proof_sizeMandatory → Ok(()), others →Err(ExhaustsResources)Important: binary rebuild required
NativeElseWasmExecutoralways picks native when versions match. WASM overrides and--execution=wasmare no-ops. Both binary AND WASM must be rebuilt.Verified on forked testnet
"Still including if mandatory. size: 5127kb, limit: 5120kb, is_mandatory: true"References
d3bf1a82ac2d🤖 Generated with Claude Code