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

[DPA-1525] solana ccip transfer ownership to timelock #16246

Draft
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

ecPablo
Copy link
Contributor

@ecPablo ecPablo commented Feb 5, 2025

https://smartcontract-it.atlassian.net/browse/DPA-1525

Adds the changeset to transfer ownership of CCIP solana programs. Should be merged after #16159 as FeeQuoter branch was merged here in order to get access to new bindings

TODO:

  • Add Offramp Transfer
  • Add Timelock Execution to tests

AI Summary

This pull request includes several changes to the deployment/ccip/changeset package, focusing on improvements and updates to the Solana chain contracts and related tests. The most important changes include updating import statements, modifying function parameters, and adding new functions for initializing and deploying contracts. Additionally, there are updates to the test files to reflect these changes.

Changes to Solana Chain Contracts:

  • Import Statements:

    • Reordered and grouped import statements in cs_chain_contracts.go and cs_deploy_chain.go for better organization. [1] [2]
  • Function Modifications:

    • Updated validateRemoteChain function to use chainState.Timelock.ProgramID.String() instead of chainState.Timelock.
    • Modified DefaultFeeQuoterDestChainConfig function to accept an optional destChainSelector parameter and added logic to handle Solana chain selectors. [1] [2]
    • Added feeQuoterAddress parameter to initializeRouter function and updated its logic accordingly. [1] [2] [3]
  • New Functions:

    • Introduced initializeFeeQuoter function to initialize the fee quoter for Solana chains.

Changes to Tests:

  • Import Statements:

    • Updated import statements in cs_chain_contracts_test.go to include new dependencies and remove unused ones.
  • Function Updates:

    • Updated TestAddRemoteChain and TestAddTokenPool functions to align with the changes in the main codebase, including the use of new structures and configuration parameters. [1] [2] [3] [4]
    • Added context initialization in TestAddTokenPool and TestBilling functions. [1] [2]

ecPablo and others added 21 commits January 30, 2025 07:22
… mcms deployment. Still pending seed parsing. Also refactored package structure to avoid import cycles.
…wnership

# Conflicts:
#	deployment/ccip/changeset/cs_deploy_chain.go
#	deployment/ccip/changeset/solana/cs_chain_contracts.go
#	deployment/ccip/changeset/testhelpers/test_helpers.go
#	deployment/environment/memory/chain.go
#	deployment/go.mod
#	deployment/go.sum
…ana-ccip-transfer-ownership

# Conflicts:
#	deployment/ccip/changeset/solana/cs_chain_contracts.go
#	deployment/ccip/changeset/solana_state.go
#	deployment/go.mod
#	deployment/go.sum
…wnership

# Conflicts:
#	deployment/go.mod
#	deployment/go.sum
@ecPablo ecPablo changed the base branch from develop to deploy-transferable-solana February 5, 2025 22:10
@ecPablo ecPablo changed the base branch from deploy-transferable-solana to develop February 5, 2025 22:11
Copy link
Contributor

github-actions bot commented Feb 5, 2025

AER Report: CI Core

aer_workflow , commit , Detect Changes , Clean Go Tidy & Generate , Scheduled Run Frequency , GolangCI Lint (core/scripts) , GolangCI Lint (.) , test-scripts , Core Tests (go_core_ccip_deployment_tests) , GolangCI Lint (integration-tests) , GolangCI Lint (deployment) , lint , SonarQube Scan

1. Missing go.sum entry for module:

Why: The Go modules required by the project are not listed in the go.sum file, which is necessary for dependency management in Go. This can happen if the dependencies were added but go mod tidy was not run to update the go.sum file.
Suggested fix: Run go mod tidy to update the go.sum file with the necessary module entries.

<summary><b>Source of Error:</b></summary>

