-
Notifications
You must be signed in to change notification settings - Fork 0
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
make getWeeklySpend more sensitive to future programs. #40
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
overall it is a great addition, but it is unclear why would you include here also the future schedules?
mind elaborating why you think on the comparison against
MaxGlobalAmountPerPeriod
is important to also consider the future ones?. since the future ones could be in 2 weeks or in a month time etcThere 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.
It is important that getGlobalAmountSchedule ensures that more than that amount is never paid. It would be too complex to write logic to ensure that otherwise. This may be a little bit "over-protective" but that's ok. If someone get's stuck they can figure that out.
Future scheduling isn't something we expect to do often, and one should think more about the whole thing if you're gtting close to a defined max anyway.
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.
Alright, can see that this may fall more into corner case and that future scheduling of injections is something internally to be considered rare
Only consideration to keep in mind at least while operating as an admin this contract is that on the rare case that future schedules are set for new gauges/recipients besides whatever injections schedules may be running in parallel, that it could lead into revert in case that it's bigger that defined
MaxGlobalAmountPerPeriod
As long as internally there is awareness of that should not lead into reverts while operating the injector
Worth adding a minor note/comment around that line of code, from an outside pov it seems a very intricacy detail that can be forgotten
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.
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.
feel free to include our
@dev
comment suggestion or use different language as you may see best fit to highlight this small intricacyThere 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.
I think the point of the whole thing is for the contract to break/revert before sending out more money than intended.
The point of the revert is to make someone think. The error message clearly explains why this configuration action is being taken. I don't think that the @dev notice above helps to clarify things. This is better documented in user guides/in the UI.
In the end after further assessment I think it would make the most sense to not merge this PR. It just adds more complexity to the code without really adding clarity for the folks that would be using it or functionality that I can see likely to be used.