Measured over five cold smoldot-direct runs: the peer count under the loading headline is visible for a median of 100ms per load (min 75ms, max 101ms), and only ever reads "2 peers".
The cause is the data source, not the wiring. system_health awaits is_near_head_of_chain_heuristic() inside smoldot, which round-trips to a runtime-service task that is busy while the chain is warping. So the first health reply lands just before bootstrapComplete, and the host clears the detail line on bootstrapComplete because a peer count is meaningless once the chain is ready. The result is a readout that is correct and almost never seen.
Options, roughly in order of value:
- Upstream a peer-count lifecycle event. Smoldot's watchdog already keeps a live
peer_count in light-base/src/lib.rs and only uses it for the 30s NoPeers threshold. Emitting it through lifecycle_unstable_follow is about ten lines and needs no polling at all.
- Keep showing the count after
bootstrapComplete while later phases run. Cheap, but it means displaying a number that no longer describes what the user is waiting for.
- Accept it. The stall copy ("searching for peers") is the part that earns its place on a genuinely slow connection, and that path is unaffected.
My recommendation is 1, with 3 in the meantime. Worth noting that the same five runs show chain sync taking only 1.4s of a 14.8s load, while the bitswap content fetch takes 12.4s, so peer counts are not where the waiting actually happens.
Measured over five cold smoldot-direct runs: the peer count under the loading headline is visible for a median of 100ms per load (min 75ms, max 101ms), and only ever reads "2 peers".
The cause is the data source, not the wiring.
system_healthawaitsis_near_head_of_chain_heuristic()inside smoldot, which round-trips to a runtime-service task that is busy while the chain is warping. So the first health reply lands just beforebootstrapComplete, and the host clears the detail line onbootstrapCompletebecause a peer count is meaningless once the chain is ready. The result is a readout that is correct and almost never seen.Options, roughly in order of value:
peer_countinlight-base/src/lib.rsand only uses it for the 30s NoPeers threshold. Emitting it throughlifecycle_unstable_followis about ten lines and needs no polling at all.bootstrapCompletewhile later phases run. Cheap, but it means displaying a number that no longer describes what the user is waiting for.My recommendation is 1, with 3 in the meantime. Worth noting that the same five runs show chain sync taking only 1.4s of a 14.8s load, while the bitswap content fetch takes 12.4s, so peer counts are not where the waiting actually happens.