fix: adjust connection timeout and remove debug logging for ephemeral ports

- Increased the connection timeout from 15 seconds to 20 seconds for improved reliability during peer connections.
- Removed debug logging that filtered out ephemeral port addresses to streamline the logging process.
This commit is contained in:
anonpenguin23 2025-11-03 08:11:20 +02:00
parent 11ce4f2a53
commit 5e7d59c7a1
3 changed files with 16 additions and 7 deletions

View File

@ -13,6 +13,20 @@ The format is based on [Keep a Changelog][keepachangelog] and adheres to [Semant
### Deprecated
### Fixed
## [0.53.18] - 2025-11-03
### Added
\n
### Changed
- Increased the connection timeout during peer discovery from 15 seconds to 20 seconds to improve connection reliability.
- Removed unnecessary debug logging related to filtering out ephemeral port addresses during peer exchange.
### Deprecated
### Removed
### Fixed
\n
## [0.53.17] - 2025-11-03
### Added

View File

@ -21,7 +21,7 @@ test-e2e:
.PHONY: build clean test run-node run-node2 run-node3 run-example deps tidy fmt vet lint clear-ports install-hooks
VERSION := 0.53.17
VERSION := 0.53.18
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'

View File

@ -128,11 +128,6 @@ func (d *Manager) handlePeerExchangeStream(s network.Stream) {
// Common LibP2P ports are typically < 10000
if portNum > 0 && portNum <= 32767 {
filteredAddrs = append(filteredAddrs, addr)
} else {
d.logger.Debug("Filtering out ephemeral port address",
zap.String("peer_id", pid.String()[:8]+"..."),
zap.String("addr", addr.String()),
zap.Int("port", portNum))
}
} else {
// If we can't parse port, include it anyway (might be non-TCP)
@ -358,7 +353,7 @@ func (d *Manager) discoverViaPeerExchange(ctx context.Context, maxConnections in
d.host.Peerstore().AddAddrs(parsedID, addrs, time.Hour*24)
// Try to connect
connectCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
connectCtx, cancel := context.WithTimeout(ctx, 20*time.Second)
peerAddrInfo := peer.AddrInfo{ID: parsedID, Addrs: addrs}
if err := d.host.Connect(connectCtx, peerAddrInfo); err != nil {