feat(e2e): Token Lane Refactor#763
Open
rodrigombsoares wants to merge 2 commits into
Open
Conversation
|
👋 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! |
74650fb to
78d2cf4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second stacked PR in the token-lane refactor (
pr2-token-laneon top ofpr1-load-metrics). Centralizes token pool config inTokenLane, adds env-scoped TOML, supports Canton fixed-point amounts and optional transfer instruments, and updatesSetupSend/MintTokensto 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 oftests/constants.go:CantonToEVMFeeAmount = 50(message-only)CantonToEVMTokenTransferFeeAmount = 130(token path)CantonFixedPointScale(10¹⁰) andCantonFixedPointToEVMScale(10⁸), replacingEVMDecimalsScaleccip/devenv/tests/env.go— MinimalCCIPEnvAPI:EnvDevenv,EnvProdTestnet,ParseCCIPEnv,IsRemote()Token lane
token_transfer_config.toml— Flat[evm_to_canton]/[canton_to_evm]→ nested[devenv.*]and[prod-testnet.*]skeletontoken_lane.go—ResolveTokenLane(t, env, …)with env-scoped TOML,TransferInstrument/TransferInstrumentID, Canton instrument resolution from datastore labelstoken_lane_test.go— Unit tests for env selection, TOML parsing, scale conversion, instrument helpersCore impl
impl.go— Token hunks only:SetupSend(ctx, fee, *big.Rat, optional instrument)MintTokens(ctx, *big.Rat)with nil/zero guardSendMessageviaCantonFixedPointScaleBlockDepth: 1on token pool configssetNextHoldingsnil/exhaustion semantics with*big.RatLINKInstrumentconstantmanual_execution.go— IdempotentDeployCCIPSender(CANTON_SENDER_INSTANCE_ID, defaulte2e-ccipsender)Tests
ResolveTokenLane(t, EnvDevenv, …)andcantondevenv.*constantsBootstrapE2Eyet — PR3)setupCantonTokenLoadHoldingsupdated for token transfer fee, fixed-point minting, and optionalTransferInstrumentRemoved
ccip/devenv/tests/constants.go— Superseded byccip/devenv/constants.goTesting
With local devenv running:
make start-devenvcanton2evm,evm2canton)make run-canton2evm-token-loadandmake run-evm2canton-token-loadgo test ./ccip/devenv/...andtoken_laneunit tests