AggLayer: add emergency pause mechanism#2785
Draft
mmagician wants to merge 5 commits intommagician-claude-setupfrom
Draft
AggLayer: add emergency pause mechanism#2785mmagician wants to merge 5 commits intommagician-claude-setupfrom
mmagician wants to merge 5 commits intommagician-claude-setupfrom
Conversation
Add an `emergency_paused` flag in bridge storage that, when set, blocks all 4 public entry points (bridge_out, claim, register_faucet, update_ger). The bridge admin can toggle the flag via a dedicated EMERGENCY_PAUSE note type gated by assert_sender_is_bridge_admin. Closes #2696 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add "bridge is currently paused" panic condition to doc comments on all 4 guarded procedures (update_ger, register_faucet, claim, bridge_out) - Validate paused_flag is 0 or 1 in set_emergency_paused (defense-in-depth) - Update component wrapper comment to list set_emergency_paused Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Assert ERR_BRIDGE_IS_PAUSED in test_pause_blocks_update_ger - Assert ERR_SENDER_NOT_BRIDGE_ADMIN in test_non_admin_cannot_pause - Reorder set_emergency_paused re-export alphabetically with other bridge_config exports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add test_pause_blocks_register_faucet covering a second guarded entry point - Extract create_paused_bridge helper to reduce test boilerplate - Fix comment dash count in bridge.rs section header Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
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
emergency_pausedflag in bridge storage, checked at the start of all 4 entry points (bridge_out,claim,register_faucet,update_ger)set_emergency_pausedpublic procedure (bridge-admin-gated) to toggle the flagEMERGENCY_PAUSEnote type with script, Rust builder (EmergencyPauseNote), and integration testsDetails
The Solidity base bridge (
PolygonZkEVMBridgeV2.sol) inheritsEmergencyManagerwith anifNotEmergencyStatemodifier. This PR adds the equivalent for the Miden bridge:assert_not_pausedprivate procedure reads thePAUSED_SLOTand panics if non-zeroset_emergency_pausedis NOT guarded byassert_not_paused, so the admin can always unpauseCloses #2696
Test plan
cargo test -p miden-testing -- agglayer::emergency_pause(3 tests pass)cargo test -p miden-testing -- agglayer::(49 tests pass, no regressions)make lintpasses🤖 Generated with Claude Code