Skip to content

Commit

Permalink
use buffered channel to read subscription headers from EVM node
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Apr 25, 2024
1 parent 796a138 commit 67ae4c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integration-tests/testsetups/keeper_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67ae4c8

Please sign in to comment.