Skip to content

Tracking PR for v0.14.0 release#2303

Draft
bobbinth wants to merge 111 commits intomainfrom
next
Draft

Tracking PR for v0.14.0 release#2303
bobbinth wants to merge 111 commits intomainfrom
next

Conversation

@bobbinth
Copy link
Contributor

This is a tracking PR for v0.14.0 release.

avorylli and others added 30 commits January 17, 2026 09:47
* Add ExecError wrapper for better error reporting

* Add errors module to tx_context

* Refactor execute_code to use ExecError

Updated error handling in execute_code function to use ExecError instead of ExecutionError.

* Wrap ExecutionError in ExecError for assertions

* Refactor error handling to use 'anyhow' in tests

Refactor error handling in tests to use 'anyhow' for better context management. Update function signatures to return 'anyhow::Result' instead of 'miette::Result'.

* Replace miette with anyhow for error handling

* Update lib.rs

* Update Cargo.toml

* chore: rename `ExecError` method names

* chore: remove anyhow::anyhow! error mapping

---------

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
* chore: share serde across the workspace

* chore: share tokio

* chore: unify fs-err
Co-authored-by: Bobbin Threadbare <43513081+bobbinth@users.noreply.github.com>
* feat: rename NoteInputs to NoteStorage

This commit renames the NoteInputs type to NoteStorage throughout the codebase
to better reflect that these values represent stored data associated with a note
rather than inputs.

Changes include:
- Renamed NoteInputs struct to NoteStorage
- Renamed inputs.rs to storage.rs
- Updated MAX_INPUTS_PER_NOTE to MAX_NOTE_STORAGE_ITEMS
- Updated all related method names: inputs() -> storage(), num_values() -> len(), values() -> items()
- Updated all variable names: note_inputs -> note_storage
- Updated Assembly files with new terminology
- Updated error messages and constants
- Updated documentation

Closes #1662

* chore: complete note inputs to note storage rename

Address review feedback:
- Rename INPUT_NOTE_NUM_INPUTS_OFFSET to INPUT_NOTE_STORAGE_LENGTH_OFFSET
- Rename INPUT_NOTE_INPUTS_COMMITMENT_OFFSET to INPUT_NOTE_STORAGE_COMMITMENT_OFFSET
- Rename *_NUM_INPUTS constants to *_STORAGE_LENGTH
- Rename ERR_*_WRONG_NUMBER_OF_INPUTS to ERR_*_UNEXPECTED_STORAGE_LENGTH
- Rename mint_inputs.rs to mint_storage.rs
- Update function names: parse_p2id_inputs -> parse_p2id_storage
- Update error messages to use 'note storage items' terminology
- Update test helpers and assertions

* fix: rename remaining num_expected_inputs to expected_storage_length

* chore: rename remaining note inputs references to note storage

- Rename P2ID_NOTE_NUM_INPUTS to P2ID_NOTE_STORAGE_LENGTH
- Rename RPO_CLAIM_NOTE_INPUTS_COMMITMENT to RPO_CLAIM_NOTE_STORAGE_COMMITMENT
- Update comments: "note inputs" -> "note storage"
- Update error messages to use "note storage" terminology

* address PR review comments: rename get_inputs to get_storage

Changes based on Philip's review comments:
- B2AGG.masm: B2AGG_NOTE_INPUTS_COUNT → B2AGG_NOTE_STORAGE_LEN
- B2AGG.masm: ERR_B2AGG_WRONG_NUMBER_OF_INPUTS → ERR_B2AGG_UNEXPECTED_STORAGE_LENGTH
- lib.rs: claim_inputs → claim_storage_items
- prologue.masm: INPUT_COMMITMENT → STORAGE_COMMITMENT in comment
- active_note.masm: get_inputs → get_storage procedure rename
- note.masm: various comment updates (inputs → storage)
- shared_utils/note.masm: input values → storage values
- tx_args.rs: storage_commitment |-> inputs → storage_commitment |-> storage_items
- Updated all callers of get_inputs to get_storage

* fix: correct NoteError import path after merge

* fix: update generated files and fix import order

* Apply suggestions from code review

* chore: regenerate error files

* chore: revert foreign_inputs_len change

* Apply suggestions from code review

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>

---------

Co-authored-by: Farukest <farukest@users.noreply.github.com>
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
* feat: working array

chore: simplify test

chore: be explicit about padding

* chore: add changelog entry for Array component (#2204)

* Initial plan

* chore: add changelog entry for PR 2203

Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

* fix: set_map_item no longer returns old root

* chore: change Try to TryFrom for AccountComponent

* chore: correct the docs

* chore: masm doc corrections

* chore: use BeWord instead of Word

* chore: adjust masm comment about max len

* Update crates/miden-standards/asm/account_components/array.masm

Co-authored-by: Andrey Khmuro <andrey@polygon.technology>

* chore: turn array into utility

chore: remove component code

* chore: lint, simplify test & comments

* chore: remove unnecessary comments

* chore: remove duplicated changelog entry

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Andrey Khmuro <andrey@polygon.technology>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
* feat: impl fist frontier version, add (yet buggy) test

* test: fix the test, fix the bug in algorithm

* chore: update changelog

* docs: add docs for the MMR frontier in the masm file

* refactor: update the doc comments, slightly update code

* refactor: update docs and comments, add overflow check, update test

* test: add more leaves

* test: add zero root test

* chore: rename `root` -> `expected_root`

in leaf assertion tests

* chore: lint

* chore: revert to using old dir structure

* fix: update max leaves constants and comments

* chore: regen errors file

* fix: first assert valid u32, only then u32lte

---------

Co-authored-by: Marti <marti@miden.team>
…2312)

* feat: impl fist frontier version, add (yet buggy) test

* test: fix the test, fix the bug in algorithm

* chore: update changelog

* docs: add docs for the MMR frontier in the masm file

