-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: check supply queue size #237
Conversation
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.
to me it's enough
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.
Just thought about this but actually this isn't enough to ensure that the supply queue does not go above the max size. This is because the _setCap
also pushes an element to the queue. Should we also revert in this case ? Or should we remove that feature from _setCap
?
Are you sure? We're checking that the |
Could be a good invariant btw |
Yes I think so, here is a counter-example:
|
Oh yes you can have duplicates in |
I'm not sure we should do it for both. IMO we shouldn't revert when enabling a market only because there is duplicates in the supply queue, although Maybe we should just also forbid duplicates in the supply queue. What is the gas cost of doing so ? |
I disagree with omitting the check in
I believe this is still not enough for this issue, because the supply queue can contain markets that were previously enabled but have now been removed from the withdraw queue |
Can we update this branch with the second check? |
…into fix/bound-supply-queue-size
…into fix/bound-supply-queue-size
Fixes #217
I wondered if it deserved a natspec comment (on why we bound the size of the supply queue), but since the error (which is MaxQueueSizeExceeded) is already very explicit, I thought it wasn't worth it.
wdyt ?