Commit 66166bb
committed
bch(m5): in-flight timeout/eviction for the block-download window
The windowed block download (2cc7de4) deferred stalling-peer handling until
block bodies actually flowed end-to-end -- they now do (NodeP2P enqueues each
synced headers batch and getdatas through the bounded window). This adds the
eviction leg: BlockDownloadWindow now records the issue tick per in-flight
request (next_requests(now_tick)) and exposes expire(now, timeout), which drops
any request older than the timeout, frees its window slot, and re-queues the
stalled hash at the FRONT so it is retried ahead of not-yet-requested tip
blocks. A block delivered after its eviction is reported unsolicited but still
applied. Without this a single non-delivering peer could pin a window slot
forever and wedge IBD.
Periodic-tick wiring into the NodeP2P poll loop is the next micro-slice; this
lands the pure, peer-free state machine + unit coverage first (same shape as the
windowed-download slice).
bch_block_download_test: +2 cases (full-window expiry + re-queue ahead of fresh
hashes; partial expiry leaving fresh requests; post-eviction delivery reported
unsolicited). ctest 11/11 green. Header-only, build-inert (bch skip-green). Zero
p2pool-merged-v36 surface -- pure SPV/IBD wire-sync; per-coin isolation.1 parent 2cc7de4 commit 66166bb
2 files changed
Lines changed: 78 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | | - | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
117 | 147 | | |
118 | 148 | | |
119 | 149 | | |
| |||
125 | 155 | | |
126 | 156 | | |
127 | 157 | | |
128 | | - | |
| 158 | + | |
129 | 159 | | |
130 | 160 | | |
131 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
134 | 179 | | |
135 | 180 | | |
136 | 181 | | |
0 commit comments