Commit 545cd70
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 411a14e commit 545cd70
1 file changed
Lines changed: 15 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| |||
1094 | 1094 | | |
1095 | 1095 | | |
1096 | 1096 | | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
| |||
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
1296 | 1294 | | |
1297 | | - | |
| 1295 | + | |
1298 | 1296 | | |
1299 | 1297 | | |
1300 | 1298 | | |
| |||
0 commit comments