Skip to content

Add Blockhash library following EIP-2935 #5642

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ernestognw
Copy link
Member

Fixes #5639

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

Copy link

changeset-bot bot commented Apr 21, 2025

🦋 Changeset detected

Latest commit: 1e95107

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ernestognw
Copy link
Member Author

Tests are missing, perhaps there's a way to enable 2935 in either Foundry or Hardhat but requires some research before continue

@arr00
Copy link
Contributor

arr00 commented Apr 21, 2025

Btw NomicFoundation/hardhat#6226

@ernestognw
Copy link
Member Author

Yeah I'm also trying to test in Foundry and it doesn't really work 😕

@@ -1,6 +1,6 @@
[profile.default]
solc_version = '0.8.24'
evm_version = 'cancun'
evm_version = 'prague'
Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps this is unnecessary since we're vm.etch'ing the bytecode anyway. I couldn't find anythign about EIP-2935 in the Foundry docs

@arr00 arr00 requested a review from Copilot April 24, 2025 15:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a Blockhash library as per EIP-2935, extending access to historical block hashes beyond the standard 256-block limit.

  • Updates the EVM version in foundry.toml from 'cancun' to 'prague' to support new EIP features.
  • Adds a changeset entry detailing the Blockhash library feature.

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
foundry.toml Updated evm_version to 'prague' to reflect the new EIP-2935 support.
.changeset/wet-dodos-reply.md Added changeset entry summarizing the Blockhash library feature.
Files not reviewed (2)
  • contracts/utils/Blockhash.sol: Language not supported
  • test/utils/Blockhash.t.sol: Language not supported

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.

Create a library to serve historical block hashes from state (EIP-2935)
2 participants