-
Notifications
You must be signed in to change notification settings - Fork 670
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
AA-184: Remove second postOp retry #311
Conversation
Makes comments and formatting consistent
fix EntryPoint revert if 'postOp' reverts with short revert reason
if postOp retry is getting removed, shouldn't this be lowered to 2 instead of 3? |
I think so. @drortirosh @forshtat any reason not to? |
What's the rationale behind removing |
The invariant we add is that passing all validation means transaction will always get paid for. |
The change in the paymaster's code is in cases where it wants to perform different action upon reverting the user's execution. In the suggested new model, it will increment the counter in the validatePaymasterUserOp, and decrement it in the postOp. The only thing that we know of that can be done in the two-postOp mode and can't be with the new model is emitting an event in the 2nd |
This mechanism was needed when With "view" being removed (long ago), paymasters can defend themselves during validation. A TokenPaymaster can precharge the max cost and then refund the unused part in postOp. A paymaster that wants to verify that the transaction performed some action and ban the user otherwise, could raise the "ban" flag for the user during validation and then reset it in postOp (or revert there, which leaves the user in a banned state. Any logic could be handled similarly. As for protecting the paymaster's reputation, |
…on into remove_second_postop_retry
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.
missing fix for the code that calls postOp with postOpReverted (in executeUserOp
@drortirosh please elaborate what specifically do you think requires fixing? |
@@ -664,20 +664,6 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard, | |||
IPaymaster(paymaster).postOp{ |
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.
Why do we still need mode
here?
@@ -163,11 +162,6 @@ contract TokenPaymaster is BasePaymaster, UniswapHelper, OracleHelper { | |||
address userOpSender | |||
) = abi.decode(context, (uint256, uint256, uint256, address)); | |||
uint256 gasPrice = getGasPrice(maxFeePerGas, maxPriorityFeePerGas); | |||
if (mode == PostOpMode.postOpReverted) { |
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.
Maybe change _handlePostOp()
to _postExecution()
? It's no longer handling post op only
@@ -664,20 +664,6 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard, | |||
IPaymaster(paymaster).postOp{ |
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.
in case the PostOp reverts, the "outer" postExecution will report the error (success=false), but there is no indication that it was a paymaster (postOp) that reverted, instead of user-code that reverted.
I suggest emit PostOpRevertReason to report it.
(technically, it is not here, but at the "catch" of the innerHandleOp)
No description provided.