Merged
Conversation
295d31a to
ca27e27
Compare
akokoshn
reviewed
Apr 14, 2025
ca27e27 to
ec7c4c4
Compare
ec7c4c4 to
64b46e5
Compare
oclaw
reviewed
Apr 16, 2025
| func validateBatch(subgraphs []Subgraph) error { | ||
| if len(subgraphs) == 0 { | ||
| return errors.New("subgraphs cannot be empty") | ||
| func ExistingBlockBatch( |
Contributor
There was a problem hiding this comment.
A bit confusing name. What does Existing word means here?
Contributor
Author
There was a problem hiding this comment.
The idea is that ExistingBlockBatch reconstructs an existing batch, while NewBlockBatch creates a new one
upd: renamed to ReconstructExistingBlockBatch(...)
64b46e5 to
fe95915
Compare
fe95915 to
9d4842d
Compare
akokoshn
reviewed
Apr 16, 2025
9d4842d to
770aacc
Compare
Modified the APIs of the `BlockBatch` and `Subgraph` types for better support of multi-subgraph batch construction * `NewBlockBatch(...)` now always constructs an empty batch; * Implemented `BlockBatch.WithAddedSubgraph(...)` method, which checks per-shard block sequencing and appends a new subgraph to the batch; * Replaced `BlockBatch.SetDataProofs(...)` with `BlockBatch.WithDataProofs(...)`; Both `WithAddedSubgraph(...)` and `WithDataProofs(...)` are implemented as immutable methods that return a shallow copy of the original batch. This is required for batch event handling (to be implemented in a follow-up PR)
* Replaced the `Subgraph` type, which depends on the main shard block, with `ChainSegments`; * Simplified the `BlockBatch` structure and its methods (using a map of blocks instead of a list of subgraphs); * `SubgraphFetcher` still uses the main shard block as the starting point, but now returns `ChainSegments`;
770aacc to
8a5c10f
Compare
Replaced `TryGetLatestBatchId` with `TryGetLatestBatch` to return full batch details instead of just the ID. Will be used in the next PR by `Aggregator`.
8a5c10f to
93fa94e
Compare
akokoshn
approved these changes
Apr 22, 2025
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.
BlockBatch type API
Modified the APIs of the
BlockBatchandSubgraphtypes for better support of multi-subgraph batch constructionNewBlockBatch(...)now always constructs an empty batch;BlockBatch.WithAddedBlocks(...)method, which checks per-shard block sequencing and appends a new blocks to the batch;Simplified Block Batching
Subgraphtype, which depends on the main shard block, withChainSegments;BlockBatchstructure and its methods (using a map of blocks instead of a list of subgraphs);SubgraphFetcherstill uses the main shard block as the starting point, but now returnsChainSegments;Batch Reconstruction
TryGetLatestBatchIdwithTryGetLatestBatchto return full batch details instead of just the ID. Will be used in the next PR byAggregator;