feat: zero network fees in relay execute flow#8181
Open
matthewwalsh0 wants to merge 1 commit intomainfrom
Open
feat: zero network fees in relay execute flow#8181matthewwalsh0 wants to merge 1 commit intomainfrom
matthewwalsh0 wants to merge 1 commit intomainfrom
Conversation
306ba83 to
b4c7277
Compare
b4c7277 to
417a524
Compare
417a524 to
10fca5b
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.
Explanation
When using the Relay execute flow (EIP-7702 + execute enabled), network fees are subsidized by the relayer for cross-chain transactions. This change zeroes out the displayed source network fees in the quote normalization step so users see the correct zero cost.
For same-chain transactions, network fees are only zeroed when the quote includes a subsidized fee from the relayer.
References
Checklist
Note
Medium Risk
Changes Relay quote normalization to report zero
sourceNetworkfees under specific execute/subsidy conditions, which could impact fee display and downstream totals if the gating logic is wrong. Covered by new unit tests but still touches quote/fee computation paths.Overview
Adjusts Relay quote normalization so
fees.sourceNetworkis zeroed out when the Relay execute flow is active on EIP-7702 chains and the transaction is cross-chain, or when a subsidized fee is present (including same-chain).Updates
calculateSourceNetworkCostto accept anisSubsidizedflag and short-circuit fee calculation with zero amounts (and emptygasLimits) under these conditions, and adds focused unit tests plus a changelog entry documenting the behavior change.Written by Cursor Bugbot for commit 10fca5b. This will update automatically on new commits. Configure here.