Skip to content

Implement governance proposals + weighted signed voting API (bounty #50)#571

Merged
Scottcjn merged 4 commits intoScottcjn:mainfrom
createkr:feature/governance-proposals-voting-50
Mar 5, 2026
Merged

Implement governance proposals + weighted signed voting API (bounty #50)#571
Scottcjn merged 4 commits intoScottcjn:mainfrom
createkr:feature/governance-proposals-voting-50

Conversation

@createkr
Copy link
Contributor

@createkr createkr commented Mar 4, 2026

Summary

This PR implements governance proposals and voting end-to-end for bounty issue #50.

What was added

  • Database schema for governance proposals and votes.
  • API endpoints:
    • POST /governance/propose
    • GET /governance/proposals
    • POST /governance/vote
    • GET /governance/proposal/
  • Proposal lifecycle handling with clear status:
    • Draft -> Active (7 days) -> Passed/Failed
  • Proposal creation rule:
    • proposer wallet must hold more than 10 RTC
  • Voting rules:
    • signed Ed25519 vote verification (aligned with existing wallet signature style)
    • voter must be an active miner from attestation/miners view
    • weighted voting: weight = wallet_balance_rtc * antiquity_multiplier
  • Pass/fail determination:
    • proposal closes to passed when yes_weight > no_weight, else failed
  • Lightweight web UI:
    • GET /governance/ui serving web/governance.html
    • view proposals and submit vote payload
  • README updates:
    • governance rules and endpoint examples
  • Tests:
    • new route and governance logic coverage in tests/test_governance_api.py

Files changed

  • node/rustchain_v2_integrated_v2.2.1_rip200.py
  • web/governance.html
  • README.md
  • tests/test_governance_api.py

Test commands and results

  • python3 -m py_compile node/rustchain_v2_integrated_v2.2.1_rip200.py tests/test_governance_api.py
    • Result: success
  • python3 -m pytest -q tests/test_governance_api.py
    • Result: 2 passed, 1 warning

@createkr createkr requested a review from Scottcjn as a code owner March 4, 2026 06:53
@github-actions github-actions bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related tests Test suite changes labels Mar 4, 2026
@github-actions github-actions bot added the size/XL PR: 500+ lines label Mar 4, 2026
@Scottcjn Scottcjn merged commit ed62aa7 into Scottcjn:main Mar 5, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation node Node server related size/XL PR: 500+ lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants