Conversation
* 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: Farukest
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: UPDATE_GER note outline * feat: working update ger note * chore: swap upper, lower GER parts * lint: regen error file
* feat: put target account in attachment * feat: extract b2agg creation to helper * lint: regen error file * feat: use NetworkAccountTarget for attachments - make bridge a network account - move the ID check to non-reclaim branch * fix: still need LET slot * chore: test the target mismatch logic * chore: apply target checks to UPDATE_GER * Apply suggestion from @mmagician * chore: add TODOs * chore: lint * docs(masm): trim dangling B2AGG note description Co-authored-by: marti <marti@hungrycats.studio> * docs(masm): clarify B2AGG attachment layout Co-authored-by: marti <marti@hungrycats.studio> * feat: use network account target helper Co-authored-by: marti <marti@hungrycats.studio> * feat: make B2AGG notes always public Co-authored-by: marti <marti@hungrycats.studio> * feat: mark B2AGG notes always consumable Co-authored-by: marti <marti@hungrycats.studio> * style: use NoteScript import for B2AGG Co-authored-by: marti <marti@hungrycats.studio> * docs: add changelog entry for PR 2334 Co-authored-by: marti <marti@hungrycats.studio> * Apply suggestions from code review * chore: move helper to network_account_target * chore: note script section headers * chore: comment simplify and wrap * lint * fix: use `with_account_target` instead of `0` for `NoteTag` Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: add missing panic to get_id * chore: mention active note * docs: how active_account_matches_target_account panics * Revert "fix: use `with_account_target` instead of `0` for `NoteTag`" This reverts commit 0282672. * feat: extract assert_is_network_account_target helper * feat: change is_network_account_target to return bool, not panic * feat: swap kind/scheme in signatures * lint: regen errors * feat: encapsulate note logic in structs * chore: rename file to bagg_note * chore: remove redundant comments * Revert "feat: swap kind/scheme in signatures" This reverts commit aad47e5. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
chore: merge `agglayer` into `next`
* feat: introduce TokenMetadata type for fungible faucet metadata This adds a new TokenMetadata struct that encapsulates the metadata associated with fungible faucet accounts (token_supply, max_supply, decimals, symbol). The struct provides: - Constructors: new() and with_supply() - Accessors: token_supply(), max_supply(), decimals(), symbol() - Conversions: From<TokenMetadata> for Word and StorageSlot - Parsing: TryFrom<&StorageSlot> and TryFrom<&AccountStorage> BasicFungibleFaucet and NetworkFungibleFaucet have been refactored to use TokenMetadata internally, reducing code duplication. Closes #2344 * refactor: address TokenMetadata review feedback - Move METADATA_SLOT_NAME constant to token_metadata.rs - Update BasicFungibleFaucet docs to reference TokenMetadata - Add slot name validation in TryFrom<&StorageSlot> for TokenMetadata - Implement TryFrom<Word> for TokenMetadata (public trait) - Replace NetworkFungibleFaucet/BasicFungibleFaucet::try_from with TokenMetadata in tests --------- Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
…#2404) * refactor: replace auth event constant workarounds with direct imports Replace the temporary workaround constants introduced in PR #2377 with direct imports from `miden::protocol::auth`. The linker bug that required the workaround has been fixed in miden-vm#2637. Changes: - Replace `const AUTH_REQUEST_EVENT = ::miden::protocol::auth::AUTH_REQUEST_EVENT` with `use miden::protocol::auth::AUTH_REQUEST_EVENT` - Replace `const AUTH_UNAUTHORIZED_EVENT = ::miden::protocol::auth::AUTH_UNAUTHORIZED_EVENT` with `use miden::protocol::auth::AUTH_UNAUTHORIZED_EVENT` Closes #2392 * chore: update miden-assembly to v0.20.6 for constant import support --------- Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
…liance-check-eefd MASM lowercase inline comments
* feat: make kernel procedure offset constants public for use outside the kernel This exports the kernel procedure offset constants so they can be used by code outside the kernel, such as note scripts that need to call kernel procedures dynamically. Changes: - Make offset constants public in kernel_proc_offsets.masm - Update build.rs regex to handle pub const declarations Closes #2342 * refactor: replace accessor procedures with direct public constant usage --------- Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
…w/o `DataStore` query (#2417) * feat: handle standards scripts directly w/o DataStore query * chore: no need to explicitly add standard scripts to tx context in tests * changelog * chore: add note to DataStore::get_note_script * chore: clarify docs and add panics
* feat: add p2id::new MASM constructor for creating P2ID notes This adds a new `p2id::new` procedure to the P2ID note MASM code that makes it easy to create P2ID notes from MASM transaction scripts. The procedure: - Takes target_id_prefix, target_id_suffix, tag, note_type, SERIAL_NUM - Handles writing note storage to memory in the expected layout - Uses procref.main to obtain the note script root - Builds the recipient and creates the note - Returns the note index This allows MASM code to create P2ID notes without manually handling the note storage layout or hardcoding script roots. Closes #2280 * refactor: move inline comments to doc comment in p2id::new * refactor: simplify local store instructions in p2id::new --------- Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
* 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 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
* 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.
…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>
* 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>
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a tracking PR for v0.14.0 release.