-
Notifications
You must be signed in to change notification settings - Fork 115
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
ForkedChain implementation #2405
Conversation
- revamp test_blockchain_json using ForkedChain - re-enable previously failing test cases.
nimbus/core/chain/forked_chain.nim
Outdated
c.replaySegment(finalizedHash) | ||
c.writeBaggage(finalizedHash) | ||
c.stagingTx.commit() | ||
# Update base forward to finalized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, base should move to min(finalized.blockNumber, nax(head.blockNumber, baseDistance) - baseDistance)
where baseDistance
is the 128 constant - later we'll make that configurable as well - it's important to have base at least that much behind so we can answer state queries about history that deep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably means moving the computation of the base block up a bit and separating finalizedHash
and baseHash
- they are two separate concepts - finalizedHash will typically be 64-95 blocks behind head depending on how the voting goes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! I think this is enough to cover the MVP needs for this part, we'll obviously need to revisit a lot of it but we can start wiring it up to the execution API and the rest of nimbus 🥳 |
No optimization
The new test_blockchain_json total run time is not slower than the old one although we employ chain replay. Probably because we also skip descendants of invalid chains altogether instead of try to validate/execute it.
Also the_blockchain_json not relying on total difficulty/chain score anymore even when testing pre PoS chains.
note: uncles, withdrawals, transactions, and receipts are not written to database.fix #2260