Skip to content

feat(NTL): support attachments#2295

Open
igamigo wants to merge 21 commits into
nextfrom
igamigo-ntl-attachments
Open

feat(NTL): support attachments#2295
igamigo wants to merge 21 commits into
nextfrom
igamigo-ntl-attachments

Conversation

@igamigo

@igamigo igamigo commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Also includes some minor refactors.
Closes #2286

  • NTL-delivered notes with on-chain attachments now fetch their attachment content from the node during import, making them consumable.
  • State sync now applies fetched attachments to tracked notes regardless of note type.
  • Fetched content is validated before acceptance: type/content variant must match, attachments must match the authenticated commitment, and missing advertised attachments return RpcError::InvalidResponse. Also left some TODOs for further validations (will open an issue about this)
  • import_notes now ensures genesis is present up front, avoiding fresh-store BlockHeaderNotFound(0) failures.
  • Note transport now reports the header-derived on-chain note ID, not the locally rejoined note ID with empty attachments.
  • Replaced sync_notes_with_details() with sync_notes_with_content(..., NoteContentFetch), returning self-contained ResolvedSyncNotesBlocks. NoteContentFetch defines whether
  • Added fetch policies: PublicDetailsAndAttachments for state sync and AttachmentsOnly for import.
  • Replaced SyncedNoteDetails with SyncedNote and ResolvedNoteContent, making private synced note details unrepresentable.
  • Added CommittedNote::has_attachments() and block_num().
  • Renamed: NoteSyncBlock to SyncNotesBlock, InputNoteRecord::set_attachments to attachments_received. THe latter now skips unchanged writes and reports whether the record changed.
  • Import paths now build the partial MMR once per batch instead of once per note.
  • State sync no longer needs side tables or per-note ID joins because SyncedNote carries its content.
  • Renamed check_expected_notes to sync_expected_notes.

@igamigo
igamigo marked this pull request as ready for review July 2, 2026 00:04
@TomasArrachea
TomasArrachea self-requested a review July 3, 2026 19:04
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.

Support attachments on NTL

1 participant