Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/gagliardetto/solana-go"
chainsel "github.com/smartcontractkit/chain-selectors"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/mcms"
"github.com/smartcontractkit/mcms/sdk"

Expand All @@ -16,6 +17,7 @@ import (

cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana"
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"

cs_solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"

Expand Down Expand Up @@ -55,7 +57,7 @@ func (c TransferSignerRegistryToMCMSWithTimelockSolanaConfig) Validate(e cldf.En
if err != nil {
return fmt.Errorf("failed to get addresses for chain: %w", err)
}
_, err = state.MaybeLoadMCMSWithTimelockChainStateSolana(solChain, addresses)
_, err = solstate.MaybeLoadMCMSWithTimelockChainState(solChain, addresses)
if err != nil {
return fmt.Errorf("failed to load mcm state: %w", err)
}
Expand Down Expand Up @@ -102,7 +104,7 @@ func TransferSignerRegistryToMCMSWithTimelockSolanaChangeset(

solChain := e.BlockChains.SolanaChains()[chainSelector]
addresses, _ := e.ExistingAddresses.AddressesForChain(chainSelector)
mcmState, _ := state.MaybeLoadMCMSWithTimelockChainStateSolana(solChain, addresses)
mcmState, _ := solstate.MaybeLoadMCMSWithTimelockChainState(solChain, addresses)

currentOwner := solChain.DeployerKey.PublicKey()
if !cfg.CurrentOwner.IsZero() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"github.com/smartcontractkit/chainlink-deployments-framework/operations"

evmstate "github.com/smartcontractkit/cld-changesets/pkg/family/evm"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"

solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_0"
"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
commonstate "github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
)

Expand Down Expand Up @@ -249,7 +249,7 @@ var (
type Dependencies struct {
Env cldf.Environment
EVMMCMSState map[uint64]evmstate.MCMSWithTimelockState
SolanaMCMSState map[uint64]commonstate.MCMSWithTimelockStateSolana
SolanaMCMSState map[uint64]solstate.MCMSWithTimelockState

changesetInput csInputs
}
Expand Down Expand Up @@ -495,7 +495,7 @@ func addEVMAndSolanaLaneLogic(env cldf.Environment, input AddMultiEVMSolanaLaneC
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get addresses for Solana chain: %w", err)
}
mcmState, err := commonstate.MaybeLoadMCMSWithTimelockChainStateSolana(env.BlockChains.SolanaChains()[input.SolanaChainSelector], addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(env.BlockChains.SolanaChains()[input.SolanaChainSelector], addresses)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to load Solana MCMS state: %w", err)
}
Expand All @@ -511,7 +511,7 @@ func addEVMAndSolanaLaneLogic(env cldf.Environment, input AddMultiEVMSolanaLaneC
deps := Dependencies{
Env: env,
EVMMCMSState: evmState.EVMMCMSStateByChain(),
SolanaMCMSState: map[uint64]commonstate.MCMSWithTimelockStateSolana{
SolanaMCMSState: map[uint64]solstate.MCMSWithTimelockState{
input.SolanaChainSelector: *mcmState,
},
changesetInput: changesetInputs,
Expand Down
8 changes: 4 additions & 4 deletions deployment/ccip/changeset/solana_v0_1_0/cs_deploy_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
chainsel "github.com/smartcontractkit/chain-selectors"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/mcms"
mcmsTypes "github.com/smartcontractkit/mcms/types"

Expand All @@ -24,7 +25,6 @@ import (
solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana"
"github.com/smartcontractkit/chainlink/deployment/utils/solutils"

"github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/common/types"

Expand Down Expand Up @@ -592,7 +592,7 @@ func deployChainContractsSolana(
if err != nil {
return batches, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return batches, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
Expand Down Expand Up @@ -907,11 +907,11 @@ func generateUpgradeTxns(
if err != nil {
return txns, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return txns, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
timelockSignerPDA := state.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
timelockSignerPDA := solstate.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
// if we're not upgrading via timelock, execute the raw ixns
if config.UpgradeConfig.UpgradeAuthority != timelockSignerPDA {
bufferSize, err := GetSolProgramSize(&e, chain, bufferProgram)
Expand Down
10 changes: 5 additions & 5 deletions deployment/ccip/changeset/solana_v0_1_0/cs_idl.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/gagliardetto/solana-go"
"github.com/pelletier/go-toml"
chainsel "github.com/smartcontractkit/chain-selectors"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/mcms"
mcmsTypes "github.com/smartcontractkit/mcms/types"

Expand All @@ -20,7 +21,6 @@ import (

"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
commonstate "github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/common/types"
"github.com/smartcontractkit/chainlink/deployment/utils/solutils"
Expand Down Expand Up @@ -345,7 +345,7 @@ func (c IDLConfig) Validate(e cldf.Environment) error {
if err != nil {
return fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := commonstate.MaybeLoadMCMSWithTimelockChainStateSolana(e.BlockChains.SolanaChains()[c.ChainSelector], addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(e.BlockChains.SolanaChains()[c.ChainSelector], addresses)
if err != nil {
return fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
Expand Down Expand Up @@ -414,7 +414,7 @@ func UploadIDL(e cldf.Environment, c IDLConfig) (cldf.ChangesetOutput, error) {
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := commonstate.MaybeLoadMCMSWithTimelockChainStateSolana(e.BlockChains.SolanaChains()[c.ChainSelector], addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(e.BlockChains.SolanaChains()[c.ChainSelector], addresses)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
Expand Down Expand Up @@ -498,7 +498,7 @@ func SetAuthorityIDL(e cldf.Environment, c IDLConfig) (cldf.ChangesetOutput, err
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := commonstate.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
Expand Down Expand Up @@ -600,7 +600,7 @@ func UpgradeIDL(e cldf.Environment, c IDLConfig) (cldf.ChangesetOutput, error) {
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := commonstate.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions deployment/ccip/changeset/solana_v0_1_0/cs_ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/Masterminds/semver/v3"
"github.com/gagliardetto/solana-go"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"

cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana"
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
Expand All @@ -24,7 +25,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana"
csState "github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
)

Expand Down Expand Up @@ -210,7 +210,7 @@ func SetUpgradeAuthorityChangeset(
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := csState.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions deployment/ccip/changeset/solana_v0_1_0/cs_set_ocr3.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/gagliardetto/solana-go"
chain_selectors "github.com/smartcontractkit/chain-selectors"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"

cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana"

Expand All @@ -23,7 +24,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana"
csState "github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
)
Expand Down Expand Up @@ -103,7 +103,7 @@ func SetOCR3ConfigSolana(e cldf.Environment, cfg v1_6.SetOCR3OffRampConfig) (cld
}
chain := e.BlockChains.SolanaChains()[remote]
addresses, _ := e.ExistingAddresses.AddressesForChain(remote)
mcmState, _ := csState.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, _ := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)

timelocks[remote] = mcmsSolana.ContractAddress(
mcmState.TimelockProgram,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/gagliardetto/solana-go"
"github.com/mr-tron/base58"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"

"github.com/smartcontractkit/mcms"
mcmsTypes "github.com/smartcontractkit/mcms/types"
Expand All @@ -16,7 +17,6 @@ import (
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"

"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
csState "github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/utils/solutils"
)
Expand Down Expand Up @@ -320,13 +320,13 @@ func VerifyBuild(e cldf.Environment, cfg VerifyBuildConfig) (cldf.ChangesetOutpu
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := csState.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err)
}
var timelockSignerPDA solana.PublicKey
if mcmState != nil {
timelockSignerPDA = csState.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
timelockSignerPDA = solstate.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
}

verifications := []struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/gagliardetto/solana-go"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/mcms"
"github.com/smartcontractkit/mcms/sdk"

Expand All @@ -17,7 +18,6 @@ import (

"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana"
"github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/common/types"
)
Expand Down Expand Up @@ -86,7 +86,7 @@ func (cfg TransferCCIPToMCMSWithTimelockSolanaConfig) Validate(e cldf.Environmen
if err != nil {
return fmt.Errorf("failed to load addresses for chain %d: %w", chainSelector, err)
}
_, err = state.MaybeLoadMCMSWithTimelockChainStateSolana(solChain, addresses)
_, err = solstate.MaybeLoadMCMSWithTimelockChainState(solChain, addresses)
if err != nil {
return fmt.Errorf("failed to load mcm state: %w", err)
}
Expand Down Expand Up @@ -153,13 +153,13 @@ func TransferCCIPToMCMSWithTimelockSolana(
for chainSelector, contractsToTransfer := range cfg.ContractsByChain {
solChain := e.BlockChains.SolanaChains()[chainSelector]
addresses, _ := e.ExistingAddresses.AddressesForChain(chainSelector)
mcmState, _ := state.MaybeLoadMCMSWithTimelockChainStateSolana(solChain, addresses)
mcmState, _ := solstate.MaybeLoadMCMSWithTimelockChainState(solChain, addresses)

currentOwner := solChain.DeployerKey.PublicKey()
if !cfg.CurrentOwner.IsZero() {
currentOwner = cfg.CurrentOwner
}
timelockSigner := state.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
timelockSigner := solstate.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
proposedOwner := timelockSigner
if !cfg.ProposedOwner.IsZero() {
proposedOwner = cfg.ProposedOwner
Expand Down
8 changes: 4 additions & 4 deletions deployment/ccip/changeset/solana_v0_1_0/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/gagliardetto/solana-go"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/mcms"
"github.com/smartcontractkit/mcms/sdk"
mcmsSolana "github.com/smartcontractkit/mcms/sdk/solana"
Expand All @@ -17,7 +18,6 @@ import (

"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana"
"github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
)

Expand Down Expand Up @@ -82,7 +82,7 @@ func buildProposalCommon(

chain := e.BlockChains.SolanaChains()[chainSelector]
addresses, _ := e.ExistingAddresses.AddressesForChain(chainSelector)
mcmState, _ := state.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, _ := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)

timelocks[chainSelector] = mcmsSolana.ContractAddress(
mcmState.TimelockProgram,
Expand Down Expand Up @@ -158,11 +158,11 @@ func FetchTimelockSigner(e cldf.Environment, chainSelector uint64) (solana.Publi
if err != nil {
return solana.PublicKey{}, fmt.Errorf("failed to load addresses for chain %d: %w", chainSelector, err)
}
mcmState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(e.BlockChains.SolanaChains()[chainSelector], addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(e.BlockChains.SolanaChains()[chainSelector], addresses)
if err != nil {
return solana.PublicKey{}, fmt.Errorf("failed to load mcm state: %w", err)
}
timelockSignerPDA := state.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
timelockSignerPDA := solstate.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
return timelockSignerPDA, nil
}

Expand Down
8 changes: 4 additions & 4 deletions deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/gagliardetto/solana-go"
chainsel "github.com/smartcontractkit/chain-selectors"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/mcms"
mcmsTypes "github.com/smartcontractkit/mcms/types"

Expand All @@ -23,7 +24,6 @@ import (
solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana"
"github.com/smartcontractkit/chainlink/deployment/utils/solutils"

"github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/common/types"

Expand Down Expand Up @@ -670,7 +670,7 @@ func deployChainContractsSolana(
if err != nil {
return batches, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return batches, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
Expand Down Expand Up @@ -1035,11 +1035,11 @@ func generateUpgradeTxns(
if err != nil {
return txns, fmt.Errorf("failed to get existing addresses: %w", err)
}
mcmState, err := state.MaybeLoadMCMSWithTimelockChainStateSolana(chain, addresses)
mcmState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addresses)
if err != nil {
return txns, fmt.Errorf("failed to load MCMS with timelock chain state: %w", err)
}
timelockSignerPDA := state.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)
timelockSignerPDA := solstate.GetTimelockSignerPDA(mcmState.TimelockProgram, mcmState.TimelockSeed)

bufferSize, err := GetSolProgramSize(&e, chain, bufferProgram)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
solBinary "github.com/gagliardetto/binary"
"github.com/gagliardetto/solana-go"
chain_selectors "github.com/smartcontractkit/chain-selectors"
solstate "github.com/smartcontractkit/cld-changesets/pkg/family/solana"
"github.com/smartcontractkit/quarantine"
"github.com/stretchr/testify/require"

Expand All @@ -25,7 +26,6 @@ import (
"github.com/smartcontractkit/chainlink/deployment/ccip/shared"
"github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview"
commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset"
csState "github.com/smartcontractkit/chainlink/deployment/common/changeset/state"
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
"github.com/smartcontractkit/chainlink/deployment/common/types"
"github.com/smartcontractkit/chainlink/deployment/internal/soltestutils"
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestUpgrade(t *testing.T) {
require.NoError(t, err)
addresses, err := e.ExistingAddresses.AddressesForChain(solSelector)
require.NoError(t, err)
chainState, err := csState.MaybeLoadMCMSWithTimelockChainStateSolana(e.BlockChains.SolanaChains()[solSelector], addresses)
chainState, err := solstate.MaybeLoadMCMSWithTimelockChainState(e.BlockChains.SolanaChains()[solSelector], addresses)
require.NoError(t, err)

// deploy the contracts
Expand Down
Loading
Loading