The snippet above shows the location of the error. rcmgr is nil on the transport. My host configuration includes libp2p.DefaultResourceManager but that setting is not reflected in the AutoNAT configuration.
// config/config.go
autoNatCfg := Config{
Transports: cfg.Transports,
Muxers: cfg.Muxers,
SecurityTransports: cfg.SecurityTransports,
Insecure: cfg.Insecure,
PSK: cfg.PSK,
ConnectionGater: cfg.ConnectionGater,
Reporter: cfg.Reporter,
PeerKey: autonatPrivKey,
Peerstore: ps,
DialRanker: swarm.NoDelayDialRanker,
SwarmOpts: []swarm.Option{
// It is better to disable black hole detection and just attempt a dial for autonat
swarm.WithUDPBlackHoleConfig(false, 0, 0),
swarm.WithIPv6BlackHoleConfig(false, 0, 0),
},
}
Notice how there's no ResourceManager assignment in the above snippet. I also don't see any code that adds sensible defaults to the AutoNAT configuration.
Version Information
When AutoNAT attempts to dial a host listening over WebRTC direct transport, a nil reference occurs.
The snippet above shows the location of the error.
rcmgr
is nil on the transport. My host configuration includeslibp2p.DefaultResourceManager
but that setting is not reflected in the AutoNAT configuration.Notice how there's no ResourceManager assignment in the above snippet. I also don't see any code that adds sensible defaults to the AutoNAT configuration.
My workaround is to disable AutoNAT.