Skip to content

election-provider-multi-block: reduce overclaimed proof_size during Signed phase#11156

Merged
sigurpol merged 2 commits into
stable2512from
sigurpol-election-poll-reduce-weight-for-signed-phase
Feb 24, 2026
Merged

election-provider-multi-block: reduce overclaimed proof_size during Signed phase#11156
sigurpol merged 2 commits into
stable2512from
sigurpol-election-poll-reduce-weight-for-signed-phase

Conversation

@sigurpol
Copy link
Copy Markdown
Contributor

@sigurpol sigurpol commented Feb 24, 2026

on_initialize claimed on_initialize_into_signed weight (> ~3M proof_size) every block during the Signed phase, but the heavy work (loading voter snapshots) only happens once when transitioning from Snapshot into Signed.
Use discriminant comparison to distinguish phase entry from same-phase ticks, falling back to on_initialize_nothing for the latter.

A proper fix would be backporting #9925 into stable2512 - but this would be a bigger change not compatible with the tight timeline of 2.1.0 release on Polkadot/Kusama.

…igned phase

on_initialize claimed on_initialize_into_signed weight (> ~3M proof_size)
every block during the Signed phase, but the heavy work (loading voter snapshots)
only happens once when transitioning from Snapshot into Signed.
Use discriminant comparison to distinguish phase entry from same-phase ticks,
falling back to on_initialize_nothing for the latter.
@sigurpol sigurpol requested a review from a team as a code owner February 24, 2026 10:45
@sigurpol sigurpol added the T2-pallets This PR/Issue is related to a particular pallet. label Feb 24, 2026
@sigurpol
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience runtime_dev --bump

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 24, 2026

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or not need an audit.
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@sigurpol
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch

@sigurpol
Copy link
Copy Markdown
Contributor Author

This is meant to be a tentative workaround for #11034 for Release 2.1.0 based on 2512 where due to lack of time, we can't afford to backport #9925 . The expected benefit is that only during Snapshot phase (33 blocks) and in the transition Snapshot(0 ) -> Signed(N) we would see a spike in PoV but after that, Signed(_) is back to normal since no heavy work is performed

@sigurpol sigurpol merged commit 91cca27 into stable2512 Feb 24, 2026
252 of 260 checks passed
@sigurpol sigurpol deleted the sigurpol-election-poll-reduce-weight-for-signed-phase branch February 24, 2026 16:06
fellowship-merge-bot Bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Feb 26, 2026
- Bump election provider multiblock to include [SDK
PR#11156](paritytech/polkadot-sdk#11156) :
reduce overclaimed proof_size during Signed phase
- Bump staking pallets to include [SDK
PR#11168](paritytech/polkadot-sdk#11168): add a
configurable MinSetKeysBond threshold that rejects set_keys when active
bond is insufficient.
arturgontijo pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Apr 1, 2026
…igned phase (paritytech#11156)

on_initialize claimed on_initialize_into_signed weight (> ~3M
proof_size) every block during the Signed phase, but the heavy work
(loading voter snapshots) only happens once when transitioning from
Snapshot into Signed.
Use discriminant comparison to distinguish phase entry from same-phase
ticks, falling back to on_initialize_nothing for the latter.

A proper fix would be backporting paritytech#9925 into stable2512 - but this would
be a bigger change not compatible with the tight timeline of 2.1.0
release on Polkadot/Kusama.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
arturgontijo pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants