Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCIP-4408: E2E test for LBTC #1563

Open
wants to merge 25 commits into
base: ccip-develop
Choose a base branch
from
Open

CCIP-4408: E2E test for LBTC #1563

wants to merge 25 commits into from

Conversation

b-gopalswami
Copy link
Collaborator

@b-gopalswami b-gopalswami commented Dec 6, 2024

Motivation

Adding two E2E test to validate Lombard integration.

Test-1: Make sure the destination payload data from mock token pool is sent as 32 bytes and that triggers call attestation API enabled flow. Mock attestation API provides the required attestation and token transfer should be successful.

Test-2: Send non 32 bytes destination payload data form mock token pool and that should trigger attestation disabled flow and the token transfer should be successful.

Solution

@b-gopalswami b-gopalswami marked this pull request as ready for review December 9, 2024 20:40
@@ -989,6 +1004,32 @@ func (ccipModule *CCIPCommon) DeployContracts(
}

ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, usdcPool)
} else if ccipModule.IsLBTCDeployment() && i == 0 {
ccipModule.Logger.Warn().Msg("Right before lbtcPool")
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove these debug comments

} else if ccipModule.IsLBTCDeployment() && i == 0 {
ccipModule.Logger.Warn().Msg("Right before lbtcPool")
rmnContract := *ccipModule.RMNContract
ccipModule.Logger.Warn().Msg(fmt.Sprintf("token addr: %v, RMN contract %v, router addr: %v", token.Address(), rmnContract, ccipModule.Router.Instance.Address()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

rmnContract := *ccipModule.RMNContract
destPoolData, err := hex.DecodeString(LBTCValidDestPoolData) // valid 32 bytes should call attestation api
if err != nil {
return fmt.Errorf("decoding dest pool data shouldn't fail %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that errors.Wrapf would be much more useful as it would also give you the whole stacktrace. That function comes from "github.com/pkg/errors"

@@ -925,6 +932,16 @@ func (ccipModule *CCIPCommon) DeployContracts(
if err != nil {
return fmt.Errorf("granting minter role to token transmitter shouldn't fail %w", err)
}
} else if ccipModule.IsLBTCDeployment() && i == 0 {
// if it's LBTC deployment, we deploy the burn mint token 677 with decimal 8 and cast it to ERC20Token
lbtcToken, err := ccipModule.tokenDeployer.DeployCustomBurnMintERC677Token("Lombard LBTC", "LBTC", uint8(8), new(big.Int).Mul(big.NewInt(1e6), big.NewInt(1e18)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably better to specify this in deployment/ccip/changeset/token_info.go

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is in CCIP repo and I don't find that path. We have that in Chainlink repo but not in CCIP.

@@ -962,6 +962,32 @@ runner-test-matrix:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml

- id: ccip-smoke-lbtc-32bytes-destination-pool-data
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really need two entire smoke tests for the minor difference in tx types? Can't we just use one test and send both txs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The test TestSmokeCCIPForBidirectionalLane which is used here is common one and this LBTC functionality is driven by config values in that test. This approach avoids adding new set of test and also running it using separate runner parallelize it.

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.

5 participants