Skip to content

fix(note-transport): explicit block hint on sendPrivate; add sendPrivateOutput (0.16/next) - #264

Merged
WiktorStarczewski merged 3 commits into
nextfrom
port/private-note-hint-next
Aug 7, 2026
Merged

fix(note-transport): explicit block hint on sendPrivate; add sendPrivateOutput (0.16/next)#264
WiktorStarczewski merged 3 commits into
nextfrom
port/private-note-hint-next

Conversation

@WiktorStarczewski

Copy link
Copy Markdown
Collaborator

Summary

The 0.16 / next-channel version of #263 (which targets main/0.15). This is a breaking change, so it belongs on the next dist-tag.

Addresses maintainer review feedback (igamigo) on the private-note block-hint fix:

  • client.notes.sendPrivate({ note, to }) now requires an explicit scanAfterBlockNum — the block the recipient scans forward from for the note's on-chain commitment — instead of the SDK inferring it from the client's current sync height. A hint above the commitment is never scanned back to, so the sync-height inference silently dropped delivery once the sender had synced past the note (e.g. relaying after waiting for the transaction to commit).
  • New client.notes.sendPrivateOutput({ noteId, to }) derives the block from the output note's stored expected_height (the chain tip when its transaction was submitted) — exactly the value the review pointed to for output notes — so relaying one of this client's own notes is correct regardless of sync/relay timing.

The old sync-height auto-read is removed, so an arbitrary note is never silently relayed with a bad hint.

react-sdk's useTransaction / useSend / useMultiSend relay via sendPrivateOutputNote. Cross-client node regression tests guard both paths: the convenience method (delivers after the sender syncs past the commitment) and the agnostic sendPrivateNote (a deliberately-too-high explicit hint drops delivery). Verified compiling and passing against next's 0.16 miden-client.

Supersedes #263 (which targets main) for the 0.16 line.

closes #262

…ateOutput (expected_height)

0.16 / next-channel version of #263 (which targets main/0.15). This is a breaking
change, so it belongs on the next dist-tag.

Addresses maintainer review feedback (igamigo) on the private-note block-hint fix:

- `client.notes.sendPrivate({ note, to })` now requires an explicit `scanAfterBlockNum`
  — the block the recipient scans forward from for the note's on-chain commitment —
  instead of the SDK inferring it from the client's current sync height (which
  overshoots the commitment once the sender has synced past the note and silently
  drops delivery).
- New `client.notes.sendPrivateOutput({ noteId, to })` derives the block from the
  output note's stored `expected_height` (the chain tip when its transaction was
  submitted), so relaying one of this client's own notes is correct regardless of
  sync/relay timing.

react-sdk's useTransaction/useSend/useMultiSend relay via sendPrivateOutputNote.
Cross-client node regression tests guard both the convenience path (delivers after
syncing past the commitment) and the agnostic path (a too-high explicit hint drops
delivery). Verified compiling against next's 0.16 miden-client.

@igamigo igamigo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Just in case: we can still fix this in main by keeping the old signature (and adding a new function that adds the parameter). This will make the fix non-breaking and users (such as the wallet) can hotfix this by calling the new signature instead of the new one. If you think this is unnecessary though, please disregard!

@WiktorStarczewski
WiktorStarczewski force-pushed the port/private-note-hint-next branch from c506f28 to b272263 Compare August 6, 2026 19:40
@WiktorStarczewski
WiktorStarczewski merged commit 9f45d95 into next Aug 7, 2026
37 checks passed
@WiktorStarczewski
WiktorStarczewski deleted the port/private-note-hint-next branch August 7, 2026 09:53
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.

2 participants