Change Token fetching to refer to IsSupportedChain instead of GetSupportedChains#1837
Change Token fetching to refer to IsSupportedChain instead of GetSupportedChains#1837
Conversation
|
👋 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! |
* feat: infer registry address * chore: remove registryRef from test cases and update inference logic * chore: refactor * fix: format specifiers
revert change:
daff93c to
d4023d0
Compare
…o supported-chain-fix
There was a problem hiding this comment.
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 buildtokensPerRemoteChain. - Rework
ConnectedChains(v1.5.0 and v1.6.0 adapters) to filter remote chains based on derived lane versions. - Add a new
TestOnRampintegration 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.
| 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) | ||
| } |
| for destSel, version := range remoteChainToVersionMap { | ||
| if version.Equal(semver.MustParse("1.5.0")) { |
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>
…inlink-ccip into supported-chain-fix
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…inlink-ccip into supported-chain-fix
|
No description provided.