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 link token skeleton #15801

Closed
wants to merge 1 commit into from
Closed

solana link token skeleton #15801

wants to merge 1 commit into from

Conversation

tt-cll
Copy link

@tt-cll tt-cll commented Dec 23, 2024

https://smartcontract-it.atlassian.net/browse/INTAUTO-369

Adding high level skeleton code for solana changesets supporting link token deployment

Copy link
Contributor

AER Report: CI Core

aer_workflow , commit , Detect Changes , Clean Go Tidy & Generate , Scheduled Run Frequency , Flakeguard Root Project / Get Tests To Run , GolangCI Lint (deployment) , Core Tests (go_core_tests) , test-scripts , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_fuzz) , Core Tests (go_core_race_tests) , Flakeguard Deployment Project / Get Tests To Run , Flakeguard Root Project / Run Tests , Flakeguard Root Project / Report , Flakeguard Deployment Project / Run Tests , Flakeguard Deployment Project / Report , lint , SonarQube Scan , Flakey Test Detection

1. Unused import in deploy_link_token.go:[Golang Lint (deployment)]

Source of Error:
##[error]common/changeset/deploy_link_token.go:6:2: "github.com/gagliardetto/solana-go" imported as solana and not used) (typecheck)
	"github.com/smartcontractkit/chainlink/deployment/common/changeset"
	^
**Why**: The `github.com/gagliardetto/solana-go` package is imported but not used in the `deploy_link_token.go` file, causing a typecheck error.

Suggested fix: Remove the unused import statement from the deploy_link_token.go file.

2. Undefined fields in CCIPChainState struct:[Golang Lint (deployment)]

