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

solana upgrade flow #16424

Closed
wants to merge 2 commits into from
Closed

solana upgrade flow #16424

wants to merge 2 commits into from

Conversation

tt-cll
Copy link
Contributor

@tt-cll tt-cll commented Feb 14, 2025

Requires

Supports

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
11.5% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube

Copy link
Contributor

AER Report: CI Core

aer_workflow , commit , Detect Changes , Scheduled Run Frequency , Clean Go Tidy & Generate , GolangCI Lint (deployment) , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , test-scripts , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_fuzz) , Core Tests (go_core_race_tests) , lint , SonarQube Scan

1. Undefined field or method ContractParamsPerChain in UpgradeConfigSolana:[Golang Lint (deployment)]

Source of Error:
Golang Lint (deployment)	2025-02-15T01:25:46.0564704Z deployment/ccip/changeset/solana/cs_add_remote_chain.go:1: : # github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana
Golang Lint (deployment)	2025-02-15T01:25:46.0595407Z ##[error]ccip/changeset/solana/cs_deploy_chain.go:86:26: c.ContractParamsPerChain undefined (type UpgradeConfigSolana has no field or method ContractParamsPerChain) (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0610843Z ##[error]deployment/ccip/changeset/testhelpers/test_environment.go:29:2: could not import github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana (-: # github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana
Golang Lint (deployment)	2025-02-15T01:25:46.0614275Z ##[error]ccip/changeset/solana/cs_deploy_chain.go:86:26: c.ContractParamsPerChain undefined (type UpgradeConfigSolana has no field or method ContractParamsPerChain)) (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0690685Z ##[error]ccip/changeset/solana/cs_deploy_chain.go:86:26: c.ContractParamsPerChain undefined (type UpgradeConfigSolana has no field or method ContractParamsPerChain)) (typecheck)

Why: The UpgradeConfigSolana struct does not have a field or method named ContractParamsPerChain. This causes the type checker to fail when it encounters this undefined field or method.

Suggested fix: Ensure that the UpgradeConfigSolana struct is defined with the ContractParamsPerChain field or method. If this field or method is not needed, remove the reference to it in the code.

2. Declared and not used variables:[Golang Lint (deployment)]

