feat(evm): add database with separate storage for block data #4485
+1,985
−0
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.
Why this should be merged
Allows EVM block data to be moved out of the key-value database into dedicated height-indexed databases that are better suited for block storage. This reduces KV usage and lowers compaction impact.
heightindexdb; all other data remains in the underlying KV database.Part of #4491
How this works
The
blockdb.Databaseroutes block data by key prefix, while keeping non-block data on the KV store.allowDeferredInitis enabled, the database can be initialized when the minimum block height is known (useful with state sync). The min height is then persisted and cannot be changed without recreating the block databases.blockdbis enabled, it should not be disabled.Migrations
On initialization, the database starts migrating canonical block data from the KV store to the height-indexed databases in the background.
How this was tested
blockdbrunning for weeks.blockdb.Need to be documented in RELEASES.md?
No