Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Jul 15, 2024
1 parent 8dd41a7 commit 72e7c70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (b *logBuffer) dequeue(start int64, capacity int, minimumDequeue bool) ([]B
// update the buffer with how many logs we have dequeued for this window
q.dequeued[start] += len(logs)
}
b.lggr.Debugw("minimum commitment logs dequeued", "start", start, "end", end, "numUpkeeps", len(b.queues), "minimumDequeueMet", minimumDequeueMet)
b.lggr.Debugw("minimum commitment logs dequeued", "start", start, "end", end, "numUpkeeps", len(b.queues), "numUpkeepIDs", len(b.queueIDs), "minimumDequeueMet", minimumDequeueMet, "logLimit", logLimit)
return result, remainingLogs
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,15 @@ func (p *logEventProvider) minimumCommitmentDequeue(latestBlock, start int64) []
var payloads []ocr2keepers.UpkeepPayload

blockRate := int(p.opts.BlockRate)
logLimit := int(p.opts.LogLimit)

for len(payloads) < MaxPayloads && start <= latestBlock {
startWindow, _ := getBlockWindow(start, blockRate)

// dequeue the minimum number logs (log limit, varies by chain) per upkeep for this block window
logs, remaining := p.buffer.Dequeue(startWindow, MaxPayloads-len(payloads), true)
if len(logs) > 0 {
p.lggr.Debugw("minimum commitment dequeue", "start", start, "latestBlock", latestBlock, "logs", len(logs), "remaining", remaining)
p.lggr.Debugw("minimum commitment dequeue", "start", start, "latestBlock", latestBlock, "logs", len(logs), "remaining", remaining, "blockRate", blockRate, "logLimit", logLimit)
}
for _, l := range logs {
payload, err := p.createPayload(l.ID, l.Log)
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/load/automationv2_1/automationv2_1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ Load Config:
upkeepDelaysRecovery = append(upkeepDelaysRecovery, delayRecovery)
}

blockWindowCounts[i] = upkeepMap
if len(upkeepMap) > 0 {
blockWindowCounts[i] = upkeepMap
}
}

for _, triggerContract := range triggerContracts {
Expand Down

0 comments on commit 72e7c70

Please sign in to comment.