Skip to content

Commit

Permalink
Actually add number
Browse files Browse the repository at this point in the history
  • Loading branch information
kalverra committed Nov 15, 2023
1 parent 0afe3b4 commit 8ca004f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions integration-tests/testsetups/keeper_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ func (k *KeeperBenchmarkTest) Run() {

// Collect logs for each registry to calculate test metrics
// This test generates a LOT of logs, and we need to break up our reads, or risk getting rate-limited by the node
endBlock := big.NewInt(0).Add(k.startingBlock, big.NewInt(u.BlockRange))
registryLogs := make([][]types.Log, len(k.keeperRegistries))
var (
endBlock = big.NewInt(0).Add(k.startingBlock, big.NewInt(u.BlockRange))
registryLogs = make([][]types.Log, len(k.keeperRegistries))
blockBatchSize int64 = 100
)
for rIndex := range k.keeperRegistries {
// Variables for the full registry
var (
Expand All @@ -310,7 +313,7 @@ func (k *KeeperBenchmarkTest) Run() {
filterQuery := geth.FilterQuery{
Addresses: []common.Address{common.HexToAddress(addr)},
FromBlock: queryStartBlock,
ToBlock: big.NewInt(0).Add(queryStartBlock, big.NewInt(100)),
ToBlock: big.NewInt(0).Add(queryStartBlock, big.NewInt(blockBatchSize)),
}

// This RPC call can possibly time out or otherwise die. Failure is not an option, keep retrying to get our stats.
Expand All @@ -334,6 +337,7 @@ func (k *KeeperBenchmarkTest) Run() {
Int("Log Count", len(logs)).
Str("Registry Address", addr).
Msg("Collected logs")
queryStartBlock.Add(queryStartBlock, big.NewInt(blockBatchSize))
registryLogs[rIndex] = append(registryLogs[rIndex], logs...)
}
}
Expand Down

0 comments on commit 8ca004f

Please sign in to comment.