diff --git a/assertions/sync.go b/assertions/sync.go index ee5c8b2696..da27f05640 100644 --- a/assertions/sync.go +++ b/assertions/sync.go @@ -85,7 +85,7 @@ func (m *Manager) syncAssertions(ctx context.Context) { return true, nil }) if err != nil { - log.Error("Could not check for assertion added event") + log.Error("Could not check for assertion added event", "err", err) return } } @@ -105,22 +105,28 @@ func (m *Manager) syncAssertions(ctx context.Context) { if fromBlock == toBlock { continue } - filterOpts := &bind.FilterOpts{ - Start: fromBlock, - End: &toBlock, - Context: ctx, - } - _, err = retry.UntilSucceeds(ctx, func() (bool, error) { - innerErr := m.processAllAssertionsInRange(ctx, filterer, filterOpts) - if innerErr != nil { - log.Error("Could not process assertions in range", "err", innerErr) - return false, innerErr + for startBlock := fromBlock; startBlock <= toBlock; startBlock = startBlock + m.maxGetLogBlocks { + endBlock := startBlock + m.maxGetLogBlocks + if endBlock > toBlock { + endBlock = toBlock + } + filterOpts := &bind.FilterOpts{ + Start: startBlock, + End: &endBlock, + Context: ctx, + } + _, err = retry.UntilSucceeds(ctx, func() (bool, error) { + innerErr := m.processAllAssertionsInRange(ctx, filterer, filterOpts) + if innerErr != nil { + log.Error("Could not process assertions in range", "err", innerErr) + return false, innerErr + } + return true, nil + }) + if err != nil { + log.Error("Could not check for assertion added event", "err", err) + return } - return true, nil - }) - if err != nil { - log.Error("Could not check for assertion added", "err", err) - return } fromBlock = toBlock case <-ctx.Done():