Skip to content

fix(store): network notes must be public#1738

Merged
Mirko-von-Leipzig merged 5 commits intonextfrom
mirko/fix-network-notes-next
Mar 4, 2026
Merged

fix(store): network notes must be public#1738
Mirko-von-Leipzig merged 5 commits intonextfrom
mirko/fix-network-notes-next

Conversation

@Mirko-von-Leipzig
Copy link
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig commented Mar 3, 2026

The counterpart of #1736 for the next branch.

This PR updates miden-protocol to include 0xMiden/protocol#2365 which added network note support. This PR then replaces our adhoc (and faulty) implementation with the one from protocol.

This does leave our types and conversions in a bit of a wonky state -- things could be cleaned up further, but since we're already actively refactoring the ntx-builder I've elected to not do this.

Fixes #1726

@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/fix-network-notes-next branch from b2c665b to 7f40b6a Compare March 3, 2026 08:53
@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/fix-network-notes-next branch from 7f40b6a to 313defa Compare March 3, 2026 08:53
@Mirko-von-Leipzig Mirko-von-Leipzig marked this pull request as ready for review March 3, 2026 08:53
@Mirko-von-Leipzig Mirko-von-Leipzig force-pushed the mirko/fix-network-notes-next branch from 313defa to 22869b2 Compare March 3, 2026 08:59
Copy link
Contributor

@partylikeits1983 partylikeits1983 left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Contributor

@bobbinth bobbinth 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! Thank you!

@Mirko-von-Leipzig Mirko-von-Leipzig merged commit 4a4bfa5 into next Mar 4, 2026
18 checks passed
@Mirko-von-Leipzig Mirko-von-Leipzig deleted the mirko/fix-network-notes-next branch March 4, 2026 09:12
Comment on lines +86 to +92
// We check first to avoid cloning non-network notes.
OutputNote::Full(inner) => inner.is_network_note().then_some(
inner
.clone()
.into_account_target_network_note()
.expect("we just checked that this is a network note"),
),
Copy link
Collaborator

@igamigo igamigo Mar 4, 2026

Choose a reason for hiding this comment

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

@juan518munoz found an issue here where this panics. then_some() will imply evaluating the inner value regardless, whereas something like then() would do it lazily. In any case we also found that it's probably not even necessary to check for if note.is_network_note() because the inner conversion already implicitly checks so you can probably mtach/check for Ok(network_note) instead. He'll open a PR soon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah of course 🤦 Thank you!

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.

Network note missing public details

5 participants