-
Notifications
You must be signed in to change notification settings - Fork 39
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
Cancelling an already cancelled order shouldn't consume all gas #143
Comments
I disagree. The habit of using returns when the thing which your function is named didn't happen is too dangerous to be worth it IMO. That's on the EVM designers for not including a free exception op. p.s. Did you know |
pps see ethereum/EIPs#140 |
While I appreciate your principled position, the EVM designers aren't paying the gas cost for this. It is our users that will have to pay instead. In this specific case it is not about |
We already use the boolean return for In general and certainly for bigger contracts I'd agree that throw is the better pattern, as it reverts all state changes. @jorisbontje: would you also want to return false in the case of |
@rainbeam yes, preferably; especially during mass order cancellation (when the market is closed) it is likely that |
These arguments make sense to me. I have been using |
Yeah, for a bigger codebase. There's only 3 public functions here though so not sure it's worth it. But then maybe it could be seen in the context of the larger ecosystem. Whichever way it's addressed we're still just working around limitations of the current language. We need better tooling for localised state rollback. Nice EIP btw. |
Currently we
throw
if you try to cancel an order that is already cancelled. This will cause all the 1M gas to be consumed. Instead we should justreturn
instead ofthrow
and make this a NOOP / save lots of gas / trees.The text was updated successfully, but these errors were encountered: