Commit 8e2f724
authored
feat(coprocessor): add --seed-start-block flag to host-listener poller (backport 0.13.x) (#3124)
feat(coprocessor): add --seed-start-block flag to host-listener poller
Without a persisted anchor the poller used to seed its cursor from
host_chain_blocks_valid, a table owned by the WS listener. That
cross-service read was a bootstrap aid from when the poller was first
introduced into already-running systems; on a fresh database it is a
startup race: if the poller initializes before the WS listener has
written anything, it anchors at 0 and walks the chain from genesis
(observed on Amoy pollers on devnet/testnet, ~2-3 months behind head).
Drop the cross-service read entirely. The poller's seed sources are now
its own: the persisted anchor row always wins; otherwise
--seed-start-block seeds deterministically (non-negative = absolute
height, 0 = genesis explicitly, negative = that many blocks behind
head); otherwise the poller exits with an explicit error, so a missing
flag on a new chain surfaces as a crash-loop at deploy time instead of
a silent weeks-long genesis walk.
The flag is deliberately initialization-only, not the listener's
--start-at-block semantics (where the flag beats persisted state on
every startup): once the anchor row exists the flag is inert, so a flag
left in Helm values can never rewind the poller on restart, skip blocks
past the anchor, or clobber a drift-revert anchor reset. Deliberate
rewinds remain a manual host_listener_poller_state update.
Adding a poller to an already-running listener-only deployment now
requires setting --seed-start-block explicitly (the removed fallback
previously covered that case). The e2e compose poller passes
--seed-start-block=0: fresh local chain, genesis is the honest value.1 parent 7a7e9ec commit 8e2f724
4 files changed
Lines changed: 77 additions & 1 deletion
File tree
- coprocessor/fhevm-engine/host-listener
- src
- bin
- poller
- tests
- test-suite/fhevm/docker-compose
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
180 | 188 | | |
181 | 189 | | |
182 | 190 | | |
| 191 | + | |
183 | 192 | | |
184 | 193 | | |
185 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
73 | 125 | | |
74 | 126 | | |
75 | 127 | | |
| |||
88 | 140 | | |
89 | 141 | | |
90 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
91 | 146 | | |
92 | 147 | | |
93 | 148 | | |
| |||
195 | 250 | | |
196 | 251 | | |
197 | 252 | | |
198 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
199 | 264 | | |
200 | 265 | | |
201 | 266 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
0 commit comments