Source of Error:
##[error]deployment/ccip/changeset/cs_ccip_home.go:470:63: state.Chains[cfg.HomeChainSelector].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	cfg.HomeChainSelector: state.Chains[cfg.HomeChainSelector].Timelock.Address(),
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:473:63: state.Chains[cfg.HomeChainSelector].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	cfg.HomeChainSelector: state.Chains[cfg.HomeChainSelector].ProposerMcm,
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:252:63: state.Chains[cfg.HomeChainSelector].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	cfg.HomeChainSelector: state.Chains[cfg.HomeChainSelector].Timelock.Address(),
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:255:63: state.Chains[cfg.HomeChainSelector].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	cfg.HomeChainSelector: state.Chains[cfg.HomeChainSelector].ProposerMcm,
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:640:63: state.Chains[cfg.HomeChainSelector].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	cfg.HomeChainSelector: state.Chains[cfg.HomeChainSelector].Timelock.Address(),
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:643:63: state.Chains[cfg.HomeChainSelector].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	cfg.HomeChainSelector: state.Chains[cfg.HomeChainSelector].ProposerMcm,
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:136:133: homeChainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	if err := commoncs.ValidateOwnership(e.GetContext(), p.MCMS != nil, e.Chains[p.HomeChainSelector].DeployerKey.From, homeChainState.Timelock.Address(), homeChainState.CapabilityRegistry); err != nil {
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:305:133: homeChainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	if err := commoncs.ValidateOwnership(e.GetContext(), s.MCMS != nil, e.Chains[s.HomeChainSelector].DeployerKey.From, homeChainState.Timelock.Address(), homeChainState.CapabilityRegistry); err != nil {
	 ^
##[error]deployment/ccip/changeset/cs_ccip_home.go:846:133: homeChainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	if err := commoncs.ValidateOwnership(e.GetContext(), r.MCMS != nil, e.Chains[r.HomeChainSelector].DeployerKey.From, homeChainState.Timelock.Address(), homeChainState.CapabilityRegistry); err != nil {
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:332:45: s.Chains[chainSel].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	timelocks[chainSel] = s.Chains[chainSel].Timelock.Address()
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:333:45: s.Chains[chainSel].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	proposers[chainSel] = s.Chains[chainSel].ProposerMcm
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:739:45: s.Chains[chainSel].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	timelocks[chainSel] = s.Chains[chainSel].Timelock.Address()
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:740:45: s.Chains[chainSel].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	proposers[chainSel] = s.Chains[chainSel].ProposerMcm
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:913:45: s.Chains[chainSel].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	timelocks[chainSel] = s.Chains[chainSel].Timelock.Address()
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:914:45: s.Chains[chainSel].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	proposers[chainSel] = s.Chains[chainSel].ProposerMcm
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:1020:45: state.Chains[remote].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	timelocks[remote] = state.Chains[remote].Timelock.Address()
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:1021:45: state.Chains[remote].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	proposers[remote] = state.Chains[remote].ProposerMcm
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:78:120: sourceChainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, sourceChain.DeployerKey.From, sourceChainState.Timelock.Address(), sourceChainState.OnRamp); err != nil {
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:254:121: chainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, e.Chains[chainSel].DeployerKey.From, chainState.Timelock.Address(), chainState.OnRamp); err != nil {
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:382:121: chainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	if err := commoncs.ValidateOwnership(e.GetContext(), cfg.MCMS != nil, e.Chains[chainSel].DeployerKey.From, chainState.Timelock.Address(), chainState.FeeQuoter); err != nil {
	 ^
##[error]deployment/ccip/changeset/cs_chain_contracts.go:395:36: chainState.Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	expectedAuthCaller = chainState.Timelock.Address()
	 ^
##[error]deployment/ccip/changeset/cs_deploy_chain.go:121:37: existingState.Chains[chainSel].LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	if existingState.Chains[chainSel].LinkToken == nil || existingState.Chains[chainSel].Weth9 == nil {
	 ^
##[error]deployment/ccip/changeset/cs_deploy_chain.go:164:16: chainState.LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	if chainState.LinkToken == nil {
	 ^
##[error]deployment/ccip/changeset/cs_deploy_chain.go:167:34: chainState.LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	linkTokenContract := chainState.LinkToken
	 ^
##[error]deployment/ccip/changeset/cs_deploy_chain.go:290:52: state.Chains[chain.Selector].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	[]common.Address{state.Chains[chain.Selector].Timelock.Address()}, // timelock should be able to update, ramps added after
	 ^
##[error]deployment/ccip/changeset/cs_home_chain.go:394:37: homeChainState.ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	cfg.HomeChainSel: homeChainState.ProposerMcm,
	 ^
##[error]deployment/ccip/changeset/cs_prerequisites.go:416:60: chainState.LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	[]common.Address{weth9Contract.Address(), chainState.LinkToken.Address()},
	 ^
##[error]deployment/ccip/changeset/cs_update_rmn_config.go:414:44: state.Chains[chain.Selector].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	Timelock: state.Chains[chain.Selector].Timelock,
	 ^
##[error]deployment/ccip/changeset/cs_update_rmn_config.go:415:44: state.Chains[chain.Selector].CallProxy undefined (type CCIPChainState has no field or method CallProxy) (typecheck)
	CallProxy: state.Chains[chain.Selector].CallProxy,
	 ^
##[error]deployment/ccip/changeset/cs_update_rmn_config.go:433:67: state.Chains[chain.Selector].ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	proposerPerChain[chain.Selector] = state.Chains[chain.Selector].ProposerMcm
	 ^
##[error]deployment/ccip/changeset/state.go:239:7: c.LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	if c.LinkToken != nil {
	 ^
##[error]deployment/ccip/changeset/state.go:240:27: c.GenerateLinkView undefined (type CCIPChainState has no field or method GenerateLinkView) (typecheck)
	linkTokenView, err := c.GenerateLinkView()
	 ^
##[error]deployment/ccip/changeset/state.go:242:98: c.LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	return chainView, errors.Wrapf(err, "failed to generate link token view for link token %s", c.LinkToken.Address().String())
	 ^
##[error]deployment/ccip/changeset/state.go:246:7: c.StaticLinkToken undefined (type CCIPChainState has no field or method StaticLinkToken) (typecheck)
	if c.StaticLinkToken != nil {
	 ^
##[error]deployment/ccip/changeset/state.go:247:33: c.GenerateStaticLinkView undefined (type CCIPChainState has no field or method GenerateStaticLinkView) (typecheck)
	staticLinkTokenView, err := c.GenerateStaticLinkView()
	 ^
##[error]deployment/ccip/changeset/state.go:321:17: chainState.ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	if chainState.ProposerMcm == nil {
	 ^
##[error]deployment/ccip/changeset/state.go:324:33: chainState.ProposerMcm undefined (type CCIPChainState has no field or method ProposerMcm) (typecheck)
	multiSigs[chain] = chainState.ProposerMcm
	 ^
##[error]deployment/ccip/changeset/test_assertions.go:97:48: state.Chains[chain.Selector].LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	linkAddress := state.Chains[chain.Selector].LinkToken.Address()
	 ^
##[error]deployment/ccip/changeset/test_environment.go:207:26: chainState.CallProxy undefined (type CCIPChainState has no field or method CallProxy) (typecheck)
	CallProxy: chainState.CallProxy,
	 ^
##[error]deployment/ccip/changeset/test_environment.go:463:49: state.Chains[e.FeedChainSel].LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	require.NotNil(t, state.Chains[e.FeedChainSel].LinkToken)
	 ^
##[error]deployment/ccip/changeset/test_environment.go:498:35: state.Chains[chain].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	Timelock: state.Chains[chain].Timelock,
	 ^
##[error]deployment/ccip/changeset/test_environment.go:499:35: state.Chains[chain].CallProxy undefined (type CCIPChainState has no field or method CallProxy) (typecheck)
	CallProxy: state.Chains[chain].CallProxy,
	 ^
##[error]deployment/ccip/changeset/test_environment.go:501:75: state.Chains[chain].LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	tokenInfo := tokenConfig.GetTokenInfo(e.Env.Logger, state.Chains[chain].LinkToken, state.Chains[chain].Weth9)
	 ^
##[error]deployment/ccip/changeset/test_environment.go:591:41: state.Chains[chain].LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	require.NotNil(t, state.Chains[chain].LinkToken)
	 ^
##[error]deployment/ccip/changeset/test_helpers.go:474:19: stateChainFrom.LinkToken undefined (type CCIPChainState has no field or method LinkToken) (typecheck)
	stateChainFrom.LinkToken.Address(): DefaultLinkPrice,
	 ^
##[error]deployment/ccip/changeset/accept_ownership_test.go:27:36: state.Chains[source].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	Timelock: state.Chains[source].Timelock,
	 ^
##[error]deployment/ccip/changeset/accept_ownership_test.go:28:36: state.Chains[source].CallProxy undefined (type CCIPChainState has no field or method CallProxy) (typecheck)
	CallProxy: state.Chains[source].CallProxy,
	 ^
##[error]deployment/ccip/changeset/accept_ownership_test.go:31:34: state.Chains[dest].Timelock undefined (type CCIPChainState has no field or method Timelock) (typecheck)
	Timelock: state.Chains[dest].Timelock,
	 ^
**Why**: The `CCIPChainState` struct is missing several fields (`Timelock`, `ProposerMcm`, `LinkToken`, `CallProxy`, etc.) that are being referenced in the code, causing typecheck errors.

Suggested fix: Ensure that the CCIPChainState struct includes the necessary fields or update the code to use the correct fields that exist in the struct.

3. Build failures in multiple packages:[Run tests]

Source of Error:
##[error]common/changeset/deploy_link_token.go:6:2: "github.com/gagliardetto/solana-go" imported as solana and not used
FAIL	github.com/smartcontractkit/chainlink/deployment/ccip/changeset [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5 [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/common/changeset [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/common/changeset/example [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/common/changeset/internal [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/environment/crib [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/keystone [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/keystone/changeset [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test [build failed]
FAIL	github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry [build failed]
FAIL	g
</cicore>

@tt-cll
Copy link
Author

tt-cll commented Dec 23, 2024

closing in favor of #15726

@tt-cll tt-cll closed this Dec 23, 2024
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