Skip to content

AggLayer: validate destination_network during bridge-out#2778

Open
Fumuran wants to merge 2 commits intoandrew-validate-destination-network-bridge-infrom
andrew-validate-destination-network-bridge-out
Open

AggLayer: validate destination_network during bridge-out#2778
Fumuran wants to merge 2 commits intoandrew-validate-destination-network-bridge-infrom
andrew-validate-destination-network-bridge-out

Conversation

@Fumuran
Copy link
Copy Markdown
Contributor

@Fumuran Fumuran commented Apr 15, 2026

Summary

Adds an AggLayer-aligned guard on bridge-out: a B2AGG note’s destination network ID must not equal Miden’s AggLayer network ID (MIDEN_NETWORK_ID). This matches the rule that an exit cannot target the current chain as its destination, and complements the existing CLAIM path that requires leaves to target Miden as the destination.

Changes

  • bridge_out.masm: Early in bridge_out, assert destination_network ≠ MIDEN_NETWORK_ID. New error ERR_B2AGG_DESTINATION_NETWORK_IS_MIDEN.
  • b2agg.masm / SPEC.md: Document the new failure mode in the B2AGG / bridge-out flow.
  • bridge_out.rs: test_bridge_out_fails_when_destination_is_miden_network — registered faucet, B2AGG note with AggLayerBridge::MIDEN_NETWORK_ID, expects the new error.

Closes: #2747

@Fumuran Fumuran added no changelog This PR does not require an entry in the `CHANGELOG.md` file pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority labels Apr 15, 2026
@Fumuran Fumuran marked this pull request as ready for review April 15, 2026 23:57
@mmagician mmagician added the agglayer PRs or issues related to AggLayer bridging integration label Apr 16, 2026
Copy link
Copy Markdown
Contributor

@partylikeits1983 partylikeits1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

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 no changelog This PR does not require an entry in the `CHANGELOG.md` file 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.

3 participants