Skip to content

pallet-signed-voting extracted from governance umbrella PR#2713

Open
l0r1s wants to merge 1 commit into
governancefrom
governance-signed-voting
Open

pallet-signed-voting extracted from governance umbrella PR#2713
l0r1s wants to merge 1 commit into
governancefrom
governance-signed-voting

Conversation

@l0r1s
Copy link
Copy Markdown
Collaborator

@l0r1s l0r1s commented Jun 3, 2026

Summary

Extracts a new pallet-signed-voting backend from the governance work and adds the shared runtime-common traits/types it needs to integrate with a poll producer such as referenda.

What Changed

  • Added VoteTally to subtensor-runtime-common for perbill approval/rejection/abstention reporting.
  • Added shared SetLike, Polls, OnPollCreated, and OnPollCompleted traits for producer/backend coordination.
  • Added pallet-signed-voting with signed vote and remove_vote extrinsics, frozen voter-set snapshots, per-poll tallies, and lazy cleanup of per-voter records.
  • Added benchmarks, generated weights, mock runtime support, README documentation, and unit tests covering voting, vote removal, lifecycle hooks, cleanup, tally conversion, and configuration integrity.

Behavioral Impact

This PR adds the signed-voting backend crate and shared interfaces, but does not wire the pallet into the runtime by itself. Once connected by the referenda/governance follow-up, poll creation snapshots the eligible voter set, vote updates push real-time tally ratios to the producer, and completed polls enqueue per-voter vote records for bounded idle cleanup.

Migration / Spec Version

The new pallet defines storage, but this PR does not add it to the runtime. Because the base branch is governance, there is no configured live-network spec-version check for this PR. A later runtime integration PR should handle the runtime spec-version and migration implications as part of wiring this pallet in.

Testing

The PR includes pallet unit tests and benchmark code for the new signed-voting surface. Suggested local verification:

cargo test -p pallet-signed-voting

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny: author has write permission, established subtensor history, no Gittensor allowlist hit found, and branch is governance-signed-voting -> governance.

Static-only Skeptic review of the prefetched diff found no .github/ai-review/* or .github/copilot-instructions.md changes, no new third-party dependency versions, and no suspicious build-script or supply-chain changes. The new pallet is not wired into the runtime in this PR; its callable paths use signed origins, scheme checks, bounded voter snapshots, and saturating tally arithmetic.

Findings

No findings.

Conclusion

No malicious intent or security vulnerability was found in the reviewed diff.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor: LIKELY by heuristic; author has repo write permission and substantial recent subtensor history, with no direct allowlist hit.

PR body is now substantive, so no replacement description is proposed.

Spec version: no auto-fix applied. This targets governance, which is not one of the configured live-network spec-version check branches, and the new pallet is not wired into the runtime in this PR.

Duplicate check: overlapping PRs appear to be stacked governance extraction/runtime-wiring work or unrelated workspace overlaps; no better duplicate candidate identified.

Testing: not run in this rerun. Static review covered the new signed-voting pallet lifecycle, signed-origin checks, bounded voter-set snapshotting, tally conversion, generated weights, lazy cleanup queue behavior, and included unit-test coverage.

Findings

No findings.

Conclusion

No blocking domain issues found. The pallet is isolated from runtime wiring in this PR, uses explicit signed origins and bounded storage paths, and includes focused tests for the main voting, lifecycle, and cleanup invariants.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@l0r1s l0r1s mentioned this pull request Jun 3, 2026
@l0r1s l0r1s added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 3, 2026
@l0r1s l0r1s marked this pull request as ready for review June 3, 2026 19:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant