Skip to content

Commit 4fffc6a

Browse files
authored
fix: strip feeToken and feePayerSignature from pre-broadcast simulation (#432)
The `viem_call` simulation in `tempo.charge` and `tempo.session` spread the deserialized transaction, including `feePayerSignature`, into the `eth_call` request and explicitly set `feeToken`. The Tempo node treats those fields as a sponsored-tx hint and tries to recover both signatures, but `call` strips the sender signature, so recovery fails with 'fee payer signature recovery failed' on every sponsored 0x76 charge. Stripping `feeToken` and `feePayerSignature` keeps the VERIA-145 revert guard intact while letting the node simulate the calls as a regular `eth_call`. Amp-Thread-ID: https://ampcode.com/threads/T-019e1503-5215-736f-a35a-292777404768
1 parent 94e76c6 commit 4fffc6a

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'mppx': patch
3+
---
4+
5+
Fixed pre-broadcast simulation in `tempo.charge` and `tempo.session` by stripping `feeToken` and `feePayerSignature` from the simulation request, so the node does not try to recover `feePayerSignature` against a sender signature that viem's `call` action never includes.

src/tempo/server/Charge.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ export function charge<const parameters extends charge.Parameters>(
409409
await viem_call(client, {
410410
...transaction,
411411
account: transaction.from,
412-
feeToken: resolvedFeeToken,
413412
calls: transaction.calls,
413+
feePayerSignature: undefined,
414414
} as never)
415415
const receipt = await sendRawTransactionSync(client, {
416416
serializedTransaction: serializedTransaction_final,
@@ -447,8 +447,8 @@ export function charge<const parameters extends charge.Parameters>(
447447
await viem_call(client, {
448448
...transaction,
449449
account: transaction.from,
450-
feeToken: resolvedFeeToken,
451450
calls: transaction.calls,
451+
feePayerSignature: undefined,
452452
} as never)
453453
const reference = await sendRawTransaction(client, {
454454
serializedTransaction: serializedTransaction_final,

src/tempo/session/Chain.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ export async function broadcastOpenTransaction(parameters: {
606606
await call(client, {
607607
...transaction,
608608
account: transaction.from,
609-
feeToken: resolvedFeeToken,
610609
calls,
610+
feePayerSignature: undefined,
611611
} as never)
612612
const txHash = await sendRawTransaction(client, {
613613
serializedTransaction: serializedTransaction_final as Transaction.TransactionSerializedTempo,
@@ -625,8 +625,8 @@ export async function broadcastOpenTransaction(parameters: {
625625
await call(client, {
626626
...transaction,
627627
account: transaction.from,
628-
feeToken: resolvedFeeToken,
629628
calls,
629+
feePayerSignature: undefined,
630630
} as never)
631631

632632
const receipt = await sendRawTransactionSync(client, {
@@ -762,10 +762,8 @@ export async function broadcastTopUpTransaction(parameters: {
762762
await call(client, {
763763
...transaction,
764764
account: transaction.from,
765-
feeToken:
766-
transaction.feeToken ??
767-
defaults.currency[client.chain?.id as keyof typeof defaults.currency],
768765
calls,
766+
feePayerSignature: undefined,
769767
} as never)
770768

771769
const receipt = await sendRawTransactionSync(client, {

0 commit comments

Comments
 (0)