From 7714d41097af665e7a6a37396ee21772be53ded6 Mon Sep 17 00:00:00 2001 From: thinkAfCod Date: Wed, 14 May 2025 00:04:57 +0800 Subject: [PATCH] modify write channel size --- p2p/discover/v5_talk.go | 2 +- p2p/discover/v5_udp.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/discover/v5_talk.go b/p2p/discover/v5_talk.go index 3187aafe53..dca09870d8 100644 --- a/p2p/discover/v5_talk.go +++ b/p2p/discover/v5_talk.go @@ -28,7 +28,7 @@ import ( ) // This is a limit for the number of concurrent talk requests. -const maxActiveTalkRequests = 2048 +const maxActiveTalkRequests = 1024 // This is the timeout for acquiring a handler execution slot for a talk request. // The timeout should be short enough to fit within the request timeout. diff --git a/p2p/discover/v5_udp.go b/p2p/discover/v5_udp.go index 637a71ea52..223de7310a 100644 --- a/p2p/discover/v5_udp.go +++ b/p2p/discover/v5_udp.go @@ -197,7 +197,7 @@ func newUDPv5(conn UDPConn, ln *enode.LocalNode, cfg Config) (*UDPv5, error) { sendNoRespCh: make(chan *sendNoRespRequest), respTimeoutCh: make(chan *callTimeout), unhandled: cfg.Unhandled, - writeCh: make(chan pendingWrite, 256), // Buffered channel for outgoing packets + writeCh: make(chan pendingWrite, 1024), // Buffered channel for outgoing packets // state of dispatch codec: v5wire.NewCodec(ln, cfg.PrivateKey, cfg.Clock, cfg.V5ProtocolID), activeCallByNode: make(map[enode.ID]*callV5),