-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Geth Import should support importing PoS blocks #24601
Comments
I think it's a good feature request. |
Some background: up until now, we've kind of treated So now, we either need to change the model, and treat the Alternatives:
I'm leaning towards the second option. Regular |
Do you have an example rlp dump of such blocks, which fails the import? |
@holiman Isn't this case simply exporting and reimporting the blocks from a network post-merge? E.g. Kiln? In that case once TTD is reached, we should just start accepting blocks without PoW IMHO. Nothing else we can do really. |
Does Thus the client can be initialized with TTD defined in genesis config. And geth import continue to work as it was given the merge rules. (Stop accepting PoW blocks and start PoS once TTD is reached) Btw is it ignoring the nonce and mixhash for testing? Basically this is test_importRawBlock kind of method, I was asking to expose to simulate a block coming from the network for the client |
@holiman this is the blockchain test used to find the issue, it contains the rlp of the block: However the genesis does not contain the TerminalTotalDifficulty, this is added in the hive |
@marioevz you don't happen to have the output from
i.e, the genesis that gets created... do you? EDIT: my bad, that doesn't spit out the genesis, nevermind. I'll dig it out |
|
Here it is:
|
Awesome, now I can repro it
|
Rationale
At the moment, using
geth import
for PoS blocks (blocks that happen after the Terminal Total Difficulty is reached) fails because the feature requires all imported blocks to have a non-zerodifficulty
value, which is not the case for PoS blocks, which all require 0 in thedifficulty
field.Why should this feature exist?
This feature would aid testing in the
consensus
hive simulator, which currently attempts to import blocks in theBlockchainTests
category of thetests
repository.What are the use-cases?
Importing blocks with non-zero difficulty after the TTD has been reached should still result in error.
PoS blocks with ommers should also fail, or non-zero Nonce.
These are test cases that cannot be tested through the Engine API since the payload does not contain these fields.
This feature was also mentioned in #24003
Implementation
Do you have ideas regarding the implementation of this feature?
The import feature should be aware of the TerminalTotalDifficulty setting in the genesis, and act accordingly when doing the block imports.
Are you willing to implement this feature?
The text was updated successfully, but these errors were encountered: