After the silence-gating change in #3504, ConnectionMonitorInit (packages/libp2p/src/connection-monitor.ts) has overlapping and leaky options. Two breaking cleanups for the next major (v4):
-
Drop abortConnectionOnPingFailure. Now that aborts are gated on connectionStaleTimeout, the boolean overlaps with the timeout — "never abort on ping failure" can be expressed as connectionStaleTimeout: Infinity instead of a separate flag.
-
Tidy pingTimeout (keep the adaptive timeout). Today it's Omit<AdaptiveTimeoutInit, 'metricsName' | 'metrics'>, which couples the public API to a @libp2p/utils-internal type — and the Omit key is typo'd (the field is metricName), so metricName leaks through. Replace it with connection-monitor's own { minTimeout?, maxTimeout? }, keeping AdaptiveTimeout internally so the ping timeout still adapts to RTT.
Plan to deprecate both in 3.x (@deprecated pointing here) for a runway. Behavior is unchanged — purely an options/API cleanup.
After the silence-gating change in #3504,
ConnectionMonitorInit(packages/libp2p/src/connection-monitor.ts) has overlapping and leaky options. Two breaking cleanups for the next major (v4):Drop
abortConnectionOnPingFailure. Now that aborts are gated onconnectionStaleTimeout, the boolean overlaps with the timeout — "never abort on ping failure" can be expressed asconnectionStaleTimeout: Infinityinstead of a separate flag.Tidy
pingTimeout(keep the adaptive timeout). Today it'sOmit<AdaptiveTimeoutInit, 'metricsName' | 'metrics'>, which couples the public API to a@libp2p/utils-internal type — and theOmitkey is typo'd (the field ismetricName), sometricNameleaks through. Replace it with connection-monitor's own{ minTimeout?, maxTimeout? }, keepingAdaptiveTimeoutinternally so the ping timeout still adapts to RTT.Plan to deprecate both in 3.x (
@deprecatedpointing here) for a runway. Behavior is unchanged — purely an options/API cleanup.