Commit 67da2af
test(consensus): integration-test IsBehind across peer topologies
Covers the live wiring that the pure-helper tests don't: IsBehind driving
a real (non-started) Switch's peer set through collectPeerHeights into
evaluateBehind, plus the sole-validator and debounce paths, end to end.
Builds a Reactor with mock peers at chosen heights, a round state at a
chosen height, and catchUpDebounce=0 so the result is the raw decision
with no timing. Cases mirror the operational topologies:
- majority of peers ahead -> behind (the partition / fell-behind case),
- synced multi-peer network -> not behind (no false positive on a healthy
multi-node network),
- lone peer ahead -> not behind (cannot corroborate),
- no peers and not the sole validator -> behind (isolated node),
- no peers but the sole validator -> not behind (finalizes alone).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c5e8b23 commit 67da2af
1 file changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
114 | 117 | | |
115 | 118 | | |
116 | 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 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
117 | 170 | | |
118 | 171 | | |
119 | 172 | | |
| |||
0 commit comments