Skip to content

Conversation

@cusma
Copy link
Collaborator

@cusma cusma commented Nov 17, 2025

This PR addresses #215, making the Proposals lifecycle fully async with respect to the xGov Registry and so allowing its reconfiguration with pending Proposals.

@cusma cusma self-assigned this Nov 17, 2025
@cusma cusma added the feature label Nov 17, 2025
@cusma cusma linked an issue Nov 17, 2025 that may be closed by this pull request
Copilot finished reviewing on behalf of cusma November 17, 2025 18:08
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 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_countassigned_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.

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.

feat: proposal pre-processing and stamping

2 participants