Skip to content

fix: optimize weight consumption on process_votes in conviction voting#1423

Merged
F3Joule merged 4 commits intomasterfrom
f3/fix-vote-weights
Apr 17, 2026
Merged

fix: optimize weight consumption on process_votes in conviction voting#1423
F3Joule merged 4 commits intomasterfrom
f3/fix-vote-weights

Conversation

@F3Joule
Copy link
Copy Markdown
Contributor

@F3Joule F3Joule commented Apr 15, 2026

Description

This PR introduces new GetReferendumState impl: DirectReferendumStatus that reads referenda state using direct access to ReferendumInfoFor instead of the frame_support::traits::voting::Polling abstraction, which implementation in pallet_conviction_voting caused extra writes to happen.

Related Issue

Related to #1341. Not a direct fix

How Has This Been Tested?

No existing regression tests failed. Weights updated as expected.

@F3Joule F3Joule self-assigned this Apr 15, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Crate versions that have been updated:

  • pallet-staking: v4.3.0 -> v4.3.1
  • hydradx-runtime: v410.0.0 -> v411.0.0

Runtime version has been increased.

@F3Joule F3Joule marked this pull request as ready for review April 16, 2026 11:56
Copy link
Copy Markdown
Contributor

@martinfridrich martinfridrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't fixes #1341 , we are still processing all votes on vote.
This PR improves benchmarks because try_access_poll() is doing unnecessary write so your improvement is ok but it's not fixing linked issue.

@github-actions
Copy link
Copy Markdown

Quick benchmark at commit e339861 has been executed successfully.
View results

@F3Joule F3Joule changed the title fix: unnecessary vote processing in conviction voting fix: optimize weight consumption on process_votes in conviction voting Apr 17, 2026
@F3Joule F3Joule merged commit 80bb228 into master Apr 17, 2026
15 of 16 checks passed
@F3Joule F3Joule deleted the f3/fix-vote-weights branch April 17, 2026 12:19
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.

3 participants