-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Forking mainnet with createMemoryClient
returns the wrong genesis block hash
#1356
Comments
createMemoryClient
returns the wrong block hashcreateMemoryClient
returns the wrong genesis block hash
This is expected because the Ethereumjs supports switching eip and hardfork based on block number but the code to do so is problematic with regard to tree shaking so when tevm adds support it will be optional and look different This issue is very low on the priority list so gonna add a "looking for help" label |
Looks like foundry just uses fork as source of truth for block hash for past blocks but otherwise isn't doing anything to keep hash correct. I'm not seeing anything that sets the EVM and uses the fork as source of truth on pre fork json rpc requests like eth_call. Using the fork as source of truth even for computed values like blockHash feels like an easy fix and a good one. Will make a ForkedBlock class for this. I also think adding a passThrough: true option that will do this behavior of using forked chain as source of truth whenever possible is a good compromise if hardfork during execution matters too for methods like eth_call. |
Closing in favor of #1360 |
The following jest test fails with the wrong block hash for mainnet's genesis block:
The result I'm getting is
"0xeff8054e319d68b09a444777360ba5d400372488a05cabc30d851b3d987b90d3"
, which is not the actual genesis blockThe text was updated successfully, but these errors were encountered: