From 67ae4c8c86f70a0e982abf00ddb55beade402675 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 25 Apr 2024 11:16:43 +0200 Subject: [PATCH] use buffered channel to read subscription headers from EVM node --- integration-tests/testsetups/keeper_benchmark.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration-tests/testsetups/keeper_benchmark.go b/integration-tests/testsetups/keeper_benchmark.go index 37420ff9e4d..63651c45822 100644 --- a/integration-tests/testsetups/keeper_benchmark.go +++ b/integration-tests/testsetups/keeper_benchmark.go @@ -281,7 +281,10 @@ func (k *KeeperBenchmarkTest) Run() { ) k.log.Debug().Str("UpkeepID", upkeepIDCopy.String()).Msg("Subscribing to new headers for upkeep observation") - headerCh := make(chan *types.Header) + // hard to say what should be the buffer size, we want it big, but too big as we might run out of memory + // but on L2s with super fast block times, we might run into `subscription queue overflow` errors, when this + // buffer is too small + headerCh := make(chan *types.Header, 5000) sub, err := k.chainClient.Client.SubscribeNewHead(context.Background(), headerCh) if err != nil { return err