refactor: move NoteExecutionHint to miden-standards#2378
Merged
PhilippGackstatter merged 4 commits into0xMiden:nextfrom Feb 3, 2026
Merged
Conversation
1a86e9a to
af6ed04
Compare
Contributor
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good, thanks! I left two small comments, after which we should be able to merge.
Comment on lines
563
to
557
| #[error( | ||
| "note execution hint tag {0} must be in range {from}..={to}", | ||
| from = NoteExecutionHint::NONE_TAG, | ||
| to = NoteExecutionHint::ON_BLOCK_SLOT_TAG, | ||
| )] | ||
| #[error("note execution hint tag {0} must be in range 0..=3")] | ||
| NoteExecutionHintTagOutOfRange(u8), |
Contributor
There was a problem hiding this comment.
I'd remove this error variant completely. It doesn't make sense to have a note execution hint variant in an error type defined in miden-protocol. Instead we can just use NoteError::other.
Comment on lines
+56
to
+59
| pub const NONE_TAG: u8 = 0; | ||
| pub const ALWAYS_TAG: u8 = 1; | ||
| pub const AFTER_BLOCK_TAG: u8 = 2; | ||
| pub const ON_BLOCK_SLOT_TAG: u8 = 3; |
Contributor
There was a problem hiding this comment.
Can we keep these private or pub(crate)?
Contributor
Author
There was a problem hiding this comment.
Can we keep these private or
pub(crate)?
All applied @PhilippGackstatter 👍
Move NoteExecutionHint type from miden-protocol to miden-standards following the usage pattern established in PR 0xMiden#2257 where NoteExecutionHint was removed from NoteMetadata and is now primarily used by NetworkAccountTarget in miden-standards. Changes: - Add execution_hint.rs to miden-standards/src/note/ - Remove execution_hint.rs from miden-protocol/src/note/ - Update error message in NoteError to use literal values instead of NoteExecutionHint constants (to avoid circular dependency) - Update imports in miden-agglayer and miden-testing to use miden-standards::note::NoteExecutionHint Closes 0xMiden#2281
- Remove NoteExecutionHintTagOutOfRange error variant from miden-protocol - Use NoteError::other for tag validation error in execution_hint.rs - Make TAG constants pub(crate) instead of pub
868c514 to
06b3417
Compare
PhilippGackstatter
approved these changes
Feb 3, 2026
Contributor
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me, thank you!
afa7789
pushed a commit
to afa7789/miden-base
that referenced
this pull request
Mar 9, 2026
* refactor: move NoteExecutionHint to miden-standards Move NoteExecutionHint type from miden-protocol to miden-standards following the usage pattern established in PR 0xMiden#2257 where NoteExecutionHint was removed from NoteMetadata and is now primarily used by NetworkAccountTarget in miden-standards. Changes: - Add execution_hint.rs to miden-standards/src/note/ - Remove execution_hint.rs from miden-protocol/src/note/ - Update error message in NoteError to use literal values instead of NoteExecutionHint constants (to avoid circular dependency) - Update imports in miden-agglayer and miden-testing to use miden-standards::note::NoteExecutionHint Closes 0xMiden#2281 * refactor: address PR review feedback for NoteExecutionHint - Remove NoteExecutionHintTagOutOfRange error variant from miden-protocol - Use NoteError::other for tag validation error in execution_hint.rs - Make TAG constants pub(crate) instead of pub * Update crates/miden-standards/src/note/execution_hint.rs --------- Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.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.
Summary
NoteExecutionHinttype frommiden-protocoltomiden-standardsas suggested in MoveNoteExecutionHinttomiden-standards#2281NoteErrorto use literal values (0..=3) instead of constants to avoid circular dependencymiden-agglayer,miden-testing, andnetwork_account_target.rsContext
Following PR #2257,
NoteExecutionHintis no longer used inNoteMetadata(inmiden-protocol) and is now primarily used byNetworkAccountTargetinmiden-standards. This refactor consolidates the type where it logically belongs.Test plan
cargo +nightly fmt --checkpassescargo clippypasses for affected cratesNoteExecutionHintunit tests pass (4 tests)NetworkAccountTargettests pass (2 tests)Closes #2281