feat(discovery-core): add incoming state sync orchestrator - #472
Conversation
40a6e4f to
30a7894
Compare
af02396 to
89e874c
Compare
30a7894 to
7b2de5f
Compare
02f3de4 to
e645277
Compare
92649eb to
b691a09
Compare
e645277 to
a115d06
Compare
b691a09 to
75b642b
Compare
a115d06 to
51c907b
Compare
75b642b to
bffcfed
Compare
bc2e5e3 to
f24f78e
Compare
b31abb3 to
76537a9
Compare
f24f78e to
3346354
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 4 files and all commit messages, and made 3 comments.
Reviewable status: 4 of 5 files reviewed, 3 unresolved discussions (waiting on m-kus).
crates/discovery-core/src/sync/incoming_state.rs line 91 at r2 (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 channels = if cursor.all_channels_processed() {
Suggestion:
let new_channels = crates/discovery-core/src/sync/incoming_state.rs line 115 at r2 (raw file):
} let mut subchannels: Vec<IncomingSubchannel> = Vec::new();
Suggestion:
let mut new_subchannels: Vec<IncomingSubchannel> = Vec::new();crates/discovery-core/src/sync/incoming_state.rs line 211 at r2 (raw file):
note.token = token; notes.push(note); }
For sanity, please check that they both were zeros before.
Or, have two structs - with and without these two fields
Code quote:
// Enrich notes with sender and token context.
for mut note in new_notes {
note.sender_addr = sender_addr;
note.token = token;
notes.push(note);
}
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 1 file and made 1 comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on m-kus).
76537a9 to
ca63ab0
Compare
3346354 to
2c854d5
Compare
2c854d5 to
3e19abe
Compare
ca63ab0 to
32b8a83
Compare
m-kus
left a comment
There was a problem hiding this comment.
@m-kus resolved 3 discussions.
Reviewable status: 4 of 6 files reviewed, all discussions resolved (waiting on Yoni-Starkware).
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on m-kus).
3e19abe to
8190ce6
Compare
32b8a83 to
633e7ec
Compare
8190ce6 to
6cd73d3
Compare

TL;DR
Added a new sync module with an orchestrator for incoming state discovery that efficiently processes channels, subchannels, and notes.
What changed?
syncmodule in the discovery-core crateincoming_state.rswith a hierarchical discovery system that:FuturesUnorderedThis change is