refactor(rust-client): make NTL and chain syncing concurrent - #2453
Open
ricomateo wants to merge 37 commits into
Open
refactor(rust-client): make NTL and chain syncing concurrent#2453ricomateo wants to merge 37 commits into
ricomateo wants to merge 37 commits into
Conversation
…em in the apply phase
…e by-details import
…_transaction_updates
…d of refetching them
ricomateo
marked this pull request as ready for review
August 31, 2026 12:47
ricomateo
requested review from
SantiagoPittella,
TomasArrachea,
igamigo and
juan518munoz
August 31, 2026 14:08
| /// | ||
| /// Covers the two node calls that depend on nothing but the sync input: | ||
| /// 1. Fetch sync data from the node (MMR delta, note inclusions, transactions). | ||
| /// 2. Update account states (fetch updated public accounts, flag mismatched private ones). |
Collaborator
There was a problem hiding this comment.
This now sounds like something that should be done in the apply phase
Contributor
Author
There was a problem hiding this comment.
Moved the apply_superseded_account_state call to the apply phase here 90ce893.
The derive_account_commitments step cannot be moved since it is required by the account_state_sync call, which performs RPC calls to the node.
juan518munoz
reviewed
Sep 2, 2026
Comment on lines
+465
to
+468
| assert!( | ||
| note_blocks_awaiting_screening.is_empty(), | ||
| "note blocks must be screened before the update is built" | ||
| ); |
Collaborator
There was a problem hiding this comment.
This should be a check, not an assertion.
Contributor
Author
There was a problem hiding this comment.
Replaced the assertion with an error here d24f669
SantiagoPittella
approved these changes
Sep 4, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactors
Client::sync_stateso the network fetching phase of the NTL and chain sync run concurrently.This reduces the syncing time by ~25%, according to some benchmarks performed against devnet, syncing the client with 6 imported accounts.
In order to make the NTL and chain fetching concurrent, both syncs are split into a fetch phase (which makes the network requests to the RPC and NTL) and an apply phase (which applies the sync updates to the store).
Client::sync_statethen runs the two fetch phases undertry_join!and applies the changes to the store afterwards, instead of running a full note transport sync before the chain sync.It also adds a check for the nullifiers of the NTL delivered notes (closes #2422).
Closes #2361