* refactor: update the doc comments, slightly update code

* refactor: update docs and comments, add overflow check, update test

* test: add more leaves

* test: add zero root test

* chore: rename `root` -> `expected_root`

in leaf assertion tests

* chore: lint

* chore: revert to using old dir structure

* feat: generate test vectors with foundry

* feat: use agglayer submodule instead of copying source files

* chore: use generated test vectors in compat tests

* chore: remove the human-readable fn

* chore: split test vectors

into leaf<>root<>count paris; and canonical zeros

* chore: remove unnecessary metadata

* chore: cleanup readme

* changelog

* chore: ignore submodule from typos check

* chore: exclude submodule from toml fmt

* fix: update max leaves constants and comments

* chore: regen errors file

* refactor: use foundry cheatcode (#2314)

* chore: use workspace serde dep

* chore: cleanup changelog

---------

Co-authored-by: Andrey Khmuro <akhmuro@gmail.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
* feat: add leafType param

fix after merge

* changelog
* feat: UPDATE_GER note outline

* feat: working update ger note

* chore: swap upper, lower GER parts

* lint: regen error file
Farukest and others added 30 commits February 17, 2026 13:58
…ters (#2420)

The previous limit of 6 characters (48 bits) was unnecessarily restrictive
compared to other blockchains (Solana: 10, Algorand: 8, Ethereum: unlimited).
Since uppercase-only encoding (base-26) fits up to 12 characters within a
single field element, the limit is increased to 12.

Closes #2406

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
* wip: u256 to felt scaling procedure

* refactor: pass quotient via stack

* refactor: procedure comments

* refactor: modify tests & use assertz

* refactor: cleanup test helper inputs

* refactor: cleanup tests

* feat: add inline sanity check test

* refactor: cleanup test

* refator: simplify and rename to verify_u256_to_native_amount_conversion

* refactor: import FUNGIBLE_ASSET_MAX_AMOUNT & use word::eqz

* revert: rename to try_to_u64

* refactor: use Felt::MODULUS

* refactor: simplify EthAmount

* refactor: rename EthAmountError variants

* refactor: renamed functions and refactored errors & conversion

* fix: taplo fmt

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* chore: clean up EthAmountError enum and improve docs

* refactor: cleanup doc comments and test case

* refactor: use existing error messages

* fix: update global_index to use little-endian format

* fix: clean up test_utils and crypto_utils files with agglayer-new changes

* fix: rm unused function

* chore: merge agglayer-new

* feat: encorporate endianness reveral procedure

* feat: clean up tests & add fuzzing test

* refactor: add byte ordering comment & add testing attribute for from_u256

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* Update crates/miden-testing/tests/agglayer/asset_conversion.rs

Co-authored-by: Marti <marti@miden.team>

* refactor: cleanup fuzzing test & address comments

* chore: use EthAmount directly in tests (#2455)

---------

Co-authored-by: Marti <marti@miden.team>
…ry (#2425)

* chore: unify b2agg note storage layout with claim note

* chore: clarify destinationAddress in CLAIM note

* feat: mem_store_double_word_unaligned

* feat: compute leaf value for bridging out

* chore: update comment about origin network ID

* fix: write_address_to_memory had incorrect address arithmetic

The add.N values should all be add.1 (incrementing the running
pointer by 1 each time), not add.1, add.2, add.3, add.4 which
caused addresses to skip (P, P+1, P+3, P+6, P+10 instead of
P, P+1, P+2, P+3, P+4).

Also includes byte-order fixes (u256_le_to_abi, swap_u32_bytes
for originNetwork and leafType) and test infrastructure for
verifying the root against Solidity vectors.

Status: the MMR root computation via call is verified correct
(test_mmr_append_via_call passes). The write_address_to_memory
fix changed the bridge_out root. Still investigating a remaining
mismatch related to u256_le_to_abi + mem_store_double_word_unaligned
interaction.

Co-authored-by: marti <marti@hungrycats.studio>

* fix: handling of dest address and ID in B2AGG

* feat: reverse_limbs_and_change_byte_endianness

* chore: integrate byte and limb swapping to bridging

* fix: swap origin net ID endianness; rearrange mem writes

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: pad mem with zeros after metadata

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… `assert_valid_ger` (#2388)

* chore: unit test for compute_ger

* fix: use LE byte<>felt conversion

* chore: inline bytes32_to_felts into callers

* fixup! fix: use LE byte<>felt conversion

* Update crates/miden-testing/tests/agglayer/update_ger.rs

* chore: unify underlying repr, use type aliases

* feat: store GER hash in a map

* feat: check GER in storage

* chore: rename to GER_KNOWN_FLAG

* Apply suggestions from code review

* chore: reduce inline comments

* changelog

* chore: use constants on Felt

* fix: reverse felt order within word after hashing

* chore: generate GER test vectors

* chore: integrate GER vectors to compute_ger test

* chore: add expected GER in bridge-in test

* Revert "fix: reverse felt order within word after hashing"

This reverts commit 61852a9.

* fix: reverse felt order before Hasher::merge

* Update crates/miden-agglayer/solidity-compat/test/ExitRoots.t.sol

* chore: add comments re: rpo256:merge stack ordering
…d update it upon `B2AGG` consumption (#2424)

* chore: unify b2agg note storage layout with claim note

* chore: clarify destinationAddress in CLAIM note

* feat: mem_store_double_word_unaligned

* feat: compute leaf value for bridging out

* chore: update comment about origin network ID

* fix: write_address_to_memory had incorrect address arithmetic

The add.N values should all be add.1 (incrementing the running
pointer by 1 each time), not add.1, add.2, add.3, add.4 which
caused addresses to skip (P, P+1, P+3, P+6, P+10 instead of
P, P+1, P+2, P+3, P+4).

Also includes byte-order fixes (u256_le_to_abi, swap_u32_bytes
for originNetwork and leafType) and test infrastructure for
verifying the root against Solidity vectors.

Status: the MMR root computation via call is verified correct
(test_mmr_append_via_call passes). The write_address_to_memory
fix changed the bridge_out root. Still investigating a remaining
mismatch related to u256_le_to_abi + mem_store_double_word_unaligned
interaction.

Co-authored-by: marti <marti@hungrycats.studio>

* fix: handling of dest address and ID in B2AGG

* feat: reverse_limbs_and_change_byte_endianness

* chore: integrate byte and limb swapping to bridging

* fix: swap origin net ID endianness; rearrange mem writes

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: pad mem with zeros after metadata

* feat: store LET frontier in double-word array

* feat: frontier test generation from param"d leaves

* feat: verify computed LER against expected root

* write leaf"s amounts to JSON

* fix: compare LET by elements, rev elements per word

* chore: Replace `unwrap()` with `expect()` for StorageSlotName parsing (#2451)

* Initial plan

* chore: replace unwrap() with expect() for storage slot names

Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

* Update crates/miden-testing/tests/agglayer/bridge_out.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: move (de)ser logic to test_utils

* chore: organize test_utils better

Signed-off-by: Marti <marti@miden.team>

* chore: serialize amounts as strings in mmr test vecs

Signed-off-by: Marti <marti@miden.team>

* test bridge_out frontier persistence across two consumes

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* fix bridge_out frontier reload num_leaves endianness

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* test bridge_out with shared multi-note helper and 32-leaf case

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* refactor bridge_out coverage to direct 32-leaf burn flow

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* refactor MMR vectors to seeded per-leaf destinations

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* chore: cleanup tests

Signed-off-by: Marti <marti@miden.team>

---------

Signed-off-by: Marti <marti@miden.team>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* chore: unify b2agg note storage layout with claim note

* chore: clarify destinationAddress in CLAIM note

* feat: mem_store_double_word_unaligned

* feat: compute leaf value for bridging out

* chore: update comment about origin network ID

* fix: write_address_to_memory had incorrect address arithmetic

The add.N values should all be add.1 (incrementing the running
pointer by 1 each time), not add.1, add.2, add.3, add.4 which
caused addresses to skip (P, P+1, P+3, P+6, P+10 instead of
P, P+1, P+2, P+3, P+4).

Also includes byte-order fixes (u256_le_to_abi, swap_u32_bytes
for originNetwork and leafType) and test infrastructure for
verifying the root against Solidity vectors.

Status: the MMR root computation via call is verified correct
(test_mmr_append_via_call passes). The write_address_to_memory
fix changed the bridge_out root. Still investigating a remaining
mismatch related to u256_le_to_abi + mem_store_double_word_unaligned
interaction.

Co-authored-by: marti <marti@hungrycats.studio>

* fix: handling of dest address and ID in B2AGG

* feat: reverse_limbs_and_change_byte_endianness

* chore: integrate byte and limb swapping to bridging

* fix: swap origin net ID endianness; rearrange mem writes

Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: pad mem with zeros after metadata

* feat: store LET frontier in double-word array

* feat: frontier test generation from param"d leaves

* feat: verify computed LER against expected root

* write leaf"s amounts to JSON

* fix: compare LET by elements, rev elements per word

* feat: add faucet registry

* chore: CONFIG note docs

* chore: simplify creation of existing agg faucet w/supply

* lint

* chore: TODO on bridge admin validation

* chore: simplify stack operations

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

* chore: Replace `unwrap()` with `expect()` for StorageSlotName parsing (#2451)

* Initial plan

* chore: replace unwrap() with expect() for storage slot names

Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

* Update crates/miden-testing/tests/agglayer/bridge_out.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: only truncate at the end

* chore: move (de)ser logic to test_utils

* chore: organize test_utils better

Signed-off-by: Marti <marti@miden.team>

* chore: serialize amounts as strings in mmr test vecs

Signed-off-by: Marti <marti@miden.team>

* test bridge_out frontier persistence across two consumes

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* fix bridge_out frontier reload num_leaves endianness

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* test bridge_out with shared multi-note helper and 32-leaf case

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* refactor bridge_out coverage to direct 32-leaf burn flow

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* refactor MMR vectors to seeded per-leaf destinations

Co-authored-by: marti <marti@hungrycats.studio>
Signed-off-by: Marti <marti@miden.team>

* chore: cleanup tests

Signed-off-by: Marti <marti@miden.team>

* fix: rustfmt line wrapping + clippy needless_range_loop

Co-authored-by: marti <marti@hungrycats.studio>

* fix: read addr conversion slot in reverse

* chore: use non-zero address

* chore: rename loc const to distinguish

* chore: use loc const in create_burn_note

* chore: bring back doc and inline comments

---------

Signed-off-by: Marti <marti@miden.team>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* feat: implement P2ID and P2IDE note storage structures with validation

* feat: enhance P2ID note storage with improved account ID handling and validation

* feat: refine P2IDE note storage structure and improve field naming for clarity

* feat: add P2idNoteStorage and P2ideNoteStorage to changelog

* fix: update changelog to include P2idNoteStorage and P2ideNoteStorage pull request reference

* feat: add tests for P2idNoteStorage and P2ideNoteStorage validation and decoding

* refactor: simplify test code by consolidating vector initialization for P2idNoteStorage and P2ideNoteStorage

* feat: add P2ideNoteStorage for improved note handling and update related tests

* feat: enhance NoteError handling with detailed messages for invalid note storage

* feat: enhance NoteError handling with detailed messages for invalid note storage

* feat: improve error handling in P2idNoteStorage and P2ideNoteStorage for invalid note storage

* feat: enhance documentation for P2ideNote and P2ideNoteStorage structures

* fix: reorder imports for consistency in test file

* feat: implement P2ID and P2IDE note storage handling with improved error management

* feat: refactor P2ID and P2IDE note recipient creation to use storage directly

* refactor: simplify consumable height calculation and improve error message for P2IDE note storage validation

* test: enhance error message assertions for note consumability static analysis

* refactor: update error handling for P2ID and P2IDE note storage to use more descriptive messages

* feat: update P2ID and P2IDE note storage to use dynamic item counts

* feat: integrate P2idNoteStorage for recipient creation in P2ID tests

* Apply suggestions from code review

* Update crates/miden-testing/src/kernel_tests/tx/test_account_interface.rs

---------

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
* feat: add DEFAULT_TAG constant to note_tag MASM module

Add a public DEFAULT_TAG = 0 constant to the note_tag standards module.
This is the default note tag value for notes that rely on attachments
rather than tags for targeting.

Co-authored-by: marti <marti@hungrycats.studio>

* docs: add changelog entry for DEFAULT_TAG constant (#2482)

Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Bobbin Threadbare <43513081+bobbinth@users.noreply.github.com>
…m data (#2474)

* feat: add solidity-compat test for generating local claimAsset() param data

* refactor: rename solidity compat test files & claimAsset vector JSON files

* refactor: rename testing methods & update test comments

* Update crates/miden-testing/tests/agglayer/bridge_in.rs

* Update crates/miden-testing/tests/agglayer/bridge_in.rs
* refactor: address review nits from PR #2474

- Add `ClaimDataSource::get_data()` method so the match is encapsulated
  in the enum rather than inlined in the test body
- Extract `claim_data_from_vector()` helper to deduplicate the shared
  logic between `real_claim_data()` and `local_claim_data()`
- Fix `.json.json` double-extension typo in `ClaimDataSource::Real` doc
- Extract `_computeCanonicalZeros()` and `_generateLocalProof()` helpers
  in `SMTMerkleProofVectors.t.sol`, mirroring `ClaimAssetTestVectorsLocalTx`,
  and replace the inline loop with calls to these helpers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: address follow-up review comments on PR #2489

- Move `ClaimDataSource` into `test_utils.rs` so its `get_data()` method
  can select the right lazy static directly, removing the now-unnecessary
  `real_claim_data()` and `local_claim_data()` public helpers
- Extract `_computeCanonicalZeros` and `_generateLocalProof` into a new
  `DepositContractTestHelpers` abstract contract; both
  `SMTMerkleProofVectors` and `ClaimAssetTestVectorsLocalTx` now inherit
  from it instead of each defining their own copies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…LAIM` note (#2460)

* feat: add native asset claim amount as element in NoteStorage of CLAIM note

* feat: add output note assertion checks

* refactor: rm debug statement

* Update crates/miden-testing/tests/agglayer/bridge_in.rs

Co-authored-by: Marti <marti@miden.team>

* refactor: cleanup test & rm leftover comments

* wip: consume P2ID by destination AccountId

* feat: add solidity-compat test for generating local claimAsset() param data

* feat: add solidity-compat test for generating local claimAsset() param data

* feat: consume output P2ID note from CLAIM note

* fix: taplo fmt

* refactor: rename solidity compat test files & claimAsset vector JSON files

* refactor: rename testing methods & update test comments

* Update crates/miden-testing/tests/agglayer/bridge_in.rs

* Update crates/miden-testing/tests/agglayer/bridge_in.rs

* refactor: add warnings in comments & update TODO regarding u256 scaling

* refactor: assert mock destination account ID matches claim data

* fix: load amount BE-felt from mem

---------

Co-authored-by: Marti <marti@miden.team>
* single sig

* change AuthScheme, AuthSingleSig, AuthSingleSigAcl, AuthMultisig

* fix cleanup_pubkey & update_signers_and_thresholds for multisig

* add ERR_INVALID_SCHEME_ID message to standard errors

* fmt

* changelog

* clippy fmt

* fix documentation

* change scheme_id for Falcon

* add hybrid multisig tests

* fmt

* fix documentation

* add threshold validations for key rotation

* fix error standards

* add helper procedures for multisig

* fix tests

* fix conflict

* fix documentation

* fmt

* fix standards error format

* fmt

* rename miden_standars::AuthScheme -> miden_standards::AuthMethod

* fix new p2id test

* change u8 to AuthScheme in SingleSig and SingleSigAcl

* refactor Multisig u8 -> AuthScheme

* Execute FPI with one `syscall` (#2408)

* refactor: rework kernel proc invocations during FPI

* test: update FPI tests to check the new memory

* chore: tiny comment fix

* refactor: compress bookkeeping section, move upcoming pointers before stack

* refactor: organize the prefix/suffix ordering

* refactor: move api helpers to tx, move zero ID check to exec_foreign_proc, import constants

* refactor: make tx_exec_foreign_proc to be invoked with dynexec

* refactor: store 16th element instead of 1st

* refactor: add ID validation, update doc comments, rename tx_prepare_fpi_call

* refactor: update doc comments, update constant name

* test: create test to check all 16 FP input values, fix bug

* test: assert the forieign procedure outputs

* refactor: reset foreign data after FPI, move foregin account validation

---------

Co-authored-by: Bobbin Threadbare <43513081+bobbinth@users.noreply.github.com>

* chore: reorder account ID and nonce memory and advice layout (#2442)

* chore: reorder account ID limbs in advice inputs

* chore: rename native account ID -> global account ID

* chore: reorder fee parameter word

* chore: implement SequentialCommit for `AccountHeader`

* chore: add changelog

* fix: docs

* chore: store global account ID individually instead of in word

* chore: introduce `account_id::create_key`

* chore: move `account_id::create_key` to `account::create_id_key`

* chore: add missing import

* merge conflicts

* rename auth_tx

* add constants to masm & fix locals

* fix scheme_id constants to auth_scheme

* fix masm comments & add error messages

* fix storage slots comments

* refactor APPROVER_SCHEME_ID_SLOT to [key_index, 0, 0, 0] => [scheme_id, 0, 0, 0]

* fmt

* clippy and std errors

* fix documentation

* fmt

* fix documentation

* apply masm suggestions

* refactor type registry

* fix scheme -> method naming

* fix comments

* add rstest and consolidate multisig tests

* refactor and consolidate acl and multisig tests

* refactor is_signer

* simplify is_signer loop

* fmt

* feat: add `make test-release` command running without debug mode (#2448)

* feat: add test make command without debug mode

* chore: switch CI test to use `make testf`

* chore: test bench building in debug mode

* fix: unnecessary rebuilds

* chore: revert fix in protocol and standards

* chore: rename `make testf` to `make test-release`

* Revert "chore: revert fix in protocol and standards"

This reverts commit 3471c7b.

* feat: increase `TokenSymbol` max length from 6 to 12 uppercase characters (#2420)

The previous limit of 6 characters (48 bits) was unnecessarily restrictive
compared to other blockchains (Solana: 10, Algorand: 8, Ethereum: unlimited).
Since uppercase-only encoding (base-26) fits up to 12 characters within a
single field element, the limit is increased to 12.

Closes #2406

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>

* chore: Remove BlockSigner trait (#2447)

* feat: account builder helper for schema commitment (#2419)

* Add `P2idNoteStorage` and `P2ideNoteStorage` (#2389)

* feat: implement P2ID and P2IDE note storage structures with validation

* feat: enhance P2ID note storage with improved account ID handling and validation

* feat: refine P2IDE note storage structure and improve field naming for clarity

* feat: add P2idNoteStorage and P2ideNoteStorage to changelog

* fix: update changelog to include P2idNoteStorage and P2ideNoteStorage pull request reference

* feat: add tests for P2idNoteStorage and P2ideNoteStorage validation and decoding

* refactor: simplify test code by consolidating vector initialization for P2idNoteStorage and P2ideNoteStorage

* feat: add P2ideNoteStorage for improved note handling and update related tests

* feat: enhance NoteError handling with detailed messages for invalid note storage

* feat: enhance NoteError handling with detailed messages for invalid note storage

* feat: improve error handling in P2idNoteStorage and P2ideNoteStorage for invalid note storage

* feat: enhance documentation for P2ideNote and P2ideNoteStorage structures

* fix: reorder imports for consistency in test file

* feat: implement P2ID and P2IDE note storage handling with improved error management

* feat: refactor P2ID and P2IDE note recipient creation to use storage directly

* refactor: simplify consumable height calculation and improve error message for P2IDE note storage validation

* test: enhance error message assertions for note consumability static analysis

* refactor: update error handling for P2ID and P2IDE note storage to use more descriptive messages

* feat: update P2ID and P2IDE note storage to use dynamic item counts

* feat: integrate P2idNoteStorage for recipient creation in P2ID tests

* Apply suggestions from code review

* Update crates/miden-testing/src/kernel_tests/tx/test_account_interface.rs

---------

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>

* merge next

* fmt

* fix schema commitment storage error

* fix comments

* fix comments

* fix naming

* fmt

* add approvers: Vec<(PublicKeyCommitment, AuthScheme)>

---------

Co-authored-by: Bobbin Threadbare <43513081+bobbinth@users.noreply.github.com>
Co-authored-by: Andrey Khmuro <andrey@polygon.technology>
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
Co-authored-by: Farukest <abdullahfarukozden@gmail.com>
Co-authored-by: Serge Radinovich <47865535+sergerad@users.noreply.github.com>
Co-authored-by: igamigo <ignacio.amigo@lambdaclass.com>
Co-authored-by: Nikhil Patil <nikhil876706@gmail.com>
…DGE` & `UPDATE_GER` (resp. `BURN`) notes

* chore: tracking empty commit

* feat(AggLayer): validate `CONFIG_AGG_BRIDGE` and `UPDATE_GER` note senders are authorized entities (#2479)

* feat: validate CONFIG_AGG_BRIDGE and UPDATE_GER note senders

Add sender validation to ensure only authorized entities can update
bridge configuration or the global exit root. Two distinct roles are
enforced:

- **Bridge admin** (BRIDGE_ADMIN_SLOT): authorized to register faucets
  via CONFIG_AGG_BRIDGE notes
- **Global exit root manager** (GER_MANAGER_SLOT): authorized to update
  the GER via UPDATE_GER notes

Changes:
- Add BRIDGE_ADMIN_SLOT and GER_MANAGER_SLOT storage slots to bridge account
- Add assert_sender_is_bridge_admin account procedure in bridge_config
- Add assert_sender_is_ger_manager account procedure in bridge_config
- Export both procedures from the bridge component
- CONFIG_AGG_BRIDGE calls assert_sender_is_bridge_admin
- UPDATE_GER calls assert_sender_is_ger_manager
- Update create_bridge_account to accept bridge_admin_id and ger_manager_id
- Update all tests accordingly

Closes #2450
Closes #2467

Co-authored-by: marti <marti@hungrycats.studio>

* test: use distinct bridge_admin and ger_manager accounts in all tests

Create separate wallet accounts for bridge admin and GER manager roles
in every test, even when only one role is exercised. This makes the
role distinction explicit and avoids accidentally relying on both
roles sharing the same identity.

Co-authored-by: marti <marti@hungrycats.studio>

* lints

* fix: order of stack comments; simplify ops

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* feat: create BURN note with NetworkAccountTarget attachment (#2481)

* feat: create BURN note with NetworkAccountTarget attachment

Replace NoteTag-based targeting with NetworkAccountTarget attachment for
BURN notes created by bridge_out. The BURN note now uses:
- A NetworkAccountTarget attachment to specify the faucet as target
- A simple tag (0) instead of note_tag::create_account_target
- set_attachment is called right after note creation, using a dup'd
  note_idx so no local is needed to save it

Changes:
- bridge_out.masm: use network_account_target::new + output_note::set_attachment
  instead of note_tag::create_account_target
- bridge_out test: verify attachment target instead of NoteTag

Closes #2470

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: use DEFAULT_TAG constant and set_attachment in create_burn_note

Replace the local BURN_NOTE_TAG constant with the DEFAULT_TAG constant
from the note_tag standards module (re-declared locally since MASM does
not support cross-module constant references in push).

Save attachment_scheme and attachment_kind to locals and use
set_attachment instead of set_word_attachment.

Co-authored-by: marti <marti@hungrycats.studio>

* Apply suggestions from code review

Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>

* Apply suggestion from @partylikeits1983

Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>

* feat(standards): add NoteExecutionHint constants to MASM standards

Add `note/execution_hint.masm` under the standards library exposing the
four NoteExecutionHint variants as public constants:

- NONE = 0
- ALWAYS = 1
- AFTER_BLOCK = 2  (tag bits only; payload must be composed at runtime)
- ON_BLOCK_SLOT = 3  (tag bits only; payload must be composed at runtime)

These mirror the `NONE_TAG` / `ALWAYS_TAG` / `AFTER_BLOCK_TAG` /
`ON_BLOCK_SLOT_TAG` internal constants from the Rust
`NoteExecutionHint` implementation and allow MASM callers to reference
them via `use miden::standards::note::execution_hint::ALWAYS` (etc.)
rather than duplicating magic numbers locally.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor(agglayer): import ALWAYS execution hint from standards library

Replace the locally-defined `EXECUTION_HINT_ALWAYS = 1` constants with
the canonical `ALWAYS` constant from `miden::standards::note::execution_hint`.

- `bridge_out.masm`: add `use miden::standards::note::execution_hint::ALWAYS`,
  drop local const, update `push.EXECUTION_HINT_ALWAYS` → `push.ALWAYS`
- `agglayer_faucet.masm`: drop dead `EXECUTION_HINT_ALWAYS = 1` (was defined
  but never referenced in the file)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: lowercase `.expect()` messages in agglayer code (#2491)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…r lib from bridge & faucet components libs

* feat: add native asset claim amount as element in NoteStorage of CLAIM note

* feat: add output note assertion checks

* refactor: rm debug statement

* Update crates/miden-testing/tests/agglayer/bridge_in.rs

Co-authored-by: Marti <marti@miden.team>

* refactor: cleanup test & rm leftover comments

* empty commit

* Agglayer: restructure the `asm` directory: clear split between library, components, notes (#2471)

* refactor: restructure miden-agglayer asm directory with per-component libraries

Restructure the agglayer asm directory to follow the miden-standards
pattern, addressing the security vulnerability where all component
library functions returned the same unified library, causing bridge
accounts to expose faucet procedures and vice versa.

Changes:
- Move asm/bridge/ files to asm/agglayer/bridge/ subdirectory
- Rename agglayer_faucet.masm to asm/agglayer/faucet/mod.masm
- Create thin component wrappers in asm/components/ (bridge.masm,
  faucet.masm) that pub use only relevant procedures
- Update build.rs to compile main library from asm/agglayer/, then
  compile per-component libraries from asm/components/
- Update lib.rs with per-component LazyLock libraries so bridge_*_library()
  returns the bridge component library and faucet_library() returns the
  faucet component library
- Update all MASM namespace references (miden::agglayer::X to
  miden::agglayer::bridge::X, agglayer_faucet to faucet)
- Update Rust test files with new namespace paths

Closes #2294

Co-authored-by: marti <marti@hungrycats.studio>

* fix: address CI failures (rustfmt and changelog)

- Fix rustfmt line length issue in mmr_frontier.rs test strings
- Add CHANGELOG.md entry for the asm directory restructuring

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: consolidate component library API

- Remove bridge_out_library, bridge_in_library, local_exit_tree_library
  aliases; keep a single agglayer_bridge_library()
- Remove faucet_library alias; keep a single agglayer_faucet_library()
- Replace separate bridge_out_component/bridge_in_component/
  local_exit_tree_component with a single bridge_component()
- Remove bridge_out_with_local_exit_tree_component convenience function
- Consolidate create_bridge_account_builder to use one bridge_component
  with all storage slots combined

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: move update_ger to bridge_config and shared modules to common/

- Move update_ger procedure from bridge_in.masm to bridge_config.masm,
  since it is a bridge configuration operation alongside register_faucet
- Move utils.masm, asset_conversion.masm, eth_address.masm from
  agglayer/bridge/ to agglayer/common/ since they are shared between
  bridge and faucet modules
- Update all MASM use statements and Rust test strings to reflect
  the new module paths (bridge::utils -> common::utils, etc.)
- Update component wrapper and note script references accordingly

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: move bridge_in-specific procs out of crypto_utils

Move procedures that are only called from bridge_in.masm out of the
shared crypto_utils.masm module:
- get_leaf_value: loads leaf data from advice map, delegates to
  compute_leaf_value
- compute_ger: computes GER from mainnet/rollup exit roots
- verify_merkle_proof: verifies a Keccak-based Merkle proof
- calculate_root: private helper for verify_merkle_proof

crypto_utils.masm now only contains compute_leaf_value and pack_leaf_data,
which are genuinely shared between bridge_in and bridge_out.

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: deduplicate storage slot constants into bridge_config

Move GER and faucet registry storage management into bridge_config.masm
to eliminate duplicate constant definitions:

- Move assert_valid_ger from bridge_in to bridge_config as a pub proc,
  so GER_STORAGE_SLOT and GER_KNOWN_FLAG are defined only in bridge_config
- Add assert_faucet_registered to bridge_config as a pub proc, so
  FAUCET_REGISTRY_SLOT is defined only in bridge_config
- bridge_in now calls bridge_config::assert_valid_ger
- bridge_out now calls bridge_config::assert_faucet_registered instead
  of inlining the registry lookup

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: rename crypto_utils to leaf_utils

The module now only contains compute_leaf_value and pack_leaf_data,
so leaf_utils better describes its purpose.

Co-authored-by: marti <marti@hungrycats.studio>

* chore: remove unused local exit tree mod

* chore: remove getters from interface

* refactor: move verify_merkle_proof test to bridge_in module

Move solidity_verify_merkle_proof_compatibility test and its helper
from leaf_utils.rs to bridge_in.rs, since verify_merkle_proof now
lives in bridge_in. Drop the 'test_' prefix from the name.

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: standardize file organization across all agglayer MASM files

Apply consistent section ordering to all MASM files:
1. Imports (use statements, alphabetized)
2. Type aliases
3. Errors
4. Constants (grouped: storage slots, memory pointers, data offsets,
   local memory offsets, data sizes, flags/other)
5. Public interface (pub proc)
6. Helper procedures (private proc)

Files reorganized:
- bridge_config.masm: separate storage slots from flags, errors first
- bridge_in.masm: group memory pointers, local offsets, data sizes
- bridge_out.masm: group LET storage slots, memory pointers, leaf
  data offsets, local memory offsets, and other constants into
  labeled blocks
- common/eth_address.masm: errors before constants, public interface
  before helper procs
- common/asset_conversion.masm: errors before constants
- faucet/mod.masm: group storage slots, memory pointers, local memory
  offsets, data sizes, and note constants; public interface before
  helpers

Co-authored-by: marti <marti@hungrycats.studio>

* Apply suggestions from code review

dont need such verbosity

* chore: remove dead code; make functions private

* chore: use ZERO instead of Felt::new(0)

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* refactor(agglayer): encapsulate faucet and bridge in structs (#2478)

* refactor: restructure miden-agglayer asm directory with per-component libraries

Restructure the agglayer asm directory to follow the miden-standards
pattern, addressing the security vulnerability where all component
library functions returned the same unified library, causing bridge
accounts to expose faucet procedures and vice versa.

Changes:
- Move asm/bridge/ files to asm/agglayer/bridge/ subdirectory
- Rename agglayer_faucet.masm to asm/agglayer/faucet/mod.masm
- Create thin component wrappers in asm/components/ (bridge.masm,
  faucet.masm) that pub use only relevant procedures
- Update build.rs to compile main library from asm/agglayer/, then
  compile per-component libraries from asm/components/
- Update lib.rs with per-component LazyLock libraries so bridge_*_library()
  returns the bridge component library and faucet_library() returns the
  faucet component library
- Update all MASM namespace references (miden::agglayer::X to
  miden::agglayer::bridge::X, agglayer_faucet to faucet)
- Update Rust test files with new namespace paths

Closes #2294

Co-authored-by: marti <marti@hungrycats.studio>

* fix: address CI failures (rustfmt and changelog)

- Fix rustfmt line length issue in mmr_frontier.rs test strings
- Add CHANGELOG.md entry for the asm directory restructuring

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: consolidate component library API

- Remove bridge_out_library, bridge_in_library, local_exit_tree_library
  aliases; keep a single agglayer_bridge_library()
- Remove faucet_library alias; keep a single agglayer_faucet_library()
- Replace separate bridge_out_component/bridge_in_component/
  local_exit_tree_component with a single bridge_component()
- Remove bridge_out_with_local_exit_tree_component convenience function
- Consolidate create_bridge_account_builder to use one bridge_component
  with all storage slots combined

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: move update_ger to bridge_config and shared modules to common/

- Move update_ger procedure from bridge_in.masm to bridge_config.masm,
  since it is a bridge configuration operation alongside register_faucet
- Move utils.masm, asset_conversion.masm, eth_address.masm from
  agglayer/bridge/ to agglayer/common/ since they are shared between
  bridge and faucet modules
- Update all MASM use statements and Rust test strings to reflect
  the new module paths (bridge::utils -> common::utils, etc.)
- Update component wrapper and note script references accordingly

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: move bridge_in-specific procs out of crypto_utils

Move procedures that are only called from bridge_in.masm out of the
shared crypto_utils.masm module:
- get_leaf_value: loads leaf data from advice map, delegates to
  compute_leaf_value
- compute_ger: computes GER from mainnet/rollup exit roots
- verify_merkle_proof: verifies a Keccak-based Merkle proof
- calculate_root: private helper for verify_merkle_proof

crypto_utils.masm now only contains compute_leaf_value and pack_leaf_data,
which are genuinely shared between bridge_in and bridge_out.

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: deduplicate storage slot constants into bridge_config

Move GER and faucet registry storage management into bridge_config.masm
to eliminate duplicate constant definitions:

- Move assert_valid_ger from bridge_in to bridge_config as a pub proc,
  so GER_STORAGE_SLOT and GER_KNOWN_FLAG are defined only in bridge_config
- Add assert_faucet_registered to bridge_config as a pub proc, so
  FAUCET_REGISTRY_SLOT is defined only in bridge_config
- bridge_in now calls bridge_config::assert_valid_ger
- bridge_out now calls bridge_config::assert_faucet_registered instead
  of inlining the registry lookup

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: rename crypto_utils to leaf_utils

The module now only contains compute_leaf_value and pack_leaf_data,
so leaf_utils better describes its purpose.

Co-authored-by: marti <marti@hungrycats.studio>

* chore: remove unused local exit tree mod

* chore: remove getters from interface

* refactor: move verify_merkle_proof test to bridge_in module

Move solidity_verify_merkle_proof_compatibility test and its helper
from leaf_utils.rs to bridge_in.rs, since verify_merkle_proof now
lives in bridge_in. Drop the 'test_' prefix from the name.

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: standardize file organization across all agglayer MASM files

Apply consistent section ordering to all MASM files:
1. Imports (use statements, alphabetized)
2. Type aliases
3. Errors
4. Constants (grouped: storage slots, memory pointers, data offsets,
   local memory offsets, data sizes, flags/other)
5. Public interface (pub proc)
6. Helper procedures (private proc)

Files reorganized:
- bridge_config.masm: separate storage slots from flags, errors first
- bridge_in.masm: group memory pointers, local offsets, data sizes
- bridge_out.masm: group LET storage slots, memory pointers, leaf
  data offsets, local memory offsets, and other constants into
  labeled blocks
- common/eth_address.masm: errors before constants, public interface
  before helper procs
- common/asset_conversion.masm: errors before constants
- faucet/mod.masm: group storage slots, memory pointers, local memory
  offsets, data sizes, and note constants; public interface before
  helpers

Co-authored-by: marti <marti@hungrycats.studio>

* Apply suggestions from code review

dont need such verbosity

* chore: remove dead code; make functions private

* chore: use ZERO instead of Felt::new(0)

* refactor(agglayer): encapsulate faucet and bridge in structs, make helpers private

- Add AggLayerBridge and AggLayerFaucet structs with new() and From for AccountComponent
- Use TokenMetadata for faucet metadata slot instead of hardcoded layout
- Make internal helpers private: agglayer_bridge_library, agglayer_faucet_library,
  create_agglayer_faucet_component, create_bridge_account_builder,
  create_agglayer_faucet_builder

Closes #2371

Co-authored-by: marti <marti@hungrycats.studio>

* lint

* chore: slot name getters; improve struct docs

* chore: use slot getters in tests

* Update crates/miden-agglayer/src/lib.rs

Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>

---------

Co-authored-by: riemann <aleqvids@gmail.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Marti <marti@miden.team>
…tachment, not `NoteStorage` (#2480)

* refactor: enforce CLAIM note consumer via NetworkAccountTarget attachment

Replace the storage-based assert_aggfaucet_is_consumer check with the
standard network_account_target::active_account_matches_target_account
attachment check, unifying how all agglayer note scripts enforce their
target consumer.

The CLAIM note already carries the target faucet ID in its
NetworkAccountTarget attachment (set during note creation in Rust).
This change makes the note script use that attachment for the consumer
check instead of reading target_faucet_account_id from note storage.

Closes #2468

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: remove target_faucet_account_id from CLAIM NoteStorage

Now that the consumer check uses the NetworkAccountTarget attachment,
the target_faucet_account_id no longer needs to be serialized into
NoteStorage. The field is kept in OutputNoteData (used to build the
attachment in Rust) but excluded from to_elements().

The OutputNoteData memory layout changes from:
  [serial_num(4), faucet_id(2), tag(1), amount(1)]
to:
  [serial_num(4), tag(1), amount(1), padding(2)]

Updated MASM constants:
- OUTPUT_NOTE_TAG_MEM_ADDR: 574 -> 572
- OUTPUT_NOTE_FAUCET_AMOUNT: 575 -> 573

Co-authored-by: marti <marti@hungrycats.studio>

* refactor: move target_faucet_id out of OutputNoteData into create_claim_note param

The target faucet account ID is only needed to build the
NetworkAccountTarget attachment, not as part of the note storage data.
Move it from OutputNoteData to a direct parameter of create_claim_note.

Co-authored-by: marti <marti@hungrycats.studio>

* lint

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
…2511)

* refactor: move sender authorization from note scripts into account procedures

Sender authorization for UPDATE_GER and CONFIG_AGG_BRIDGE notes was
previously enforced in the note scripts via separate calls to
assert_sender_is_ger_manager / assert_sender_is_bridge_admin. This was
unsafe because any note script consumed by the bridge account could call
update_ger or register_faucet directly, bypassing the sender check.

Move the authorization into the account procedures themselves
(update_ger and register_faucet) so that sender verification is enforced
regardless of which note script invokes them. The assertion procedures
have a net-zero stack effect, so they can be called first thing without
disturbing the procedure's inputs.

https://claude.ai/code/session_01JeSHNeBxs1aTUe3Lm8NjVi

* refactor: remove superfluous stack-effect comments

https://claude.ai/code/session_01JeSHNeBxs1aTUe3Lm8NjVi

* Apply suggestions from code review

* Update crates/miden-agglayer/asm/note_scripts/UPDATE_GER.masm

* Update crates/miden-agglayer/asm/note_scripts/CONFIG_AGG_BRIDGE.masm

* refactor: remove assert_sender_is_* from bridge component interface

These procedures are now internal implementation details called via exec
from within update_ger and register_faucet. They no longer need to be
part of the bridge account's public interface.

https://claude.ai/code/session_01JeSHNeBxs1aTUe3Lm8NjVi

---------

Co-authored-by: Claude <noreply@anthropic.com>
…nents (#2510)

* docs: fix doc comments and inline comments for bridge components

- Update AggLayerBridge doc comments to list current procedures
  (assert_sender_is_bridge_admin, assert_sender_is_ger_manager)
- Add bridge_admin and ger_manager storage slots to doc comments
- Fix faucet_registry_key doc comment to match actual element order
- Fix inline comments in tests ("bridge_out" -> "bridge")

* Apply suggestions from code review

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
…2509)

* feat: rm serial_num & output_note_tag from OutputNoteData

* feat: rm OutputNoteData from AdviceMap

* refactor: cleanup masm & fix pad amounts in stack comments

* refactor: update number of NoteStorage values in comment

* refactor: update claim_storage size and update comments

* refactor: use prefix from proc input & cleanup pad stack comments

* revert stack pad comment changes

* fix: rm old comment

* fix: correct CLAIM stack comments and flatten OutputNoteData into ClaimNoteStorage

* fix: rustfmt

* fix: fix stack comment pad(x)

* chore: dropw -> drop is sufficient

---------

Co-authored-by: Marti <marti@miden.team>
Co-authored-by: mmagician <marcin.gorny.94@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.