Skip to content

feat(indexer): batch state sync - #435

Closed
m-kus wants to merge 1 commit into
02-05-feat_indexer_sync_outgoing_statefrom
02-06-feat_indexer_batch_state_sync
Closed

m-kus wants to merge 1 commit into
02-05-feat_indexer_sync_outgoing_statefrom
02-06-feat_indexer_batch_state_sync

Conversation

@m-kus

@m-kus m-kus commented Feb 6, 2026 •

Copy link
Copy Markdown

Optimize discovery with batched RPC calls

This PR improves the efficiency of privacy pool discovery by implementing batched RPC calls for notes and channel information. Key improvements:

  • Replace sequential note scanning with a two-phase approach:

    1. Batched exponential probing to find the last existing note index
    2. Efficient linear batch scanning for note amounts and nullifiers
  • Add batch methods to IViews trait:

    • get_channel_info_batch: fetch multiple channels in one call
    • get_notes_batch: check existence of multiple notes
    • get_note_and_nullifier_batch: fetch note amounts and nullifier status
  • Implement consume_up_to in IoBudget to handle batch operations efficiently

  • Replace tokio::task::JoinSet with futures::FuturesUnordered for concurrent processing

  • Clarify cursor semantics for max_note_index in incoming channels

These changes significantly reduce RPC round trips, improving discovery performance while maintaining the same functionality.


This change is Reviewable

m-kus commented Feb 6, 2026 •

Copy link
Copy Markdown
Author

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.

1 participant