-
Notifications
You must be signed in to change notification settings - Fork 2
feat: fully async proposals #331
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: main
Are you sure you want to change the base?
Conversation
…idation; remove unused errors
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 fully asynchronous proposal lifecycle management with respect to the xGov Registry. The key architectural change allows the registry to be reconfigured even when proposals are pending, by storing registry configuration values directly in each proposal's state at creation time rather than reading them dynamically.
Key Changes:
- Proposal contracts now cache registry configuration values (quorum thresholds, durations, fees) at creation time in their global state
- Removed the restriction preventing registry reconfiguration when proposals are pending
- Increased proposal global state from 20 to 26 uint slots to accommodate cached configuration values
- Reduced proposal approval program from 2 pages to 1 page for optimization
- Renamed variables for clarity:
voters_count→assigned_members
Reviewed Changes
Copilot reviewed 22 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/xgov_registry/test_finalize_proposal.py | Added metadata_uploaded=True parameter to test assertions |
| tests/xgov_registry/test_drop_proposal.py | Added metadata_uploaded=True parameter to test assertions |
| tests/xgov_registry/test_config_xgov_registry.py | Removed test for NO_PENDING_PROPOSALS restriction |
| tests/proposal/test_vote.py | Renamed voters_count to assigned_members throughout |
| tests/proposal/test_unassign_voters.py | Renamed variables and function reference for consistency |
| tests/proposal/test_submit.py | Updated function reference and added metadata_uploaded checks |
| tests/proposal/test_scrutiny.py | Renamed voters_count to assigned_members in extensive test scenarios |
| tests/proposal/test_finalize.py | Added metadata_uploaded=True parameter |
| tests/proposal/test_drop.py | Added metadata_uploaded=True parameter |
| tests/proposal/test_assign_voters.py | Updated function references and variable names |
| tests/proposal/common.py | Refactored helper functions to support new state schema and naming |
| smart_contracts/xgov_registry/contract.py | Removed pending proposals check; added increment_pending_proposals; reduced approval program handling |
| smart_contracts/xgov_registry/constants.py | Changed PROPOSAL_APPROVAL_PAGES from 2 to 1 |
| smart_contracts/proposal_mock/contract.py | Updated config key references to use reg_cfg instead of prop_cfg |
| smart_contracts/proposal/contract.py | Major refactoring to cache registry values and simplify duration/quorum calculations |
| smart_contracts/proposal/config.py | Increased GLOBAL_UINTS to 26; added new state keys |
| smart_contracts/errors/std_errors.py | Removed NO_PENDING_PROPOSALS error constant |
| smart_contracts/artifacts/*.teal | Updated compiled TEAL reflecting all contract changes |
| docs/specs/xgov-rbac.md | Removed restriction about reconfiguring with pending proposals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR addresses #215, making the Proposals lifecycle fully async with respect to the xGov Registry and so allowing its reconfiguration with pending Proposals.