Skip to content

Conversation

@cusma
Copy link
Collaborator

@cusma cusma commented Nov 19, 2025

This PR updates the quorums (both regular and weighted) from a fixed category-sized quorum to linearized quorums according to the requested amount.

@cusma cusma self-assigned this Nov 19, 2025
@cusma cusma added the feature label Nov 19, 2025
Copilot finished reviewing on behalf of cusma November 19, 2025 11:13
Copy link
Contributor

Copilot AI left a 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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants