Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new(tests): EIP-2935: Serve historical block hashes from state #564

Merged
merged 8 commits into from
May 24, 2024

Conversation

marioevz
Copy link
Member

πŸ—’οΈ Description

Implement EIP-2935 tests for Prague.

πŸ”— Related Issues

#498

βœ… Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@marioevz marioevz added scope:tests Scope: Test cases type:feat type: Feature labels May 17, 2024
Copy link
Collaborator

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Happy for you to merge this after tox is passing.

I'm aware that we need to update this based on these change:
ethereum/EIPs#8577

I really liked the approach with the contract.bin file, but I guess we wont need it now.

I tried to outline what the key changes below are from my understanding, I think we could add extra tests for some of these cases, on the off chance clients keep some of the original funcitionality:

  1. Only update the ring buffer starting from the fork block and not including additional ancestors. Maybe add a test to check that additional ancestors are not included.
  2. Before the fork check that the opcode returns the blockhash for blocks within the old blockhash window, zero otherwise. We could extend this to be 256 + 1 blocks before transitioning. After the fork check the same for the appropriate new windon. I believe it should be gradual, so we could check inside and outside this window for each block as the ring buffer is filling up until > 8192 blocks. We could maybe do this all in one test, like a super transition test. :)
  3. BLOCKHASH gas costs, with the new update the opcode gas cost now remains the same. We could add a sanity check for this to make sure clients adhere to this.

Copy link
Collaborator

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and then the CHANGELOG too!

@marioevz marioevz merged commit 3baf416 into main May 24, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:tests Scope: Test cases type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants