Why do we need to revert a batch execution if one of the execution reverts? #69
Replies: 4 comments 6 replies
-
Great idea Shub, I like this. Curious about @PaulRBerg opinion. The only downside I can think of now, is that it will cost more gas (if all stream IDs are correct). Also, we it would be a good idea to also return the streams IDs that have been canceled/withdrawn successfully. |
Beta Was this translation helpful? Give feedback.
-
Interesting idea, @smol-ninja. I remember we have previously discussed this in V2 Core, but I can't remember exactly where. Anyway, the rationale for reverting was the following: However, I'm not as convinced that we should prioritize that principle over the practical benefits of letting the withdrawals pass through, especially since withdrawals can be public now. So let's do it as you suggested @smol-ninja, and let's also open an issue in V2 Core not just here. |
Beta Was this translation helpful? Give feedback.
-
@smol-ninja are you sure that having just one Looking at Solidity by Example, my sense is that we need another arm for |
Beta Was this translation helpful? Give feedback.
-
Since we no longer have |
Beta Was this translation helpful? Give feedback.
-
The batch functions such as withdraw-multiple and cancel-multiple revert if the execution of one of the stream IDs reverts. In such cases, the reverted transaction would consume a lot of gas because of the nature of the batch functions.
Thus, I would like to suggest that instead of reverting the entire transaction, it should proceed with the valid stream IDs and ignore the invalid ones.
For invalid IDs, the
catch
block should catch and emit the reverting error. This would help the user identify the invalid IDs by looking at the explorer.This offers three advantages to the users:
withdrawMultiple
. Anyone can run a keeper job that would keep callingwithdrawMultiple
on all stream IDs without fail.Beta Was this translation helpful? Give feedback.
All reactions