Skip to content

Conversation

@GheisMohammadi
Copy link
Collaborator

@GheisMohammadi GheisMohammadi commented Nov 27, 2025

This PR implements the EIP-2935 specification to add block hash history window. The enhancement addresses a significant limitation where only recent block hashes were accessible, hindering the development of applications requiring access to older block data. The implementation introduces a new ring buffer storage mechanism that efficiently stores block hashes using modulo-based indexing. When the Prague fork activates, the system automatically populates the entire history buffer with available block hashes, providing seamless access to much older block information. The storage uses a dedicated contract address and maintains backward compatibility while extending the accessible history by 32x.
This enhancement significantly improves functionalities by providing access to historical block states that were previously inaccessible. The implementation follows the EIP-2935 specification exactly, ensuring compatibility with existing tooling and standards while opening new possibilities for blockchain applications that require historical data access.

@GheisMohammadi GheisMohammadi changed the base branch from main to dev November 27, 2025 22:02
@GheisMohammadi GheisMohammadi self-assigned this Nov 27, 2025
@GheisMohammadi GheisMohammadi changed the title EIP 2935 EIP 2935: Block Hash History Nov 27, 2025
- Add ProcessBlockHashHistory function that properly populates the entire history buffer
- Fix ProcessParentBlockHash function signature and implementation
- Implement correct ring buffer logic for 8192-block history window
- Handle transition from old 256-block window to new 8192-block window
- Ensure proper parameter ordering and function calls
- Fix test compilation issues
- Simplify test to use direct state database creation instead of complex test environment
- Remove debug panic statements that were added for troubleshooting
- Add proper imports for rawdb and state packages
- Ensure test can run without nil pointer dereference errors
- Fix ProcessBlockHashHistory fork block detection logic
- Update BLOCKHASH opcode to support history storage contract (8192 blocks)
- Add IsPrague flag to Rules struct for EVM chain rules
- Fix opBlockhash to exclude 256-block window from history lookup
- Fix ProcessBlockHashHistory to store correct block hashes
- Add nil check for genesis block case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants