[Governance 2/4] Introduce pallet-signed-voting#2806
Conversation
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: l0r1s has write permission, an established 2018 account, substantial prior subtensor PR history, no Gittensor allowlist hit in trusted context, and no in-PR author/committer mismatch; branch governance-signed-voting -> governance-multi-collective. Reviewed the prefetched metadata, prior Skeptic sticky, contributor signals, changed-file list, and 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 I calibrated as an established repo contributor while still reviewing the new runtime pallet paths. No duplicate-work recommendation: the overlapping PRs are the stacked governance series or unrelated shared workspace touches, not competing implementations. Spec version: not applicable for base branch Verification: static review only on this rerun. I did not run cargo tests because no finding required runtime confirmation. FindingsNo findings. ConclusionThe signed-voting pallet has explicit signed origins, scheme gating, bounded voter snapshots, saturating tally updates, lazy cleanup with overflow signaling, generated weights, and broad unit coverage for voting, lifecycle, tally conversion, and cleanup behavior. I found no actionable domain issues in the diff. |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
51a033f to
0ebd213
Compare
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Summary
Part of #2804 .
Adds
pallet-signed-voting, a generic signed aye/nay voting backend for poll producers such aspallet-referenda.The pallet records per-account votes, snapshots voter eligibility when a poll opens, and pushes tally updates back to the poll producer.
What Changed
pallet-signed-voting.VoteTallyreporting for approval, rejection, and abstention.voteandremove_voteextrinsics.Detailed Reference
See
pallets/signed-voting/README.mdfor the full design reference. It covers the producer/backend contract, poll lifecycle, frozen voter-set snapshots, real-time tally updates, lazy cleanup, sizing guidance, and runtime configuration.Reviewers may want to focus on the snapshot and cleanup behavior: voter eligibility is fixed when the poll opens, the tally denominator does not drift during collective rotations, and completed poll vote records are cleaned during idle time so poll completion stays bounded.
Behavioral Impact
No live runtime behavior changes in this PR. The voting pallet is added to the codebase but is not wired into the Subtensor runtime until the governance wiring PR.
Once wired, active polls keep a stable voter set for their full lifecycle, and tally updates can drive referendum decisions without mixing voting logic into the referendum pallet.
Migration / Spec Version
The pallet defines storage, but this PR does not add it to the runtime. No live storage migration or spec-version bump is required here.
Testing
Suggested local verification:
cargo test -p pallet-signed-voting