fix(session): separate sender from fee payer in settle and close#247
Merged
brendanjryan merged 2 commits intomainfrom Mar 27, 2026
Merged
fix(session): separate sender from fee payer in settle and close#247brendanjryan merged 2 commits intomainfrom
brendanjryan merged 2 commits intomainfrom
Conversation
commit: |
8d3fc58 to
7084015
Compare
7084015 to
da2264b
Compare
da2264b to
aca8819
Compare
Collaborator
Author
|
@tmm examples are good here! |
tmm
approved these changes
Mar 27, 2026
src/tempo/session/Chain.test.ts
Outdated
Comment on lines
+733
to
+734
| // TODO: add on-chain test with distinct feePayer != account once localnet | ||
| // supports fee-sponsored settle (currently msg.sender resolves to feePayer). |
src/tempo/session/Chain.test.ts
Outdated
Comment on lines
+829
to
+830
| // TODO: add on-chain test with distinct feePayer != account once localnet | ||
| // supports fee-sponsored close (currently msg.sender resolves to feePayer). |
src/tempo/session/Chain.ts
Outdated
Comment on lines
+103
to
+104
| feePayer?: Account | undefined, | ||
| account?: Account | undefined, |
Member
There was a problem hiding this comment.
Generic type parameter to require account if feePayer is defined?
1f2cd68 to
32bd2eb
Compare
tmm
reviewed
Mar 27, 2026
Comment on lines
+190
to
+194
| "pnpm": { | ||
| "overrides": { | ||
| "path-to-regexp": ">=8.4.0", | ||
| "tar": ">=7.5.11" | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
moved here!
tmm
reviewed
Mar 27, 2026
Comment on lines
+5
to
+10
| Fixed `settleOnChain` and `closeOnChain` to use the payee account as | ||
| `msg.sender` instead of the fee payer when submitting fee-sponsored | ||
| transactions. Previously, `sendFeePayerTx` used the fee payer as both | ||
| sender and gas sponsor, causing the escrow contract to revert with | ||
| `NotPayee()`. Added `account` option to `tempo.settle()` so callers can | ||
| specify the signing account separately from the fee payer. |
The escrow contract requires msg.sender == payee for settle() and close(). The sendFeePayerTx helper used the fee payer as both sender and gas sponsor, causing every fee-sponsored settlement/close to revert with NotPayee(). Fix sendFeePayerTx to accept a separate account (logical sender) and feePayer (gas sponsor). Update settleOnChain and closeOnChain to resolve and pass the correct account. Add account option to the top-level tempo.settle() API. Also fix feeToken resolution to use resolveCurrency() which falls back to pathUsd for unknown chain IDs (e.g. localnet).
32bd2eb to
f79b884
Compare
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.
The escrow contract requires
msg.sender == payeeforsettle()andclose(). ThesendFeePayerTxhelper used the fee payer as both sender and gas sponsor, causing every fee-sponsored settlement/close to revert withNotPayee().