-
Notifications
You must be signed in to change notification settings - Fork 197
fix: sending multiple uos with deferred action #1529
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd 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. |
🌿 Documentation Preview
|
2740ced
to
a7761c8
Compare
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 revertSolution: Parse entity id and isGlobalVal options, and the falsy value for
deferredActionData
from above is set toundefined
so it wouldn't be used if the DA has been consumedThis 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
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)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
const sig
tolet sig
insignUserOperationHash
fornativeSMASigner
andsingleSignerMessageSigner
.deferredActionData
after use.entityId
andisGlobalValidation
fields inparseDeferredAction
.deferredActionData
type to include specific formatting.createMAv2Base
.