From 45ba591f8ae5c8ed8b48e6ea5ef1513f3dca4446 Mon Sep 17 00:00:00 2001 From: Goktug Poyraz Date: Tue, 11 Aug 2026 15:23:16 +0300 Subject: [PATCH 1/3] Fix signed transaction failures --- packages/transaction-controller/CHANGELOG.md | 4 ++ .../src/TransactionController.test.ts | 49 +++++++++++++++++++ .../src/TransactionController.ts | 1 + 3 files changed, 54 insertions(+) diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 1bff4d745e..1ff319e9a0 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Skip resimulation check when failing incomplete transactions at startup, preventing a crash when `isSimulationEnabled` depends on controllers not yet registered ([#XXXX](https://github.com/MetaMask/core/pull/XXXX)) + ### Changed - Bump `@metamask/accounts-controller` from `^39.0.7` to `^39.1.0` ([#9807](https://github.com/MetaMask/core/pull/9807)) diff --git a/packages/transaction-controller/src/TransactionController.test.ts b/packages/transaction-controller/src/TransactionController.test.ts index 97a14a14ea..dbbc422a42 100644 --- a/packages/transaction-controller/src/TransactionController.test.ts +++ b/packages/transaction-controller/src/TransactionController.test.ts @@ -1275,6 +1275,55 @@ describe('TransactionController', () => { ); }); + it('fails signed transactions even when isSimulationEnabled throws', async () => { + const mockTransactionMeta = { + from: ACCOUNT_MOCK, + txParams: { + from: ACCOUNT_MOCK, + to: ACCOUNT_2_MOCK, + }, + }; + + const mockedTransactions = [ + { + id: '111', + chainId: toHex(5), + status: TransactionStatus.signed, + ...mockTransactionMeta, + }, + { + id: '222', + chainId: toHex(1), + status: TransactionStatus.approved, + ...mockTransactionMeta, + }, + ]; + + const mockedControllerState = { + transactions: mockedTransactions, + methodData: {}, + lastFetchedBlockNumbers: {}, + }; + + const { controller } = setupController({ + options: { + isSimulationEnabled: () => { + throw new Error('Handler not registered'); + }, + // TODO: Replace `any` with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + state: mockedControllerState as any, + }, + }); + + await flushPromises(); + + const { transactions } = controller.state; + + expect(transactions[0].status).toBe(TransactionStatus.failed); + expect(transactions[1].status).toBe(TransactionStatus.failed); + }); + it('removes unapproved transactions', async () => { const mockTransactionMeta = { from: ACCOUNT_MOCK, diff --git a/packages/transaction-controller/src/TransactionController.ts b/packages/transaction-controller/src/TransactionController.ts index 244a0318ee..f6aa336639 100644 --- a/packages/transaction-controller/src/TransactionController.ts +++ b/packages/transaction-controller/src/TransactionController.ts @@ -4388,6 +4388,7 @@ export class TransactionController extends BaseController< { transactionId: transactionMeta.id, skipValidation: true, + skipResimulateCheck: true, }, (draftTransactionMeta) => { draftTransactionMeta.status = TransactionStatus.failed; From 47388cff3f0ffa6fb7faa7521c4121f274201a3a Mon Sep 17 00:00:00 2001 From: Goktug Poyraz Date: Tue, 11 Aug 2026 15:26:15 +0300 Subject: [PATCH 2/3] Update changelog --- packages/transaction-controller/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 1ff319e9a0..dee889f523 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Skip resimulation check when failing incomplete transactions at startup, preventing a crash when `isSimulationEnabled` depends on controllers not yet registered ([#XXXX](https://github.com/MetaMask/core/pull/XXXX)) +- Skip resimulation check when failing incomplete transactions at startup, preventing a crash when `isSimulationEnabled` depends on controllers not yet registered ([#9821](https://github.com/MetaMask/core/pull/9821)) ### Changed From 4d1fd5d5f34f68a53ab3a3088f63a2fad051cbd8 Mon Sep 17 00:00:00 2001 From: Goktug Poyraz Date: Tue, 11 Aug 2026 15:32:04 +0300 Subject: [PATCH 3/3] Update --- packages/transaction-controller/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index dee889f523..58772de962 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -7,14 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Fixed - -- Skip resimulation check when failing incomplete transactions at startup, preventing a crash when `isSimulationEnabled` depends on controllers not yet registered ([#9821](https://github.com/MetaMask/core/pull/9821)) - ### Changed - Bump `@metamask/accounts-controller` from `^39.0.7` to `^39.1.0` ([#9807](https://github.com/MetaMask/core/pull/9807)) +### Fixed + +- Skip resimulation check when failing incomplete transactions at startup, preventing a crash when `isSimulationEnabled` depends on controllers not yet registered ([#9821](https://github.com/MetaMask/core/pull/9821)) + ## [69.5.1] ### Changed