Track when we enqueue logs for the same upkeep on the same block more than once#13176
Merged
Track when we enqueue logs for the same upkeep on the same block more than once#13176
Conversation
infiloop2
reviewed
May 28, 2024
| if lastBlockSeen := b.lastBlockSeen.Load(); lastBlockSeen < latestLogBlock { | ||
| b.lastBlockSeen.Store(latestLogBlock) | ||
| } else if latestLogBlock < lastBlockSeen { | ||
| b.lggr.Debugw("enqueuing logs from a block older than latest seen block", "logBlock", latestLogBlock, "lastBlockSeen", lastBlockSeen) |
Contributor
There was a problem hiding this comment.
nit. enqueuing logs with a latest block older older than latest seen block
infiloop2
previously approved these changes
May 28, 2024
|
infiloop2
previously approved these changes
Jun 3, 2024
…olated Add tests Add changeset
amirylm
previously approved these changes
Jun 4, 2024
amirylm
approved these changes
Jun 4, 2024
infiloop2
reviewed
Jun 4, 2024
Comment on lines
+147
to
+149
| if uid == nil { | ||
| return | ||
| } |
Contributor
There was a problem hiding this comment.
curious did we run into this issue? do we have codepaths that call this with nil upkeepID?
Collaborator
Author
There was a problem hiding this comment.
In unit testing, passing a nil uid led to "nil" strings in the map, which I didn't want
infiloop2
approved these changes
Jun 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





https://smartcontract-it.atlassian.net/browse/AUTO-10164
WIth this PR, we're updating some comments within the buffer implementation, to explicitly declare our assumptions on how the buffer will be used.
Further to this, we're also adding logs to identify scenarios when these assumptions are violated. To achieve this, we use a map to track the number of times we enqueue upkeep logs for a particular block number.
Testing
Running the load test, we don't see the logs appear for enqueuing upkeep logs for the same block number more than once.