Source of Error:
Golang Lint (deployment)	2025-02-15T01:25:46.0615691Z 	"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana"
Golang Lint (deployment)	2025-02-15T01:25:46.0616264Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0617354Z ##[error]deployment/ccip/changeset/cs_accept_admin_role_test.go:19:19: declared and not used: tokens (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0618657Z 	e, selectorA, _, tokens, timelockContracts := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true)
Golang Lint (deployment)	2025-02-15T01:25:46.0619548Z 	 ^
Golang Lint (deployment)	2025-02-15T01:25:46.0620510Z ##[error]deployment/ccip/changeset/cs_active_candidate_test.go:141:3: declared and not used: block (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0621330Z 		block := latesthdr.Number.Uint64()
Golang Lint (deployment)	2025-02-15T01:25:46.0621719Z 		^
Golang Lint (deployment)	2025-02-15T01:25:46.0622702Z ##[error]deployment/ccip/changeset/cs_active_candidate_test.go:195:2: declared and not used: tokenConfig (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0623968Z 	tokenConfig := changeset.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds)
Golang Lint (deployment)	2025-02-15T01:25:46.0624588Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0625509Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:35:2: declared and not used: envNodes (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0626389Z 	envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain)
Golang Lint (deployment)	2025-02-15T01:25:46.0627348Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0628318Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:250:4: declared and not used: tokenConfig (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0629394Z 			tokenConfig := changeset.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds)
Golang Lint (deployment)	2025-02-15T01:25:46.0630023Z 			^
Golang Lint (deployment)	2025-02-15T01:25:46.0630967Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:368:4: declared and not used: tokenConfig (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0632029Z 			tokenConfig := changeset.NewTestTokenConfig(state.Chains[tenv.FeedChainSel].USDFeeds)
Golang Lint (deployment)	2025-02-15T01:25:46.0632651Z 			^
Golang Lint (deployment)	2025-02-15T01:25:46.0633777Z ##[error]deployment/ccip/changeset/cs_chain_contracts_test.go:736:2: declared and not used: destChain (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0634887Z 	destChain := e.Env.Chains[dest]
Golang Lint (deployment)	2025-02-15T01:25:46.0635254Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0636253Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:156:19: declared and not used: tokens (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0637431Z 	e, selectorA, _, tokens, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true)
Golang Lint (deployment)	2025-02-15T01:25:46.0638226Z 	 ^
Golang Lint (deployment)	2025-02-15T01:25:46.0639241Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:416:5: declared and not used: lockReleaseA (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0641034Z 				lockReleaseA, _ := token_pool.NewTokenPool(state.Chains[selectorA].LockReleaseTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1].Address(), e.Chains[selectorA].Client)
Golang Lint (deployment)	2025-02-15T01:25:46.0642131Z 				^
Golang Lint (deployment)	2025-02-15T01:25:46.0643774Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:417:5: declared and not used: burnMintA (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0645573Z 				burnMintA, _ := token_pool.NewTokenPool(state.Chains[selectorA].BurnMintTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1].Address(), e.Chains[selectorA].Client)
Golang Lint (deployment)	2025-02-15T01:25:46.0646648Z 				^
Golang Lint (deployment)	2025-02-15T01:25:46.0647757Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:419:5: declared and not used: lockReleaseB (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0649565Z 				lockReleaseB, _ := token_pool.NewTokenPool(state.Chains[selectorB].LockReleaseTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1].Address(), e.Chains[selectorB].Client)
Golang Lint (deployment)	2025-02-15T01:25:46.0650657Z 				^
Golang Lint (deployment)	2025-02-15T01:25:46.0651681Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:420:5: declared and not used: burnMintB (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0653567Z 				burnMintB, _ := token_pool.NewTokenPool(state.Chains[selectorB].BurnMintTokenPools[testhelpers.TestTokenSymbol][deployment.Version1_5_1].Address(), e.Chains[selectorB].Client)
Golang Lint (deployment)	2025-02-15T01:25:46.0654642Z 				^
Golang Lint (deployment)	2025-02-15T01:25:46.0655647Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:558:6: declared and not used: aType (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0656541Z 					aType := changeset.LockReleaseTokenPool
Golang Lint (deployment)	2025-02-15T01:25:46.0656980Z 					^
Golang Lint (deployment)	2025-02-15T01:25:46.0657919Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:562:6: declared and not used: bType (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0658804Z 					bType := changeset.LockReleaseTokenPool
Golang Lint (deployment)	2025-02-15T01:25:46.0659228Z 					^
Golang Lint (deployment)	2025-02-15T01:25:46.0660242Z ##[error]deployment/ccip/changeset/cs_configure_token_pools_test.go:325:2: declared and not used: acceptLiquidity (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0661071Z 	acceptLiquidity := false
Golang Lint (deployment)	2025-02-15T01:25:46.0661409Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0662319Z ##[error]deployment/ccip/changeset/cs_propose_admin_role_test.go:20:19: declared and not used: tokens (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0663719Z 	e, selectorA, _, tokens, timelockContracts := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true)
Golang Lint (deployment)	2025-02-15T01:25:46.0664621Z 	 ^
Golang Lint (deployment)	2025-02-15T01:25:46.0665583Z ##[error]deployment/ccip/changeset/cs_active_candidate_test.go:4:2: "math/big" imported and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0666647Z 	"math/big"
Golang Lint (deployment)	2025-02-15T01:25:46.0666932Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0668322Z ##[error]deployment/ccip/changeset/cs_active_candidate_test.go:24:2: "github.com/smartcontractkit/chainlink/v2/core/logger" imported and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0669402Z 	"github.com/smartcontractkit/chainlink/v2/core/logger"
Golang Lint (deployment)	2025-02-15T01:25:46.0669856Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0670727Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:4:2: "math/big" imported and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0671419Z 	"math/big"
Golang Lint (deployment)	2025-02-15T01:25:46.0671703Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0673293Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:13:2: "github.com/smartcontractkit/chainlink-ccip/chainconfig" imported and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0674597Z 	"github.com/smartcontractkit/chainlink-ccip/chainconfig"
Golang Lint (deployment)	2025-02-15T01:25:46.0675074Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0676704Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:14:2: "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" imported as cciptypes and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0677995Z 	cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
Golang Lint (deployment)	2025-02-15T01:25:46.0678556Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0680146Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:19:2: "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" imported and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0681433Z 	"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals"
Golang Lint (deployment)	2025-02-15T01:25:46.0682001Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0683851Z ##[error]deployment/ccip/changeset/cs_ccip_home_test.go:23:2: "github.com/smartcontractkit/chainlink/v2/core/logger" imported and not used (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0684929Z 	"github.com/smartcontractkit/chainlink/v2/core/logger"
Golang Lint (deployment)	2025-02-15T01:25:46.0685386Z 	^
Golang Lint (deployment)	2025-02-15T01:25:46.0692065Z 	changeset_solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana"
Golang Lint (deployment)	2025-02-15T01:25:46.0692789Z 	 ^
Golang Lint (deployment)	2025-02-15T01:25:46.0694005Z ##[error]deployment/ccip/changeset/solana/cs_deploy_chain_test.go:33:2: declared and not used: nodes (typecheck)
Golang Lint (deployment)	2025-02-15T01:25:46.0694903Z 	nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain)
Golang Lint (deployment)	2025-02-15T01:25:46.0695357Z 	^

Why: Variables are declared but not used within the scope of the function,

@tt-cll tt-cll closed this Feb 15, 2025
@tt-cll tt-cll deleted the tt/upgradeV2 branch February 15, 2025 18:51
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