EVM: block hash to block store wire up - #5437
Open
mpapierski wants to merge 6 commits into
Open
Conversation
Replace external DataReader and DataWriter usage with semantic methods on LMDB transactions. Keep the generic traits and internal key types crate-private, exposing only methods required by node and EVM callers. Let temporary block stores own their directory across shallow clones and update storage, executor, and test-support callers accordingly.
mpapierski
requested review from
EdHastingsCasperAssociation and
darthsiroftardis
July 31, 2026 15:20
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.
Overview
This PR removes the
BlockHashProviderabstraction from the EVM executor and letsCasperDbread block hashes directly from the indexed LMDB block store through theDataAccessLayer.The DAL now owns a shallow-cloned
LmdbBlockStorehandle, allowing the executor to open short-lived read transactions without reopening the LMDB environment. The old block-hash preloading logic and the speculative execution requests used to populate it have been removed.As part of the DAL wiring, LMDB transaction access is exposed through semantic block-store methods. The generic
DataReaderandDataWritertraits and their internal key types are now crate-private. Temporary block stores also own their temporary directory, making shallow-cloned test stores self-contained.EIP-2935
This also adds the EIP-2935 block hash history contract at its standard address, with the standard runtime bytecode and code hash. The predeploy is installed idempotently during genesis and protocol upgrades.
Direct
CALLandSTATICCALLoperations are handled natively byCasperEvmPrecompiles. Valid requests read indexed Casper block headers from LMDB instead of executing the contract bytecode or maintaining Ethereum’s 8,191-slot state ring.DELEGATECALLandCALLCODEcontinue to use the deployed bytecode path.The existing
BLOCKHASHopcode remains unchanged semantically: revm continues to enforce its 256-block window, while the hash itself is loaded from the indexed block store.Execution guard
Before executing a finalized block containing EVM transactions, contract runtime checks that the full 8,191-block EIP-2935 history window is locally available. Missing history emits the existing non-executable block announcement and moves the node toward CatchUp. Non-EVM blocks skip this check.