-
Notifications
You must be signed in to change notification settings - Fork 139
fix(agglayer): enforce NoteType::Public for B2AGG bridge-out notes #2988
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
Merged
partylikeits1983
merged 6 commits into
agglayer
from
ajl-claude/b2agg-enforce-public-note
May 27, 2026
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2569f44
fix(agglayer): enforce NoteType::Public for B2AGG bridge-out notes
partylikeits1983 6142fa3
chore(agglayer): add changelog entry for #2988 and clarify is_note_pu…
partylikeits1983 8c07834
refactor: enforce B2AGG public-note check in bridge_out, add active_n…
claude 336b5c6
Update crates/miden-agglayer/asm/agglayer/bridge/bridge_out.masm
partylikeits1983 2ba8087
docs(agglayer): trim verbose bridge_out doc comment and test narration
claude e5d35fb
refactor(protocol): source note-type constants from shared util module
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
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
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,48 @@ | ||
| use miden::protocol::active_note | ||
|
|
||
| # CONSTANTS | ||
| # ================================================================================================= | ||
|
|
||
| # Note type encoding for a public note (see the protocol note type definition). | ||
| const NOTE_TYPE_PUBLIC = 1 | ||
|
partylikeits1983 marked this conversation as resolved.
Outdated
|
||
|
|
||
| # PROCEDURES | ||
| # ================================================================================================= | ||
|
|
||
| #! Returns whether the currently executing note is public. | ||
| #! | ||
| #! The note type is stored in the low byte of the metadata header's `sender_id_suffix_and_note_type` | ||
| #! felt and is not part of the recipient commitment. This reads the active note's metadata and | ||
| #! compares the note type against the public encoding. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [is_public] | ||
| #! | ||
| #! Where: | ||
| #! - is_public is 1 if the active note is public, 0 otherwise. | ||
| #! | ||
| #! Panics if: | ||
| #! - no note is currently active. | ||
| pub proc is_note_public | ||
|
partylikeits1983 marked this conversation as resolved.
Outdated
|
||
| exec.active_note::get_metadata | ||
| # => [NOTE_ATTACHMENT, METADATA_HEADER] | ||
|
|
||
| # drop the attachment word, keeping the metadata header | ||
| dropw | ||
| # => [sender_id_suffix_and_note_type, sender_id_prefix, tag, attachment_kind_scheme] | ||
|
|
||
| # move the merged suffix/note_type felt to the bottom and drop the other three header felts | ||
| movdn.3 drop drop drop | ||
| # => [sender_id_suffix_and_note_type] | ||
|
|
||
| # take the low 32 bits of the felt | ||
| u32split swap drop | ||
| # => [suffix_and_note_type_lo] | ||
|
|
||
| # mask to the low byte, which holds the note type | ||
| u32and.0xff | ||
| # => [note_type] | ||
|
|
||
| eq.NOTE_TYPE_PUBLIC | ||
| # => [is_public] | ||
|
partylikeits1983 marked this conversation as resolved.
Outdated
|
||
| end | ||
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
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
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.