-
Notifications
You must be signed in to change notification settings - Fork 759
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
Invalid block stateRoot: runBlockchain for very early blocks from Ropsten / Mainnet #587
Comments
I wouldn't be surprised if early blocks fail. |
We should really keep this a bit on the plate to backport/re-integrate older HFs - should be much more manageable now with all the latest refactorings and optimizations. Just can't prioritize right now with all the Istanbul and other work. |
Yeah I won't be able to look into this until Istanbul support is done. Something valuable would be to collect a list of issues that need to be fixed if anyone is interested (@whalelephant maybe?). My guess is that #543 would solve a set of gas-related issues. |
@s1na : Can I clarify, you think it will be useful to collect a list of all the fixes required to backport old HF? |
Yes. I think as a first step it'll be helpful to have an idea which problems there are. Where the VM diverges from the early hardforks' rules. So that we can fix these problems later on. I think the main problem is the opcode base gas costs. Found this in the developer docs:
|
I also agree that it would be a good thing to support older HFs, and be able to run mainnet's blockchain. I think the discussion that happened in this -block PR is super relevant here. |
Fixed with the v5 releases #962, will close. |
For a simple case: Export blocks from a node (Ropsten / Mainnet) via JSON-rpc (eth_getBlock) and use vm.runBlockchain to run the blocks and transactions.
I have followed the provided example which runs without any issues.
Below is the modified version to run 1 block
The testData is below, genesisBlock is the header from the mainnet genesis block and
blocks[0]
is from block 1 of the networkError
The error produced is
Error: invalid block stateRoot
. The stateRoot that is set in [here] (https://github.com/ethereumjs/ethereumjs-vm/blob/master/lib/runBlock.ts#L96), before running the block, is the correct genesis state. I have tried different hardforks but the error is the same even though the stateRoots produced were different.The text was updated successfully, but these errors were encountered: