security: extend pause gate to all state-changing entrypoints#59
Merged
mikewheeleer merged 1 commit intoJun 24, 2026
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Previously only
record_usageandsettlerespected thePausedemergency-stop flag, while admin config and registry mutations still ran
while the contract was paused. This extends the pause gate consistently
to every state-changing config/registry entrypoint.
Closes #23
Changes
ensure_not_paused(env)next toread_flag/write_flagthat panics withContractPaused(#4)when paused, centralising the check so new mutating entrypoints cannot
forget it.
ensure_not_paused(&env);right after the admin load +require_auth()in all 11 config-mutation entrypoints:set_service_price,register_service,unregister_service,set_service_disabled,set_service_metadata,clear_service_metadata,set_agent_allowed,set_allowlist_enabled,set_require_service_registration,set_min_requests_per_call,set_max_requests_per_call.(
transfer_service_ownershipalready had its own pause check; left as-is.)docs/escrow/security.mddocumenting the full pause matrix.unpause()and a read getter still work while paused.Security notes
retains control during an incident:
pause,unpause,propose_admin_transfer,accept_admin_transfer,cancel_admin_transfer,migrate_v1_to_v2, andinit.EscrowError::ContractPaused = 4; the error enumis unchanged (still append-only, max code
#14).admin.require_auth(), so authorizationsemantics are unchanged; the pause gate is an additional barrier, not
a replacement.
Test result
test result: ok. 56 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out🤖 Generated with Claude Code