```plaintext
Run Tests	2025-02-05T22:40:05.1583696Z ##[error]/home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-solana@v1.1.2-0.20250203204555-c245a7640475/pkg/solana/chainwriter/transform_registry.go:8:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/ccip_router (imported by github.com/smartcontractkit/chainlink-solana/pkg/solana/chainwriter); to add:
Run Tests	2025-02-05T22:40:05.1595425Z 	go get github.com/smartcontractkit/chainlink-solana/pkg/solana/chainwriter@v1.1.2-0.20250203204555-c245a7640475
Run Tests	2025-02-05T22:40:05.1598421Z ##[error]../../deployment/solana_chain.go:21:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common (imported by github.com/smartcontractkit/chainlink/deployment); to add:
Run Tests	2025-02-05T22:40:05.1600135Z 	go get github.com/smartcontractkit/chainlink/deployment@v0.0.0-20250128231431-9279badae2f0
Run Tests	2025-02-05T22:40:05.1602509Z ##[error]/home/runner/go/pkg/mod/github.com/smartcontractkit/mcms@v0.9.0/sdk/solana/configurer.go:11:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/contracts/tests/config (imported by github.com/smartcontractkit/mcms/sdk/solana); to add:
Run Tests	2025-02-05T22:40:05.1604127Z 	go get github.com/smartcontractkit/mcms/sdk/solana@v0.9.0
Run Tests	2025-02-05T22:40:05.1606097Z ##[error]/home/runner/go/pkg/mod/github.com/smartcontractkit/mcms@v0.9.0/sdk/solana/timelock_inspector.go:10:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/access_controller (imported by github.com/smartcontractkit/mcms/sdk/solana); to add:
Run Tests	2025-02-05T22:40:05.1607704Z 	go get github.com/smartcontractkit/mcms/sdk/solana@v0.9.0
Run Tests	2025-02-05T22:40:05.1609841Z ##[error]/home/runner/go/pkg/mod/github.com/smartcontractkit/mcms@v0.9.0/sdk/solana/common.go:11:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/mcm (imported by github.com/smartcontractkit/mcms/sdk/solana); to add:
Run Tests	2025-02-05T22:40:05.1611410Z 	go get github.com/smartcontractkit/mcms/sdk/solana@v0.9.0
Run Tests	2025-02-05T22:40:05.1613271Z ##[error]/home/runner/go/pkg/mod/github.com/smartcontractkit/mcms@v0.9.0/sdk/solana/common.go:12:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/timelock (imported by github.com/smartcontractkit/mcms/sdk/solana); to add:
Run Tests	2025-02-05T22:40:05.1614851Z 	go get github.com/smartcontractkit/mcms/sdk/solana@v0.9.0
Run Tests	2025-02-05T22:40:05.1616680Z ##[error]../../deployment/common/changeset/deploy_link_token.go:13:2: missing go.sum entry for module providing package github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens (imported by github.com/smartcontractkit/chainlink/deployment/common/changeset); to add:
Run Tests	2025-02-05T22:40:05.1618571Z 	go get github.com/smartcontractkit/chainlink/deployment/common/changeset@v0.0.0-20250128231431-9279badae2f0

2. GolangCI Lint errors:

Why: The GolangCI Lint tool found various issues in the code, such as unchecked error return values, formatting issues, and potential bugs.
Suggested fix: Address each linting issue as reported by GolangCI Lint. This may involve checking error return values, fixing formatting issues, and addressing potential bugs.

<summary><b>Source of Error:</b></summary>

```plaintext
Golang Lint (deployment)	2025-02-05T22:42:12.1090696Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock_test.go:109:28: Error return value of `env.ExistingAddresses.Save` is not checked (errcheck)
Golang Lint (deployment)	2025-02-05T22:42:12.1092913Z 	env.ExistingAddresses.Save(env.AllChainSelectorsSolana()[0], timelockID, deployment.TypeAndVersion{Type: commontypes.RBACTimelock, Version: deployment.Version1_0_0})
Golang Lint (deployment)	2025-02-05T22:42:12.1094136Z 	 ^
Golang Lint (deployment)	2025-02-05T22:42:12.1096185Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock_test.go:110:28: Error return value of `env.ExistingAddresses.Save` is not checked (errcheck)
Golang Lint (deployment)	2025-02-05T22:42:12.1098037Z 	env.ExistingAddresses.Save(env.AllChainSelectorsSolana()[0], mcmsID, deployment.TypeAndVersion{Type: commontypes.ProposerManyChainMultisig, Version: deployment.Version1_0_0})
Golang Lint (deployment)	2025-02-05T22:42:12.1099255Z 	 ^
Golang Lint (deployment)	2025-02-05T22:42:12.1100168Z deployment/common/changeset/mcmsnew/evm/mcms.go:7: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint (deployment)	2025-02-05T22:42:12.1101169Z 	"github.com/smartcontractkit/chainlink-common/pkg/logger"
Golang Lint (deployment)	2025-02-05T22:42:12.1102128Z deployment/common/changeset/state/evm.go:1: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint (deployment)	2025-02-05T22:42:12.1103161Z package state
Golang Lint (deployment)	2025-02-05T22:42:12.1104019Z deployment/common/changeset/mcmsnew/solana/mcms.go:11: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint (deployment)	2025-02-05T22:42:12.1105264Z 
Golang Lint (deployment)	2025-02-05T22:42:12.1106416Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go:347:23: G115: integer overflow conversion int64 -> uint32 (gosec)
Golang Lint (deployment)	2025-02-05T22:42:12.1107368Z 		SetValidUntil(uint32(validUntil)).
Golang Lint (deployment)	2025-02-05T22:42:12.1107848Z 		 ^
Golang Lint (deployment)	2025-02-05T22:42:12.1108942Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go:186:2: Consider pre-allocating `result` (prealloc)
Golang Lint (deployment)	2025-02-05T22:42:12.1109824Z 	var result []mcmsTypes.Transaction
Golang Lint (deployment)	2025-02-05T22:42:12.1110185Z 	^
Golang Lint (deployment)	2025-02-05T22:42:12.1111233Z ##[error]deployment/ccip/changeset/solana/cs_chain_contracts.go:208:2: var-naming: var feeQuoterId should be feeQuoterID (revive)
Golang Lint (deployment)	2025-02-05T22:42:12.1112670Z 	feeQuoterId := s.SolChains[chainSel].FeeQuoter
Golang Lint (deployment)	2025-02-05T22:42:12.1113085Z 	^
Golang Lint (deployment)	2025-02-05T22:42:12.1114543Z ##[error]deployment/ccip/changeset/solana/cs_chain_contracts.go:169:14: range: should omit 2nd value from range; this loop is equivalent to `for remote := range ...` (revive)
Golang Lint (deployment)	2025-02-05T22:42:12.1115603Z 	for remote, _ := range cfg.UpdatesByChain {
Golang Lint (deployment)	2025-02-05T22:42:12.1116043Z 	 ^
Golang Lint (deployment)	2025-02-05T22:42:12.1117511Z ##[error]deployment/common/changeset/mcmsnew/solana/mcms.go:213:6: func `setupRolesAndOwnership` is unused (unused)
Golang Lint (deployment)	2025-02-05T22:42:12.1118327Z func setupRolesAndOwnership(
Golang Lint (deployment)	2025-02-05T22:42:12.1118681Z ^
Golang Lint (deployment)	2025-02-05T22:42:12.1119822Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock_test.go:311:6: func `setRootAndExecuteProposal` is unused (unused)
Golang Lint (deployment)	2025-02-05T22:42:12.1120966Z func setRootAndExecuteProposal(t *testing.T, proposal *mcms.TimelockProposal) {
Golang Lint (deployment)	2025-02-05T22:42:12.1121557Z ^
Golang Lint (deployment)	2025-02-05T22:42:12.1123130Z ##[error]deployment/common/proposalutils/solana/mcms_state.go:39:1: unnecessary trailing newline (whitespace)
Golang Lint (deployment)	2025-02-05T22:42:12.1123849Z 
Golang Lint (deployment)	2025-02-05T22:42:12.1123970Z ^
Golang Lint (deployment)	2025-02-05T22:42:12.1125006Z ##[error]deployment/common/changeset/mcmsnew/evm/mcms.go:32:74: unnecessary leading newline (whitespace)
Golang Lint (deployment)	2025-02-05T22:42:12.1125625Z 
Golang Lint (deployment)	2025-02-05T22:42:12.1125737Z ^
Golang Lint (deployment)	2025-02-05T22:42:12.1126743Z ##[error]deployment/common/changeset/state/solana.go:107:2: unnecessary trailing newline (whitespace)
Golang Lint (deployment)	2025-02-05T22:42:12.1127316Z 
Golang Lint (deployment)	2025-02-05T22:42:12.1127429Z ^
Golang Lint (deployment)	2025-02-05T22:42:12.1128471Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go:137:35: unnecessary leading newline (whitespace)
Golang Lint (deployment)	2025-02-05T22:42:12.1129185Z 
Golang Lint (deployment)	2025-02-05T22:42:12.1129308Z ^
Golang Lint (deployment)	2025-02-05T22:42:12.1130311Z ##[error]deployment/ccip/changeset/solana/transfer_ccip_to_mcms_with_timelock.go:184:37: unnecessary leading newline (whitespace)
Golang Lint (deployment)	2025-02-05
</cicore>
  
    
<operatoruici>

## AER Report: [Operator UI CI](https://github.com/smartcontractkit/chainlink/actions/runs/13167904670) ran successfully :white_check_mark:

[aer_workflow](https://github.com/smartcontractkit/chainlink/actions/runs/13167924143/job/36752335604) , [commit](https://github.com/smartcontractkit/chainlink/commit/2311768c3f062c5e98100b08986392dee550e6f7)

</operatoruici>

Copy link
Contributor

github-actions bot commented Feb 5, 2025

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
26 New Major Issues (required ≤ 5)
C Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

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.

4 participants