Skip to content

Conversation

howydev
Copy link
Contributor

@howydev howydev commented Apr 11, 2025

We currently don't handle two cases well:

Problem 1. Reusing the client to send a 2nd UO, after consuming the deferred action. This is because we set the deferredActionNonce and deferredActionData to be used, but we don't update this after the UO is sent, so the 2nd uo includes the DA which causes a validation revert
Solution: Initialize these values with some defined "falsy" values and update the values to these falsy values after using the DA.

Problem 2. Initializing a new client to send a 2nd UO also doesn't work. If we don't use a nonce override, the entity id and global validation options ends up being the default value (the owner). Also, we always have a defined deferredActionData value whether the DA has been consumed or not, so it always gets prepended to any sig even if the DA is consumed, also causing a validation revert
Solution: Parse entity id and isGlobalVal options, and the falsy value for deferredActionData from above is set to undefined so it wouldn't be used if the DA has been consumed

This PR adds two tests to test the above - sending a 2nd UO from the same client as well from a new client instance.

Pull Request Checklist


PR-Codex overview

This PR focuses on enhancing the handling of deferred actions in the smart contract system, ensuring proper management of signatures and nonce values, and refining the logic for processing user operations.

Detailed summary

  • Changed const sig to let sig in signUserOperationHash for nativeSMASigner and singleSignerMessageSigner.
  • Updated signature concatenation logic to clear deferredActionData after use.
  • Added entityId and isGlobalValidation fields in parseDeferredAction.
  • Modified deferredActionData type to include specific formatting.
  • Improved nonce handling logic in createMAv2Base.
  • Updated tests to cover new deferred action flows and ensure correct client behavior.

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

Copy link

vercel bot commented Apr 11, 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 Apr 11, 2025 7:58pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 7:58pm

Copy link
Contributor

graphite-app bot commented Apr 11, 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

github-actions bot commented Apr 11, 2025

🌿 Documentation Preview

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Apr 11, 2025, 7:56 PM

@github-actions github-actions bot temporarily deployed to docs-preview April 11, 2025 17:47 Inactive
@howydev howydev changed the title fix: wip fix sending multiple uos with deferred action fix: sending multiple uos with deferred action Apr 11, 2025
@github-actions github-actions bot temporarily deployed to docs-preview April 11, 2025 17:53 Inactive
@howydev howydev marked this pull request as ready for review April 11, 2025 17:57
@howydev howydev merged commit 3446821 into main Apr 11, 2025
8 checks passed
@howydev howydev deleted the howy/improve-permissions-tests branch April 11, 2025 20:26
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