Skip to content

feat(MTTP): add MTTP smoke tests - #1607

Merged
0xsuryansh merged 16 commits into
mainfrom
mttp_smoke_test
Nov 20, 2026
Merged

0xsuryansh merged 16 commits into
mainfrom
mttp_smoke_test

Conversation

@0xsuryansh

Copy link
Copy Markdown
Member

No description provided.

@0xsuryansh
0xsuryansh marked this pull request as ready for review November 17, 2026 22:09
@0xsuryansh
0xsuryansh requested review from a team as code owners November 17, 2026 22:09
@0xsuryansh
0xsuryansh requested review from matYang and a balanced review from Copilot November 17, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The migration tests can still pass through legacy pools if registration becomes a no-op, so AddToken needs to assert that TAR’s GetPool(token) equals m.Pool after the registration proposal executes.

1 open issue
What changed in this PR

Adds multi-token pool (MTTP) smoke tests to the development environment’s end-to-end suite, covering shared-pool transfers and staged migration from legacy pools.

Changes:

  • Adds bidirectional transfer tests for three tokens and migration tests with an unmigrated control token.
  • Introduces helpers for MTTP deployment, policy configuration, registration and permissions.
  • Adds CI jobs and updates CCIP dependencies and dependency documentation.
File Description
go.md Updates the Go dependency graph.
build/​devenv/​tests/​e2e/​testutils/​chains/​evm/​mttp.go Adds MTTP deployment and configuration helpers.
build/​devenv/​tests/​e2e/​smoke_mttp_test.go Adds shared-pool transfer and staged migration scenarios.
build/​devenv/​go.sum Updates checksums for changed CCIP dependencies.
build/​devenv/​go.mod Updates CCIP EVM and deployment dependencies.
.github/​workflows/​test-smoke.yaml Runs both MTTP scenarios in smoke-test CI.

Review effort: Balanced

@matYang matYang left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Both MTTP smoke jobs passed. The migration test waits for each transfer to finish before switching pools, which hides two cutover gaps.

Three smaller notes for the test setup

  • mttpEnvironment calls mcms.Deploy on all three chains in the standard profile. Select the two test chains first so an unused chain’s governance setup cannot block the test.
  • AddLegacyPoolRemotePool uses the v2.0.0 operation on a v1.6.1 pool. The v1.6.1 package has the same operation and records the correct version.
  • The two scenario headers and the AddToken doc comment exceed the three-line limit in AGENTS.md. The longer walkthrough would fit in the PR description.

