Skip to content

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

Merged
merged 13 commits into from
Jun 4, 2025

Conversation

pedronfigueiredo
Copy link
Contributor

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

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/4991 branch 5 times, most recently from 8808f3d to 96e2cdd Compare May 27, 2025 12:32
OGPoyraz
OGPoyraz previously approved these changes Jun 2, 2025
OGPoyraz
OGPoyraz previously approved these changes Jun 2, 2025
error.message === 'Chain does not support EIP-7702'
) {
log('Falling back to hook-based batch processing');
return await addTransactionBatchWithHook(request);
Copy link
Member

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 },
Copy link
Member

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;
Copy link
Member

@matthewwalsh0 matthewwalsh0 Jun 4, 2025

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.

@pedronfigueiredo pedronfigueiredo dismissed matthewwalsh0’s stale review June 4, 2025 13:51

addressed all comments

@pedronfigueiredo pedronfigueiredo merged commit 70455d1 into main Jun 4, 2025
214 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/4991 branch June 4, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants