Commit bd6a597
pipeline: close the verify-to-commit park race, make the deferred TTL unconditional
At load the network wedged at h~1350 on four of five nodes, each at a slightly
different height. Measured chain: a child block checks for its parent via
canonical_hash_at, which reads storage — and storage only answers at APPLY-commit,
600-850 ms after the parent VERIFIES under ~250-tx blocks. Children of a verified
parent are released at verify time. A child arriving inside that verify-to-commit
window finds neither: the storage read misses, the release has already run, and the
block parks forever. The re-download of parked heights used to hide this by
accident; the byte-budget sync's deferred-height mask removed exactly that, so one
parked orphan turned into a permanent per-node wedge ("delivered rounds=0" loop).
Fix: a task-local verified_recent map (hash -> height), inserted where the release
runs, consulted as a guard before parking (`Ok(None) if parent_verified_in_flight`).
The guard, the insert and the release all execute in the SAME pipeline task, so the
ordering is total: a parent either verified earlier and the guard sees it, or
verifies later and its release drains the parked child. No locks, no timing window,
no storage round-trip. Semantics match the existing release exactly — any VERIFIED
parent frees its children; apply still arbitrates the canonical chain. Entries are
pruned 500 below the tip past 1024.
A first attempt re-checked storage after parking; it was rejected in review because
the re-check lands inside the same verify-to-commit window it is trying to close.
The deferred TTL sweep now runs whenever the buffer is non-empty. It was gated
behind count > 100, so a lone orphan below the gate lived forever — and with the
deferred set masking its height from sync, that single entry wedged the node.
Tests: 420 green, zero warnings.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent d1cd763 commit bd6a597
1 file changed
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1812 | 1812 | | |
1813 | 1813 | | |
1814 | 1814 | | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
1815 | 1820 | | |
1816 | 1821 | | |
1817 | 1822 | | |
| |||
1975 | 1980 | | |
1976 | 1981 | | |
1977 | 1982 | | |
| 1983 | + | |
| 1984 | + | |
1978 | 1985 | | |
1979 | 1986 | | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
1980 | 1990 | | |
1981 | 1991 | | |
1982 | 1992 | | |
| |||
2068 | 2078 | | |
2069 | 2079 | | |
2070 | 2080 | | |
| 2081 | + | |
2071 | 2082 | | |
2072 | 2083 | | |
2073 | | - | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
2074 | 2088 | | |
2075 | 2089 | | |
2076 | 2090 | | |
| |||
3065 | 3079 | | |
3066 | 3080 | | |
3067 | 3081 | | |
| 3082 | + | |
| 3083 | + | |
3068 | 3084 | | |
3069 | 3085 | | |
3070 | 3086 | | |
| |||
3132 | 3148 | | |
3133 | 3149 | | |
3134 | 3150 | | |
3135 | | - | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
3136 | 3162 | | |
3137 | 3163 | | |
3138 | 3164 | | |
| |||
0 commit comments