[Governance] Multi-Sig Proposal Expiry, Quorum, Vote Weighting, and Nonce Sync Safety (Issue #18) - #37
Open
Jokay1997 wants to merge 7 commits into
Open
Conversation
…d Nonce Sync Safety Closes EquipChain#18 - Multi-Sig Proposal Expiry, Quorum, Vote Weighting, and Nonce Sync Safety - Add governance.rs module with full proposal lifecycle (create, vote, execute) - Implement proposal expiry with configurable duration - Add absolute quorum (min_voters) requirement - Add vote weighting support (token-based, reputation, 1-person-1-vote) - Add configurable timelock after approval threshold is reached - Add cancel_proposal with reason (proposer only) - Add proposal status query returning detailed status enum - Fix nonce_sync.rs race condition with pending_nonce lock - Fix collapsible if in SLA penalty section (pre-existing clippy warning)
Resolve cargo fmt --check failures on both CI jobs (identical root cause as governance/upgrade-framework-16): - Collapse env.storage().instance().get(&DataKey::ApprovedTokens) onto one line in require_approved_token() - Wrap env.storage().instance() chains in approve_token() and revoke_token() starting at env. per rustfmt chain-call break rules - Wrap env.storage().instance().set() calls in approve_token() and revoke_token() - Collapse get_token_info() single-expression body onto one line All changes are pure formatting; no logic altered.
…edToken, TokenBalanceMismatch) The require_approved_token() and approve_token() functions introduced in the Issue EquipChain#23 token whitelist implementation referenced: ContractError::UnapprovedToken = 117 ContractError::TokenBalanceMismatch = 118 These variants were present in main but dropped from the ContractError enum on this branch during rebasing. Restores them to fix cargo clippy --lib failures introduced by this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #18.
Implements Multi-Sig Proposal Expiry, Quorum Enforcement, Vote Weighting, and Nonce Sync Safety for the EquipChain governance system. This PR hardens the multi-sig decision layer with time-bounded voting windows, participation minimums, flexible vote weighting, and a race-condition fix in the nonce sync module.
Files Changed
Implementation Details
governance.rs — New Module
Proposal Lifecycle
Draft → Voting → Approved / Rejected → Executed / ExpiredProposal Expiry
Quorum Mechanism
Vote Weighting
Timelock
Proposal Status Query
once_sync.rs — Race Condition Fix
lib.rs — Registry Updates
New \DataKey\ variants:
New \ContractError\ variants:
CI fix: resolved pre-existing collapsible \if\ clippy warning in the SLA penalty section.
Testing