Add admin nuclear pause#609
Open
gloskull wants to merge 2 commits into
Open
Conversation
…isig feat: admin nuclear pause
Author
|
Done with this issue. |
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.
Motivation
Provide an admin-only emergency "nuclear" pause that is guarded by the configured Admin address so deployments can set Admin to a Stellar multisig and rely on native multisig thresholds via require_auth.
Description
Add nuclear_pause(env: Env, caller: Address) to contracts/vault/src/lib.rs which requires the caller to be the current admin (calls caller.require_auth()), rejects non-admin callers and already-paused state, sets the Paused storage key, and publishes the existing vault_paused event.
Add focused tests in contracts/vault/src/test.rs covering: current-admin-only access after admin rotation, owner fallback rejection, successful pause, and rejecting an already-paused call.
Update operator and interface documentation: README.md, docs/interfaces/vault.json, docs/ACCESS_CONTROL.md, and contracts/vault/ACCESS_CONTROL.md to document the new nuclear_pause API and the multisig security model.
Small test/format adjustments only where necessary for the new behavior and docs; commit created with message feat: admin nuclear pause.
Testing
Ran git diff --check which passed before committing the changes.
Attempted cargo test -p callora-vault nuclear_pause -- --nocapture and cargo test -p callora-vault pause_unpause_admin_only -- --nocapture, but test runs failed to complete due to pre-existing repository compile errors (duplicate contract exports and unrelated syntax issues in vault/settlement test code), so the new tests were added but could not be validated end-to-end in this environment.
cargo fmt --all could not complete because of pre-existing syntax errors outside the scope of this PR (in contracts/vault/src/test.rs).
Closes #561