Repository navigation
feat(node,store): compress existing cached blocks - #6853
Draft
MoonBoi9001 wants to merge 2 commits into
Draft
MoonBoi9001 wants to merge 2 commits into
MoonBoi9001 wants to merge 2 commits into
Conversation
MoonBoi9001
marked this pull request as ready for review
December 1, 2026 10:48
MoonBoi9001
marked this pull request as draft
December 1, 2026 10:57
MoonBoi9001
marked this pull request as ready for review
December 1, 2026 16:56
MoonBoi9001
force-pushed
the
mb9/compress-existing-blocks
branch
from
December 1, 2026 17:24
880cfc3 to
297477c
Compare
MoonBoi9001
marked this pull request as draft
December 1, 2026 17:48
Copy the blocks of a chain to a new table at a limited rate, compressing them with zstd, while a trigger notes which blocks change. Then apply these changes and swap the tables. A run can be continued or undone.
Blocks that are already cached stay uncompressed when compression is turned on. Add compress-blocks, which compresses them, shows how far it got, and can undo an unfinished run or delete the uncompressed blocks.
MoonBoi9001
force-pushed
the
mb9/compress-existing-blocks
branch
from
December 2, 2026 17:20
297477c to
0c67d4d
Compare
This branch has not been deployed
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.
TL;DR
Adds
graphman chain compress-blocks, which compresses blocks already in a chain's block cache while the chain stays in use.Motivation
#6851 only compresses blocks as they are written, so an existing cache keeps its uncompressed blocks until they are deleted. The alternative, truncating the cache and letting graph-node fetch blocks again, costs an RPC call for every block a subgraph needs and slows indexing while the cache refills; converting in place needs no RPC calls.
Summary
compress-blocks <chain> runcopies the blocks into a new compressed table at a limited rate (--max-rate, 20 MB/s by default), keeps it up to date with changes, and swaps the tables at the end;--no-swapstops before the swap.statusshows progress andabortundoes an unfinished run.drop-olddeletes the uncompressed table after the swap.Important
Until
drop-oldruns, the chain needs disk space for a second copy of its blocks, at about half their current size.