Skip to content

refactor: move NoteExecutionHint to miden-standards#2378

Merged
PhilippGackstatter merged 4 commits into0xMiden:nextfrom
Farukest:feat/issue-2281-move-note-execution-hint
Feb 3, 2026
Merged

refactor: move NoteExecutionHint to miden-standards#2378
PhilippGackstatter merged 4 commits into0xMiden:nextfrom
Farukest:feat/issue-2281-move-note-execution-hint

Conversation

@Farukest
Copy link
Copy Markdown
Contributor

Summary

  • Move NoteExecutionHint type from miden-protocol to miden-standards as suggested in Move NoteExecutionHint to miden-standards #2281
  • Update error message in NoteError to use literal values (0..=3) instead of constants to avoid circular dependency
  • Update imports in miden-agglayer, miden-testing, and network_account_target.rs

Context

Following PR #2257, NoteExecutionHint is no longer used in NoteMetadata (in miden-protocol) and is now primarily used by NetworkAccountTarget in miden-standards. This refactor consolidates the type where it logically belongs.

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy passes for affected crates
  • NoteExecutionHint unit tests pass (4 tests)
  • NetworkAccountTarget tests pass (2 tests)

Closes #2281

@Farukest Farukest force-pushed the feat/issue-2281-move-note-execution-hint branch from 1a86e9a to af6ed04 Compare January 31, 2026 19:06
Copy link
Copy Markdown
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep these private or pub(crate)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@Farukest Farukest force-pushed the feat/issue-2281-move-note-execution-hint branch from 868c514 to 06b3417 Compare February 2, 2026 15:34
Copy link
Copy Markdown
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@PhilippGackstatter PhilippGackstatter merged commit 87d669f into 0xMiden:next Feb 3, 2026
15 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move NoteExecutionHint to miden-standards

2 participants