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: improve call efficiency by removing execute wrapper for calls to the account #1401

Closed
wants to merge 1 commit into from

Conversation

howydev
Copy link
Collaborator

@howydev howydev commented Feb 28, 2025

Currently, all calls go through sendUserOperation that turns the call into an execute. This results in a redundant wrapping when calls are made to the account directly. We change encodeExecute thats used in sendUserOperation to format the calls to not add the wrapping when the call target is the account

Pull Request Checklist


PR-Codex overview

This PR focuses on simplifying the sendUserOperation function call in the installValidation method by removing the account parameter from the request.

Detailed summary

  • Removed the account parameter from the client.sendUserOperation call in the installValidation method.
  • Kept the uo and overrides parameters in the sendUserOperation call.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Feb 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2025 9:11pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2025 9:11pm

Copy link

graphite-app bot commented Feb 28, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Collaborator

@adamegyed adamegyed left a comment

Choose a reason for hiding this comment

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

I think this makes sense to do, but I'm not totally sure. It is already possible for an account to specify the raw calldata on an account, because the parameters to sendUserOperation are either:

  • raw calldata (toward the account, from the EP)
  • a single instance of { target, value, data }
  • an array of { target, value, data }.

Also, for MAv2, in the case where someone tries to use the non-pure-calldata form of execute towards self, the call will fail with SelfCallRecursionDepthExceeded: https://github.com/alchemyplatform/modular-account/blob/v2.0.0/src/account/ModularAccountBase.sol#L890-L894

So this change would allow people to specify a call as { target: ≤self>, data: callData, value?: <some_value_ignored> }, instead of just as <callData>. This might help people with debugging, but it could also be unexpected.

Wdyt?

@howydev
Copy link
Collaborator Author

howydev commented Feb 28, 2025

oh TIL on the type - missed it. sendUserOp calls buildUserOp that calls _initUserOp that does this with the calldata: https://github.com/alchemyplatform/aa-sdk/blob/main/aa-sdk/core/src/actions/smartAccount/internal/initUserOperation.ts#L60

edit: no change needed then, will close PR

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