From 0369c6ecab50fd923a5c5fe4b19d5ddd0f96f0a3 Mon Sep 17 00:00:00 2001 From: Otto V Date: Sat, 29 Nov 2025 02:21:42 +0100 Subject: [PATCH 1/2] Increase MaxConcurrentRelaysPerRequest and improve log --- protocol/shannon/context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/shannon/context.go b/protocol/shannon/context.go index 18e28e011..e8eac36f1 100644 --- a/protocol/shannon/context.go +++ b/protocol/shannon/context.go @@ -43,7 +43,7 @@ const maxEndpointPayloadLenForLogging = 100 // MaxConcurrentRelaysPerRequest limits the number of concurrent relay goroutines per request. // This prevents DoS attacks via large batch requests that could spawn unbounded goroutines. // TODO_IMPROVE: Make this configurable via gateway settings. -const MaxConcurrentRelaysPerRequest = 10 +const MaxConcurrentRelaysPerRequest = 60 // requestContext provides all the functionality required by the gateway package // for handling a single service request. @@ -156,7 +156,7 @@ func (rc *requestContext) HandleServiceRequest(payloads []protocol.Payload) ([]p } if len(payloads) > MaxConcurrentRelaysPerRequest { - response, err := rc.handleInternalError(fmt.Errorf("HandleServiceRequest: batch of payloads larger than allowed: %d", MaxConcurrentRelaysPerRequest)) + response, err := rc.handleInternalError(fmt.Errorf("HandleServiceRequest: batch of payloads larger than allowed: %d, received: %d ", MaxConcurrentRelaysPerRequest, len(payloads))) return []protocol.Response{response}, err } From f51f5446a7bcc224e55a4d088099fc4bd5fa6534 Mon Sep 17 00:00:00 2001 From: Otto V Date: Sat, 29 Nov 2025 17:18:05 +0100 Subject: [PATCH 2/2] bump MaxConcurrentRelaysPerRequest to 100 --- protocol/shannon/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/shannon/context.go b/protocol/shannon/context.go index e8eac36f1..76b6f1aff 100644 --- a/protocol/shannon/context.go +++ b/protocol/shannon/context.go @@ -43,7 +43,7 @@ const maxEndpointPayloadLenForLogging = 100 // MaxConcurrentRelaysPerRequest limits the number of concurrent relay goroutines per request. // This prevents DoS attacks via large batch requests that could spawn unbounded goroutines. // TODO_IMPROVE: Make this configurable via gateway settings. -const MaxConcurrentRelaysPerRequest = 60 +const MaxConcurrentRelaysPerRequest = 100 // requestContext provides all the functionality required by the gateway package // for handling a single service request.