You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(node): drop the RPC block record on disconnect
Connection pushes a BlockRecord that RPC serves getblock from. Leaving it
after a disconnect means answering for a block the chain no longer
contains.
Removal is opportunistic on purpose. The vector is a best-effort
in-process cache, not authoritative state: it starts empty on every boot
while applied_tip resumes from a checkpoint at height N, and the prune
service removes records from it. An earlier version of the comment called
a missing tail a bug; making it one would refuse the first disconnect
after any restart. The hash check is what stops the pop from taking a
record that is not ours, and the tail can only be ours or gone, since
disconnect runs on the applied tip and connection pushed that tip's
record last.
Two entries leave the owed list. The transactions map never needed one:
connection does not populate it, which an existing test already pins.
Also records that retry is not a recovery strategy for the partial
failure window. Each UTXO operation looks idempotent on the set, but
undo_block runs through commit_adds_and_removes, which fires UtxoSet's
listener, and coin_stats is one. A second pass re-emits callbacks for
operations that changed nothing, so a cumulative listener double-counts
even where the set converges.
Copy file name to clipboardExpand all lines: docs/solutions/architecture-patterns/node-reorg-execution-design.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,7 +153,7 @@ Open, and prerequisites for giving `disconnect_block` a caller:
153
153
|`coin_stats` inverse feed | cumulative, so it drifts on every disconnect |
154
154
|`filter_index` rollback | BIP157 headers chain, so a stale link corrupts the chain; `filter_header_cache` must be reset with it |
155
155
| RPC caches |`blocks` and `transactions` would keep serving the disconnected block |
156
-
| Rollback idempotence, both stores |`undo_block` is fallible and runs after the index rolls back. Worse, it is not all-or-nothing: `commit_adds_and_removes` walks shards and both its serial and parallel paths can fail after other shards committed, so the UTXO set can be left partly undone. Retry converges only if both rollbacks are idempotent. Prove it, make the UTXO commit atomic, or add compensation |
156
+
| Rollback idempotence, both stores |`undo_block` is fallible and runs after the index rolls back. Worse, it is not all-or-nothing: `commit_adds_and_removes` walks shards and both its serial and parallel paths can fail after other shards committed, so the UTXO set can be left partly undone. Retry is not obviously a fix: each UTXO operation looks idempotent on the set, but `commit_adds_and_removes` fires `UtxoSet`'s listener, and `coin_stats` is one, so a second pass can re-emit callbacks for operations that changed nothing and a cumulative listener double-counts. Prove listener-level idempotence, make the UTXO commit atomic, or add compensation |
0 commit comments