Skip to content

AggLayer: add emergency pause mechanism#2780

Closed
mmagician wants to merge 4 commits intommagician-claude-setupfrom
mmagician-emergency-pause
Closed

AggLayer: add emergency pause mechanism#2780
mmagician wants to merge 4 commits intommagician-claude-setupfrom
mmagician-emergency-pause

Conversation

@mmagician
Copy link
Copy Markdown
Collaborator

Summary

  • Adds emergency_paused flag in bridge storage, checked at the start of all 4 entry points (bridge_out, claim, register_faucet, update_ger)
  • Adds set_emergency_paused public procedure (bridge-admin-gated) to toggle the flag
  • Adds EMERGENCY_PAUSE note type with script, Rust builder (EmergencyPauseNote), and integration tests

Details

The Solidity base bridge (PolygonZkEVMBridgeV2.sol) inherits EmergencyManager with an ifNotEmergencyState modifier. This PR adds the equivalent for the Miden bridge:

  • assert_not_paused private procedure reads the PAUSED_SLOT and panics if non-zero
  • set_emergency_paused is NOT guarded by assert_not_paused, so the admin can always unpause
  • 3 integration tests: pause blocks update_ger, unpause restores operations, non-admin cannot pause

Closes #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 lint passes

🤖 Generated with Claude Code

@mmagician mmagician force-pushed the mmagician-emergency-pause branch from 371c800 to ed01955 Compare April 16, 2026 09:22
@mmagician mmagician changed the base branch from next to mmagician-claude-setup April 16, 2026 11:14
@mmagician mmagician force-pushed the mmagician-emergency-pause branch from ed01955 to 49c9297 Compare April 16, 2026 11:16
claude added 4 commits April 16, 2026 12:25
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>
@mmagician mmagician force-pushed the mmagician-emergency-pause branch from 49c9297 to 7d98ba2 Compare April 16, 2026 12:25
@mmagician
Copy link
Copy Markdown
Collaborator Author

mmagician commented Apr 16, 2026

superseded by #2785 (which also auto-adds the changelog or no changelog label)

@mmagician mmagician closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AggLayer: Add emergency pause mechanism

2 participants