-
Notifications
You must be signed in to change notification settings - Fork 985
EVM Tool state-test should ignore previousHash in lookups #5126
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
Conversation
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
BlockHashLookup to CachingBlockHashLookup Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
siladu
left a comment
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.
Enjoyed reading the Java > 11 code :)
|
|
||
| final WorldUpdater worldStateUpdater = worldState.updater(); | ||
| final BlockHashLookup blockHashLookup = new BlockHashLookup(blockHeader, blockchain); | ||
| final BlockHashLookup blockHashLookup = new CachingBlockHashLookup(blockHeader, blockchain); |
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.
The scope of these changes make me a little nervous but I realise it is essentially just a rename, so should be good.
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.
Yea, either we rename the implementation or we rename the type. I went with the impl on the basis the impl can describe how it implements the interface. i.e. List / ArrayList.
| mutableWorldState, | ||
| transactionProcessor)) | ||
| .collect(Collectors.toList()); | ||
| .toList(); |
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.
Glory be!
| } else if (chainedUpdater instanceof StackedUpdater<?, ?> stackedUpdater) { | ||
| stackedUpdater.markTransactionBoundary(); |
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.
fancy ;)
Use the specified BlockHashes in t8n Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Support two in-the-wild models of blockhash for testing. For state-tests always use the keccak hash of the decimal text of the block number. For t8n always use the blockHashes table in the env. No change to production handling of blockhash. Refactored BlockHashLookup to split caching implementation from API. Signed-off-by: Danno Ferrin <[email protected]>
Support two in-the-wild models of blockhash for testing. For state-tests always use the keccak hash of the decimal text of the block number. For t8n always use the blockHashes table in the env. No change to production handling of blockhash. Refactored BlockHashLookup to split caching implementation from API. Signed-off-by: Danno Ferrin <[email protected]>
PR description
The EVMTool State test needs to ignore the
previosHashfield when it comes to calculating BlockHashes, and instead follow the reference test rule that the hash is the Keccack hash of the base-10 ascii number.To "do it right" this involved refactoring BlockHashLookup to not drag along some caching rules.
Fixed Issue(s)
Fixes #5122
Documentation
doc-change-requiredlabel to this PR ifupdates are required.
Acceptance Tests (Non Mainnet)
./gradlew acceptanceTestNonMainnetlocally if my PR affects non-mainnet modules.Changelog