Tech collective: clean up stale votes after member removal (F-91265)#605
Closed
n13 wants to merge 3 commits into
Closed
Tech collective: clean up stale votes after member removal (F-91265)#605n13 wants to merge 3 commits into
n13 wants to merge 3 commits into
Conversation
Bump runtime spec_version 133 -> 134 for the new ranked-collective extrinsic (F-91265), and add it to the TechCollective surface doc (fixing a code reference shifted by the insertion).
Collaborator
Author
|
The edge case here is What if a poll is ongoing, and a tech collective member is removed while the poll is ongoing. In our current setting only 1 poll can be active at a time Therefore you can't remove a member while the poll is ongoing (needs a 2nd poll) also I don't see why this is a better solution - the member was part of the tech collective when the voting began, then voted... Removing them if they're no longer eligible is a choice, but keeping them is equally valid... I don't think we should do this Claude opened a PR for it already, but I think it just adds some complications that then also have other impacts potentially, less code is more |
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
Adds the substantive fix from the v12 suggestions (authored by
illuzen) that closes audit finding F-91265 (a removed member's vote stays in an ongoing poll's tally) in the surviving tech-collective lane.allow removing votes from poll if member removed(illuzen): adds a permissionlessremove_vote_for_non_member(who, poll)extrinsic topallet-ranked-collective(call_index(7)) that clears a non-member's stale vote from an Ongoing poll and corrects the tally. Guarded to only act on accounts that are not current members (StillMember), that actually voted (NotVoted), on polls still ongoing (NotPolling). Fee waived (cleanup op). Ships 6 unit tests.spec_version133 → 134 (new extrinsic).docs/TECH_REFERENDA_FEATURES.md.The second suggested commit was intentionally dropped
The other suggested commit (
fix zero-denominator issueinpallets/conviction-voting, F-91141) does not apply here:pallet-conviction-votingwas removed entirely in #604, so the bug is moot. The surviving tech-lane tally already guards the zero-denominator case:Test plan
cargo test -p pallet-ranked-collective→ 21 passed (incl. 6 new:remove_vote_for_non_member_works,..._removes_nay_vote,..._fails_if_not_voted,..._fails_on_completed_poll,..._fails_if_still_member,remove_member_cleanup_works)cargo check -p quantus-runtime→ clean; extrinsic exposed viaTechCollectiveNotes
call_index(7)is additive/backward-compatible →transaction_versionleft unchanged.WeightInfo::vote()(O(1), comparable work) → no new benchmark required.