Skip to content

Conversation

@GheisMohammadi
Copy link
Collaborator

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.

- 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
@GheisMohammadi GheisMohammadi self-assigned this Aug 12, 2025
@GheisMohammadi GheisMohammadi marked this pull request as draft August 12, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants