Skip to content

feat(agglayer): add GER removal mechanism#2837

Open
partylikeits1983 wants to merge 4 commits intoagglayerfrom
ajl-remove-ger
Open

feat(agglayer): add GER removal mechanism#2837
partylikeits1983 wants to merge 4 commits intoagglayerfrom
ajl-remove-ger

Conversation

@partylikeits1983
Copy link
Copy Markdown
Contributor

@partylikeits1983 partylikeits1983 commented Apr 27, 2026

Closes #2702.

Adds a GER removal mechanism mirroring Solidity's
GlobalExitRootManagerL2SovereignChain.removeGlobalExitRoots:

  • New ger_remover role (separate from the GER manager) stored in the bridge account.
  • New remove_ger MASM proc in bridge_config.masm that asserts the sender is the GER remover, asserts the GER is currently registered, clears ger_map[ger] to [0,0,0,0], and folds the removed GER into a running keccak256 hash chain (new_chain = keccak256(prev_chain || ger)) — same shape as the existing update_cgi_chain_hash pattern in bridge_in.masm.
  • New REMOVE_GER note script + RemoveGerNote Rust helper.
  • New storage slots: ger_remover_account_id, removed_ger_hash_chain_lo, removed_ger_hash_chain_hi.
  • Three new integration tests: happy path (removes + chain advances to keccak256(0…0 || ger)), unknown-GER reverts with ERR_GER_NOT_FOUND, non-remover sender reverts with ERR_SENDER_NOT_GER_REMOVER.
  • Spec updated: replaced the GER-removal TODO with the new flow.

AggLayerBridge::new, create_bridge_account, and create_existing_bridge_account now take a third ger_remover_id argument; all existing call sites (tests + bench-transaction) updated.

@partylikeits1983 partylikeits1983 changed the title feat(agglayer): add GER removal mechanism (#2702) feat(agglayer): add GER removal mechanism Apr 27, 2026
@partylikeits1983 partylikeits1983 self-assigned this Apr 27, 2026
@partylikeits1983 partylikeits1983 force-pushed the ajl-remove-ger branch 2 times, most recently from 8ebfee1 to 82b6703 Compare April 27, 2026 16:27
Adds a `remove_ger` MASM procedure gated by a new `ger_remover` role
(separate from the existing GER manager) that revokes a previously
registered Global Exit Root and folds it into a running keccak256 hash
chain. Mirrors the Solidity sovereign-chain
`removeGlobalExitRoots` / `removedGERHashChain` pair. Adds a
`REMOVE_GER` note script, a `RemoveGerNote` Rust helper, three
integration tests, and updates the spec.
@partylikeits1983 partylikeits1983 marked this pull request as ready for review April 29, 2026 21:53
@partylikeits1983 partylikeits1983 added agglayer PRs or issues related to AggLayer bridging integration pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority labels Apr 29, 2026
partylikeits1983 and others added 3 commits April 29, 2026 22:42
Add three integration tests for the GER removal mechanism: removing a
GER from the middle of a multi-insert sequence leaves the others
registered, a second remove of the same GER reverts with
ERR_GER_NOT_FOUND, and re-inserting a previously-removed GER succeeds
without advancing the removed-GER hash chain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	crates/miden-agglayer/src/errors/agglayer.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agglayer PRs or issues related to AggLayer bridging integration pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant