refactor(common): resolve network via BFS through dataset dependencies#1878
Merged
refactor(common): resolve network via BFS through dataset dependencies#1878
Conversation
Contributor
Author
|
This is a spinoff from #1849 |
There was a problem hiding this comment.
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) andResolveNetworkError, and replacedSpawnError::MultiNetworkwithSpawnError::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.
shiyasmohd
requested changes
Mar 1, 2026
443169f to
b8764d2
Compare
shiyasmohd
approved these changes
Mar 2, 2026
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>
b8764d2 to
a38018b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace direct catalog network collection with BFS traversal of dataset dependencies to find raw datasets, enabling correct resolution for derived datasets.
resolve_network_from_dependencies()BFS function andResolveNetworkErrortypeSpawnError::MultiNetworkwithSpawnError::ResolveNetworkwrapping the new error