-
Notifications
You must be signed in to change notification settings - Fork 293
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
blockchaintest: Optional partial state hash check #975
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #975 +/- ##
==========================================
- Coverage 93.84% 93.83% -0.01%
==========================================
Files 146 146
Lines 15439 15444 +5
==========================================
+ Hits 14488 14492 +4
- Misses 951 952 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Is this temporary, until the MPT implementation is optimized, or forever? It sounds a tiny bit scary
Temporary but for long time :) Updating MTP seems quite a work and we only need this for testing. Because the state in the final block is evolution of all previous states I think this is relatively fine. The only situation it can miss is when in a middle block state is incorrect but it corrects itself before the final block. The other option is to list the test names for which we want to do the light check. For the EEST stable tests the number of blocks is not bigger than 30. |
:)
We had a very similar case of a self-cancelling test (IIRC EXCHANGE), hence my worries
Or, can we assume a threshold (like 30), above which we automatically switch to the light check? We could also check "every some-prime-number-th" or sth like that, in addition to first 5 + last 5. So that it still keeps us under the 30 blocks mark, WDYT? |
I think at least since Prague, as block hashes are saved into state, the wrong state changes cannot cancel out easily. |
Hm, dunno, probably this is fine as is, however
true, unless they aren't saved because of some bug. But maybe this is paranoid. Maybe a flag to parametrize blockchain test runs, slow vs fast? And slow are run only on releases / with some lower cadence? |
Hm... now I noticed this is weird: we need to compute the block hash which includes the state root hash for EIP-2935, so how all this works as we just disabled this computation... |
52e4530
to
5ccd847
Compare
This is blockchain tests execution optimization: for listed test names only check state root hash of first 5 blocks (to detect early problems) and last 5 blocks (to do the final check of the chain of blocks). The current implementation of the MPT hash of the state builds the trie from scratch (no updates to the trie of the previous block). For the tests will a long chain of blocks the performance degrades significantly with 99% time spent in the keccak hash function. This improves testing of EIP-2935 implemented in #953.
5ccd847
to
14ae941
Compare
Not needed for now so put on hold. |
This is blockchain tests execution optimization: for listed test names
only check state root hash of first 5 blocks (to detect early problems)
and last 5 blocks (to do the final check of the chain of blocks).
The current implementation of the MPT hash of the state builds
the trie from scratch (no updates to the trie of the previous block).
For the tests will a long chain of blocks the performance degrades
significantly with 99% time spent in the keccak hash function.
This improves testing of EIP-2935
implemented in #953.