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 changeset #16427

Merged
merged 51 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
18238ab
try upgrade in CI
tt-cll Feb 13, 2025
6cca0c8
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 13, 2025
fd07e4a
update sha
tt-cll Feb 13, 2025
2740026
make gomodtidy
tt-cll Feb 13, 2025
750c267
try setting signer
tt-cll Feb 13, 2025
dc7c4b5
fix params
tt-cll Feb 13, 2025
4197aac
set keypair to authority
tt-cll Feb 13, 2025
55de91e
deploy same artifact
tt-cll Feb 13, 2025
21c5043
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 13, 2025
937b0e9
revert gomod
tt-cll Feb 13, 2025
a39034e
return ixns
tt-cll Feb 15, 2025
1b7345e
upgrade in place
tt-cll Feb 15, 2025
9f3550b
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 15, 2025
6953d7a
fix build
tt-cll Feb 15, 2025
c97275e
lint
tt-cll Feb 15, 2025
9f31584
bump gomod
tt-cll Feb 15, 2025
ab47391
validate upgrades
tt-cll Feb 15, 2025
80202c5
lint
tt-cll Feb 15, 2025
8468bb4
comments
tt-cll Feb 17, 2025
c6b2475
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 17, 2025
07866dc
gomod
tt-cll Feb 17, 2025
f27eae6
fix merge
tt-cll Feb 18, 2025
02980fa
lint
tt-cll Feb 18, 2025
a23d140
lint
tt-cll Feb 18, 2025
74f835f
cr comments
tt-cll Feb 18, 2025
ab58af5
lint
tt-cll Feb 18, 2025
514651e
lint
tt-cll Feb 18, 2025
20ab5e4
lint
tt-cll Feb 18, 2025
814a3ba
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 18, 2025
798d06b
move upgrades to mcms
tt-cll Feb 18, 2025
4ac68ab
bump delay
tt-cll Feb 18, 2025
3a32ebc
wip
tt-cll Feb 19, 2025
8ca3f34
wip
tt-cll Feb 19, 2025
5d1cf7b
mcms fix
tt-cll Feb 19, 2025
8f2035f
log in CI
tt-cll Feb 19, 2025
66eea30
preload first
tt-cll Feb 19, 2025
e2261bf
Merge pull request #16465 from smartcontractkit/tt/mcms1
tt-cll Feb 19, 2025
639eb8d
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 19, 2025
93d29b3
wip
tt-cll Feb 20, 2025
ecc46ff
wip
tt-cll Feb 20, 2025
de3ae32
check bytes
tt-cll Feb 20, 2025
74d17e5
lint
tt-cll Feb 20, 2025
fabd20b
revert buffer
tt-cll Feb 20, 2025
b8cef56
Merge pull request #16493 from smartcontractkit/tt/extend
tt-cll Feb 21, 2025
2691c6b
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 21, 2025
7e500ae
use program data size
tt-cll Feb 21, 2025
3a73a76
add padding
tt-cll Feb 21, 2025
09bafb2
lint
tt-cll Feb 21, 2025
334689d
bubble mcms error
tt-cll Feb 21, 2025
a8f2263
Revert "bubble mcms error"
tt-cll Feb 21, 2025
589fb37
Merge remote-tracking branch 'origin/develop' into tt/solanaUpgrades
tt-cll Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ require (
github.com/smartcontractkit/chainlink-protos/rmn/v1.6/go v0.0.0-20250131130834-15e0d4cde2a6 // indirect
github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112 // indirect
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a // indirect
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7 // indirect
github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.3 // indirect
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect
github.com/smartcontractkit/mcms v0.10.0 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,8 @@ github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32
github.com/smartcontractkit/chainlink-protos/svr v0.0.0-20250123084029-58cce9b32112/go.mod h1:TcOliTQU6r59DwG4lo3U+mFM9WWyBHGuFkkxQpvSujo=
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a h1:C+XavZQ0rBOpOrh45LUhdOsvtI8OQ0XZKI5pi+GP6h4=
github.com/smartcontractkit/chainlink-solana v1.1.2-0.20250213203720-e15b1333a14a/go.mod h1:aFm1QC/n99mVeBDtv0SE0co56+IECY6Y1fR3OfNYy3c=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7 h1:E7k5Sym9WnMOc4X40lLnQb6BMosxi8DfUBU9pBJjHOQ=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.4.7/go.mod h1:WYxCxAWpeXEHfhB0GaiV2sj21Ooh9r/Nf7tzmJgAibs=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.3 h1:CeZqFz/si4YBnYE1118mtc4FBLs2Za1qohYAeLZTI+o=
github.com/smartcontractkit/chainlink-testing-framework/framework v0.5.3/go.mod h1:9b5ugzYeKkwbxZ9yMOoxUaPiONDLC/QLCncarDFnhwk=
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.22 h1:W3doYLVoZN8VwJb/kAZsbDjW+6cgZPgNTcQHJUH9JrA=
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.22/go.mod h1:70JLBXQncNHyW63ik4PvPQGjQGZ1xK67MKrDanVAk2w=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
Expand Down
7 changes: 6 additions & 1 deletion deployment/ccip/changeset/solana/cs_add_remote_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,15 @@ func doAddRemoteChainToSolana(
}
}

