Skip to content

Empty storage entries in conviction-voting pallet #7458

@muharem

Description

@muharem

Context

After inspecting the Polkadot storage snapshot from January 17, 2025, I found 20575 VotingFor records with zero capital (zero-balance votes, no delegations, no prior locks) and 8522 ClassLocksFor entries with zero-balance locks. These records likely serve no purpose and should not be stored.

Definition of zero record for VotingFor - https://github.com/muharem/polkadot-runtimes/blob/8f2deec8afa1384c56bd3795c6fa3e3e098b02f7/pallets/rc-migrator/src/conviction_voting.rs#L155
Definition of zero record for ClassLocksFor - https://github.com/muharem/polkadot-runtimes/blob/8f2deec8afa1384c56bd3795c6fa3e3e098b02f7/pallets/rc-migrator/src/conviction_voting.rs#L125

Note that a zero vote perhaps should still be possible if an account has delegations and to vote using only those delegations.

Task

Verify or refute the findings above. If the issue is present, prevent the creation of such records and implement a migration or a call to remove them from storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions