AggLayer: validate destination_network on CLAIM#2759
Conversation
| const LEAF_TYPE_ADDRESS = CLAIM_LEAF_DATA_START_PTR | ||
|
|
||
| const ORIGIN_TOKEN_ADDRESS_0 = CLAIM_LEAF_DATA_START_PTR + 2 | ||
| const ORIGIN_TOKEN_ADDRESS_1 = CLAIM_LEAF_DATA_START_PTR + 3 | ||
| const ORIGIN_TOKEN_ADDRESS_2 = CLAIM_LEAF_DATA_START_PTR + 4 | ||
| const ORIGIN_TOKEN_ADDRESS_3 = CLAIM_LEAF_DATA_START_PTR + 5 | ||
| const ORIGIN_TOKEN_ADDRESS_4 = CLAIM_LEAF_DATA_START_PTR + 6 |
There was a problem hiding this comment.
that's a nice addition but the changes are unrelated to the feature described in this PR; ideally should have been a separate PR
There was a problem hiding this comment.
I agree, but I was updating this addresses anyway, and since this change is quite small, I decide to include it into this PR.
mmagician
left a comment
There was a problem hiding this comment.
LGTM, but this should land on agglayer
Optionally, you can merge as-is to next, and later cherry-pick this change in a fresh PR to agglayer branch
* refactor: add destination network check during bridge-out * docs: add inline comments to the test
Yeah, it seems it will be easier that updating the base branch, and potentially will simplify the future merge of |
Ensures CLAIM handling only accepts leaves whose AggLayer
destination_networkis Miden’s chain, in line with Solidity’s claimAsset check (#2698).The bridge stores Miden’s network ID in a new storage slot at deploy time and compares it to the piped leaf field early in
claim, before Merkle verification. Rust, MASM, SPEC, and tests are updated accordingly; Solidity vectors are aligned with the chosen Miden network ID, and the old real-tx vector is dropped since it can't use a new Miden network ID.Closes: #2698.