Track latest block in rpc cache #13069
Labels
A-rpc
Related to the RPC implementation
C-enhancement
New feature or request
D-good-first-issue
Nice and easy! A great choice to get started
Describe the feature
we have a race condition that affects the
Latest
block:reth/crates/rpc/rpc-eth-api/src/helpers/block.rs
Lines 242 to 254 in 8a047ed
by the time the cache handles this command:
reth/crates/rpc/rpc-eth-types/src/cache/mod.rs
Lines 508 to 511 in 8a047ed
the latest block can be reorged in between and removed from the cache:
reth/crates/rpc/rpc-eth-types/src/cache/mod.rs
Lines 533 to 535 in 8a047ed
we can get rid of this race condition, in a few ways:
reth/crates/rpc/rpc-eth-types/src/cache/mod.rs
Lines 532 to 534 in 8a047ed
former would be easier but feels hacky
latter is cleaner because this approach then allows us to also track the safe+finalized in a similar way.
TODO
ChainChange
then add alatest_blockwith_senders
function to ethstatecacheAdditional context
#13001
The text was updated successfully, but these errors were encountered: