feat(stellar): on-chain multisig quorum rotation for signers (#104)#141
Open
EmperorNexus wants to merge 1 commit into
Open
feat(stellar): on-chain multisig quorum rotation for signers (#104)#141EmperorNexus wants to merge 1 commit into
EmperorNexus wants to merge 1 commit into
Conversation
Add rotate_signers flow to stealth-sender and wraith-names (the two Timelock + Multisig Upgradable contracts per GOVERNANCE.md), gated by quorum approval from current signers plus a 7-day timelock matching the existing upgrade timelock. Invalid thresholds (zero, or greater than the proposed signer count) are rejected with a dedicated error. Execution emits SignersRotated; cancellation fully clears pending proposal state so a new rotation can be proposed immediately. Update MULTISIG.md with the on-chain rotation runbook. Futurenet rehearsal is called out as a follow-up since it requires a live deployment. Closes wraith-protocol#104
|
@EmperorNexus Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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 #104. Adds an on-chain rotate_signers flow - gated by quorum-of-current-signers plus a 7-day timelock - to the two contracts GOVERNANCE.md designates Timelock + Multisig Upgradable: stealth-sender and wraith-names.
Why both contracts
The issue's suggested path (contracts/*/src/multisig.rs) is a glob; this repo has no single admin-gated contract to attach it to - today's admin is a plain Stellar account address, multisig'd off-chain (see MULTISIG.md), with zero on-chain visibility into signers/threshold from any contract. GOVERNANCE.md designates both stealth-sender and wraith-names as Timelock + Multisig Upgradable with the same 3-of-5 / 7-day model, so both got a symmetric src/multisig.rs module rather than picking one arbitrarily.
Design
Each contract tracks its own governance signer set independently (DataKey::MultisigSigners / MultisigThreshold / PendingRotation) - this is a second, independent layer from the account-level Stellar multisig: the account multisig controls who can submit transactions at all; this controls quorum + timelock for signer rotation specifically, enforced by the contract regardless of which account submitted the call.
Flow: init_multisig (one-shot bootstrap) -> propose_rotate_signers (any current signer; auto-approves; only one rotation pending at a time) -> approve_rotate_signers (remaining signers, asynchronously - matches the existing off-chain MULTISIG.md 'collect M signatures over time' UX rather than requiring one atomic co-signed transaction) -> execute_rotate_signers (once approvals >= current threshold AND 7 days have elapsed since proposal; emits SignersRotated(new_signers, old_threshold, new_threshold)) -> cancel_rotate_signers (any current signer, any time before execution; fully clears proposal state so a fresh rotation can be proposed immediately).
InvalidThreshold is a dedicated error rejecting threshold 0 or threshold > new_signers.len(), at both init_multisig and propose_rotate_signers.
Acceptance criteria
Test location note
Tests are inline in each contract's existing #[cfg(test)] mod test in src/lib.rs, matching how every existing test in both stealth-sender and wraith-names is already organized (there is no per-contract tests/ directory convention in use, and the repo's shared integration-tests crate is currently non-functional - its src is a stray file containing a misnamed Cargo.toml, no real harness - so a new file there wouldn't compile without unrelated scaffolding repair).
Test plan