-
Notifications
You must be signed in to change notification settings - Fork 2
feat: linear quorums #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/fully-async-proposals
Are you sure you want to change the base?
feat: linear quorums #332
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements linear quorum thresholds for proposals based on the requested amount, replacing the previous fixed category-based quorum system. The quorum now scales linearly from minimum to maximum values according to the formula: Q(A) = Q_min + ΔQ × (A - A_min) / ΔA.
Key changes include:
- Implementation of linear quorum calculation functions in both test code and smart contracts
- Removal of medium quorum configuration values (now unused as quorums are computed dynamically)
- Updated documentation to reflect the new linear quorum specification
- Modified environment templates and CI/CD configurations to set medium quorum to 0
Reviewed Changes
Copilot reviewed 12 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/proposal/common.py |
Added compute_quorum_threshold and compute_weighted_quorum_threshold functions to calculate linear quorums based on requested amount |
smart_contracts/proposal/contract.py |
Removed old category-based quorum lookup functions; implemented new linear quorum computation in compute_quorum_threshold and compute_weighted_quorum_threshold |
smart_contracts/xgov_registry/contract.py |
Marked medium quorum fields as "No longer used" and set them to 0 in configuration |
smart_contracts/xgov_registry_mock/contract.py |
Removed set_quorum_medium and set_weighted_quorum_medium methods |
smart_contracts/xgov_registry/config.py |
Set QUORUM_MEDIUM and WEIGHTED_QUORUM_MEDIUM to 0 with deprecation comments |
docs/specs/proposal.md |
Updated specification to document the linear quorum formula |
docs/specs/proposal-vote.md |
Removed "category-dependent" language from quorum descriptions |
docs/implementation/configuration.md |
Updated configuration table to show Min/Max quorum values instead of Small/Medium/Large |
tests/xgov_registry/conftest.py |
Grouped transactions using new_group() and send() for better transaction management |
.env.localnet.template |
Updated medium quorum values to 0 in configuration |
.github/workflows/xgov-beta-sc-cd.yml |
Updated CI/CD configuration to use 0 for medium quorum values |
| Compiled TEAL artifacts | Reflect the contract changes with updated bytecode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR updates the quorums (both regular and weighted) from a fixed category-sized quorum to linearized quorums according to the requested amount.