t1a := common.HexToAddress(poolsA[0].Token())
t1b := common.HexToAddress(poolsB[0].Token())
mttpA := evm.DeployMTTP(t, env, selA)
mttpA.AddToken(t, env, t1a, evm.TokenDecimals, selB, t1b, common.HexToAddress(poolsB[0].Address()), true, true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we make the registry switch the last step of the canary? AddToken switches A’s registry before granting the MTTP mint/burn roles, and B only starts trusting A’s MTTP on the next line. A send immediately after the switch can fail to burn on A or fail the source-pool check on B. The first transfer runs after both gaps have closed. Grant the roles and add A’s MTTP to B’s legacy pool before switching A’s registry. The same ordering applies to T2.

@0xsuryansh 0xsuryansh Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

mttpA.ConfigureToken(t, env, t1a, evm.TokenDecimals, selB, t1b, common.HexToAddress(poolsB[0].Address()), true, true)

// Step 2: B's MTTP takes over T1, then A's MTTP is repointed from B's legacy pool to B's MTTP
// with the native format (false flags). Both directions now run MTTP to MTTP.
mttpB := evm.DeployMTTP(t, env, selB)
mttpB.AddToken(t, env, t1b, evm.TokenDecimals, selA, t1a, mttpA.Pool, false, false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A transfer sent from B’s legacy pool just before B switches can still be waiting for execution on A. The next AddToken replaces A’s entire trusted remote-pool list with B’s MTTP, so that pending transfer fails the source-pool check. In the other direction, B sets allowLegacyOnReceive=false while A’s MTTP is still sending legacy-format data. Keep the old pool and the required receive flags through the transition, and exercise a transfer sent before the switch and executed afterward. The current round trips finish before each change. A helper that updates just the remote-pool record would also avoid replaying token onboarding for this step.

@0xsuryansh 0xsuryansh Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

mttpA := evm.DeployMTTP(t, env, selA)
mttpB := evm.DeployMTTP(t, env, selB)
for i := range tokenCount {
mttpA.AddToken(t, env, tokensA[i], evm.TokenDecimals, selB, tokensB[i], mttpB.Pool, false, false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All three tokens get the same four policies. A regression that resolves T2’s fee or rate-limit policy using T1’s assignment would still produce the expected balances for every transfer. To cover the per-token policy isolation claimed here, give one token an observably different policy and check the difference. If this smoke test is meant to cover routing only, narrow its description to that.

@0xsuryansh 0xsuryansh Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

// pipeline. All three tokens share the same policy set here, so per-token policy isolation is


out := make([]common.Address, n)
for i := range n {
pool := evm.DeployBurnMintTokenPoolV161(t, env, sel, fmt.Sprintf("%s-%d", qual, i))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This creates six legacy pools for the transfers-only test and immediately discards their addresses. This path supplies only DeployTokenInput and DeployTokenPoolInput to token expansion. Registry setup runs during transfer configuration, so there is no registered legacy pool to replace here. A token-only deployment would avoid six unused pool deployments in CI and keep the legacy setup in the migration test.

@0xsuryansh 0xsuryansh Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

func DeployMTTPToken(t *testing.T, env *deployment.Environment, sel uint64, qual string) common.Address {

}})
})
confirm(t, chain, "set rate limit policy default", func() (*types.Transaction, error) {
disabled := pool_config_manager.RateLimiterConfig{IsEnabled: false, Capacity: big.NewInt(0), Rate: big.NewInt(0)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The migration starts with enabled rate limits in both directions (capacity 100, refill rate 10). During the handover each migrated token gets this disabled policy. A transfer of one token succeeds under either configuration, so the smoke test passes even though the migrated lane has lost its limit. Carry the legacy limits into the MTTP configuration and assert the effective limits after each switch.

@0xsuryansh 0xsuryansh Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

mttpA.SetRateLimitPolicy(t, env, capacity, rate)


// Destination overhead of the default policy, applied to every token.
const (
defaultDestGasOverhead = uint32(90_000)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The 90,000-gas default is below the pinned MTTP spec’s estimated 102,000–195,000 gas for a first receive. The v2 OffRamp uses this value for pricing, so successful delivery can hide an underquote. Use a measured receive cost plus margin for lanes targeting an MTTP. Destination gas budget

@0xsuryansh 0xsuryansh Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

defaultDestGasOverhead = uint32(250_000)

@0xsuryansh
0xsuryansh requested a review from matYang November 18, 2026 05:17
makramkd
makramkd previously approved these changes Nov 18, 2026
matYang
matYang previously approved these changes Nov 18, 2026
// Both sides are now MTTP, so drop the legacy pool and the legacy receive flags and run the native
// format end to end.
mttpA.SetRemotePools(t, env, t1a, selB, false, evm.RemotePool{Address: mttpB.Pool, AllowLegacy: false})
mttpB.SetRemotePools(t, env, t1b, selA, false, evm.RemotePool{Address: mttpA.Pool, AllowLegacy: false})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

B enables legacy receives at setup, but the only transfer across B’s switch goes B→A. This test would still pass if B’s MTTP rejected every legacy-format message from A. Can we send A→B while A still emits legacy data, keep that message pending across B’s switch, and verify it settles on B’s MTTP before clearing AllowLegacy here?

@0xsuryansh
0xsuryansh dismissed stale reviews from matYang and makramkd via 4069109 November 18, 2026 20:13
matYang
matYang previously approved these changes Nov 19, 2026
# Conflicts:
#	build/devenv/go.mod
#	build/devenv/go.sum
makramkd
makramkd previously approved these changes Nov 19, 2026
tt-cll
tt-cll previously approved these changes Nov 19, 2026
@0xsuryansh
0xsuryansh dismissed stale reviews from tt-cll and makramkd via d9f8872 November 19, 2026 20:53
@0xsuryansh
0xsuryansh requested a review from tt-cll November 19, 2026 21:16
@github-actions

Copy link
Copy Markdown
Contributor

Code coverage report:

Package main mttp_smoke_test Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 46.21% 46.21% +0.00%
github.com/smartcontractkit/chainlink-ccv/bootstrap 67.91% 67.91% +0.00%
github.com/smartcontractkit/chainlink-ccv/cli 53.78% 53.78% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 51.74% 51.74% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 47.59% 47.59% +0.00%
github.com/smartcontractkit/chainlink-ccv/docs 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 44.51% 44.51% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 36.62% 36.62% +0.00%
github.com/smartcontractkit/chainlink-ccv/integration 70.56% 70.56% +0.00%
github.com/smartcontractkit/chainlink-ccv/internal 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/migration 78.70% 78.70% +0.00%
github.com/smartcontractkit/chainlink-ccv/pkg 84.62% 84.62% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 18.67% 18.67% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 61.72% 61.72% +0.00%
github.com/smartcontractkit/chainlink-ccv/tools 52.65% 52.65% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 45.12% 45.12% +0.00%
Total 48.60% 48.60% +0.00%

@0xsuryansh
0xsuryansh enabled auto-merge November 20, 2026 01:29
@0xsuryansh
0xsuryansh added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit b3b10dc Nov 20, 2026
55 of 56 checks passed
@0xsuryansh
0xsuryansh deleted the mttp_smoke_test branch November 20, 2026 15:59
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.

6 participants