-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
support customized block number for conditional #11804
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
bd8b71d
to
5993f9a
Compare
5993f9a
to
c97448e
Compare
a simple upkeep of this can be:
|
var blockNumber int64 | ||
blockNumber, err = strconv.ParseInt(args[1], 10, 64) |
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.
should we re-use blockNum
that is declared on line 135? I believe that is the value that is used in the streams lookup section. If the users passes a blocknum for conditional upkeeps, we should use that block num for stream lookup callbacks, yeah?
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.
They are different in my opinion.
- The blockNumber in L147 is from user input, and it is used only for conditional upkeeps. So users can run checkUpkeep and performUpkeep using that specific block number.
- The blockNumber in L135 is used in log trigger based upkeeps, and the block number is read from the transaction receipt. For log trigger upkeeps, we dont ask for block number. we have the tx hash tho.
Let me know if the above makes sense :)
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.
Updated~ It is a good idea to reuse the variable, hence removed the additional variable :)
c97448e
to
06463af
Compare
SonarQube Quality Gate |
AUTO-8793
As title, support using a block number from users. This covers both checkupkeep and perform
Test plan:
Tried the following upkeep in arbitrum sepolia:
Both older block and latest block returned ineligible.
I couldn't find an upkeep which checkUpkeep returns true on older blocks but latest returns false. Hope to find some interesting test cases with Mike later.