Commit 36fd93f
authored
fix: false negative retrieving seed peers in connectivity manager at startup (#7474)
Description
---
This PR fixes a race condition between adding seed peers at startup and
retrieving them from the peer manager in the connectivity manager.
Motivation and Context
---
The warning message `WARN Failed to get seed peers from PeerManager,
using empty list // comms/core/src/connectivity/manager.rs:207` is a
timing issue. In this context the seed peer list is passed to the
proactive dialer to exclude them from being proactively dialed if other
connections exist. On a node with proper connectivity, seed peer dial
requests are coming through straight after.
- `2025-09-04 16:28:05.638210600 [p2p::initialization] DEBUG Adding seed
peer [PeerFlags(SEED)[0984896e74022c44] `
- `2025-09-04 16:28:05.648016500 [comms::connectivity::manager] DEBUG
ConnectivityManager started`
- `2025-09-04 16:28:05.648239900 [comms::connectivity::manager] WARN
Failed to get seed peers from PeerManager, using empty list`
- `2025-09-04 16:28:05.648850400 [comms::dht::connectivity] DEBUG Adding
5 neighbouring peer(s), removing 0 peers: 0984896e74022c442c1034852c, `
- `2025-09-04 16:28:05.648912900 [comms::connectivity::manager] TRACE
Request (11267568784269984977): DialPeer { node_id:
NodeId(0984896e74022c442c1034852c), reply_tx: None }` ...
- `2025-09-04 16:31:05.655859300 [comms::connectivity::manager] DEBUG
(5619097807157888458) Starting proactive dialing execution - current
connections: 10, target: 8`
How Has This Been Tested?
---
System-level testing
What process can a PR reviewer use to test or verify this change?
---
Code review
<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->
Breaking Changes
---
- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify
<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Seed peers now load on-demand instead of at startup, reducing startup
overhead and improving initial responsiveness.
* **Chores**
* Improved diagnostic logging around seed peer retrieval and DNS seed
parsing, including warnings for parse failures and failed seed lookups
to aid troubleshooting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent b0cfe30 commit 36fd93f
File tree
3 files changed
+28
-14
lines changed- base_layer/p2p/src
- comms/core/src
- connectivity
- peer_manager
3 files changed
+28
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | 202 | | |
215 | 203 | | |
216 | 204 | | |
| |||
1217 | 1205 | | |
1218 | 1206 | | |
1219 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1220 | 1225 | | |
1221 | 1226 | | |
1222 | 1227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
268 | 269 | | |
269 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
270 | 277 | | |
271 | 278 | | |
272 | 279 | | |
| |||
0 commit comments