Commit 6ab1327
fix(rpc): consolidate hot storage reads and document consistency model (#118)
* fix(rpc): consolidate hot_reader_at_block to single MDBX transaction
Opens the read transaction before resolving the block ID so that
hash→number lookup and subsequent data query share the same MDBX
snapshot. Eliminates a race where a reorg between the two
transactions could produce inconsistent results.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(rpc): consolidate resolve_evm_block to single MDBX transaction
Header lookup and RevmRead construction now share one MDBX read
transaction. This eliminates a race where a reorg between two
separate transactions could yield a header from one fork and EVM
state from another. Follows the same pattern used by the
block-processor crate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs(rpc): document atomic ordering guarantees on BlockTags
Adds module-level and struct-level rustdoc explaining Acquire/Release
ordering, multi-tag update order, rewind safety, and the race window
between tag resolution and storage queries.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs(rpc): document hot/cold consistency model on StorageRpcCtx
Adds module-level and struct-level rustdoc explaining the two-tier
architecture, query routing table, resolve-then-query pattern,
cold lag characteristics, and deferred hash-based verification.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e58c656 commit 6ab1327
3 files changed
Lines changed: 162 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
2 | 58 | | |
3 | 59 | | |
4 | 60 | | |
| |||
51 | 107 | | |
52 | 108 | | |
53 | 109 | | |
54 | | - | |
55 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
56 | 120 | | |
57 | 121 | | |
58 | 122 | | |
| |||
283 | 347 | | |
284 | 348 | | |
285 | 349 | | |
286 | | - | |
287 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
288 | 356 | | |
289 | 357 | | |
290 | 358 | | |
| |||
294 | 362 | | |
295 | 363 | | |
296 | 364 | | |
297 | | - | |
| 365 | + | |
298 | 366 | | |
299 | 367 | | |
300 | 368 | | |
301 | 369 | | |
302 | | - | |
303 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
304 | 386 | | |
| 387 | + | |
305 | 388 | | |
306 | 389 | | |
307 | 390 | | |
| |||
315 | 398 | | |
316 | 399 | | |
317 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
318 | 405 | | |
319 | 406 | | |
320 | 407 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
6 | 40 | | |
7 | 41 | | |
8 | 42 | | |
| |||
29 | 63 | | |
30 | 64 | | |
31 | 65 | | |
32 | | - | |
33 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
34 | 80 | | |
35 | 81 | | |
36 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
| |||
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
143 | | - | |
144 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
145 | 160 | | |
146 | 161 | | |
147 | 162 | | |
| |||
0 commit comments