Validate metadata extraction helpers#2351
Closed
Copilot wants to merge 48 commits intommagician-network-target-helpersfrom
Closed
Validate metadata extraction helpers#2351Copilot wants to merge 48 commits intommagician-network-target-helpersfrom
Copilot wants to merge 48 commits intommagician-network-target-helpersfrom
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>
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
instead of the whole METADATA word, pass only scheme and kind
* 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>
This reverts commit ebe73ff.
59052a4 to
d01e1cf
Compare
Copilot
AI
changed the title
[WIP] Add validation for attachment_kind and account_id in metadata helpers
Validate metadata extraction helpers
Jan 27, 2026
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.
The issue calls for stricter validation when extracting note metadata, specifically validating
attachment_kindand the senderaccount_id, and documenting panic conditions. This ensures metadata helpers are safe by default.Implementation
Documentation
No code snippet included because no changes were applied.
Original prompt
attachment_kindandaccount_idin metadata extraction helpers #2349✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.