Skip to content

Commit 7e1e1e3

Browse files
committed
fix(nonce-lanes): honor parallel/nonceKey in signTransaction
signTransaction routed through _resolveQuote, which never called _resolveNonce, so a requested nonce lane was silently dropped and the operation was signed at the default key-0 nonce. Route signTransaction through _prepareForSend (the same helper sendTransaction/transfer use): it resolves the lane, bypasses the key-0 quote cache for lane sends, and builds at the lane nonce. The default path is unchanged (same cache reuse + staleness check, same async cost). Remove the now-dead _resolveQuote.
1 parent cb496f2 commit 7e1e1e3

2 files changed

Lines changed: 3 additions & 22 deletions

File tree

src/wallet-account-evm-erc-4337.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,16 @@ export default class WalletAccountEvmErc4337 extends WalletAccountReadOnlyEvmErc
161161
this._validateConfig(mergedConfig)
162162
}
163163

164-
const cached = await this._resolveQuote(tx, config)
164+
const prepared = await this._prepareForSend(tx, [tx], mergedConfig)
165165

166-
const fee = cached.fee
166+
const fee = prepared.fee
167167

168168
const { isSponsored, transactionMaxFee } = mergedConfig
169169
if (!isSponsored && transactionMaxFee !== undefined && fee > transactionMaxFee) {
170170
throw new Error('Exceeded maximum fee cost for transaction operation.')
171171
}
172172

173-
const { userOp } = await this._signUserOperation([tx], { config: mergedConfig, cachedBuild: cached })
173+
const { userOp } = await this._signUserOperation([tx], { config: mergedConfig, cachedBuild: prepared })
174174

175175
this._quoteCache.clear()
176176

@@ -366,23 +366,6 @@ export default class WalletAccountEvmErc4337 extends WalletAccountReadOnlyEvmErc
366366
this._ownerAccount.dispose()
367367
}
368368

369-
/** @private */
370-
async _resolveQuote (tx, config) {
371-
let cached = this._consumeCachedQuote(tx)
372-
373-
if (cached?.userOp) {
374-
const onChainNonce = await fetchAccountNonce(this._provider, cached.smartAccount.entrypointAddress, cached.smartAccount.accountAddress)
375-
if (cached.userOp.nonce !== onChainNonce) cached = undefined
376-
}
377-
378-
if (!cached) {
379-
await this.quoteSendTransaction(tx, config)
380-
cached = this._consumeCachedQuote(tx)
381-
}
382-
383-
return cached
384-
}
385-
386369
/** @private */
387370
async _prepareForSend (tx, txs, config) {
388371
const nonce = await this._resolveNonce(config)

types/src/wallet-account-evm-erc-4337.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ export default class WalletAccountEvmErc4337 extends WalletAccountReadOnlyEvmErc
127127
*/
128128
dispose(): void;
129129
/** @private */
130-
private _resolveQuote;
131-
/** @private */
132130
private _prepareForSend;
133131
/** @private */
134132
private _buildAtNonce;

0 commit comments

Comments
 (0)