Skip to content
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

remove unused event PostOpReverted from TokenPaymaster #383

Conversation

livingrockrises
Copy link
Contributor

  1. Removing the event PostOpReverted which is not being used in current paymaster. I would also like to understand reason behind adding this in the entry point and how to use it in paymasters. (in context of current entry point and upcoming EP)

  2. Adding this back in _postOp()

 if (mode == PostOpMode.postOpReverted) {
            return; // Do nothing here to not revert the whole bundle and harm reputation
        }

since current entry point still uses postOp twice and current code will just revert twice if postOp can not transfer tokens etc.

pre charging in validatePaymasterUserOp works but it's not a great UX to give pre approval to the paymaster as part of other userOp sponsored by some other paymaster. instead of that dapps would prefer limited approvals given as part of each calldata (based on fee quotes)

in new entry point with this it would change couple of things again regarding UX of token paymaster.

@livingrockrises
Copy link
Contributor Author

@forshtat @leekt

@drortirosh
Copy link
Contributor

postOp is no longer called twice, only once:
if PostOp reverts, then:

  • PostOpReverted is emitted
  • the account's exec is reverted (as well as paymaster's postOp)
  • the UserOpEvent is emitted, with "success=false"
  • the account's nonce is incremented (so you can't re-play this UserOp)
  • the handleOps continues with the rest of the UserOps in this bundle
  • the payment of this userop (validation and reverts of account's exec and postOp) are done by the paymaster.
    For naive account, this is a normal revert on-chain, (except that it was not caused by faulty account exec code, but by a faulty paymaster)

@drortirosh
Copy link
Contributor

btw - the PostOpReverted is indeed not in use, and should be removed. you can update your pr, for that.

@drortirosh drortirosh changed the title feaT:update token paymaster postop remove unused event PostOpReverted from TokenPaymaster Dec 12, 2023
@drortirosh drortirosh merged commit 558e024 into eth-infinitism:develop Dec 12, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants