Skip to content

Change Token fetching to refer to IsSupportedChain instead of GetSupportedChains#1837

Merged
AnieeG merged 15 commits intomainfrom
supported-chain-fix
Mar 13, 2026
Merged

Change Token fetching to refer to IsSupportedChain instead of GetSupportedChains#1837
AnieeG merged 15 commits intomainfrom
supported-chain-fix

Conversation

@AnieeG
Copy link
Contributor

@AnieeG AnieeG commented Mar 13, 2026

No description provided.

@AnieeG AnieeG requested a review from a team as a code owner March 13, 2026 15:45
Copilot AI review requested due to automatic review settings March 13, 2026 15:45
@AnieeG AnieeG requested review from a team as code owners March 13, 2026 15:45
@github-actions
Copy link

👋 AnieeG, 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!

chris-de-leon-cll and others added 2 commits March 13, 2026 08:47
* feat: infer registry address

* chore: remove registryRef from test cases and update inference logic

* chore: refactor

* fix: format specifiers
@AnieeG AnieeG force-pushed the supported-chain-fix branch from daff93c to d4023d0 Compare March 13, 2026 15:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates EVM config-import token discovery to determine per-remote-chain support via IsSupportedChain (instead of enumerating via GetSupportedChains), and adjusts how “connected remote chains” are derived for v1.5.0/v1.6.0 config importers.

Changes:

  • Pass derived connected remote chains into token discovery and use TokenPool.IsSupportedChain(remoteChain) to build tokensPerRemoteChain.
  • Rework ConnectedChains (v1.5.0 and v1.6.0 adapters) to filter remote chains based on derived lane versions.
  • Add a new TestOnRamp integration test that dials a hard-coded external RPC endpoint and queries a live FeeQuoter.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
integration-tests/deployment/tokens_test.go Adds an on-chain FeeQuoter connectivity test (currently hard-wired to an external RPC).
chains/evm/deployment/v1_6_0/adapters/configimport.go Uses lane-version derivation for connected chains and passes connected chains into token discovery.
chains/evm/deployment/v1_5_0/adapters/configimport.go Updates token discovery to use IsSupportedChain and refactors connected-chain derivation to lane-version based filtering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +100 to 109
var connected []uint64
laneResolver := adapters1_2.LaneVersionResolver{}
remoteChainToVersionMap, _, err := laneResolver.DeriveLaneVersionsForChain(e, chainsel)
if err != nil {
return nil, fmt.Errorf("failed to get off ramps from router at %s on chain %d: %w", routerAddr.String(), chain.Selector, err)
return nil, fmt.Errorf("failed to derive lane versions for chain %d: %w", chainsel, err)
}
connectedChains := make([]uint64, 0)
for _, offRamp := range offRamps {
// if the offramp's address matches our offramp, then we are connected to the source chain via 1.6
if offRamp.OffRamp == ci.OffRamp {
// get the onRamp on router for the source chain and check if it matches our onRamp, if it does then we are connected to that chain
// lanes are always bi-directional so source and destination chain selectors are interchangeable for the purpose of finding connected chains
onRamp, err := routerC.GetOnRamp(&bind.CallOpts{
Context: e.GetContext(),
}, offRamp.SourceChainSelector)
if err != nil {
return nil, fmt.Errorf("failed to get on ramp for source chain selector %d from router at %s on chain %d: %w", offRamp.SourceChainSelector, routerAddr.String(), chain.Selector, err)
}
if onRamp != ci.OnRamp {
continue
}
connectedChains = append(connectedChains, offRamp.SourceChainSelector)
for destSel, version := range remoteChainToVersionMap {
if version.Equal(semver.MustParse("1.6.0")) {
connected = append(connected, destSel)
}
Comment on lines +129 to +130
for destSel, version := range remoteChainToVersionMap {
if version.Equal(semver.MustParse("1.5.0")) {
AnieeG and others added 6 commits March 13, 2026 09:03
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

Metric supported-chain-fix main
Coverage 70.1% 69.8%

@AnieeG AnieeG added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit c243148 Mar 13, 2026
40 checks passed
@AnieeG AnieeG deleted the supported-chain-fix branch March 13, 2026 19:34
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.

5 participants