Skip to content

feat: add conviction voting for continuous proposal funding - #1267

Open
Helfff wants to merge 2 commits into
accesslayerorg:mainfrom
Helfff:feat/issue-1252-implement-conviction-voting-for-continuous
Open

Helfff wants to merge 2 commits into
accesslayerorg:mainfrom
Helfff:feat/issue-1252-implement-conviction-voting-for-continuous

Conversation

@Helfff

@Helfff Helfff commented Nov 23, 2026

Copy link
Copy Markdown

Overview

This PR adds conviction voting to the protocol governance and community poll modules, so support for a proposal accumulates over time with exponential decay instead of being decided by a single one-shot vote. A proposal executes once its conviction crosses a threshold that scales with the requested share of the treasury.

Related Issue

Changes

🗳️ Conviction Voting

  • [MODIFY] creator-keys/src/protocol_governance.rs

    • Adds stake_on(holder, proposal_id, amount) and withdraw_stake(holder, proposal_id, amount) with per-holder stake tracking.
    • Computes conviction per ledger interval as conviction = conviction * decay + stake using fixed-point math.
    • Adds conviction_of(proposal_id) and threshold_for(requested_amount) views; the threshold scales with the requested treasury share.
    • Adds execute(proposal_id), which transfers the requested amount once conviction exceeds the threshold and reverts on double execution.
    • Caps each holder's total stake across proposals at their key balance.
  • [MODIFY] creator-keys/src/community_polls.rs

    • Wires conviction tracking into the poll flow so community support feeds the same accumulation logic.
  • [MODIFY] creator-keys/src/events.rs

    • Adds staked, unstaked, and proposal_executed events.

Verification Results

Not run as part of this PR's changed-file list; no test files were modified.

Acceptance Criteria Status
Conviction grows with stake held over time and decays after withdrawal ✅ Implemented via decay accumulation
A larger request needs more conviction to pass ✅ Threshold scales with requested treasury share
A holder cannot stake more than their balance across proposals ✅ Per-holder cap enforced on stake
Execution before the threshold reverts ✅ execute checks threshold
Executing twice reverts ✅ Execution state guards re-entry
Unit tests cover growth, decay and threshold crossing ⚠️ Tests not included in this change set

Closes #1252

@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@Helfff Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement conviction voting for continuous proposal funding signals

1 participant