fix: select gas account for private send when megafuel is suppressed (OK-59993) - #12916
Merged
Conversation
weatherstar
requested review from
ezailWang,
huhuanming,
originalix,
revan-zhang and
sidmorizon
as code owners
August 18, 2026 03:17
Contributor
|
@codex review |
Contributor
|
@codex security review |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
@cursoragent review |
sidmorizon
reviewed
Aug 18, 2026
sidmorizon
reviewed
Aug 19, 2026
- Guard gas account quote eligibility on a non-empty quoteId via isGasAccountQuoteEligible(), aligning resolveSponsorPayerState input with every downstream quoteId gate (fee display, precheck, broadcast) - Add unit tests fixing the invariant: quote object without quoteId resolves to user/user even on the Private Send megafuel fallback - Append the bug-fix retrospective entry to case-studies.md
An id-less quote with serverPayer='gasAccount' previously kept effectiveFeePayer at 'gasAccount' while selectedPayer fell back to 'user', showing the sponsored UI while broadcasting user-paid. Reset effectiveFeePayer to 'user' when the quote is not eligible, and cover the direct gasAccount path with unit tests.
originalix
approved these changes
Aug 20, 2026
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.


OK-59993
Summary
Follow-up to #12867, addressing the P1 finding from the automated review: #12867 (comment)
Private Send suppresses Megafuel, but
selectedPayerwas still derived from the raw backendpayer. On BNB-chain responses where the fee service returnspayer='megafuel'together with an eligible Gas Account quote, the confirm flow cleared Megafuel for display yet keptselectedPayer='user', so the sponsored quote was silently dropped and the tx broadcast user-paid.Fix
resolveSponsorPayerState()(packages/kit/src/views/SignatureConfirm/utils/gasAccountPayerSelection.ts), which deriveseffectiveFeePayer(display) andselectedPayer(submit wiring) together from the post-filtered sponsor state so they can no longer drift.megafuel, an eligible Gas Account quote now falls through toselectedPayer='gasAccount'with itsidempotencyKey, andeffectiveFeePayerfollows — the sponsored coupon shows and the broadcast uses the sponsored submit path (TxConfirmActionsrequires both payers aligned).Tests
gasAccountPayerSelection.test.tscovering the preserved behaviors and the Private Send fallback.yarn agent:check --profile prpasses.OK-59993