fix: handle prefilled Tempo fee payer signatures#4660
Merged
jxom merged 6 commits intoMay 24, 2026
Conversation
|
@struong is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: b48edaf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
…eth_fillTransaction The withRelay transport always made a second round trip to the relay (eth_signRawTransaction) even when the fill response already carried a feePayerSignature. Two fixes in serializeTempo: 1. When a feePayerSignature is already attached and the sender has signed, emit a full broadcast envelope (0x76) with both signatures instead of the partial fee-payer-format envelope (0x78). 2. Always strip feeToken from the sender's sign payload under sponsorship — previously this only happened when no feePayerSignature was present, causing the sender to commit to feeToken once the relay had pre-signed (violating TIP-76 and producing an invalid envelope).
…on` response Relay fillers (e.g. Tempo sponsor autoSwap) may expand the user's calls with additional preamble (token approvals, swaps) and sign over the expanded set. Dropping the relay's calls during the fill-result merge caused the broadcast envelope to omit the preamble, making the fee payer signature unrecoverable on chain.
341abff to
a66772d
Compare
jxom
reviewed
May 24, 2026
Comment on lines
+431
to
+442
| // Adopt expanded calls from the fill response so the | ||
| // broadcast envelope matches what the fee payer signed over. | ||
| ...('calls' in rest && | ||
| Array.isArray(rest.calls) && | ||
| rest.calls.length > 0 | ||
| ? { | ||
| calls: rest.calls, | ||
| to: undefined, | ||
| data: undefined, | ||
| value: undefined, | ||
| } | ||
| : {}), |
Member
There was a problem hiding this comment.
I don't think we should do this, as an eth_fillTransaction to a malicious relay may return "different" calls.
The prepareTransactionRequest action returns an autoSwap capability, so the consumer should use that to fill the calls for sign tx instead.
const request = client.prepareTransactionRequest(...)
const autoSwap = request._capabilities.autoSwap
const signature = await client.signTransaction(client, {
...request,
calls: [...autoSwap.calls, ...request.calls]
})
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes single-roundtrip Tempo sponsorship when
eth_fillTransactionreturns a prefilled fee payer signature. Keeps fill-response call expansion opt-in via_capabilities.autoSwapinstead of automatically trustingtransaction.callsreturned by the relay.Motivation
serializeTempopreviously emitted a partial sponsorship handoff even when both sender and fee payer signatures were already present, sowithRelaymade an unnecessary secondeth_signRawTransactionround trip. The sponsorship sign payload also needed tighterfeeTokenhandling so the sender does not commit to the fee token before final broadcast. Relay-providedtransaction.callsshould not be adopted automatically because a malicious relay could alter the call set; callers can explicitly include_capabilities.autoSwap.callswhen they want that behavior.Changes
callsinprepareTransactionRequestand exposedautoSwap.callsthrough_capabilitiesfor explicit caller opt-in.0x76broadcast envelope when both signatures are present, allowingwithRelayto broadcast without a second fee payer signing request.feeTokenfrom sender sign payloads and partial sponsorship handoffs while keeping it on the final broadcast envelope.Testing
prepareTransactionRequestignores relay transactioncallswhile exposingautoSwap.calls.feeTokenstripping cases.SKIP_GLOBAL_SETUP=true pnpm test --project core src/actions/wallet/prepareTransactionRequest.test.ts -t "ignores relay transaction"pnpm test --project tempo src/tempo/Transaction.test.ts src/tempo/Transport.test.tspnpm biome check src/actions/wallet/prepareTransactionRequest.ts src/actions/wallet/prepareTransactionRequest.test.ts src/tempo/Transaction.ts src/tempo/Transaction.test.ts