Repository navigation
perf(primitives-traits): hash txs before rpc block clone - #89
Conversation
`clone_into_rpc_block` with full transactions cloned the whole block and hashed the transactions of the clone. Transactions read from the database carry no hash, so the hashes never reached the shared block and every call computed them again. Add `clone_into_rpc_block_full`, which hashes each transaction through the reference before cloning it, and route `clone_into_rpc_block` through it.
👁️ Cyclops Security Review✅ Reviewed b08c750 (latest) · Coverage: partial · no open findings · report |
Drop the hashing pass from the state cache's block fetch. It ran for every fetched block, including for callers that never read transaction hashes (fee history rewards, header and count lookups). reth-core's `clone_into_rpc_block` now hashes each transaction through the reference before cloning it, so the first full-transaction response fills the hashes on the cached block and later responses reuse them. Bumps reth-core to paradigmxyz/reth-core#89, which also brings in the codec changes from paradigmxyz/reth-core#72, #81, #83 and #84.
paradigmxyz/reth-core#89 merged as 5dabd396f4, with the same tree as the PR commit pinned before.
clone_into_rpc_blockwith full transactions cloned the whole block and hashed the transactions of the clone. Transactions read from the database carry no hash, so the hashes never reached the shared block, and every full-transaction response for a cached block computed them again.This adds
clone_into_rpc_block_full, which hashes each transaction through the reference before cloning it, and routesclone_into_rpc_blockthrough it. The hashes are computed on the first full conversion and stay cached on the block.Used in paradigmxyz/reth#28552