Skip to content

Conversation

DracoLi
Copy link

@DracoLi DracoLi commented Sep 8, 2025

Why this should be merged

Not meant to be merged. This PR is for evaluation and testing only.

How this works

Adds a block database wrapper for the ETH database that redirects block header and body storage to a separate block database.
The block database wrapper does not allow storing multiple blocks per height. This means to use it, we must move block persistence from Verify to Accept. Therefore, this PR also includes logic to not store block headers and bodies on Verify. Instead, blocks are stored in an in-memory cache for verified blocks while block-related data (receipts, hash→number mapping, preimages) are still persisted on Verify. These data are needed by other parts of the code before the block is accepted, so they are still persisted on Verify.
However, SAE changes should move block persistence from Verify to Accept as well, so we might not need the changes introduced in this PR for moving block persistence. Therefore, this PR is marked as Do Not Merge for now as we should ideally rely on the SAE work for this change.

This PR is mainly for testing the block database before SAE is fully usable in Coreth.

How this was tested

Tests & manually spinning up a node with block database enabled.

@DracoLi DracoLi changed the title Add vm config to enable block database Add block database support Sep 8, 2025
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch 3 times, most recently from 81ff147 to 76eb0bc Compare September 9, 2025 18:09
@DracoLi DracoLi mentioned this pull request Sep 9, 2025
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch 7 times, most recently from 2f46527 to d0e0a14 Compare September 15, 2025 20:08
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch 4 times, most recently from 4811024 to ff317d6 Compare September 21, 2025 23:25
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch 12 times, most recently from b89948e to f946f2a Compare September 29, 2025 21:45
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch 5 times, most recently from 582cb87 to 1e5abbf Compare October 2, 2025 13:24
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch 4 times, most recently from 6bcfe5d to 346c520 Compare October 13, 2025 18:07
@DracoLi DracoLi force-pushed the dl/blockdb-integration-no-sae branch from 346c520 to 945ad3c Compare October 14, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant