Skip to content

token expansion v2#998

Merged
tt-cll merged 17 commits intomainfrom
tt/tokens2
Apr 7, 2026
Merged

token expansion v2#998
tt-cll merged 17 commits intomainfrom
tt/tokens2

Conversation

@tt-cll
Copy link
Copy Markdown
Contributor

@tt-cll tt-cll commented Apr 2, 2026

No description provided.

@tt-cll tt-cll marked this pull request as ready for review April 3, 2026 14:02
@tt-cll tt-cll requested review from a team and skudasov as code owners April 3, 2026 14:02
Copilot AI review requested due to automatic review settings April 3, 2026 14:02
Copy link
Copy Markdown
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

Updates devenv to use a chain-agnostic “TokenExpansion v2” flow for deploying tokens/pools and configuring cross-chain token transfers, moving token setup responsibilities into per-chain implementations.

Changes:

  • Bumps chainlink-ccip / chainlink-ccip/ccv/chains/evm dependencies to newer commits.
  • Replaces the old EVM-specific token transfer config builder with chain-agnostic deployment (DeployTokensAndPools) + configuration (ConfigureAllTokenTransfers) driven by new chain-impl interfaces.
  • Refactors token-combination modeling (local/remote pools) and updates E2E token-transfer test case generation APIs.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
go.mod Updates chainlink-ccip/ccv/chains/evm pseudo-version.
go.sum Updates module checksums for the bumped dependency.
build/devenv/go.mod Updates chainlink-ccip module versions used by devenv module.
build/devenv/go.sum Updates checksums for bumped chainlink-ccip/deployment deps.
build/devenv/tokenconfig/config.go Removes prior token transfer config builder (EVM-specific).
build/devenv/cciptestinterfaces/interface.go Extends on-chain configuration interface with token/pool deployment + transfer-config provider methods.
build/devenv/common/common.go Introduces chain-agnostic pool capability + token-combination computation, and refactors combination API to local/remote naming.
build/devenv/implcommon.go Adds chain-agnostic helpers to deploy tokens/pools and configure transfers across chains.
build/devenv/environment.go Computes valid combinations from chain capabilities; deploys generic tokens/pools per chain; calls new transfer configuration path.
build/devenv/evm/impl.go Moves generic token/pool deployment out of DeployContractsForSelector; implements new token expansion + transfer config provider methods for EVM.
build/devenv/tests/e2e/tcapi/token_transfer/v3.go Updates test case generation to accept combos and uses local/remote pool refs for naming/lookup.
build/devenv/tests/e2e/smoke_test.go Updates smoke test to pass token combinations into token-transfer test case generators.
Comments suppressed due to low confidence (1)

build/devenv/tests/e2e/tcapi/token_transfer/v3.go:242

  • All17 is described as “2.0.0-only token combinations”, but the generated test names still say “token transfer 1.7.0 …”. This makes test output misleading when debugging failures. Rename the test case strings to match the intended version terminology (either 2.0.0 or 1.7.0, but be consistent with the comment and filtering logic).
// All17 returns test cases for 2.0.0-only token combinations: EOA and mock receiver with default finality (0).
func All17(src, dest cciptestinterfaces.CCIP17, combos []common.TokenCombination) []tcapi.TestCase {
	var filtered []common.TokenCombination
	for _, tc := range combos {
		if common.Is17Combination(tc) {
			filtered = append(filtered, tc)
		}
	}
	out := make([]tcapi.TestCase, 0, len(filtered)*2)
	for _, combo := range filtered {
		qual := combo.LocalPoolAddressRef().Qualifier
		out = append(out,
			tokenTransferCase(src, dest, combo, 0, true, fmt.Sprintf("token transfer 1.7.0 EOA default finality (%s)", qual)),
			tokenTransferCase(src, dest, combo, 0, false, fmt.Sprintf("token transfer 1.7.0 mock receiver default finality (%s)", qual)),
		)

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

Comment thread build/devenv/common/common.go
Comment thread build/devenv/evm/impl.go
Comment thread build/devenv/tests/e2e/tcapi/token_transfer/v3.go
carte7000
carte7000 previously approved these changes Apr 6, 2026
Comment thread build/devenv/implcommon.go Outdated
// up-to-date with the full state so that each TokenExpansion call can
// resolve previously deployed contracts.
func DeployTokensAndPools(
impl cciptestinterfaces.CCIP17Configuration,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small nit: do we want to use the narrower TokenConfigProvider interface instead here, since we're only using those methods on impl?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think that is probably cleaner

Comment thread build/devenv/implcommon.go Outdated
}

if err := impl.PostTokenDeploy(env, selector, deployedRefs); err != nil {
return fmt.Errorf("post-token-deploy for selector %d: %w", selector, err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit/

Suggested change
return fmt.Errorf("post-token-deploy for selector %d: %w", selector, err)
return fmt.Errorf("PostTokenDeploy for selector %d: %w", selector, err)

Comment thread build/devenv/implcommon.go Outdated
if cfg.TokenPoolRef.Version != nil {
v = cfg.TokenPoolRef.Version.String()
}
return string(cfg.TokenPoolRef.Type) + "\x00" + v + "\x00" + cfg.TokenPoolRef.Qualifier
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Q: is the "\x00" necessary or would any symbol (e.g. "+") do to create a unique key?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The "+" is fine and more intuitive. Switching that out

Comment on lines +238 to +241
func ComputeTokenCombinations(
capabilities map[uint64][]PoolCapability,
topology *offchain.EnvironmentTopology,
) []TokenCombination {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a pretty hefty method - should we have some unit tests?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I actually don't think such unit tests are being run in CI now actually 😬 . Maybe this can be a follow up, we should track it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah this is only covered insofar as the existing e2e tests call it. Opened https://smartcontract-it.atlassian.net/browse/CCIP-10703 to track

// OnChainConfigurable defines methods that allows devenv to
// deploy, configure Chainlink product and connect on-chain part with other chains.
type OnChainConfigurable interface {
TokenConfigProvider
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This ties into a discussion we had in standup - could we have these somehow as "optional" (a good example would be, imagine we just wanted to deploy an env w/out token pools, for pure messaging testing, in the event token pools have not been developed for a particular AltVM)?

Doesn't have to be solved in this PR, but I think its something we should think about for both devenv usage and for tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I do think pulling this out and having it as a standalone interface is the best play. I can give it a try here just to see what it would look like

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Code coverage report:

Package main tt/tokens2 diff
github.com/smartcontractkit/chainlink-ccv/aggregator 48.45% 48.46% +0.01%
github.com/smartcontractkit/chainlink-ccv/bootstrap 42.35% 42.35% +0.00%
github.com/smartcontractkit/chainlink-ccv/cli 65.13% 65.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 50.74% 50.74% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 45.74% 45.74% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 37.51% 37.46% -0.05%
github.com/smartcontractkit/chainlink-ccv/integration 46.85% 46.85% +0.00%
github.com/smartcontractkit/chainlink-ccv/pkg 100.00% 100.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 69.07% 69.07% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 32.62% 32.62% +0.00%

@tt-cll tt-cll enabled auto-merge April 6, 2026 19:58
@tt-cll tt-cll added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit f159b1c Apr 7, 2026
29 of 31 checks passed
@tt-cll tt-cll deleted the tt/tokens2 branch April 7, 2026 08:41
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.

4 participants