Commit ad78799
committed
Move to awaiting gossip validation in the background processor
`P2PGossipSync` is a rather poor design. It currently basically
requires two circular `Arc` references, leaving `NetworkGraph`s to
leak if LDK is un-loaded:
* `P2PGossipSync` owns/holds a reference to the
`GossipVerifier` and `GossipVerifier` holds an `Arc` to the
`P2PGossipSync` and
* `PeerManager` holds a reference to the `P2PGossipSync` (as the
gossip message handler) which owns/holds a reference to the
`GossipVerifier`, which has a `Deref` (likely an `Arc` in
practice) to the `PeerManager`.
Instead, we should move towards the same design we have elsewhere -
hold a `Notifier` and expose waiting on it to the background
processor then poll for completion from there (in this case, as in
others by checking for completion when handling
`get_and_clear_pending_msg_events` calls).
After the last few commits of setup, here we finally switch to
waking the background processor directly when we detect async
gossip validation completion, allowing us to drop the circular
references in `P2PGossipSync`/`GossipVerifier` entirely.
Fixes #33691 parent 91a16c5 commit ad78799
3 files changed
Lines changed: 61 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
238 | 247 | | |
239 | 248 | | |
240 | 249 | | |
| |||
520 | 529 | | |
521 | 530 | | |
522 | 531 | | |
| 532 | + | |
523 | 533 | | |
524 | 534 | | |
525 | 535 | | |
526 | 536 | | |
527 | 537 | | |
528 | 538 | | |
| 539 | + | |
529 | 540 | | |
530 | 541 | | |
531 | 542 | | |
| |||
534 | 545 | | |
535 | 546 | | |
536 | 547 | | |
| 548 | + | |
537 | 549 | | |
538 | 550 | | |
539 | 551 | | |
| |||
542 | 554 | | |
543 | 555 | | |
544 | 556 | | |
545 | | - | |
| 557 | + | |
| 558 | + | |
546 | 559 | | |
547 | 560 | | |
548 | 561 | | |
| |||
580 | 593 | | |
581 | 594 | | |
582 | 595 | | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
583 | 602 | | |
584 | 603 | | |
585 | 604 | | |
| |||
606 | 625 | | |
607 | 626 | | |
608 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
609 | 634 | | |
610 | 635 | | |
611 | 636 | | |
| |||
1058 | 1083 | | |
1059 | 1084 | | |
1060 | 1085 | | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
1073 | 1093 | | |
1074 | 1094 | | |
1075 | 1095 | | |
| |||
1083 | 1103 | | |
1084 | 1104 | | |
1085 | 1105 | | |
| 1106 | + | |
1086 | 1107 | | |
1087 | 1108 | | |
1088 | | - | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1089 | 1114 | | |
1090 | 1115 | | |
1091 | 1116 | | |
| |||
1639 | 1664 | | |
1640 | 1665 | | |
1641 | 1666 | | |
| 1667 | + | |
1642 | 1668 | | |
1643 | 1669 | | |
1644 | 1670 | | |
1645 | 1671 | | |
1646 | | - | |
| 1672 | + | |
1647 | 1673 | | |
1648 | 1674 | | |
1649 | 1675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| |||
128 | 125 | | |
129 | 126 | | |
130 | 127 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 128 | + | |
| 129 | + | |
136 | 130 | | |
137 | | - | |
138 | 131 | | |
139 | 132 | | |
140 | | - | |
141 | | - | |
142 | 133 | | |
143 | 134 | | |
144 | 135 | | |
145 | 136 | | |
146 | 137 | | |
147 | 138 | | |
148 | | - | |
149 | | - | |
| 139 | + | |
150 | 140 | | |
151 | 141 | | |
152 | | - | |
153 | 142 | | |
154 | | - | |
| 143 | + | |
155 | 144 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 145 | + | |
| 146 | + | |
166 | 147 | | |
167 | 148 | | |
168 | 149 | | |
169 | | - | |
170 | | - | |
171 | 150 | | |
172 | 151 | | |
173 | 152 | | |
| |||
256 | 235 | | |
257 | 236 | | |
258 | 237 | | |
259 | | - | |
260 | | - | |
| 238 | + | |
261 | 239 | | |
262 | 240 | | |
263 | | - | |
264 | 241 | | |
265 | 242 | | |
266 | 243 | | |
267 | 244 | | |
268 | 245 | | |
269 | 246 | | |
270 | 247 | | |
271 | | - | |
272 | | - | |
| 248 | + | |
273 | 249 | | |
274 | 250 | | |
275 | | - | |
276 | 251 | | |
277 | 252 | | |
278 | 253 | | |
279 | 254 | | |
280 | 255 | | |
281 | | - | |
282 | 256 | | |
283 | | - | |
284 | 257 | | |
285 | 258 | | |
286 | 259 | | |
287 | | - | |
288 | 260 | | |
289 | 261 | | |
290 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
370 | 382 | | |
371 | 383 | | |
372 | 384 | | |
| |||
0 commit comments