-
Notifications
You must be signed in to change notification settings - Fork 153
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
block_number
genesis parameter removed
#225
Comments
Hey @Pet3ris. This is due to an upstream set of changes in >>> backend = PyEVMBackend(vm_configuration=(
... (0, LondonVM),
... ))
>>> default_header_fields = vars(backend.chain.header).items()
>>> custom_header_fields = {}
>>> for key, val in default_header_fields:
... normalized_key = key[1:] # removes starting "_" from the property
... if normalized_key == 'block_number':
... custom_header_fields['block_number'] = 12345 # set block number here
... else:
... custom_header_fields[normalized_key] = val
>>> backend.chain.header = LondonBlockHeader(**custom_header_fields)
>>> backend.chain.header.block_number
12345
>>> tester = EthereumTester(backend=backend) This is pretty hacky but I'm hoping it will at least get you unstuck for now. I will create an issue in Let me know if this workaround helps you get unstuck. Good luck! |
Wow thanks @fselmo - this is super cool, thanks for suggesting the work-around and adding the issue. Will give it a go! |
Alright - I was able to change the block number with this snippet but it looks like it changes the block number of the second block, not the first block. I'm now getting the error:
which comes from here: https://github.com/ethereum/py-evm/blob/cb6f44c3e43f3f56ff4082b10cc63ab90e6acf19/eth/vm/base.py#L608 Is there a way around this other than monkey patching out the parent check? |
@Pet3ris yeah... none of this is ideal. I can try to check out the |
@fselmo no worries - unfortunate the cascading effects of the block number! I'll try and think about what would be safe to monkey patch for now. |
What was wrong?
I noticed that the
block_number
genesis parameter is removed to make London work (eth-tester/eth_tester/backends/pyevm/main.py
Line 146 in 8587730
eth-tester
?How can it be fixed?
Uncomment
block_number
in supported genesis parameters?The text was updated successfully, but these errors were encountered: