-
Notifications
You must be signed in to change notification settings - Fork 271
tempo request: feePayer=true uses feeToken=0x0 for gas estimation, causing InvalidToken #3259
Description
Summary
When a server's 402 challenge includes feePayer: true in methodDetails, tempo request sends feeToken: 0x0000000000000000000000000000000000000000 in the eth_estimateGas RPC call. Tempo's node rejects this with TIP20 token error: InvalidToken(InvalidToken), preventing the channel open transaction from being built.
Reproduction
# Server issues challenge with feePayer: true
# (mpp.lasso.sh is a live MPP gateway)
tempo request -vvv -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://mpp.lasso.sh/fastest/ethereumIn the trace output, the eth_estimateGas call shows:
{
"feeToken": "0x0000000000000000000000000000000000000000",
...
}Tempo responds: {"error":{"code":-32603,"message":"TIP20 token error: InvalidToken(InvalidToken)"}}
Expected Behavior
The CLI should use the payment currency address (available in the challenge's request.currency field) as the feeToken for gas estimation, even when feePayer: true. The mppx TypeScript SDK does this correctly — it passes feeToken: currency to prepareTransactionRequest alongside feePayer: true.
The sender doesn't sign over feeToken when sponsored (per spec), but gas estimation still needs a valid token to compute costs.
Context
tempoversion: 1.4.3 (commit a35c7d1)- Network: Tempo mainnet (chain ID 4217)
- USDC address:
0x20C000000000000000000000b9537d11c60E8b50 - When
feePayer: false, the CLI correctly uses the USDC address for gas estimation and everything works
Workaround
Setting feePayer: false in the server challenge causes the CLI to use the correct feeToken for estimation. The client pays gas directly instead of the server sponsoring it.