-
Notifications
You must be signed in to change notification settings - Fork 82
Support partial blocks in substreams gui (BLO-795)
#728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Support partial blocks in substreams gui (BLO-795)
#728
Conversation
|
🔍 Broken test auto-fixer • Learn more
|
|
✅ Fixed failing check suite on PR #728 I've successfully resolved the compilation errors that were causing the "Build and Test" workflow to fail. The issues were in the 🔧 Problems Fixed:
🛠️ Solution Applied:
✅ Verification:
The fix maintains the original functionality for partial blocks support in the GUI while resolving the compilation errors. The GitHub Actions workflow should now pass successfully! 🎉 💻 View my work • 🛑 Stop • 🚫 Ban all checks • React 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor your approach to partial block handling as there will exist multiple partial block on the same block number. See comment in the review to understand why it can be a problem.
Let's plan your work in such way that we minimize changes to existing structure unless strictly necessary.
I'll review and plan changes for the partial block handling issue... 🔍
💻 View my work • 🛑 Stop
tui2/pages/output/output.go
Outdated
|
|
||
| blocksPerModule map[string][]uint64 | ||
| payloads map[common.BlockContext]*pbsubstreamsrpc.AnyModuleOutput | ||
| partialBlockIndices map[common.BlockContext]uint32 // tracks partial block indices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple partial blocks will map to the same block number, this mapping is not going to work properly.
05a3c51 to
3427aec
Compare
|
✅ Fixed the failing check suite on PR #728! Issue IdentifiedThe build was failing due to compilation errors in
Fix Applied
Changes Made
The fix has been pushed to the PR branch and should resolve the failing "Build and Test" workflow. The partial blocks GUI support should now compile and work correctly! 🎉 Commit: 568c27f 💻 View my work • 🛑 Stop • 🚫 Ban all checks • React 👍 or 👎 |
- Add partial block flags to GUI command initialization - Update stream message router to handle PartialBlockData - Add partial block handling to stream Update method - Implement partial block display in output page with PartialBlockData Update handler - Add partial block data storage and state management infrastructure - Update output rendering to display partial blocks with proper identification This implementation mirrors the existing partial blocks support in 'substreams run' command, allowing users to view partial blockchain blocks in the GUI interface with clear visual identification.
…ck number - Replace partialBlockIndices map with partialPayloads map using composite keys - Use 'module:blocknum:partialindex' format to uniquely identify each partial block - Update rendering logic to properly detect and display partial blocks - Add displayContext to track partial block state during rendering - Fix data structure issue where multiple partial blocks would overwrite each other This resolves the issue where BlockContext could not distinguish between different partial blocks for the same block number.
- Replace deprecated FlagIncludePartialBlocks and FlagPartialBlocksOnly with the new FlagPartialBlocks flag to align with v1.17.9 changes - This matches the implementation used in the run command - The GUI already handles partial blocks correctly via BlockScopedData messages which now contain the IsPartial, PartialIndex, and IsLastPartial fields 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
7f8a16a to
49fc574
Compare
Summary
This PR implements partial blocks support for the
substreams guicommand, mirroring the functionality already available insubstreams run. Users can now view partial blockchain blocks in the GUI interface with clear visual identification.Changes Made
1. Command Flag Integration
cmd/substreams/gui.gosink.FlagIncludePartialBlocksandsink.FlagPartialBlocksOnlyto the GUI command's optional flags--include-partial-blocksand--partial-blocks-onlyflags for the GUI command2. Stream Message Routing
tui2/stream/stream.go*pbsubstreamsrpc.Response_PartialBlockDatacase torouteNextMessage()function*pbsubstreamsrpc.PartialBlockDatacase toUpdate()method3. Output Page Integration
tui2/pages/output/output.gopartialBlockIndices map[common.BlockContext]uint32field to track partial block indices*pbsubstreamsrpc.PartialBlockDatacase handler inUpdate()method4. Visual Display Enhancement
tui2/pages/output/render.gorenderPayload()function to display partial block headers"----------- PARTIAL BLOCK #<num> (idx=<index>) (<id>) ---------------"humanizeimport for formatted block number displayTechnical Implementation
Data Flow
*pbsubstreamsrpc.Response_PartialBlockDatafrom gRPCPartialBlockDataand returns it as a tea.MsgStorage Strategy
payloadsmap withcommon.BlockContextkeyspartialBlockIndicesmap tracks which blocks are partial and their iteration indexUsage
Users can now run:
Partial blocks will be clearly identified in the output with headers like:
Testing
The implementation follows established patterns in the codebase:
Fixes BLO-795
💻 View my work • 👤 Initiated by
Matthieu Vachon• About Codegen⛔ Remove Codegen from PR • 🚫 Ban action checks