Commit 7b7626a
committed
chain/ethereum: Check block cache before RPC in fetch_full_block_with_rpc
fetch_full_block_with_rpc previously called adapter.block_by_hash()
directly, bypassing the block cache and always making an eth_getBlockByHash
RPC call. It is called from ancestor_block when the cached block has no
receipts, or after walking back the chain via parent_ptr (which populates
the cache). In both cases the block may already be available in the cache.
Change it to delegate the light block fetch to fetch_light_block_with_rpc,
which goes through adapter.load_blocks() and chain_store.blocks() —
checking recent_blocks_cache and the DB before falling back to RPC.1 parent 97c117b commit 7b7626a
1 file changed
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1284 | 1284 | | |
1285 | 1285 | | |
1286 | 1286 | | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1295 | 1293 | | |
1296 | | - | |
| 1294 | + | |
1297 | 1295 | | |
1298 | 1296 | | |
1299 | 1297 | | |
| |||
0 commit comments