-
Notifications
You must be signed in to change notification settings - Fork 164
feat(batch kernel): wire up INPUT_NOTES_COMMITMENT & note erasure
#2905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mmagician
wants to merge
48
commits into
next
Choose a base branch
from
mmagician-claude/batch-kernel-logic
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
01f5f62
feat: verify batch tx list, tx headers, and input-notes commitment
claude 79967d6
test: drive batch-kernel rejection tests through BatchExecutor advice…
claude feeb1cc
style: use the '# =>' stack-comment convention in the batch kernel masm
claude 622bee3
feat: compute the nullifier-sorted batch INPUT_NOTES_COMMITMENT
claude fc74536
feat: erase intra-batch created-and-consumed notes from the batch inp…
claude 8746a94
fix: reject same-transaction create+consume via the erasure ordering …
claude 0e9e806
test: assert concrete batch-kernel errors in the binding/erasure nega…
claude a4f8bf5
docs: describe final-state behavior in batch-kernel comments
claude 6304eef
feat: bound batch note/tx counts and codegen sentinel keys
claude 92502cf
test: harden batch verifier/output tests from review
claude f85ebac
docs: clarify batch verifier warning on self-reported BATCH_ID
claude e295049
refactor: address PR review comments
claude d62e9e7
refactor: simplify tampered-advice test parametrization
claude 623d1cf
docs: address MASM review comments on memory/prologue
claude 174ed7e
refactor: split batch kernel into prologue / note-tracking / epilogue
claude c1496dd
perf: fold per-input epilogue assertions into the commitment pass
claude 4ee8a17
refactor: derive batch note-list keys from a domain message
claude 0a80c7c
Merge branch 'next' into mmagician-claude/batch-kernel-logic
claude 08cd5ac
refactor: address PR review on batch kernel docs and note-list keys
claude 91a2e3b
refactor: derive note-list keys via MASM word(...) const
claude 4abe140
docs: clarify note-tracking binding in note_tracker.masm
claude af662e6
refactor: name note lists by sort key
claude 65158db
refactor: simplify epilogue hashing and trim key comments
claude 74a4b8b
refactor(batch-kernel): drop dead scratch bookkeeping, clarify docs
claude 9f4f2f8
perf(batch-kernel): absorb input entries in runs, drop unreachable as…
claude c6178b7
test(batch): cover capacity limits and duplicate note marking
claude d502cc6
Revert "perf(batch-kernel): absorb input entries in runs, drop unreac…
claude 5bde6bf
test(batch): drive forged-batch-id tests through BatchExecutor
claude bf4eedd
refactor(batch): keep testing overrides out of BatchExecutor::execute
claude 8d18cb2
refactor(batch): take caller advice as a parameter, mirroring the tx …
claude ef594bb
docs: strip self-evident and overly verbose comments
claude df9ee18
fix: address review comments
claude 5df0369
Merge branch 'next' into mmagician-claude/batch-kernel-logic
mmagician 273fdf0
Merge remote-tracking branch 'origin/next' into mmagician-claude/batc…
claude 941d204
feat(batch): surface unsupported batches early in BatchExecutor
claude a259c82
Merge remote-tracking branch 'origin/next' into mmagician-claude/batc…
claude dc7558f
Merge remote-tracking branch 'origin/next' into mmagician-claude/batc…
claude d7973e8
chore: address review comments (#3615)
zeapoz 43ffbc1
Update crates/miden-protocol/asm/kernels/batch/lib/epilogue.masm
mmagician 0914d80
pull out shared errors into errors.masm
claude f94484c
style(batch-kernel): format constants to match repo conventions
claude 150bc93
style(batch-kernel): wrap comment lines exceeding 100 columns
claude b9194f6
Merge branch 'next' into mmagician-claude/batch-kernel-logic
mmagician ff1f7ec
docs: fix batch kernel changelog entry
claude 23eba90
feat(batch): reject kernel outputs that do not match the proposed batch
claude 0355fc3
style(batch-kernel): address MASM formatting and style review nits
claude 97138b2
style(batch-kernel): apply review formatting conventions across all m…
claude e571bb4
style(batch-kernel): address review comments on the formatting sweep
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
391 changes: 391 additions & 0 deletions
391
crates/miden-protocol/asm/kernels/batch/lib/memory.masm
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,391 @@ | ||
| # MEMORY LAYOUT | ||
| # ================================================================================================= | ||
| # | ||
| # Below is the memory layout used by the batch kernel: | ||
| # | ||
| # +-------------------+-------------------------+----------------------------------+ | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| # | Address range | Constant | Contents | | ||
| # +-------------------+-------------------------+----------------------------------+ | ||
| # | 0 | NUM_TRANSACTIONS_PTR | num_transactions (1 felt). | | ||
| # | 4..8 | BATCH_HASHER_RATE0_PTR | RATE0 of the batch-level | | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| # | | | poseidon2 hasher state. | | ||
| # | 8..12 | BATCH_HASHER_RATE1_PTR | RATE1 of the batch-level hasher. | | ||
| # | 12..16 | BATCH_HASHER_CAP_PTR | CAPACITY of the batch-level | | ||
| # | | | hasher. | | ||
| # | 16 | SCRATCH_WORDS_COUNT_PTR | num_words piped into | | ||
| # | | | TX_NOTES_SCRATCH_PTR for the | | ||
| # | | | current transaction. | | ||
| # | 17 | SCRATCH_WORD_INDEX_PTR | current iteration cursor for the | | ||
| # | | | scratch absorption loop. | | ||
| # | 18 | NUM_INPUT_NOTES_PTR | number of entries in the global | | ||
| # | | | input-note list. | | ||
| # | 19 | NUM_OUTPUT_NOTES_PTR | number of entries in the global | | ||
| # | | | output-note list. | | ||
| # | 20..8212 | TX_TUPLES_PTR | Layer 1 piped data: per | | ||
| # | | | transaction `[tx_id[4], | | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| # | | | account_id_prefix, | | ||
| # | | | account_id_suffix, 0, 0]` | | ||
| # | | | (8 felts each, sized for up to | | ||
| # | | | 1024 transactions). | | ||
| # | 8212..32788 | TX_HEADERS_PTR | Layer 2 piped data: per | | ||
| # | | | transaction the felt sequence | | ||
| # | | | TransactionId::new hashes | | ||
| # | | | (24 felts each, sized for up to | | ||
| # | | | 1024 transactions). | | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| # | 32788..40980 | TX_NOTES_SCRATCH_PTR | Per-transaction scratch space | | ||
| # | | | for Layer 3 / Layer 3' note | | ||
| # | | | data (overwritten each tx). | | ||
| # | 40980..49172 | INPUT_NOTES_PTR | Global input-note list, sorted | | ||
| # | | | by nullifier: `[NULLIFIER[4], | | ||
| # | | | NOTE_ID_OR_EMPTY[4]]` per note | | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| # | | | (8 felts each, up to 1024). | | ||
| # | 49172..53268 | INPUT_NOTE_FLAGS_PTR | Parallel input-note flags: | | ||
| # | | | `[erasure, consumption, 0, 0]` | | ||
| # | | | per note (4 felts each). | | ||
| # | 53268..61460 | OUTPUT_NOTES_PTR | Global output-note list, sorted | | ||
| # | | | by note_id: `[NOTE_ID[4], 0,0, | | ||
| # | | | 0,0]` per note (8 felts each). | | ||
| # | 61460..65556 | OUTPUT_NOTE_FLAGS_PTR | Parallel output-note flags: | | ||
| # | | | `[will_be_erased, is_created, | | ||
| # | | | linked_input_index, 0]` per note | | ||
| # | | | (4 felts each). | | ||
| # +-------------------+-------------------------+----------------------------------+ | ||
|
|
||
| # BOOK KEEPING | ||
| # ================================================================================================= | ||
|
|
||
| #! Single-felt slot holding `num_transactions` after Layer 1 verification. | ||
| const NUM_TRANSACTIONS_PTR=0 | ||
|
|
||
| # BATCH HASHER STATE | ||
| # ================================================================================================= | ||
|
|
||
| #! Word holding the RATE0 portion of the batch-level poseidon2 hasher state. | ||
| const BATCH_HASHER_RATE0_PTR=4 | ||
|
|
||
| #! Word holding the RATE1 portion of the batch-level poseidon2 hasher state. | ||
| const BATCH_HASHER_RATE1_PTR=8 | ||
|
|
||
| #! Word holding the CAPACITY portion of the batch-level poseidon2 hasher state. | ||
| const BATCH_HASHER_CAP_PTR=12 | ||
|
|
||
| # SCRATCH BOOKKEEPING | ||
| # ================================================================================================= | ||
|
|
||
| #! Number of words piped into TX_NOTES_SCRATCH_PTR for the transaction whose Layer 3 / 3' is | ||
| #! being absorbed. | ||
| const SCRATCH_WORDS_COUNT_PTR=16 | ||
|
|
||
| #! Iteration cursor (index in words) into TX_NOTES_SCRATCH_PTR for the absorption loop. | ||
| const SCRATCH_WORD_INDEX_PTR=17 | ||
|
|
||
| #! Single-felt slot holding the number of entries in the global input-note list. | ||
| const NUM_INPUT_NOTES_PTR=18 | ||
|
|
||
| #! Single-felt slot holding the number of entries in the global output-note list. | ||
| const NUM_OUTPUT_NOTES_PTR=19 | ||
|
|
||
| # PIPED DATA REGIONS | ||
| # ================================================================================================= | ||
|
|
||
| #! Base of the Layer 1 piped data region. Per transaction, 8 felts: | ||
| #! `[tx_id[4], account_id_prefix, account_id_suffix, 0, 0]`. | ||
| pub const TX_TUPLES_PTR=20 | ||
|
|
||
| #! Number of felts each transaction occupies in TX_TUPLES_PTR. | ||
| const TX_TUPLE_FELT_LEN=8 | ||
|
|
||
| #! Base of the Layer 2 piped data region. Per transaction, 24 felts: | ||
| #! `[INIT[4], FINAL[4], INPUT_NOTES_COMMITMENT[4], OUTPUT_NOTES_COMMITMENT[4], FEE_ASSET[8]]`. | ||
| #! This must match the felt-sequence layout of `TransactionId::new`. | ||
| const TX_HEADERS_PTR=8212 | ||
|
|
||
| #! Number of felts each transaction occupies in TX_HEADERS_PTR. | ||
| const TX_HEADER_FELT_LEN=24 | ||
|
|
||
| #! Felt offset within a transaction header where INPUT_NOTES_COMMITMENT starts. | ||
| const TX_HEADER_INPUT_NOTES_OFFSET=8 | ||
|
|
||
| #! Felt offset within a transaction header where OUTPUT_NOTES_COMMITMENT starts. | ||
| const TX_HEADER_OUTPUT_NOTES_OFFSET=12 | ||
|
|
||
| #! Per-transaction scratch space for Layer 3 note data, overwritten between iterations. | ||
| pub const TX_NOTES_SCRATCH_PTR=32788 | ||
|
|
||
| # GLOBAL NOTE LISTS | ||
| # ================================================================================================= | ||
|
|
||
| #! Base of the global input-note list, sorted by nullifier. Per note, an 8-felt sorted-array entry | ||
| #! `[NULLIFIER[4], NOTE_ID_OR_EMPTY[4]]` | ||
| #! where the KEY word is the nullifier (the `sorted_array` lookup key) and the VALUE word is the | ||
| #! note id (for unauthenticated notes) or the empty word. The VALUE word doubles as the second half | ||
| #! of the `(nullifier, note_id_or_empty)` tuple hashed into INPUT_NOTES_COMMITMENT. | ||
| pub const INPUT_NOTES_PTR=40980 | ||
|
|
||
| #! Number of felts each note occupies in INPUT_NOTES_PTR / OUTPUT_NOTES_PTR (KEY word + VALUE word). | ||
| pub const NOTE_ENTRY_FELT_LEN=8 | ||
|
|
||
| #! Base of the parallel input-note flags array. Per note, one word `[erasure, consumption, 0, 0]`. | ||
| #! `erasure` is 0 (not erased / external), 1 (expected to be erased, creator not yet seen) or 2 | ||
| #! (erased, creator seen). `consumption` is 0 or 1. | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| pub const INPUT_NOTE_FLAGS_PTR=49172 | ||
|
|
||
| #! Number of felts each note occupies in the flag arrays (one word). | ||
| pub const NOTE_FLAGS_FELT_LEN=4 | ||
|
|
||
| #! Felt offset of the `erasure` flag within an input-note flag word. | ||
| pub const INPUT_NOTE_ERASURE_OFFSET=0 | ||
|
|
||
| #! Felt offset of the `consumption` flag within an input-note flag word. | ||
| pub const INPUT_NOTE_CONSUMPTION_OFFSET=1 | ||
|
|
||
| #! Base of the global output-note list, sorted by note id. Per note, an 8-felt sorted-array entry | ||
| #! `[NOTE_ID[4], 0, 0, 0, 0]` | ||
| #! where the KEY word is the note id (the `sorted_array` lookup key); the VALUE word is unused. | ||
| pub const OUTPUT_NOTES_PTR=53268 | ||
|
|
||
| #! Base of the parallel output-note flags array. Per note, one word | ||
| #! `[will_be_erased, is_created, linked_input_index, 0]`. | ||
| pub const OUTPUT_NOTE_FLAGS_PTR=61460 | ||
|
|
||
| #! Felt offset of the `will_be_erased` flag within an output-note flag word. | ||
| pub const OUTPUT_NOTE_WILL_BE_ERASED_OFFSET=0 | ||
|
|
||
| #! Felt offset of the `is_created` flag within an output-note flag word. | ||
| pub const OUTPUT_NOTE_IS_CREATED_OFFSET=1 | ||
|
|
||
| #! Felt offset of the `linked_input_index` field within an output-note flag word. | ||
| pub const OUTPUT_NOTE_LINKED_INPUT_OFFSET=2 | ||
|
|
||
| # CAPACITY LIMITS | ||
| # ================================================================================================= | ||
|
|
||
| #! Maximum number of transactions in a batch. The Layer 1/2 piped-data regions are sized to hold | ||
| #! exactly this many transactions. | ||
| pub const MAX_TRANSACTIONS_PER_BATCH=1024 | ||
|
|
||
| #! Maximum number of entries in a global note list and in a single transaction's note set. The | ||
| #! input/output note regions and the per-transaction scratch region each hold exactly this many | ||
| #! entries. Equals `MAX_INPUT_NOTES_PER_BATCH` = `MAX_OUTPUT_NOTES_PER_BATCH` in `src/constants.rs`. | ||
| pub const MAX_NOTES_PER_BATCH=1024 | ||
|
|
||
| # NUM TRANSACTIONS | ||
| # ================================================================================================= | ||
|
|
||
| #! Stores `num_transactions`. | ||
| #! | ||
| #! Inputs: [num_transactions] | ||
| #! Outputs: [] | ||
| pub proc set_num_transactions | ||
| mem_store.NUM_TRANSACTIONS_PTR | ||
| end | ||
|
|
||
| #! Returns `num_transactions`. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [num_transactions] | ||
| pub proc get_num_transactions | ||
| mem_load.NUM_TRANSACTIONS_PTR | ||
| end | ||
|
|
||
| # BATCH HASHER STATE | ||
| # ================================================================================================= | ||
|
|
||
| #! Persists the batch hasher state from the operand stack into memory. | ||
| #! | ||
| #! Inputs: [RATE0, RATE1, CAPACITY] | ||
| #! Outputs: [] | ||
| pub proc save_batch_hasher_state | ||
| mem_storew_le.BATCH_HASHER_RATE0_PTR dropw | ||
| mem_storew_le.BATCH_HASHER_RATE1_PTR dropw | ||
| mem_storew_le.BATCH_HASHER_CAP_PTR dropw | ||
| end | ||
|
|
||
| #! Loads the batch hasher state from memory onto the operand stack. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [RATE0, RATE1, CAPACITY] | ||
| pub proc load_batch_hasher_state | ||
| padw mem_loadw_le.BATCH_HASHER_CAP_PTR | ||
| padw mem_loadw_le.BATCH_HASHER_RATE1_PTR | ||
| padw mem_loadw_le.BATCH_HASHER_RATE0_PTR | ||
| end | ||
|
|
||
| # SCRATCH BOOKKEEPING | ||
| # ================================================================================================= | ||
|
|
||
| #! Stores the count (in words) of data piped into the per-transaction scratch. | ||
| #! | ||
| #! Inputs: [num_words] | ||
| #! Outputs: [] | ||
| pub proc set_scratch_words_count | ||
| mem_store.SCRATCH_WORDS_COUNT_PTR | ||
| end | ||
|
|
||
| #! Returns the count (in words) of data piped into the per-transaction scratch. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [num_words] | ||
| pub proc get_scratch_words_count | ||
| mem_load.SCRATCH_WORDS_COUNT_PTR | ||
| end | ||
|
|
||
| #! Stores the absorption iteration cursor (index in words). | ||
| #! | ||
| #! Inputs: [word_index] | ||
| #! Outputs: [] | ||
| pub proc set_scratch_word_index | ||
| mem_store.SCRATCH_WORD_INDEX_PTR | ||
| end | ||
|
|
||
| #! Returns the absorption iteration cursor (index in words). | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [word_index] | ||
| pub proc get_scratch_word_index | ||
| mem_load.SCRATCH_WORD_INDEX_PTR | ||
| end | ||
|
|
||
| # TRANSACTION TUPLE / HEADER ACCESSORS | ||
| # ================================================================================================= | ||
|
|
||
| #! Returns a pointer to transaction `tx_index`'s entry in TX_TUPLES_PTR. | ||
| #! | ||
| #! Inputs: [tx_index] | ||
| #! Outputs: [tx_tuple_ptr] | ||
| pub proc tx_tuple_ptr | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I would use |
||
| mul.TX_TUPLE_FELT_LEN add.TX_TUPLES_PTR | ||
| end | ||
|
|
||
| #! Returns the verified `tx_id` for transaction `tx_index` (loaded from TX_TUPLES_PTR). | ||
| #! | ||
| #! Inputs: [tx_index] | ||
| #! Outputs: [TX_ID] | ||
| pub proc get_tx_id | ||
| exec.tx_tuple_ptr padw movup.4 mem_loadw_le | ||
| end | ||
|
mmagician marked this conversation as resolved.
|
||
|
|
||
| #! Returns a pointer to transaction `tx_index`'s entry in TX_HEADERS_PTR. | ||
| #! | ||
| #! Inputs: [tx_index] | ||
| #! Outputs: [tx_header_ptr] | ||
| pub proc tx_header_ptr | ||
| mul.TX_HEADER_FELT_LEN add.TX_HEADERS_PTR | ||
| end | ||
|
|
||
| #! Returns the verified per-transaction INPUT_NOTES_COMMITMENT for transaction `tx_index`. | ||
| #! | ||
| #! Inputs: [tx_index] | ||
| #! Outputs: [INPUT_NOTES_COMMITMENT_i] | ||
| pub proc get_tx_input_notes_commitment | ||
| exec.tx_header_ptr add.TX_HEADER_INPUT_NOTES_OFFSET padw movup.4 mem_loadw_le | ||
| end | ||
|
|
||
| #! Returns the verified per-transaction OUTPUT_NOTES_COMMITMENT for transaction `tx_index`. | ||
| #! | ||
| #! Inputs: [tx_index] | ||
| #! Outputs: [OUTPUT_NOTES_COMMITMENT_i] | ||
| pub proc get_tx_output_notes_commitment | ||
| exec.tx_header_ptr add.TX_HEADER_OUTPUT_NOTES_OFFSET padw movup.4 mem_loadw_le | ||
| end | ||
|
|
||
| # GLOBAL NOTE LIST ACCESSORS | ||
| # ================================================================================================= | ||
|
|
||
| #! Stores the number of entries in the global input-note list. | ||
| #! | ||
| #! Inputs: [num_input_notes] | ||
| #! Outputs: [] | ||
| pub proc set_num_input_notes | ||
| mem_store.NUM_INPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns the number of entries in the global input-note list. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [num_input_notes] | ||
| pub proc get_num_input_notes | ||
| mem_load.NUM_INPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Stores the number of entries in the global output-note list. | ||
| #! | ||
| #! Inputs: [num_output_notes] | ||
| #! Outputs: [] | ||
| pub proc set_num_output_notes | ||
| mem_store.NUM_OUTPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns the number of entries in the global output-note list. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [num_output_notes] | ||
| pub proc get_num_output_notes | ||
| mem_load.NUM_OUTPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns the end pointer of the global input-note list (base + num_input_notes * 8), as required | ||
| #! by `sorted_array::find_key_value`. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [input_notes_end_ptr] | ||
| pub proc get_input_notes_end_ptr | ||
| exec.get_num_input_notes mul.NOTE_ENTRY_FELT_LEN add.INPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns the end pointer of the global output-note list (base + num_output_notes * 8). | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [output_notes_end_ptr] | ||
| pub proc get_output_notes_end_ptr | ||
| exec.get_num_output_notes mul.NOTE_ENTRY_FELT_LEN add.OUTPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns a pointer to input-note entry `i` in INPUT_NOTES_PTR. | ||
| #! | ||
| #! Inputs: [i] | ||
| #! Outputs: [input_note_entry_ptr] | ||
| pub proc input_note_entry_ptr | ||
| mul.NOTE_ENTRY_FELT_LEN add.INPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns a pointer to output-note entry `i` in OUTPUT_NOTES_PTR. | ||
| #! | ||
| #! Inputs: [i] | ||
|
mmagician marked this conversation as resolved.
Outdated
|
||
| #! Outputs: [output_note_entry_ptr] | ||
| pub proc output_note_entry_ptr | ||
| mul.NOTE_ENTRY_FELT_LEN add.OUTPUT_NOTES_PTR | ||
| end | ||
|
|
||
| #! Returns a pointer to input-note flag word `i` in INPUT_NOTE_FLAGS_PTR. | ||
| #! | ||
| #! Inputs: [i] | ||
| #! Outputs: [input_note_flags_ptr] | ||
| pub proc input_note_flags_ptr | ||
| mul.NOTE_FLAGS_FELT_LEN add.INPUT_NOTE_FLAGS_PTR | ||
| end | ||
|
|
||
| #! Returns a pointer to output-note flag word `i` in OUTPUT_NOTE_FLAGS_PTR. | ||
| #! | ||
| #! Inputs: [i] | ||
| #! Outputs: [output_note_flags_ptr] | ||
| pub proc output_note_flags_ptr | ||
| mul.NOTE_FLAGS_FELT_LEN add.OUTPUT_NOTE_FLAGS_PTR | ||
| end | ||
|
|
||
| #! Converts an input-note `key_ptr` (as returned by `sorted_array::find_key_value`) into its entry | ||
| #! index `(key_ptr - INPUT_NOTES_PTR) / 8`. | ||
| #! | ||
| #! Inputs: [key_ptr] | ||
| #! Outputs: [i] | ||
| pub proc input_entry_index_from_key_ptr | ||
| sub.INPUT_NOTES_PTR div.NOTE_ENTRY_FELT_LEN | ||
| end | ||
|
|
||
| #! Converts an output-note `key_ptr` into its entry index `(key_ptr - OUTPUT_NOTES_PTR) / 8`. | ||
| #! | ||
| #! Inputs: [key_ptr] | ||
| #! Outputs: [i] | ||
| pub proc output_entry_index_from_key_ptr | ||
| sub.OUTPUT_NOTES_PTR div.NOTE_ENTRY_FELT_LEN | ||
| end | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.