Repository navigation
feat(MTTP): add MTTP smoke tests - #1607
Conversation
… as the role grants.
There was a problem hiding this comment.
🟡 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
left a comment
There was a problem hiding this comment.
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
mttpEnvironmentcallsmcms.Deployon all three chains in the standard profile. Select the two test chains first so an unused chain’s governance setup cannot block the test.AddLegacyPoolRemotePooluses 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
AddTokendoc comment exceed the three-line limit inAGENTS.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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
| // 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
| 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
|
|
||
| out := make([]common.Address, n) | ||
| for i := range n { | ||
| pool := evm.DeployBurnMintTokenPoolV161(t, env, sel, fmt.Sprintf("%s-%d", qual, i)) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
| }}) | ||
| }) | ||
| 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)} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
|
|
||
| // Destination overhead of the default policy, applied to every token. | ||
| const ( | ||
| defaultDestGasOverhead = uint32(90_000) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
aaea164 to
77c5022
Compare
| // 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}) |
There was a problem hiding this comment.
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?
# Conflicts: # build/devenv/go.sum
# Conflicts: # build/devenv/go.mod # build/devenv/go.sum
|
Code coverage report:
|

No description provided.