Commit 0e465fe
fix(storenode): community fetches cap at 3 pages and skip empty-page processing (#21470-hf)
Run-4 device evidence (all prior #21470-hf fixes in): dead curated community
ids — whose descriptions are never on the store node — each cost a
~minutes-long 30-page run finalizing with fetchedEnvelopesCount=0 at cap-trip,
re-issued by client polling ~every 20s. The per-id backoff never suppresses
because each RUN outlasts its early backoff windows. The CPU engine:
shouldFetchNextPage force-runs Messenger.ProcessAllMessages on EVERY page,
including empty ones, and ProcessAllMessages walks the messenger's whole
pending backlog. During the legitimate channel backfill that means re-walking a
fat queue 30x per dead id, continuously (GC 67%, service 320-370%).
Two changes, both in protocol/messenger_store_node_request_manager*.go:
1. Split the page cap by request type. Community fetches now build from a
dedicated community config capped at 3 pages
(maxCommunityStoreNodeRequestPageCount) via
buildCommunityStoreNodeRequestConfig; contact fetches keep the generic
30-page default (buildStoreNodeRequestConfig). Store queries page
newest-first (verified in go-waku history.go: PaginationForward unset =>
proto3 default false => backward) and community descriptions are
republished periodically, so a live community's description appears within
the first pages; with the description-seen gate (6cd6ced) a hit stops the
request anyway, so deeper paging can only ever chew empty/irrelevant
history. The shared default is untouched — only the community construction
site is tightened, and caller options can still override.
2. Skip the forced per-page ProcessAllMessages when the just-fetched page
carried zero envelopes (shouldProcessStoreNodePage). The call only exists to
flush THIS request's envelopes into the DB before the GetByID check; with
zero envelopes there is nothing of ours to flush, so the backlog re-walk is
pure waste. The DB check still runs, so a description delivered by a parallel
channel-sync page is not missed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit cae6698)
(cherry picked from commit 0b2ee62d39aad5c0aa6134825365a9417723f1b7)1 parent 59ab161 commit 0e465fe
3 files changed
Lines changed: 124 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
385 | 399 | | |
386 | 400 | | |
387 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
12 | 25 | | |
13 | 26 | | |
14 | 27 | | |
| |||
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
92 | 118 | | |
93 | 119 | | |
94 | 120 | | |
| |||
101 | 127 | | |
102 | 128 | | |
103 | 129 | | |
104 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
105 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
106 | 138 | | |
| 139 | + | |
107 | 140 | | |
108 | 141 | | |
109 | 142 | | |
110 | 143 | | |
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
114 | 160 | | |
115 | 161 | | |
116 | 162 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 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 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
67 | 128 | | |
68 | 129 | | |
69 | 130 | | |
| |||
0 commit comments