Skip to content

feat(indexer): sync outgoing state - #433

Closed
m-kus wants to merge 1 commit into
02-05-feat_index_discover_outgoing_channelsfrom
02-05-feat_indexer_sync_outgoing_state
Closed

m-kus wants to merge 1 commit into
02-05-feat_index_discover_outgoing_channelsfrom
02-05-feat_indexer_sync_outgoing_state

Conversation

@m-kus

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

Copy link
Copy Markdown

TL;DR

Added outgoing state synchronization for privacy pools with improved channel key handling.

What changed?

  • Increased COST_OUTGOING_CHANNEL_INFO from 2 to 3 to account for public key retrieval
  • Enhanced OutgoingChannel struct to include a channel_key derived from sender and recipient identities
  • Added channel key registration in the discovery cursor
  • Created a new outgoing_state module that orchestrates the full outgoing sync workflow:
    • Implements hierarchical discovery (channels → subchannels → note indices)
    • Parallelizes channel and subchannel processing using tokio::task::JoinSet
    • Provides cursor-based pagination with pruning of fully-discovered elements
  • Added comprehensive tests for full discovery and pagination scenarios

How to test?

Run the new tests in the outgoing_state module:

  • test_sync_outgoing_state_full_discovery: Verifies complete discovery with a generous budget
  • test_sync_outgoing_state_pagination: Tests pagination across multiple calls with limited budgets

Why make this change?

This change completes the outgoing state synchronization workflow, enabling efficient discovery of outgoing channels, subchannels, and note indices. The addition of channel key handling improves the security model, while the parallelized processing enhances performance. The pagination support with cursor pruning ensures efficient resource usage during discovery operations.


This change is Reviewable

m-kus commented Feb 5, 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