Skip to content

fix(common): use real fee token for gas estimation when fee_payer is true#405

Open
skyc1e wants to merge 2 commits intotempoxyz:mainfrom
skyc1e:fix/fee-payer-gas-estimation-token
Open

fix(common): use real fee token for gas estimation when fee_payer is true#405
skyc1e wants to merge 2 commits intotempoxyz:mainfrom
skyc1e:fix/fee-payer-gas-estimation-token

Conversation

@skyc1e
Copy link
Copy Markdown

@skyc1e skyc1e commented Apr 2, 2026

Closes tempoxyz/tempo#3259.

When a 402 challenge specifies feePayer: true, resolve_and_sign_tx_with_fee_payer was passing Address::ZERO as the fee token to eth_estimateGas. The node rejects this with InvalidToken because it cannot price gas against the zero address.

The fix separates the two concerns:

  • Gas estimation always uses the real fee_token so the node can compute costs
  • The final signed transaction still uses Address::ZERO when fee_payer is true, so the sponsor can co-sign server-side

This matches the approach used by the mppx TypeScript SDK.

…true

When fee_payer is true the gas estimation request was using
Address::ZERO as the fee token, causing the node to reject it
with InvalidToken. Gas estimation needs the real token address
to price the transaction; only the final signed transaction
should use Address::ZERO so the sponsor can co-sign server-side.

Closes tempoxyz/tempo#3259
@Slokh
Copy link
Copy Markdown
Collaborator

Slokh commented Apr 3, 2026

lgtm, @skyc1e can you add a changelog

@skyc1e
Copy link
Copy Markdown
Author

skyc1e commented Apr 4, 2026

Added a changelog entry in 4001010. Thanks for the review!

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.

tempo request: feePayer=true uses feeToken=0x0 for gas estimation, causing InvalidToken

2 participants