-
Notifications
You must be signed in to change notification settings - Fork 524
config: add DHTMode configuration value #6516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
❌ 1 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
|
There is a hybridClient algod profile that is described as "Participate in consensus or simply ensure chain health by validating blocks and supporting P2P traffic propagation.", It enables EnableP2PHybridMode and EnableDHTProviders. EnableDHTProviders turns on Capabilities Discovery but also starts periodic advertisment of gossip service that because if n.capabilitiesDiscovery != nil {
n.capabilitiesDiscovery.AdvertiseCapabilities(n.nodeInfo.Capabilities()...)
}Maybe advertisement should not be invoked when isGossipServer() is false ? But maybe someone wants to be an archival without a gossip service. We should advertise then. |
Summary
Currently the DHT mode is hardcoded to
ModeAutoServer, with no way to configure client-only mode for nodes that want to discover peers without advertising themselves. This exposes the DHT mode configuration to allow choosingdht.ModeOptas per the docs here:https://pkg.go.dev/github.com/libp2p/go-libp2p-kad-dht#ModeOpt
New config field
DHTModesupports values:IsGossipServertrue (listening onNetAddressorP2PHybridNetAddress) use server mode; others use auto modeTest Plan