addressLookupTable, err := cs.FetchOfframpLookupTable(e.GetContext(), chain, offRampID)
if err != nil {
return fmt.Errorf("failed to get offramp reference addresses: %w", err)
}

if err := solCommonUtil.ExtendLookupTable(
e.GetContext(),
chain.Client,
s.SolChains[chainSel].OfframpAddressLookupTable,
addressLookupTable,
*chain.DeployerKey,
lookUpTableEntries,
); err != nil {
Expand Down
14 changes: 12 additions & 2 deletions deployment/ccip/changeset/solana/cs_billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,15 @@ func AddBillingToken(e deployment.Environment, cfg BillingTokenConfig) (deployme
return deployment.ChangesetOutput{}, fmt.Errorf("failed to confirm instructions: %w", err)
}

addressLookupTable, err := cs.FetchOfframpLookupTable(e.GetContext(), chain, chainState.OffRamp)
if err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("failed to get offramp reference addresses: %w", err)
}

if err := solCommonUtil.ExtendLookupTable(
e.GetContext(),
chain.Client,
chainState.OfframpAddressLookupTable,
addressLookupTable,
*chain.DeployerKey,
[]solana.PublicKey{tokenBillingPDA},
); err != nil {
Expand Down Expand Up @@ -170,10 +175,15 @@ func AddBillingTokenForRemoteChain(e deployment.Environment, cfg BillingTokenFor
return deployment.ChangesetOutput{}, fmt.Errorf("failed to confirm instructions: %w", err)
}

addressLookupTable, err := cs.FetchOfframpLookupTable(e.GetContext(), chain, chainState.OffRamp)
if err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("failed to get offramp reference addresses: %w", err)
}

if err := solCommonUtil.ExtendLookupTable(
e.GetContext(),
chain.Client,
chainState.OfframpAddressLookupTable,
addressLookupTable,
*chain.DeployerKey,
[]solana.PublicKey{remoteBillingPDA},
); err != nil {
Expand Down
39 changes: 24 additions & 15 deletions deployment/ccip/changeset/solana/cs_build_solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,32 @@ func runCommand(command string, args []string, workDir string) (string, error) {

// Clone and checkout the specific revision of the repo
func cloneRepo(e deployment.Environment, revision string) error {
// Remove the clone directory if it already exists
if _, err := os.Stat(cloneDir); !os.IsNotExist(err) {
os.RemoveAll(cloneDir)
}
// Check if the repository already exists
if _, err := os.Stat(filepath.Join(cloneDir, ".git")); err == nil {
e.Logger.Debugw("Repository already exists, discarding local changes and updating", "dir", cloneDir)

e.Logger.Debugw("Cloning repository", "url", repoURL, "revision", revision)
_, err := runCommand("git", []string{"clone", repoURL, cloneDir}, ".")
if err != nil {
return fmt.Errorf("failed to clone repository: %w", err)
// Discard any local changes
_, err := runCommand("git", []string{"reset", "--hard"}, cloneDir)
if err != nil {
return fmt.Errorf("failed to discard local changes: %w", err)
}

// Fetch the latest changes from the remote
_, err = runCommand("git", []string{"fetch", "origin"}, cloneDir)
if err != nil {
return fmt.Errorf("failed to fetch origin: %w", err)
}
} else {
// Repository does not exist, clone it
e.Logger.Debugw("Cloning repository", "url", repoURL, "revision", revision)
_, err := runCommand("git", []string{"clone", repoURL, cloneDir}, ".")
if err != nil {
return fmt.Errorf("failed to clone repository: %w", err)
}
}

e.Logger.Debugw("Checking out revision", "revision", revision)
_, err = runCommand("git", []string{"checkout", revision}, cloneDir)
_, err := runCommand("git", []string{"checkout", revision}, cloneDir)
if err != nil {
return fmt.Errorf("failed to checkout revision %s: %w", revision, err)
}
Expand Down Expand Up @@ -93,7 +106,6 @@ type BuildSolanaConfig struct {
ChainSelector uint64
GitCommitSha string
DestinationDir string
IsUpgrade bool
CleanDestinationDir bool
CreateDestinationDir bool
}
Expand All @@ -116,11 +128,8 @@ func BuildSolanaChangeset(e deployment.Environment, config BuildSolanaConfig) (d
return deployment.ChangesetOutput{}, fmt.Errorf("error cloning repo: %w", err)
}

// Upgrades don't need to generate keys, we upgrade the program in place
if !config.IsUpgrade {
if err := replaceKeys(e); err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("error replacing keys: %w", err)
}
if err := replaceKeys(e); err != nil {
return deployment.ChangesetOutput{}, fmt.Errorf("error replacing keys: %w", err)
}

// Build the project with Anchor
Expand Down
Loading
Loading