mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-12-12 22:38:50 +00:00
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:
parent
11ce4f2a53
commit
5e7d59c7a1
14
CHANGELOG.md
14
CHANGELOG.md
@ -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
|
||||
|
||||
2
Makefile
2
Makefile
@ -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)'
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user