-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dequeue upkeeps using the current dequeue iteration #12852
Conversation
48b0ae5
to
da2723a
Compare
da2723a
to
d749efb
Compare
8214bc8
to
e399dee
Compare
|
p.calculateIterations = true | ||
} | ||
|
||
if p.calculateIterations { | ||
p.calculateIterations = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. can potentially be deleted
512f834
to
58c374e
Compare
… results Add logging Add tests Clean up linting
1bd9e84
to
a6fb702
Compare
|
https://smartcontract-it.atlassian.net/browse/AUTO-9357
This PR consists of the following key change:
The goal here is that, in cases where the number of upkeeps exceeds the maximum number of results for a single call to log dequeue, we want to dequeue logs for subsets of upkeep IDs, in successive calls to dequeue, until at least the minimum number of logs have been dequeued for all upkeep IDs.
For example, if
maxResults
is 100, but we store logs for 200 upkeeps; even if we choose to dequeue at most 1 log for each upkeep, we could still only dequeue logs for at most 100 upkeeps in a single dequeue call. This means that in order to dequeue 1 log for all 200 upkeeps; we would need to make 2 calls to dequeue, and for each call, ensure that we dequeue for two unique, distinct sets of upkeep IDs.To do this determinstically, we can:
iterations
iterations
), and in each dequeue round, define a custom upkeep selector such thatupkeepID % iterations == currentIteration
currentIterations
counter, so that on the next call to dequeue, the upkeep selector will cause a different subset of upkeep IDs to be selectedTesting
Node upgrade test is passing here: https://github.com/smartcontractkit/chainlink/actions/runs/8871312521
Load test run here: https://github.com/smartcontractkit/chainlink/actions/runs/8989012623/job/24691139888
Additionally, some unit tests have been added that demonstrate the behaviour when the buffer has logs for a small number of upkeeps, a large number of upkeeps, and a large number of upkeeps that increases midway through the dequeue rounds.