Skip to content

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Jun 11, 2025

Small patch release for the account-tree-controller.

@ccharly ccharly requested review from a team as code owners June 11, 2025 15:53
@ccharly ccharly enabled auto-merge (squash) June 11, 2025 15:55
@ccharly ccharly merged commit 4df775d into main Jun 11, 2025
221 checks passed
@ccharly ccharly deleted the release/434.0.0 branch June 11, 2025 15:58
matthewwalsh0 added a commit that referenced this pull request Oct 16, 2025
## Explanation

When publishing a transaction, a batch is automatically created if
`batchTransactions` are found on the `TransactionMeta`.

If this batch can be achieved via EIP-7702, we currently add a new
transaction that supersedes the original.

While the original transaction promise currently resolves or rejects
based on the new EIP-7702 transaction, its status is changed to
`dropped` and duplicate metrics are generated in the clients given two
transactions are ultimately created and submitted.

This PR instead converts the original transaction to EIP-7702 by
updating the transaction parameters and re-signing the original
transaction.

## References

Related to
[#5959](MetaMask/MetaMask-planning#5959)
[#5960](MetaMask/MetaMask-planning#5960)

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Converts existing transactions to EIP-7702 when publishing batches,
adds newSignature support to onPublish, and refactors publish flow with
a default/extra publish hook; updates batch utils to estimate
gas/re-sign and tests accordingly.
> 
> - **Transaction publish flow**:
> - Introduce `#defaultPublishHook` to encapsulate publish/trace and
fallback submission.
> - Use `ExtraTransactionsPublishHook` when `txMeta.batchTransactions`
exist; it now receives `getTransaction` and `originalPublishHook` and
can call the original hook when provided a `newSignature`.
> - **Batch processing (EIP-7702)**:
> - Convert an existing transaction to EIP-7702 on publish (update
`txParams`, estimate gas via new `estimateGas` hook, set `batchId`,
re-sign) instead of creating a new superseding tx.
> - Add helpers `convertTransactionToEIP7702` and
`updateTransactionSignature`.
> - **Types**:
> - Extend `TransactionBatchSingleRequest.existingTransaction.onPublish`
to accept optional `newSignature`.
> - **Controller/utils API**:
>   - Pass `estimateGas` into `addTransactionBatch`.
> - **Tests/Changelog**:
>   - Update tests for new publish and batch behaviors.
> - Changelog entry noting EIP-7702 conversion and `newSignature`
addition.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
cae3e22. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

4 participants