-
-
Notifications
You must be signed in to change notification settings - Fork 231
feat: Default addTransactionBatch to EIP7702 if supported, otherwise use sequential batch #5853
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
b46ad98
to
6f74606
Compare
6f74606
to
37d55f9
Compare
packages/transaction-controller/src/hooks/ExtraTransactionsPublishHook.ts
Show resolved
Hide resolved
8808f3d
to
96e2cdd
Compare
…e use sequential batch
96e2cdd
to
cb180c9
Compare
packages/transaction-controller/src/hooks/ExtraTransactionsPublishHook.ts
Outdated
Show resolved
Hide resolved
e9419d7
to
4748992
Compare
Co-authored-by: OGPoyraz <[email protected]>
error.message === 'Chain does not support EIP-7702' | ||
) { | ||
log('Falling back to hook-based batch processing'); | ||
return await addTransactionBatchWithHook(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, could we invert the if
condition to only throw if not this, then we wouldn't need to duplicate this and it would continue on below.
@@ -401,15 +413,28 @@ async function addTransactionBatchWithHook( | |||
getPendingTransactionTracker: request.getPendingTransactionTracker, | |||
}); | |||
|
|||
const { | |||
request: { disable7702, disableHook, disableSequential }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, we've already got this above as userRequest
.
* Whether to use the publish batch hook to submit the batch. | ||
* Defaults to false. | ||
*/ | ||
useHook?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies I missed this, but this is a breaking chance since we're removing a property.
In order to avoid a breaking chance for now, and having to release all the other controllers, could we instead mark this as deprecated and clarify it will be ignored?
We could handle it as an alias for disable7702
and disableSequential
but it's only used within the controller currently.
Explanation
We previously relied on the
useHook
property in the request. Instead, the deciding factor is only whether or not EIP 7702 is supported on the chain of the batch transaction.References
Fixes https://github.com/MetaMask/MetaMask-planning/issues/4991
Changelog
Checklist