-
Notifications
You must be signed in to change notification settings - Fork 13
test(ethhash): Use libevm #900
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
base: main
Are you sure you want to change the base?
Conversation
e05c528
to
5929fc9
Compare
fwKeys = append(fwKeys, accHash[:]) | ||
encodedVal, err := rlp.EncodeToBytes(acc) | ||
require.NoError(t, err) | ||
fwVals = append(fwVals, encodedVal) |
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.
How does this NOT change the hash???
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.
Ah yes, you found some of the ethhash magic. It doesn't matter what the hash is inside the data for an account. We compute the correct value and use that to hash the trie.
I was mistaken earlier when I stated that we never look at the data. We do some magic RLP encoding stuff to ensure compatibility with the hash at the top level, and we don't care what that hash is inside the data when computing the hash.
Instead of importing
go-ethereum
,libevm
has the same functionality, but maintained by us. Upon editing the file, there were additionally lint changes needed, as well as adding account changes to better emulate use cases.