Skip to content

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Feb 10, 2026

This extends the segment selection algorithm to support multi-network segments. Call sites will continue to depend on there only being single-network segments for now.

@Theodus Theodus mentioned this pull request Feb 10, 2026
14 tasks
@Theodus Theodus force-pushed the theodus/multi-network branch from d6ed284 to 0e2b31f Compare February 10, 2026 20:03
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

LGTM ✅

There are some implementation details, but in general, LGTM.

Comment on lines +467 to +469
/// Multi-network canonical chain not supported with start block
#[error("multi-network datasets with start_block are not supported")]
MultiNetworkWithStartBlock,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that multi-chain joins need to sync the whole history?

Comment on lines +256 to +259
// Invariant: this function only works for single-network segments (raw datasets)
if let Some(first_segment) = segments.first() {
assert_eq!(first_segment.ranges.len(), 1);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible that we bake these invariants into the typesystem?
I'm not asking to do it as part of this PR, just asking if it is possible.

// remove overlapping ranges from each segment
for segment in &segments {
let segment_range = segment.range.numbers.clone();
assert_eq!(segment.ranges.len(), 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we running through this assertion in all the segments? Spooky! 😨

Why don't we just tracing::error and skip the segment?

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