Skip to content

refactor(common): resolve network via BFS through dataset dependencies#1878

Merged
LNSD merged 1 commit intomainfrom
lnsd/refactor-common-bfs-network-resolution
Mar 2, 2026
Merged

refactor(common): resolve network via BFS through dataset dependencies#1878
LNSD merged 1 commit intomainfrom
lnsd/refactor-common-bfs-network-resolution

Conversation

@LNSD
Copy link
Contributor

@LNSD LNSD commented Feb 28, 2026

Replace direct catalog network collection with BFS traversal of dataset dependencies to find raw datasets, enabling correct resolution for derived datasets.

  • Add resolve_network_from_dependencies() BFS function and ResolveNetworkError type
  • Replace SpawnError::MultiNetwork with SpawnError::ResolveNetwork wrapping the new error
  • Remove per-table network collection in admin-api schema handler
  • Add dummy network placeholder in schema endpoint for TS manifest builder compat

@LNSD
Copy link
Contributor Author

LNSD commented Feb 28, 2026

This is a spinoff from #1849

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors streaming query initialization to resolve the target blockchain network by traversing dataset dependency graphs (BFS) to correctly handle derived datasets, and adjusts the admin-api schema endpoint to avoid per-table network collection.

Changes:

  • Added resolve_network_from_dependencies() (BFS) and ResolveNetworkError, and replaced SpawnError::MultiNetwork with SpawnError::ResolveNetwork.
  • Updated streaming query spawn flow to determine network via dataset dependency traversal before resolving the blocks table.
  • Removed catalog-wide network collection from the admin-api schema handler and returned a placeholder network for TS manifest-builder compatibility.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
crates/services/admin-api/src/handlers/schema.rs Stops collecting networks from the planning catalog per table; returns a placeholder network in the schema response.
crates/core/common/src/streaming_query.rs Introduces BFS-based network resolution through dataset dependencies and updates streaming query spawn error handling accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@LNSD LNSD force-pushed the lnsd/refactor-common-bfs-network-resolution branch from 443169f to b8764d2 Compare March 2, 2026 08:17
@LNSD LNSD requested a review from shiyasmohd March 2, 2026 08:22
Unify network resolution and raw dataset lookup into a single BFS traversal,
eliminating a redundant second pass through the dependency graph.

- Add `resolve_raw_dataset_from_dependencies()` returning both `NetworkId` and raw `Dataset`
- Remove separate `search_dependencies_for_raw_dataset()` and its error type
- Simplify `resolve_blocks_table()` to accept a `Dataset` directly
- Replace `SpawnError::ResolveNetwork` with `SpawnError::ResolveRawDataset`
- Remove per-table network collection in admin-api schema handler

Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
@LNSD LNSD force-pushed the lnsd/refactor-common-bfs-network-resolution branch from b8764d2 to a38018b Compare March 2, 2026 10:05
@LNSD LNSD merged commit f4c9e3f into main Mar 2, 2026
17 of 18 checks passed
@LNSD LNSD deleted the lnsd/refactor-common-bfs-network-resolution branch March 2, 2026 10:40
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.

3 participants