-
Notifications
You must be signed in to change notification settings - Fork 649
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
Make block_number
configurable in genesis header again
#2044
Comments
Only question here is whether or not we should be passing the |
@catoenm I'd be curious to hear your use-case for this change. It would be strange to me to provide a In other words... if the header to be configured has a parent, then the In this sense something like this might make the most sense ? : if parent is None:
parent_hash = GENESIS_PARENT_HASH
block_number = block_number if block_number else GENESIS_BLOCK_NUMBER
if state_root is None:
state_root = BLANK_ROOT_HASH
else:
parent_hash = parent.hash
if block_number:
raise PyEVMError("block_number cannot be configured if a parent header exists.")
block_number = BlockNumber(parent.block_number + 1)
if state_root is None:
state_root = parent.state_root Let me know if I'm missing anything. @Pet3ris I'd be curious on your input here and use-case as well. edit: This validation also makes sense to me considering the original issue and the validation already in place, as outlined in this comment: ethereum/eth-tester#225 (comment) |
This makes a lot of sense. I've updated #2063 accordingly. |
@fselmo Thanks a lot for looking into this! I'm using |
What is wrong?
block_number
. See eth-tester issue #225.How can it be fixed
fill_header_params_from_parent()
needs the ability to pass in ablock_number
kwarg to be configurable again. This call is made from the create_header_from_parent() method in the header classes.block_number
should be a parameter in the fill_header_params_from_parent() method that can be configured but should still keep the current default toGENESIS_BLOCK_NUMBER
if the parent is None or to the parentblock_number
+ 1 if the parent exists.At a quick glance I believe this is the only change necessary. Testing should be added as well.
The text was updated successfully, but these errors were encountered: