Skip to content
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7559170
refactor(rust-client): split both syncs into fetch and apply phases
ricomateo Aug 26, 2026
db355b2
refactor(rust-client): keep flush_relay_outbox as a single function
ricomateo Aug 26, 2026
b12aff4
refactor(rust-client): group the expected-note import fns in one impl…
ricomateo Aug 26, 2026
1fca608
refactor(rust-client): make ChainSyncData plain data and move its met…
ricomateo Aug 26, 2026
ce332b8
refactor(rust-client): store note blocks as they are fetched
ricomateo Aug 27, 2026
0ff8e1a
refactor(rust-client): rename the expected-note update types and fields
ricomateo Aug 27, 2026
8e886b0
refactor(rust-client): carry a single merged ExpectedNoteUpdates per …
ricomateo Aug 27, 2026
393f6b2
refactor(rust-client): cache and prune inside apply_chain_updates
ricomateo Aug 27, 2026
7888dcf
refactor(rust-client): fetch note blocks in the fetch phase, store th…
ricomateo Aug 27, 2026
47c4bd5
docs(rust-client): correct and trim the sync phase doc comments
ricomateo Aug 27, 2026
692f01b
fix(rust-client): screen the chain sync's notes after the transport w…
ricomateo Aug 28, 2026
1c6d625
fix(rust-client): check delivered notes for spends below the sync height
ricomateo Aug 28, 2026
ddd92d9
chore: update changelog
ricomateo Aug 28, 2026
a072502
refactor(rust-client): name the sync data types and bindings after wh…
ricomateo Aug 28, 2026
f6642f3
refactor(rust-client): name the transport fetch fns after what they r…
ricomateo Aug 28, 2026
f1d251c
refactor(rust-client): pair the transport fetch and apply fns by the …
ricomateo Aug 28, 2026
2669f29
chore: simplify doc comments
ricomateo Aug 28, 2026
c79d60a
chore: improve doc comments
ricomateo Aug 28, 2026
4cb2afa
refactor(rust-client): key the awaiting-block notes on their record s…
ricomateo Aug 29, 2026
f442817
docs(rust-client): correct the note import docs for the single note list
ricomateo Aug 29, 2026
603e7c7
refactor(rust-client): import notes by details through the transport …
ricomateo Aug 29, 2026
daf6dc8
refactor(rust-client): match the transport note fetch interface to th…
ricomateo Aug 29, 2026
6e4fcb5
refactor(rust-client): return the by-details import records for impor…
ricomateo Aug 29, 2026
e843309
refactor(rust-client): simplify the sync_state phase boundaries
ricomateo Aug 30, 2026
bffcc4d
refactor(rust-client): rename screen_fetched_notes to derive_note_and…
ricomateo Aug 30, 2026
b442c60
docs(rust-client): explain the NTL note merge and nullifier coverage …
ricomateo Aug 30, 2026
7c11dc3
docs(rust-client): simplify the nullifier fetch comment in sync_state
ricomateo Aug 30, 2026
9f9b365
refactor(rust-client): take note blocks from the sync response instea…
ricomateo Aug 31, 2026
13975b5
chore: improve doc comments
ricomateo Aug 31, 2026
5a0d45c
fix(rust-client): return imported notes only when the fetched informa…
ricomateo Aug 31, 2026
5504940
chore: update changelog
ricomateo Aug 31, 2026
4f6bd78
Merge branch 'next' into ricomateo-concurrent-ntl-chain-sync
ricomateo Aug 31, 2026
66c3825
Merge branch 'next' into ricomateo-concurrent-ntl-chain-sync
ricomateo Sep 1, 2026
90ce893
chore: move apply_superseded_account_state call to derive_state_updates
ricomateo Sep 1, 2026
c987407
chore: add type alias for the import_note_records_by_details parameter
ricomateo Sep 1, 2026
0e8ba3c
Merge branch 'next' into ricomateo-concurrent-ntl-chain-sync
ricomateo Sep 4, 2026
d24f669
chore: replace assertion with an error
ricomateo Sep 4, 2026
552f9a2
Merge branch 'next' into ricomateo-concurrent-ntl-chain-sync
ricomateo Sep 9, 2026
c5980b5
refactor(rust-client): make only the note transport fetch concurrent …
ricomateo Sep 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

### Enhancements

