Skip to content

fix: use tx_hash for transaction identity in RecoveredBlock lookups - #88

Open
xenoliss wants to merge 1 commit into
paradigmxyz:mainfrom
xenoliss:baptisteoueriagli/chain-6923-upstream-pr-reth-core-matches
Open

xenoliss wants to merge 1 commit into
paradigmxyz:mainfrom
xenoliss:baptisteoueriagli/chain-6923-upstream-pr-reth-core-matches

Conversation

@xenoliss

@xenoliss xenoliss commented Nov 11, 2026 •

Copy link
Copy Markdown

RecoveredBlock::find_indexed, IndexedTx::tx_hash and IndexedTx::meta identify a transaction by Encodable2718::trie_hash, the keccak256 of its EIP-2718 encoding. That is the transaction hash only when the two are equal. For a transaction type where they differ, find_indexed(tx_hash) returns None, so reth's in-memory lookups such as eth_getTransactionByHash for a not-yet-persisted block miss the transaction, and meta() carries the wrong hash.

This uses TxHashRef::tx_hash instead and keeps trie_hash for trie and proof commitments, applying the rule from paradigmxyz/reth#24494 to reth-primitives-traits.

@xenoliss
xenoliss marked this pull request as ready for review November 11, 2026 15:20
@xenoliss
xenoliss force-pushed the baptisteoueriagli/chain-6923-upstream-pr-reth-core-matches branch from af75209 to 17ff2fe Compare November 12, 2026 15:21
`RecoveredBlock::find_indexed`, `IndexedTx::tx_hash` and `IndexedTx::meta`
identified transactions by `Encodable2718::trie_hash`, the keccak256 of the
EIP-2718 encoding. For transaction types whose hash is not the hash of their
encoding, `find_indexed` misses the transaction and the returned metadata
carries the wrong hash.

Use the cached `TxHashRef::tx_hash` instead, keeping `trie_hash` for trie
and proof commitments, as paradigmxyz/reth#24494 did in reth.
@xenoliss
xenoliss force-pushed the baptisteoueriagli/chain-6923-upstream-pr-reth-core-matches branch from 17ff2fe to d85b3cf Compare November 12, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant