Skip to content
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

core/rawdb: fix transaction indexing/unindexing hashing error #22457

Merged
merged 4 commits into from
Mar 16, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Mar 8, 2021

In reference to #22453
While investigating that, I found that the transaction indexer / unindexer used a shortcut to do hashing: writing the raw rlp into the hasher, without going via object-form. This is a neat trick to save some cycles, however, due to the new hashing format of typed transaction, it does not produce correct hashes any longer.

This PR therefore changes that, removes the use of rlp-direct-to-hasher and instead parses the full object form of the block body, and afterwards does a full hashing. The rlp.ListIterator is currently still left in there, perhaps we want to revisit that optimization later and reapply it.

This PR also adds better log output, so we can see what blocks are causing problems.

@holiman holiman changed the title core/rawdb: more verbose error logs + better hashing core/rawdb: fix transaction indexing/unindexing hashing error Mar 8, 2021
@holiman holiman added this to the 1.10.2 milestone Mar 10, 2021
Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@karalabe karalabe merged commit 94ab4ea into ethereum:master Mar 16, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
…um#22457)

* core/rawdb: more verbose error logs + better hashing

* core/rawdb: add failing testcase

* core/rawdb: properly hash transactions while indexing/unindexing

* core/rawdb: exit on error + better log msg
formingform added a commit to formingform/PlatON-Go that referenced this pull request Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants