User Agent suffix is not set in libp2p #9456
Labels
kind/bug
A bug in existing code (including security flaws)
need/triage
Needs initial labeling and prioritization
Checklist
Installation method
built from source
Version
No response
Config
No response
Description
Create two nodes A and B. Start node A with
--user-agent-suffix=foo
. On node B runipfs id <node A id>
and see that the suffix is missing 😢.The implementation in #8419 seems to have been implemented incorrectly and the sharness test "verifying behavior" only tests that the node itself knows about the suffix but not that it broadcasts it.
The issue stems from
kubo/core/node/libp2p/libp2p.go
Line 28 in fdd1965
where the user agent option is created. While the option is itself a function which will get called and run after the suffix has been processed and
SetUserAgentSuffix
called, the string passed into libp2p.UserAgent is fetched on package load.kubo/version.go
Line 34 in fdd1965
Any fix that delays the setting of the user agent string until fx has asked for it should be fine. As for testing, I'd recommend using the scenario above to reproduce.
The text was updated successfully, but these errors were encountered: