client/eth: Use total fee comparison for relay fee validation.#3575
Open
JoeGruffins wants to merge 6 commits intodecred:masterfrom
Open
client/eth: Use total fee comparison for relay fee validation.#3575JoeGruffins wants to merge 6 commits intodecred:masterfrom
JoeGruffins wants to merge 6 commits intodecred:masterfrom
Conversation
added 6 commits
March 19, 2026 08:36
The previous approach back-calculated the relay's per-gas profit using the client's own base fee. Since the client and relay often use different RPC providers with different base fees, the 2.2x base fee multiplier amplified small differences into large tip miscalculations, causing false rejections. Instead of extracting the per-gas tip, compare the relay's total fee against what the client would estimate using its own network fees and a generous max relay tip. Accept anything within 150% of that estimate to tolerate base fee variance while still rejecting unreasonable fees.
logoPath checked BipSymbols before stripping the token suffix, so symbols like pol.eth were not recognized and fell back to a single letter. Strip the suffix first so the base symbol is matched.
When a swap has been redeemed externally (e.g. via emergency gasless redeem), the ETH wallet now detects this in two places: In validateRedemptions, if isRedeemable returns false but the on-chain status is SSRedeemed, return ErrSwapRedeemed with the redeemed value. The Redeem method catches this and returns synthetic success data so core advances the match state normally. In confirmTransaction, before declaring a tx lost, check the contract state. If the contract shows SSRedeemed, return confirmed instead of ErrTxLost, preventing the match status from being reverted. Also add MatchComplete to isRedeemable's early return to prevent redundant redeem attempts on already-completed matches.
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.
Sorry some unrelated commits in here just in a hurry. This also makes it so client can recover if a redeem is done manually.