ποΈ Multi-Sig Governance | Quorum Threshold Checker for WASM Code Upgrades - #650
Open
ayandipe wants to merge 2 commits into
Open
ποΈ Multi-Sig Governance | Quorum Threshold Checker for WASM Code Upgrades#650ayandipe wants to merge 2 commits into
ayandipe wants to merge 2 commits into
Conversation
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.
Closes #595
Description
Implements N-of-M multi-sig authorization for WASM bytecode upgrades to prevent single-key compromise exploits (Issue #595).
Changes
src/governance.rs
GovernanceConfigstruct with configurablequorum_threshold(defaults to 2, matching previous hardcoded behavior)get_governance_config()/set_governance_config()storage accessorsverify_upgrade_quorum(env, signers)β validates that the provided signer list meets the threshold. Signers are validated against the admin and theSIGNERS_KEYregistryGovernanceUpgradeProposalstruct to persist the full signer listGOVERNANCE_UPGRADE_KEYandGOVERNANCE_CONFIG_KEYstorage constantssrc/lib.rs
propose_upgrade(): Now accepts asigners: Vec<Address>parameter, callsverify_upgrade_quoruminstead of the old hardcodedrequire_multisig, stores the full proposal, emitsGV_UPG_PROPOSEDeventexecute_upgrade(): Loads the storedGovernanceUpgradeProposaland re-verifies quorum at execution time β prevents race conditions where signers are removed between proposal and executioncancel_upgrade(): Also cleans upGOVERNANCE_UPGRADE_KEYset_governance_config(),get_governance_config(),get_governance_upgrade_proposal()public methodssrc/test.rs
propose_upgradetest calls to include thesignersparameter and register the admin as a signerTechnical Requirements Addressed