From 957f1a8ebb4ac566b531d89291f54e031be15c7d Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 14 Aug 2023 17:21:07 +0200 Subject: [PATCH] node: hard-code limits for engine API Signed-off-by: jsvisa --- node/defaults.go | 7 +++++++ node/node.go | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/node/defaults.go b/node/defaults.go index d8f718121e..79fb53a955 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -36,6 +36,13 @@ const ( DefaultAuthPort = 8551 // Default port for the authenticated apis ) +const ( + // Engine API batch limits: these are not configurable by users, and should cover the + // needs of all CLs. + engineAPIBatchItemLimit = 2000 + engineAPIBatchResponseSizeLimit = 100 * 1000 * 1000 +) + var ( DefaultAuthCors = []string{"localhost"} // Default cors domain for the authenticated apis DefaultAuthVhosts = []string{"localhost"} // Default virtual hosts for the authenticated apis diff --git a/node/node.go b/node/node.go index 0fbc17195c..41c9971fe8 100644 --- a/node/node.go +++ b/node/node.go @@ -449,9 +449,10 @@ func (n *Node) startRPC() error { if err := server.setListenAddr(n.config.AuthAddr, port); err != nil { return err } - // Don't limit the requests to the auth endpoint sharedConfig := rpcEndpointConfig{ - jwtSecret: secret, + jwtSecret: secret, + batchItemLimit: engineAPIBatchItemLimit, + batchResponseSizeLimit: engineAPIBatchResponseSizeLimit, } if err := server.enableRPC(allAPIs, httpConfig{ CorsAllowedOrigins: DefaultAuthCors,