Skip to content

feat(e2e): Token Lane Refactor#763

Open
rodrigombsoares wants to merge 2 commits into
pr1-load-metricsfrom
pr2-token-lane
Open

feat(e2e): Token Lane Refactor#763
rodrigombsoares wants to merge 2 commits into
pr1-load-metricsfrom
pr2-token-lane

Conversation

@rodrigombsoares

@rodrigombsoares rodrigombsoares commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Second stacked PR in the token-lane refactor (pr2-token-lane on top of pr1-load-metrics). Centralizes token pool config in TokenLane, adds env-scoped TOML, supports Canton fixed-point amounts and optional transfer instruments, and updates SetupSend / MintTokens to use *big.Rat.
Devenv-only paths are exercised; [prod-testnet.*] TOML blocks exist but stay inert until PR4.

Reviewer story: Token tests resolve lanes from TOML instead of ad-hoc setup; Canton token sends support multiple instruments via fixed-point amounts.

Features

Constants & env

  • ccip/devenv/constants.go — Shared constants moved out of tests/constants.go:
    • CantonToEVMFeeAmount = 50 (message-only)
    • CantonToEVMTokenTransferFeeAmount = 130 (token path)
    • CantonFixedPointScale (10¹⁰) and CantonFixedPointToEVMScale (10⁸), replacing EVMDecimalsScale
  • ccip/devenv/tests/env.go — Minimal CCIPEnv API: EnvDevenv, EnvProdTestnet, ParseCCIPEnv, IsRemote()

Token lane

  • token_transfer_config.toml — Flat [evm_to_canton] / [canton_to_evm] → nested [devenv.*] and [prod-testnet.*] skeleton
  • token_lane.goResolveTokenLane(t, env, …) with env-scoped TOML, TransferInstrument / TransferInstrumentID, Canton instrument resolution from datastore labels
  • token_lane_test.go — Unit tests for env selection, TOML parsing, scale conversion, instrument helpers

Core impl

  • impl.go — Token hunks only:
    • SetupSend(ctx, fee, *big.Rat, optional instrument)
    • MintTokens(ctx, *big.Rat) with nil/zero guard
    • Fixed-point SendMessage via CantonFixedPointScale
    • FTF BlockDepth: 1 on token pool configs
    • setNextHoldings nil/exhaustion semantics with *big.Rat
    • LINKInstrument constant
  • manual_execution.go — Idempotent DeployCCIPSender (CANTON_SENDER_INSTANCE_ID, default e2e-ccipsender)

Tests

  • E2E and load tests use ResolveTokenLane(t, EnvDevenv, …) and cantondevenv.* constants
  • Inline devenv bootstrap kept (no BootstrapE2E yet — PR3)
  • setupCantonTokenLoadHoldings updated for token transfer fee, fixed-point minting, and optional TransferInstrument

Removed

  • ccip/devenv/tests/constants.go — Superseded by ccip/devenv/constants.go

Testing

With local devenv running:

  1. make start-devenv
  2. Token e2e — Run token subtests in both directions (canton2evm, evm2canton)
  3. Token loadmake run-canton2evm-token-load and make run-evm2canton-token-load
  4. Compile / unit — e.g. go test ./ccip/devenv/... and token_lane unit tests

@rodrigombsoares rodrigombsoares requested a review from a team as a code owner July 7, 2026 20:16
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

@rodrigombsoares rodrigombsoares changed the base branch from main to pr1-load-metrics July 7, 2026 20:16
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.

1 participant