Skip to content

server/asset/eth: Fix unset contractVer in TokenBackend#3617

Open
peterzen wants to merge 1 commit into
decred:masterfrom
peterzen:fix-eth-token-backend-contract-version
Open

server/asset/eth: Fix unset contractVer in TokenBackend#3617
peterzen wants to merge 1 commit into
decred:masterfrom
peterzen:fix-eth-token-backend-contract-version

Conversation

@peterzen

@peterzen peterzen commented Jul 6, 2026

Copy link
Copy Markdown
Member
  • TokenBackend() never set AssetBackend.contractVer, so it stayed at 0 for every token regardless of actual contract version.
  • That field gates the tx-not-found redeem fallback and relay (gasless) coin construction, so v1 tokens (usdc.polygon, usdc.eth, etc.) hit a spurious "wrong contract version" error whenever a redeem tx lagged the node, and gasless token redemptions failed outright.
  • Fix sets the field correctly; also zero-inits the fallback coin's gas fields to match relayBaseCoin and avoid a nil big.Int panic in FeeRate.

TokenBackend() never set AssetBackend.contractVer, leaving it at the
zero value regardless of the token's actual contract version. That
field is read directly by the tx-not-found redeem fallback and by
relay coin construction, so v1 tokens (e.g. usdc.polygon) hit a
spurious "wrong contract version" error whenever a redeem tx wasn't
yet visible to the node, and gasless (relay) token redemptions failed
outright. Also zero-initializes the fallback coin's gas fields to
match relayBaseCoin and avoid a nil big.Int panic in FeeRate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant