Skip to content

feat(discovery-core): add outgoing state sync orchestrator - #473

Merged
m-kus merged 1 commit into
mainfrom
pr-split/12-outgoing-sync
Feb 19, 2026
Merged

m-kus merged 1 commit into
mainfrom
pr-split/12-outgoing-sync

Conversation

@m-kus

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

Copy link
Copy Markdown

TL;DR

Added outgoing state sync orchestration to the discovery module, enabling hierarchical discovery of outgoing channels, subchannels, and note indices.

What changed?

  • Created a new outgoing_state.rs module that orchestrates the outgoing sync process
  • Implemented sync_outgoing_state function that composes paginated discovery of channels, subchannels, and note indices
  • Added concurrent processing of channels and subchannels using FuturesUnordered
  • Implemented cursor-based pagination to handle large datasets efficiently
  • Added support for precomputing channels for requested recipients
  • Exposed the new module via pub mod outgoing_state in the sync module

This change is Reviewable

@m-kus
m-kus requested a review from Yoni-Starkware February 11, 2026 16:19
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 57f57d7 to f3313de Compare February 11, 2026 19:10
@m-kus
m-kus force-pushed the pr-split/11-incoming-sync branch from af02396 to 89e874c Compare February 11, 2026 19:10
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from f3313de to a9e0712 Compare February 13, 2026 01:49
@m-kus
m-kus force-pushed the pr-split/11-incoming-sync branch from 89e874c to 02f3de4 Compare February 13, 2026 01:49
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from a9e0712 to 8a9360d Compare February 13, 2026 02:02
@m-kus
m-kus force-pushed the pr-split/11-incoming-sync branch from 02f3de4 to e645277 Compare February 13, 2026 02:02
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 8a9360d to fe37bfb Compare February 13, 2026 02:07
@m-kus
m-kus force-pushed the pr-split/11-incoming-sync branch from e645277 to a115d06 Compare February 13, 2026 02:07
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from fe37bfb to 81240cc Compare February 13, 2026 02:23
@m-kus
m-kus force-pushed the pr-split/11-incoming-sync branch 2 times, most recently from 51c907b to 589218b Compare February 13, 2026 02:29
@m-kus
m-kus changed the base branch from pr-split/11-incoming-sync to graphite-base/473 February 17, 2026 17:09
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 784d819 to 7ef3112 Compare February 17, 2026 17:13
@m-kus
m-kus force-pushed the graphite-base/473 branch from f24f78e to 3346354 Compare February 17, 2026 17:13
@m-kus
m-kus changed the base branch from graphite-base/473 to pr-split/11-incoming-sync February 17, 2026 17:13
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 7ef3112 to 57e7866 Compare February 18, 2026 15:12
@m-kus
m-kus force-pushed the pr-split/11-incoming-sync branch from 3346354 to 2c854d5 Compare February 18, 2026 15:12
@m-kus
m-kus changed the base branch from pr-split/11-incoming-sync to graphite-base/473 February 18, 2026 15:59
@m-kus
m-kus force-pushed the graphite-base/473 branch from 2c854d5 to 3e19abe Compare February 18, 2026 16:03
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 57e7866 to 03731f2 Compare February 18, 2026 16:03
@m-kus
m-kus changed the base branch from graphite-base/473 to pr-split/11-incoming-sync February 18, 2026 16:03
@m-kus
m-kus changed the base branch from pr-split/11-incoming-sync to graphite-base/473 February 18, 2026 16:52
@m-kus
m-kus force-pushed the graphite-base/473 branch from 3e19abe to e43d3c5 Compare February 18, 2026 16:57
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 03731f2 to c74417e Compare February 18, 2026 16:57
@m-kus
m-kus changed the base branch from graphite-base/473 to main February 18, 2026 16:58
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from c74417e to 91af1d8 Compare February 18, 2026 16:58

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@Yoni-Starkware reviewed 2 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on m-kus).


crates/discovery-core/src/sync/outgoing_state.rs line 96 at r1 (raw file):

    // On a fresh cursor this is vacuously true; on subsequent calls it fires
    // once all previously discovered channels have been fully processed.
    let mut channels = if cursor.all_channels_processed() {

etc. (to emphasize they are brand new channels, and not existing ones that were partially traversed)

Suggestion:

 let mut new_channels

crates/discovery-core/src/sync/outgoing_state.rs line 190 at r1 (raw file):

    budget: &IoBudget,
) -> Result<ProcessChannelResult, DiscoveryError> {
    let channel_key = cursor.channel_key.ok_or_else(|| {

Why is the channel key optional?

Code quote:

let channel_key = cursor.channel_key.ok_or_else(|| 

@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 91af1d8 to 8121167 Compare February 19, 2026 15:06
@m-kus
m-kus force-pushed the pr-split/12-outgoing-sync branch from 8121167 to ef68149 Compare February 19, 2026 15:41

@m-kus m-kus left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kus resolved 2 discussions.
Reviewable status: 1 of 8 files reviewed, all discussions resolved (waiting on Yoni-Starkware).

@m-kus
m-kus merged commit d738b19 into main Feb 19, 2026
5 of 6 checks passed
@m-kus
m-kus deleted the pr-split/12-outgoing-sync branch February 19, 2026 16:15
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.

2 participants