* [rust] The chain sync and the note transport sync are each split into a fetch phase and a store phase, so every NTL and RPC call happens before the first store write. `Client::sync_state` runs the two fetch phases concurrently and applies both sets of updates afterwards, instead of running a full note transport sync before the chain sync ([#2453](https://github.com/0xMiden/rust-sdk/pull/2453)).
* [FEATURE][rust] `Client::sync_state` now issues its independent gRPC calls concurrently instead of one after another, reducing the total time a sync takes. `NodeRpcClient::sync_notes_with_content` and `NodeRpcClient::sync_transactions` are now called concurrently rather than in sequence, and the per-account `NodeRpcClient::get_account` requests are issued in parallel instead of one at a time ([#2420](https://github.com/0xMiden/rust-sdk/pull/2420)).
* [store] Added `SqliteStore::database_filepath`, which returns the backing database path losslessly as a `&Path` ([#2363](https://github.com/0xMiden/rust-sdk/pull/2363)).
* [FEATURE][rust] Syncing no longer issues a `GetNotesById` request for a note whose attachments the `SyncNotes` response already carried. The node sends an attachment that fits in a single word verbatim, so the client reconstructs it locally: a private note whose attachments are all single-word is resolved with no follow-up request during state sync, as is a note of either type while checking expected notes. Both standard attachment schemes in `miden-standards` (`NetworkAccountTarget` and the PSWAP attachment) are single-word, so the round trip disappears from the common case. A caller-supplied attachment spanning more than one word arrives as a commitment and is still fetched. Public notes are unaffected during state sync, since their bodies are requested regardless ([#2360](https://github.com/0xMiden/rust-sdk/issues/2360)).
Expand Down Expand Up @@ -87,6 +88,7 @@

### Fixes

* [FIX][rust] A private note fetched from the Note Transport Layer whose nullifier is already on chain is now imported as consumed instead of committed, so `get_consumable_notes` no longer reports notes the node will reject ([#2453](https://github.com/0xMiden/rust-sdk/pull/2453)).
* [FIX][rust] `ChainAnchor` deserialization no longer panics on crafted input: a partial blockchain whose tracked leaf is missing an ancestor sibling, or whose block-map key disagrees with its header, is rejected as an invalid value, and anchors tracking more blocks than a transaction can reference are rejected early with the new `ChainAnchorError::TooManyTrackedBlocks` ([#2421](https://github.com/0xMiden/rust-sdk/pull/2421)).
* [FIX][rust] `Client::execute_transaction_at` now fails with the new `ChainAnchorError::AnchoredTransactionExpired` when the executed transaction's expiration block has already been reached, instead of handing back a transaction the network would reject after proving ([#2421](https://github.com/0xMiden/rust-sdk/pull/2421)).
* [FIX][rust] A request that sets `ignore_invalid_input_notes` but carries no input notes, or whose notes are all screened out, no longer fails with an out-of-range note-count error from the consumption checker ([#2421](https://github.com/0xMiden/rust-sdk/pull/2421)).
Expand Down
281 changes: 215 additions & 66 deletions crates/rust-client/src/note/import.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/rust-client/src/note/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ use crate::store::{InputNoteRecord, NoteFilter, OutputNoteRecord};
use crate::{Client, ClientError, IdPrefixFetchError};

mod import;
pub(crate) use import::{TransportNoteUpdates, ensure_not_processing};
mod note_reader;
mod note_screener;
mod note_update_tracker;
Expand Down
18 changes: 18 additions & 0 deletions crates/rust-client/src/note/note_update_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,24 @@ impl NoteUpdateTracker {
})
}

/// Tracks additional already-persisted input notes.
///
/// Used to extend a sync's nullifier check to notes that are about to be written by another
/// path (e.g. the note transport sync) and are therefore absent from the store snapshot this
/// tracker was built from. Notes already tracked for the same details commitment are skipped,
/// so a record built by this sync is never replaced by a stale one.
pub(crate) fn track_existing_input_notes(
&mut self,
notes: impl IntoIterator<Item = InputNoteRecord>,
) {
for note in notes {
if self.input_notes.contains_key(&note.details_commitment()) {
continue;
}
self.insert_input_note(note, NoteUpdateType::None);
}
}

/// Appends nullifiers to the per-account ordered nullifier list.
///
/// Nullifiers from the same account must be in execution order; ordering across different
Expand Down
Loading
Loading