refactor(conductor): fetch missing blocks as necessary #1054
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.
Summary
Conductor fetches blocks from the rollup node if they are not in its cache.
Background
During initialization and when set to firm-and-soft commitment mode, Conductor issued a
BatchGetBlocks
RPC to the rollup. When the delta between firm and soft commitments was too large, this could be a request for 50k and more elements, putting a lot of pressure on the rollup node or failing outright because the request exceeded the default 4MB limit for gRPC requests.This patch replaces this pre-fetch in favor of an already existing fallback logic: if conductor finds a Celestia block with the next desired firm-number, it either looks up the corresponding rollup block in its cache, or requests it from the rollup. It then updates the rollup's commitment state.
Changes
BatchGetBlocks
logic from conductorTesting
Update the conductor test for fetching missing rollup blocks.