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

ERC4337 module feature: Extract execution to a separate function and require success in the internal call #95

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

mmv08
Copy link
Member

@mmv08 mmv08 commented Oct 16, 2023

This PR:

  • Extracts the execution function of a user operation into a separate function on the module (previously, the entrypoint would directly call execTransactionFromModule and had to be enabled as a module as well
  • This was done to require success and revert on failing transactions to enable a proper gas estimation

This PR is a prototype only at the moment, and the goal is to seek the team's feedback on the approach.

@mmv08 mmv08 requested review from a team, rmeissner, Uxio0 and akshay-ap and removed request for a team October 16, 2023 14:31
@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch from 6c3e5f5 to f565930 Compare October 16, 2023 14:32
address entryPoint = _msgSender();
require(entryPoint == supportedEntryPoint, "Unsupported entry point");

(bool success, ) = msg.sender.call(executionData);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think we'd benefit from an additional check for the execTransactionFromModule signature?

@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch from f565930 to aed12a3 Compare October 16, 2023 19:36
Copy link
Member

@rmeissner rmeissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach should work and be gas efficient, would just add 2 checks

@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch from aed12a3 to e381527 Compare October 17, 2023 08:50
@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch 2 times, most recently from 9cfd4dc to b40d9c6 Compare October 17, 2023 12:48
@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch from b40d9c6 to 907e849 Compare October 17, 2023 15:06
@mmv08 mmv08 marked this pull request as ready for review October 18, 2023 09:06
@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch from ad89aa2 to 02c1a14 Compare October 18, 2023 09:09
@mmv08 mmv08 force-pushed the feature/require-success-for-operation-execution branch from 02c1a14 to ca698b0 Compare October 18, 2023 09:11
@mmv08 mmv08 merged commit 06c2936 into master Oct 18, 2023
1 of 2 checks passed
@mmv08 mmv08 deleted the feature/require-success-for-operation-execution branch October 18, 2023 09:16
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