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

Add hardfork histories for opt and arb mainnet/sepolia #5394

Merged
merged 3 commits into from
Jun 19, 2024

Conversation

fvictorio
Copy link
Member

Fixes NomicFoundation/edr#447.

We don't have hardfork activation histories for optimism and arbitrum. This means that if you fork one of those networks and immediately make a call, you'll get a "No known hardfork for execution on historical block..." error, because those calls are executed in the forked block, which uses the remote hardfork.

A scenario that doesn't work and is easier to understand is a call executed in a block before the forked block, for the same reason, but this is rarely done.

You might be wondering "why aren't more people complaining about this? Surely there are many users forking optimism and arbitrum", and I think the answer is that normally you send a transaction before making a call, which mines a new block and then the subsequent calls use the local, known hardfork.

The "histories" are used are obviously wrong. This basically says "use Shanghai for these chains". Finding the proper hardfork block numbers for L2s is hard, and even if you can do it there are extra problems: 1) those hardforks might not map 1-1 with ethereum mainnet hardforks, and 2) the hardforks might be specified using timestamps instead of block numbers, which makes this even harder.

So I did the lazy, conservative thing and set Shanghai to block 0 for the four chains.

Copy link

changeset-bot bot commented Jun 14, 2024

🦋 Changeset detected

Latest commit: 1ad1973

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

This PR includes changesets to release 1 package
Name Type
hardhat Patch

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

Copy link

vercel bot commented Jun 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 9:22am

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Jun 14, 2024
@@ -141,6 +141,30 @@ export const defaultHardhatNetworkParams: Omit<
]),
},
],
[
Copy link
Member

Choose a reason for hiding this comment

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

This is ok, but i'd rather keep track of it, either with a comment or an issue (linked in a comment).

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 1ad1973

Copy link
Member

@alcuadrado alcuadrado left a comment

Choose a reason for hiding this comment

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

approved but left a small comment

@fvictorio fvictorio merged commit 11f13e5 into main Jun 19, 2024
73 checks passed
@fvictorio fvictorio deleted the add-l2-hardfork-histories branch June 19, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

No known hardfork for execution on historical block
2 participants