[Governance 2/4] Introduce pallet-signed-voting#2806
Conversation
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: l0r1s has write permission, an established account, substantial prior subtensor PR history, and no in-PR author/committer mismatch; branch governance-signed-voting -> governance-multi-collective. Reviewed the prefetched PR metadata, prior Skeptic sticky, changed-file list, and full diff. The PR does not modify FindingsNo findings. ConclusionNo actionable security findings were found in this static Skeptic pass, so the PR is SAFE from the malicious/vulnerability perspective. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor UNKNOWN; author has write permission and substantial prior PR history, so reviewed as an established repo contributor. PR body was empty/trivial; the Auditor has auto-filled it. Please review. PR body is currently trivial ( Spec version: not applicable for base branch Verification: attempted FindingsNo findings. ConclusionThe new signed-voting pallet has explicit signed origins, bounded storage snapshots, lazy cleanup with queue overflow handling, generated weights, and broad tests for voting, removal, lifecycle, tally conversion, and cleanup behavior. I found no blocking domain issues in the diff. |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Summary
Introduces
pallet-signed-voting, a per-account voting backend for governance poll producers. The pallet snapshots a poll's eligible voter set at creation time, accepts signed aye/nay votes from snapshot members, maintains exact raw vote counts, converts them toVoteTallyratios, and pushes tally updates back to the poll producer.What Changed
subtensor-runtime-common:VoteTallyfor approval/rejection/abstention ratios.SetLike,Polls,OnPollCreated, andOnPollCompletedtraits for producer/backend integration.pallet-signed-votingwith:voteandremove_voteextrinsics.VoterSetOf.TallyOf.VotingFor.VotingForcleanup throughPendingCleanupandon_idle.Cargo.tomlandCargo.lock.Behavioral Impact
The pallet is not wired into the runtime in this PR. Once integrated by a poll producer, eligibility is fixed at poll creation: members rotated out after creation retain voting rights for that poll, and members rotated in later cannot vote on already-created polls. Completed polls remove tally and voter-set state synchronously, while per-voter records are reclaimed over idle blocks to avoid unbounded completion work.
Migration / Spec Version
No runtime wiring is included here, and the PR targets
governance-multi-collective, which has no configured spec-version check mapping. No spec-version bump is required for this branch.Testing
The PR includes unit coverage for vote casting, vote flipping, duplicate rejection, non-member rejection, root-origin rejection, vote removal, lifecycle hooks, voter-set snapshot sorting/deduplication, zero-total tally conversion, cleanup queue behavior, cursor-based lazy cleanup, and integrity-test configuration guards.
Auditor attempted
cargo test -p pallet-signed-voting, but the CI review environment could not start the test because the installed rustup/cargo setup tried to write under read-only home-directory cache paths.