Fix native transfers checks#276
Merged
Merged
Conversation
|
You must have Developer access to commit code to Chainlink Labs on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes. Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles |
jeffrifwaldsmartcontract
previously approved these changes
Jun 22, 2026
|
👋 marek-sadura, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
3ef682e to
f9f6450
Compare
andrevmatos
previously approved these changes
Jun 22, 2026
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
andrevmatos
previously approved these changes
Jun 22, 2026
andrevmatos
previously approved these changes
Jun 22, 2026
pedrovsg
previously approved these changes
Jun 22, 2026
104af6f to
931a269
Compare
931a269 to
8758f0a
Compare
Token-2022 mints that use the built-in tokenMetadata extension store symbol/name inside `parsed.info.extensions[].state`, not in `parsed.info.symbol/name`. The old code fell through to Metaplex PDA lookup which returns null for these tokens, leaving symbol as 'UNKNOWN'. Fix: check for a `tokenMetadata` extension entry before falling back to Metaplex, so tokens like PYUSD resolve correctly without an extra RPC call.
The previous fix broke a test case where a token in the `unknownTokens` hardcoded map (e.g. devnet USDC) should still be overridden by Metaplex metadata. The condition `symbol === 'UNKNOWN'` was too narrow. Track `hasAuthoritativeSymbol` / `hasAuthoritativeName` to distinguish on-chain data (parsed fields + Token-2022 extensions) from fallbacks (unknownTokens, 'UNKNOWN'). Only skip Metaplex fetch when we already have authoritative data for both symbol and name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a80bbc4 to
b2e8cf8
Compare
Coverage Report |
andrevmatos
approved these changes
Jun 23, 2026
Farber98
approved these changes
Jun 23, 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.
Problem
Since 1.8.0,
getFeeruns a token-pool preflight (checkSendMessage, added in "validate token is connected to remote and has enough RL before send"). The preflight resolves aTokenAdminRegistryfrom therouteraddress and looks up a token pool per token in the message.This breaks native value transfers:
token: ZeroAddress, which has no token pool / registry entry / rate limiter — sogetTokenPoolRemote(tokenPool!)runs against an undefined pool.EtherSenderReceiver) pass that contract asrouter, sogetTokenAdminRegistryFor(router)throwsCCIPContractNotRouterError("Not a Router, Ramp or expected contract").Either way
getFeethrows for native, where 1.7.1 succeeded.Fix
Native value transfers aren't pool-managed, so they must be excluded from the token preflights:
protected isNativeAsset(token)onChain(defaultfalse), overridden inEVMChain(token === ZeroAddress).checkSendMessageandcheckExecutebefore any registry/pool lookup.For a native-only message the preflight loop is a no-op, the registry is never resolved, and
getFeeproceeds. ERC20 transfers over a real Router are unchanged.Scope / risk
isNativeAssetdefaults tofalse, so non-EVM chains are unaffected unless they opt in.