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

feat: add userOpFailed hook #447

Closed
wants to merge 1 commit into from

Conversation

BenSparksCode
Copy link
Contributor

@BenSparksCode BenSparksCode commented Oct 30, 2024

Changes:

  • When a metacall fails due to the UserOperation call reverting with the UserOpFail error, the rest of the hooks are skipped, and Atlas executes an additional UserOpFailed hook.
  • The UserOpFailed hook is called on the DAppControl, and includes the UserOperation memory userOp parameter as well as the relevant properties available via the appended packed Context var. DAppControls can implement this hook in the same way other hooks are implemented.
  • The execution of the new UserOpFailed hook happens in the catch block of the metacall function. This means that any accounting changes that would have occured in _settle() are skipped.
  • If the UserOpFailed hook reverts, the entire metacall will always revert.

To Do:

  • Set gas limit for UserOpFailed hook - maybe specified in dAppOp.
  • Add needsUserOpFailedHook() setting to CallConfig to make this new call conditional.
  • Enforce needsUserOpFailedHook() and allowsReuseUserOps() settings are mutually exclusive.
  • Check new errors are handled correctly in Simulator.
  • Tests

@BenSparksCode
Copy link
Contributor Author

Moving this "revert-prevention-for-refund" type of research to the monad-contracts repo. Will most likely not involve a new DAppControl hook.

@BenSparksCode BenSparksCode deleted the userOpFailed-hook branch November 5, 2024 07:17
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.

1 participant