fix(common): use real fee token for gas estimation when fee_payer is true#405
Open
skyc1e wants to merge 2 commits intotempoxyz:mainfrom
Open
fix(common): use real fee token for gas estimation when fee_payer is true#405skyc1e wants to merge 2 commits intotempoxyz:mainfrom
skyc1e wants to merge 2 commits intotempoxyz:mainfrom
Conversation
…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
Collaborator
|
lgtm, @skyc1e can you add a changelog |
Author
|
Added a changelog entry in 4001010. Thanks for the review! |
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.
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:
This matches the approach used by the mppx TypeScript SDK.