diff --git a/deployment/ccip/changeset/aptos/config/deploy_aptos_chain.go b/deployment/ccip/changeset/aptos/config/deploy_aptos_chain.go index 0667b3c4533..a8dc9faef1e 100644 --- a/deployment/ccip/changeset/aptos/config/deploy_aptos_chain.go +++ b/deployment/ccip/changeset/aptos/config/deploy_aptos_chain.go @@ -8,15 +8,15 @@ import ( "github.com/aptos-labs/aptos-go-sdk" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) // DeployAptosChainConfig is a configuration for deploying CCIP Package for Aptos chains type DeployAptosChainConfig struct { MCMSDeployConfigPerChain map[uint64]types.MCMSWithTimelockConfigV2 - MCMSTimelockConfigPerChain map[uint64]proposalutils.TimelockConfig + MCMSTimelockConfigPerChain map[uint64]cldfproposalutils.TimelockConfig ContractParamsPerChain map[uint64]ChainContractParams } diff --git a/deployment/ccip/changeset/aptos/config/deploy_curse_mcms.go b/deployment/ccip/changeset/aptos/config/deploy_curse_mcms.go index 37b9511c894..f82870dff47 100644 --- a/deployment/ccip/changeset/aptos/config/deploy_curse_mcms.go +++ b/deployment/ccip/changeset/aptos/config/deploy_curse_mcms.go @@ -3,18 +3,17 @@ package config import ( "fmt" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" mcmstypes "github.com/smartcontractkit/mcms/types" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) // DeployCurseMCMSConfig holds per-chain configuration for deploying and // configuring a CurseMCMS contract on Aptos chains. type DeployCurseMCMSConfig struct { CurseMCMSConfigPerChain map[uint64]cldfproposalutils.MCMSWithTimelockConfig - MCMSTimelockConfigPerChain map[uint64]proposalutils.TimelockConfig + MCMSTimelockConfigPerChain map[uint64]cldfproposalutils.TimelockConfig } func (c DeployCurseMCMSConfig) Validate() error { diff --git a/deployment/ccip/changeset/aptos/config/deploy_regulated_token.go b/deployment/ccip/changeset/aptos/config/deploy_regulated_token.go index ff12561109a..26423a0075e 100644 --- a/deployment/ccip/changeset/aptos/config/deploy_regulated_token.go +++ b/deployment/ccip/changeset/aptos/config/deploy_regulated_token.go @@ -4,8 +4,7 @@ import ( "errors" "github.com/aptos-labs/aptos-go-sdk" - - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) // DeployRegulatedTokenConfig drives the regulated token publish + initialize + @@ -19,7 +18,7 @@ type DeployRegulatedTokenConfig struct { TokenMint *TokenMint // RegistrarPreregister is passed to DeployMCMSRegistrarToExistingObject (default true). RegistrarPreregister *bool - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (c DeployRegulatedTokenConfig) Validate() error { diff --git a/deployment/ccip/changeset/aptos/config/dynamic.go b/deployment/ccip/changeset/aptos/config/dynamic.go index c350cd85aea..2c238cd4acc 100644 --- a/deployment/ccip/changeset/aptos/config/dynamic.go +++ b/deployment/ccip/changeset/aptos/config/dynamic.go @@ -1,8 +1,8 @@ package config import ( + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type DynamicConfig struct { @@ -10,5 +10,5 @@ type DynamicConfig struct { Inputs []any // Each element should be the corresponding input type for its operation ChainSelector uint64 Description string - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } diff --git a/deployment/ccip/changeset/aptos/config/lane.go b/deployment/ccip/changeset/aptos/config/lane.go index 4e3aad36448..2e4faf8af09 100644 --- a/deployment/ccip/changeset/aptos/config/lane.go +++ b/deployment/ccip/changeset/aptos/config/lane.go @@ -7,9 +7,10 @@ import ( "github.com/ethereum/go-ethereum/common" chainsel "github.com/smartcontractkit/chain-selectors" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type LaneConfig struct { @@ -22,9 +23,9 @@ type LaneConfig struct { // Lanes accept different chain families type UpdateAptosLanesConfig struct { // EVMMCMSConfig defines the MCMS configuration for EVM chains. - EVMMCMSConfig *proposalutils.TimelockConfig + EVMMCMSConfig *cldfproposalutils.TimelockConfig // MCMSConfig defines the MCMS configuration for Aptos chains. - AptosMCMSConfig *proposalutils.TimelockConfig + AptosMCMSConfig *cldfproposalutils.TimelockConfig // Lanes describes the lanes that we want to create. Lanes []LaneConfig // TestRouter indicates if we want to enable these lanes on the test router. diff --git a/deployment/ccip/changeset/aptos/config/lane_test.go b/deployment/ccip/changeset/aptos/config/lane_test.go index b2272795d50..0f0c9b47548 100644 --- a/deployment/ccip/changeset/aptos/config/lane_test.go +++ b/deployment/ccip/changeset/aptos/config/lane_test.go @@ -10,8 +10,8 @@ import ( aptos_fee_quoter "github.com/smartcontractkit/chainlink-aptos/bindings/ccip/fee_quoter" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" ) @@ -25,7 +25,7 @@ func TestToEVMUpdateLanesConfig(t *testing.T) { { name: "EVM <> Aptos Biderectional Lane", input: UpdateAptosLanesConfig{ - EVMMCMSConfig: &proposalutils.TimelockConfig{}, + EVMMCMSConfig: &cldfproposalutils.TimelockConfig{}, Lanes: []LaneConfig{ { Source: getEVMDef(), @@ -42,7 +42,7 @@ func TestToEVMUpdateLanesConfig(t *testing.T) { }, expected: v1_6.UpdateBidirectionalLanesChangesetConfigs{ UpdateFeeQuoterDestsConfig: v1_6.UpdateFeeQuoterDestsConfig{ - MCMS: &proposalutils.TimelockConfig{}, + MCMS: &cldfproposalutils.TimelockConfig{}, UpdatesByChain: map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig{ 1881: { 4457093679053095497: fee_quoter.FeeQuoterDestChainConfig{ @@ -70,7 +70,7 @@ func TestToEVMUpdateLanesConfig(t *testing.T) { }, }, UpdateFeeQuoterPricesConfig: v1_6.UpdateFeeQuoterPricesConfig{ - MCMS: &proposalutils.TimelockConfig{}, + MCMS: &cldfproposalutils.TimelockConfig{}, PricesByChain: map[uint64]v1_6.FeeQuoterPriceUpdatePerSource{ 1881: { GasPrices: map[uint64]*big.Int{ @@ -80,7 +80,7 @@ func TestToEVMUpdateLanesConfig(t *testing.T) { }, }, UpdateOnRampDestsConfig: v1_6.UpdateOnRampDestsConfig{ - MCMS: &proposalutils.TimelockConfig{}, + MCMS: &cldfproposalutils.TimelockConfig{}, UpdatesByChain: map[uint64]map[uint64]v1_6.OnRampDestinationUpdate{ 1881: { 4457093679053095497: v1_6.OnRampDestinationUpdate{ @@ -92,7 +92,7 @@ func TestToEVMUpdateLanesConfig(t *testing.T) { }, }, UpdateOffRampSourcesConfig: v1_6.UpdateOffRampSourcesConfig{ - MCMS: &proposalutils.TimelockConfig{}, + MCMS: &cldfproposalutils.TimelockConfig{}, UpdatesByChain: map[uint64]map[uint64]v1_6.OffRampSourceUpdate{ 1881: { 4457093679053095497: v1_6.OffRampSourceUpdate{ @@ -105,7 +105,7 @@ func TestToEVMUpdateLanesConfig(t *testing.T) { }, UpdateRouterRampsConfig: v1_6.UpdateRouterRampsConfig{ TestRouter: false, - MCMS: &proposalutils.TimelockConfig{}, + MCMS: &cldfproposalutils.TimelockConfig{}, UpdatesByChain: map[uint64]v1_6.RouterUpdates{ 1881: { OnRampUpdates: map[uint64]bool{ diff --git a/deployment/ccip/changeset/aptos/config/migrate_onramp.go b/deployment/ccip/changeset/aptos/config/migrate_onramp.go index 1342bc40233..04a039e3ae1 100644 --- a/deployment/ccip/changeset/aptos/config/migrate_onramp.go +++ b/deployment/ccip/changeset/aptos/config/migrate_onramp.go @@ -3,12 +3,12 @@ package config import ( "github.com/aptos-labs/aptos-go-sdk" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) type MigrateOnRampDestChainConfigsToV2Config struct { ChainSelector uint64 DestChainSelectors []uint64 RouterModuleAddresses []aptos.AccountAddress - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } diff --git a/deployment/ccip/changeset/aptos/config/token.go b/deployment/ccip/changeset/aptos/config/token.go index 3c481fae833..363e8d28430 100644 --- a/deployment/ccip/changeset/aptos/config/token.go +++ b/deployment/ccip/changeset/aptos/config/token.go @@ -7,8 +7,8 @@ import ( "github.com/aptos-labs/aptos-go-sdk" "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type TokenParams struct { @@ -44,13 +44,13 @@ type TokenMint struct { type DeployTokenFaucetInput struct { ChainSelector uint64 TokenCodeObjectAddress aptos.AccountAddress - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type MintTokenInput struct { ChainSelector uint64 TokenCodeObjectAddress aptos.AccountAddress - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig TokenMint } @@ -67,7 +67,7 @@ type TokenTransferInput struct { type TransferTokenOwnershipInput struct { ChainSelector uint64 Transfers []TokenTransferInput - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type TokenAcceptInput struct { @@ -78,23 +78,23 @@ type TokenAcceptInput struct { type AcceptTokenOwnershipInput struct { ChainSelector uint64 Accepts []TokenAcceptInput - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type ExecuteTokenOwnershipTransferInput struct { ChainSelector uint64 Transfers []TokenTransferInput - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type TransferTokenAdminInput struct { ChainSelector uint64 Transfers []TokenTransferInput - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type AcceptTokenAdminInput struct { ChainSelector uint64 Accepts []TokenAcceptInput - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } diff --git a/deployment/ccip/changeset/aptos/config/token_pool.go b/deployment/ccip/changeset/aptos/config/token_pool.go index fd0ec9b6bcc..1f972d5bd99 100644 --- a/deployment/ccip/changeset/aptos/config/token_pool.go +++ b/deployment/ccip/changeset/aptos/config/token_pool.go @@ -8,7 +8,7 @@ import ( fee_quoter "github.com/smartcontractkit/chainlink-aptos/bindings/ccip/fee_quoter" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) type AddTokenPoolConfig struct { @@ -21,7 +21,7 @@ type AddTokenPoolConfig struct { TokenTransferFeeByRemoteChainConfig map[uint64]fee_quoter.TokenTransferFeeConfig EVMRemoteConfigs map[uint64]EVMRemoteConfig TokenParams TokenParams - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig TokenMint *TokenMint } @@ -66,7 +66,7 @@ type TokenPoolTransfer struct { type TransferTokenPoolOwnershipInput struct { ChainSelector uint64 Transfers []TokenPoolTransfer - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type TokenPoolAccept struct { @@ -77,11 +77,11 @@ type TokenPoolAccept struct { type AcceptTokenPoolOwnershipInput struct { ChainSelector uint64 Accepts []TokenPoolAccept - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type ExecuteTokenPoolOwnershipTransferInput struct { ChainSelector uint64 Transfers []TokenPoolTransfer - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } diff --git a/deployment/ccip/changeset/aptos/config/upgrade.go b/deployment/ccip/changeset/aptos/config/upgrade.go index 9116efad4a6..4717e7be4be 100644 --- a/deployment/ccip/changeset/aptos/config/upgrade.go +++ b/deployment/ccip/changeset/aptos/config/upgrade.go @@ -1,6 +1,6 @@ package config -import "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" +import cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" type UpgradeAptosChainConfig struct { ChainSelector uint64 @@ -8,5 +8,5 @@ type UpgradeAptosChainConfig struct { UpgradeOffRamp bool UpgradeOnRamp bool UpgradeRouter bool - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } diff --git a/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go b/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go index 69465d3c7be..4f7c20253da 100644 --- a/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go +++ b/deployment/ccip/changeset/aptos/cs_add_token_pool_test.go @@ -19,13 +19,14 @@ import ( "github.com/smartcontractkit/chainlink-aptos/bindings/ccip_token_pools/managed_token_pool" mcmsbind "github.com/smartcontractkit/chainlink-aptos/bindings/mcms" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + aptoscs "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/config" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var testTokenTransferFeeConfig = fee_quoter.TokenTransferFeeConfig{ @@ -59,7 +60,7 @@ func TestAddTokenPool_Apply(t *testing.T) { // Configure token pool settings cfg := config.AddTokenPoolConfig{ - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go b/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go index 600dff49984..ff8909faae6 100644 --- a/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go +++ b/deployment/ccip/changeset/aptos/cs_deploy_aptos_chain_test.go @@ -19,6 +19,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/chain" aptoschain "github.com/smartcontractkit/chainlink-deployments-framework/chain/aptos" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" @@ -26,7 +27,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/config" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" aptosstate "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/aptos" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -267,7 +267,7 @@ func TestDeployAptosChain_Apply(t *testing.T) { TimelockMinDelay: big.NewInt(1), }, }, - MCMSTimelockConfigPerChain: map[uint64]proposalutils.TimelockConfig{ + MCMSTimelockConfigPerChain: map[uint64]cldfproposalutils.TimelockConfig{ selector: { MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, diff --git a/deployment/ccip/changeset/aptos/cs_deploy_regulated_token_test.go b/deployment/ccip/changeset/aptos/cs_deploy_regulated_token_test.go index 58c9ae2bec1..c95d4c8686f 100644 --- a/deployment/ccip/changeset/aptos/cs_deploy_regulated_token_test.go +++ b/deployment/ccip/changeset/aptos/cs_deploy_regulated_token_test.go @@ -9,12 +9,14 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + aptoscs "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/config" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestDeployRegulatedToken_Apply(t *testing.T) { @@ -36,7 +38,7 @@ func TestDeployRegulatedToken_Apply(t *testing.T) { Icon: "", Project: "", }, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/cs_dynamic_test.go b/deployment/ccip/changeset/aptos/cs_dynamic_test.go index 96bf35da7ff..bb265136e74 100644 --- a/deployment/ccip/changeset/aptos/cs_dynamic_test.go +++ b/deployment/ccip/changeset/aptos/cs_dynamic_test.go @@ -13,7 +13,9 @@ import ( module_fee_quoter "github.com/smartcontractkit/chainlink-aptos/bindings/ccip/fee_quoter" mcmsbind "github.com/smartcontractkit/chainlink-aptos/bindings/mcms" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + aptoscs "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos" aptosconfig "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/config" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/operation" @@ -22,7 +24,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/operation/aptos" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestDynamicCS_Apply(t *testing.T) { @@ -102,7 +103,7 @@ func TestDynamicCS_Apply(t *testing.T) { Inputs: inputs, ChainSelector: aptosChainSel, Description: "Test dynamic changeset with multiple operations", - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, @@ -180,7 +181,7 @@ func TestDynamicCS_Apply(t *testing.T) { Inputs: inputs, ChainSelector: aptosChainSel, Description: "Test dynamic changeset with uncurse subjects operation", - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, @@ -230,7 +231,7 @@ func TestDynamicCS_Apply(t *testing.T) { Inputs: inputs, ChainSelector: aptosChainSel, Description: "Test dynamic changeset with global curse operation", - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/cs_migrate_onramp_dest_chain_configs_test.go b/deployment/ccip/changeset/aptos/cs_migrate_onramp_dest_chain_configs_test.go index 04505ed970b..e6d19eb6ef6 100644 --- a/deployment/ccip/changeset/aptos/cs_migrate_onramp_dest_chain_configs_test.go +++ b/deployment/ccip/changeset/aptos/cs_migrate_onramp_dest_chain_configs_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + "github.com/aptos-labs/aptos-go-sdk" chain_selectors "github.com/smartcontractkit/chain-selectors" mcmstypes "github.com/smartcontractkit/mcms/types" @@ -14,7 +16,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/config" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestMigrateOnRampDestChainConfigsToV2_Apply(t *testing.T) { @@ -33,7 +34,7 @@ func TestMigrateOnRampDestChainConfigsToV2_Apply(t *testing.T) { ChainSelector: chainSelector, DestChainSelectors: []uint64{chain_selectors.ETHEREUM_MAINNET.Selector}, RouterModuleAddresses: []aptos.AccountAddress{{}}, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go b/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go index 584a5d29fc9..a61589669af 100644 --- a/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go +++ b/deployment/ccip/changeset/aptos/cs_set_ocr3_offramp_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + chain_selectors "github.com/smartcontractkit/chain-selectors" mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" @@ -16,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -32,7 +33,7 @@ func TestSetOCR3Offramp_Apply(t *testing.T) { cfg := v1_6.SetOCR3OffRampConfig{ HomeChainSel: env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM))[0], RemoteChainSels: env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyAptos)), - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes.go b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes.go index a22024c9cc7..93081add605 100644 --- a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes.go +++ b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes.go @@ -5,6 +5,7 @@ import ( "fmt" chainsel "github.com/smartcontractkit/chain-selectors" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/mcms" mcmstypes "github.com/smartcontractkit/mcms/types" @@ -16,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/utils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var _ cldf.ChangeSetV2[config.UpdateAptosLanesConfig] = AddAptosLanes{} @@ -136,9 +136,9 @@ func (cs AddAptosLanes) Apply(env cldf.Environment, cfg config.UpdateAptosLanesC } // Aggregate all Timelock proposals - proposal, err := proposalutils.AggregateProposalsV2( + proposal, err := proposeutils.AggregateProposalsV2( env, - proposalutils.MCMSStates{ + proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSAptosState: state.AptosMCMSStateByChain(), }, diff --git a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go index 1e50c0bff9a..44564343680 100644 --- a/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go +++ b/deployment/ccip/changeset/aptos/cs_update_aptos_lanes_test.go @@ -6,6 +6,8 @@ import ( "testing" "time" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + "github.com/aptos-labs/aptos-go-sdk" "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" @@ -26,7 +28,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" ) @@ -108,7 +109,7 @@ func getMockUpdateConfig( return config.UpdateAptosLanesConfig{ EVMMCMSConfig: nil, - AptosMCMSConfig: &proposalutils.TimelockConfig{ + AptosMCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/cs_upgrade_aptos_ccip_test.go b/deployment/ccip/changeset/aptos/cs_upgrade_aptos_ccip_test.go index 7fd70fec063..b9e7e42b669 100644 --- a/deployment/ccip/changeset/aptos/cs_upgrade_aptos_ccip_test.go +++ b/deployment/ccip/changeset/aptos/cs_upgrade_aptos_ccip_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + chain_selectors "github.com/smartcontractkit/chain-selectors" mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" @@ -13,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/config" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestUpgradeAptosChain_Apply(t *testing.T) { @@ -30,7 +31,7 @@ func TestUpgradeAptosChain_Apply(t *testing.T) { cfg := config.UpgradeAptosChainConfig{ ChainSelector: chainSelector, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/aptos/utils/mcms.go b/deployment/ccip/changeset/aptos/utils/mcms.go index f00a4255b3b..d76b756717b 100644 --- a/deployment/ccip/changeset/aptos/utils/mcms.go +++ b/deployment/ccip/changeset/aptos/utils/mcms.go @@ -12,13 +12,14 @@ import ( aptosmcms "github.com/smartcontractkit/mcms/sdk/aptos" mcmstypes "github.com/smartcontractkit/mcms/types" - "github.com/smartcontractkit/chainlink-aptos/bindings/bind" - "github.com/smartcontractkit/chainlink-aptos/bindings/compile" - mcmsbind "github.com/smartcontractkit/chainlink-aptos/bindings/mcms" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + "github.com/smartcontractkit/chainlink-aptos/bindings/bind" + "github.com/smartcontractkit/chainlink-aptos/bindings/compile" + mcmsbind "github.com/smartcontractkit/chainlink-aptos/bindings/mcms" ) const MCMSProposalVersion = "v1" @@ -29,7 +30,7 @@ func GenerateProposal( chainSel uint64, operations []mcmstypes.BatchOperation, description string, - mcmsCfg proposalutils.TimelockConfig, + mcmsCfg cldfproposalutils.TimelockConfig, ) (*mcms.TimelockProposal, error) { // Get role from action role, err := cldfproposalutils.GetAptosRoleFromAction(mcmsCfg.MCMSAction) @@ -38,7 +39,7 @@ func GenerateProposal( } inspector := aptosmcms.NewInspector(env.BlockChains.AptosChains()[chainSel].Client, role) - return proposalutils.BuildProposalFromBatchesV2( + return proposeutils.BuildProposalFromBatchesV2( env, map[uint64]string{chainSel: mcmsAddress.StringLong()}, map[uint64]string{chainSel: mcmsAddress.StringLong()}, @@ -60,7 +61,7 @@ func GenerateCurseMCMSProposal( chainSel uint64, operations []mcmstypes.BatchOperation, description string, - mcmsCfg proposalutils.TimelockConfig, + mcmsCfg cldfproposalutils.TimelockConfig, ) (*mcms.TimelockProposal, error) { role, err := cldfproposalutils.GetAptosRoleFromAction(mcmsCfg.MCMSAction) if err != nil { @@ -68,7 +69,7 @@ func GenerateCurseMCMSProposal( } inspector := aptosmcms.NewInspectorWithMCMSType(env.BlockChains.AptosChains()[chainSel].Client, role, aptosmcms.MCMSTypeCurse) - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, map[uint64]string{chainSel: curseMCMSAddress.StringLong()}, map[uint64]string{chainSel: curseMCMSAddress.StringLong()}, diff --git a/deployment/ccip/changeset/ccip-attestation-solana/cs_ops_solana.go b/deployment/ccip/changeset/ccip-attestation-solana/cs_ops_solana.go index a2ac9f7de4c..f6f883b8961 100644 --- a/deployment/ccip/changeset/ccip-attestation-solana/cs_ops_solana.go +++ b/deployment/ccip/changeset/ccip-attestation-solana/cs_ops_solana.go @@ -11,10 +11,9 @@ import ( signer_registry "github.com/smartcontractkit/chainlink/deployment/ccip/shared/bindings/signer_registry_solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cs_solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" @@ -29,7 +28,7 @@ func executeOrBuildMCMSProposal( instructions []solana.Instruction, programID string, contractType cldf.ContractType, - mcmsConfig *proposalutils.TimelockConfig, + mcmsConfig *cldfproposalutils.TimelockConfig, proposalDescription string, ) (cldf.ChangesetOutput, error) { if mcmsConfig == nil { @@ -79,7 +78,7 @@ type RotateBaseSignerNopsConfig struct { NopKeysToAdd []string NopKeysToRemove []string // if set, assumes current upgrade authority is the timelock - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type AddGreenKeysConfig struct { @@ -87,7 +86,7 @@ type AddGreenKeysConfig struct { // Pairs of blue key (existing on the account) and new green key for that NOP BlueGreenKeys [][2]string // if set, assumes current upgrade authority is the timelock - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type PromoteKeysConfig struct { @@ -95,14 +94,14 @@ type PromoteKeysConfig struct { // Keys to promote (nops can be identified by blue or green indistinctly) KeysToPromote []string // if set, assumes current upgrade authority is the timelock - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type SetUpgradeAuthorityConfig struct { ChainSelector uint64 NewUpgradeAuthority solana.PublicKey // if set, assumes current upgrade authority is the timelock - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func RotateBaseSignerNopsChangeset(e cldf.Environment, c RotateBaseSignerNopsConfig) (cldf.ChangesetOutput, error) { diff --git a/deployment/ccip/changeset/ccip-attestation-solana/cs_transfer_to_mcms_with_timelock_solana.go b/deployment/ccip/changeset/ccip-attestation-solana/cs_transfer_to_mcms_with_timelock_solana.go index 7ac25bd0948..0003c375e31 100644 --- a/deployment/ccip/changeset/ccip-attestation-solana/cs_transfer_to_mcms_with_timelock_solana.go +++ b/deployment/ccip/changeset/ccip-attestation-solana/cs_transfer_to_mcms_with_timelock_solana.go @@ -10,20 +10,19 @@ import ( pdasol "github.com/smartcontractkit/cld-changesets/pkg/family/solana" "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/mcms/sdk" - mcmsSolana "github.com/smartcontractkit/mcms/sdk/solana" mcmsTypes "github.com/smartcontractkit/mcms/types" - signer_registry "github.com/smartcontractkit/chainlink/deployment/ccip/shared/bindings/signer_registry_solana" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cs_solana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" - + signer_registry "github.com/smartcontractkit/chainlink/deployment/ccip/shared/bindings/signer_registry_solana" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -34,7 +33,7 @@ type TransferSignerRegistryToMCMSWithTimelockSolanaConfig struct { CurrentOwner solana.PublicKey ProposedOwner solana.PublicKey // MCMSCfg is for the accept ownership proposal - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } func (c TransferSignerRegistryToMCMSWithTimelockSolanaConfig) Validate(e cldf.Environment) error { @@ -139,7 +138,7 @@ func TransferSignerRegistryToMCMSWithTimelockSolanaChangeset( Transactions: mcmsTxs, }) - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, diff --git a/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry.go b/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry.go index ba85a355ff7..328a5865600 100644 --- a/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry.go +++ b/deployment/ccip/changeset/ccip-attestation/cs_configure_evm_signer_registry.go @@ -11,9 +11,9 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/bindings/signer_registry" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -22,7 +22,7 @@ var ( type SetNewSignerAddressesConfig struct { // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // UpdatesByChain maps chain selector -> (existing signer -> new signer) for per-chain updates. UpdatesByChain map[uint64]map[common.Address]common.Address } diff --git a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config.go b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config.go index 33273072268..92ad87188fb 100644 --- a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config.go +++ b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config.go @@ -10,7 +10,7 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" ccip_cs_common "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" @@ -66,7 +66,7 @@ type TokenTransferFeeConfigArgs struct { type SetTokenTransferFeeConfigInput struct { InputsByChain map[uint64]map[uint64]TokenTransferFeeConfigArgs `json:"inputsByChain"` VersionHints *OptionalVersions `json:"versionHints"` - MCMS *proposalutils.TimelockConfig `json:"mcms"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms"` } func (cfg SetTokenTransferFeeConfigInput) buildOrchestrateChangesetsConfig(env cldf.Environment) (ccip_cs_common.OrchestrateChangesetsConfig, error) { diff --git a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go index 5ba67df1156..0e9dfffc1ac 100644 --- a/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go +++ b/deployment/ccip/changeset/crossfamily/cs_set_token_transfer_fee_config_test.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/stretchr/testify/require" chainsel "github.com/smartcontractkit/chain-selectors" @@ -19,12 +20,14 @@ import ( solfq "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/fee_quoter" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" solstate "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers/v1_5" @@ -39,7 +42,7 @@ import ( const SetTokenTransferFeePriceRegStalenessThreshold = 60 * 60 * 24 * 14 // two weeks in seconds -var SetTokenTransferFeeMcmsConfig = proposalutils.TimelockConfig{MinDelay: 1 * time.Second} +var SetTokenTransferFeeMcmsConfig = cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second} func deploySolanaToken(t *testing.T, tEnv cldf.Environment, solSelector uint64, tokenSymbol string) (cldf.Environment, solana.PublicKey, error) { t.Helper() @@ -394,8 +397,8 @@ func TestSetTokenTransferFeeConfig_EVM_V1_5_1_Only(t *testing.T) { require.NoError(t, err) env.Env, err = commonchangeset.Apply(t, env.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ src: {state.MustGetEVMChainState(src).EVM2EVMOnRamp[dst].Address()}, dst: {state.MustGetEVMChainState(dst).EVM2EVMOnRamp[src].Address()}, diff --git a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane.go b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane.go index c532aa53d22..0f53f913a8c 100644 --- a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane.go +++ b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane.go @@ -6,12 +6,14 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" mcmslib "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" @@ -20,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -32,9 +33,17 @@ var ( "Post ops to aggregate proposals", func(b operations.Bundle, deps Dependencies, input postOpsInput) ([]mcmslib.TimelockProposal, error) { allProposals := input.Proposals - proposal, err := proposalutils.AggregateProposals( - deps.Env, deps.EVMMCMSState, deps.SolanaMCMSState, allProposals, - "Adding EVM and Solana lane", input.MCMSConfig) + if input.MCMSConfig == nil || len(allProposals) == 0 { + return input.Proposals, nil + } + proposal, err := proposeutils.AggregateProposals( //nolint:staticcheck //SA1019 ignoring deprecated + deps.Env, + deps.EVMMCMSState, + deps.SolanaMCMSState, + allProposals, + "Adding EVM and Solana lane", + input.MCMSConfig, + ) if err != nil { return nil, err } @@ -229,7 +238,7 @@ var ( if err != nil { return OpsOutput{}, err } - var mcmsCfg *proposalutils.TimelockConfig + var mcmsCfg *cldfproposalutils.TimelockConfig if input.MCMSConfig != nil { mcmsCfg = input.MCMSConfig } @@ -255,7 +264,7 @@ type Dependencies struct { } type postOpsInput struct { - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig Proposals []mcmslib.TimelockProposal } @@ -302,11 +311,11 @@ type csInputs struct { type AddMultiEVMSolanaLaneConfig struct { Configs []AddRemoteChainE2EConfig SolanaChainSelector uint64 - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (multiCfg *AddMultiEVMSolanaLaneConfig) populateAndValidateIndividualCSConfig(env cldf.Environment, evmState stateview.CCIPOnChainState) (csInputs, error) { - var timelockConfig *proposalutils.TimelockConfig + var timelockConfig *cldfproposalutils.TimelockConfig var input csInputs if multiCfg.MCMSConfig != nil { timelockConfig = multiCfg.MCMSConfig @@ -463,7 +472,7 @@ func addEVMSolanaPreconditions(env cldf.Environment, input AddMultiEVMSolanaLane if err != nil { return fmt.Errorf("failed to load onchain evm state: %w", err) } - var timelockConfig *proposalutils.TimelockConfig + var timelockConfig *cldfproposalutils.TimelockConfig if input.MCMSConfig != nil { timelockConfig = input.MCMSConfig } diff --git a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go index 626ee19a660..8d347b5920c 100644 --- a/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go +++ b/deployment/ccip/changeset/crossfamily/v1_6/cs_add_evm_solana_lane_test.go @@ -10,6 +10,7 @@ import ( "github.com/gagliardetto/solana-go" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" chain_selectors "github.com/smartcontractkit/chain-selectors" @@ -28,7 +29,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestAddEVMSolanaLaneBidirectional(t *testing.T) { @@ -60,7 +60,7 @@ func TestAddEVMSolanaLaneBidirectional(t *testing.T) { evmChain2 := evmChains[1] evmState, err := stateview.LoadOnchainState(e) require.NoError(t, err) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { _, _ = testhelpers.TransferOwnershipSolanaV0_1_0(t, &e, solChain, true, ccipChangesetSolana.CCIPContractsToTransfer{ @@ -68,7 +68,7 @@ func TestAddEVMSolanaLaneBidirectional(t *testing.T) { FeeQuoter: true, OffRamp: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } testhelpers.TransferToTimelock(t, tenv, evmState, []uint64{evmChain1, evmChain2}, false) diff --git a/deployment/ccip/changeset/cs_grant_and_mint_link_token.go b/deployment/ccip/changeset/cs_grant_and_mint_link_token.go index d6db83c3cf1..31186ce0be7 100644 --- a/deployment/ccip/changeset/cs_grant_and_mint_link_token.go +++ b/deployment/ccip/changeset/cs_grant_and_mint_link_token.go @@ -12,10 +12,10 @@ import ( evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm" ccipseqs "github.com/smartcontractkit/chainlink/deployment/ccip/sequence/evm" @@ -36,7 +36,7 @@ type GrantMintRoleAndMintConfig struct { type GrantMintRoleInput struct { GrantMintRoleByChain map[uint64]GrantMintRoleConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type GrantMintRoleConfig struct { diff --git a/deployment/ccip/changeset/cs_mint_link_token_mcms.go b/deployment/ccip/changeset/cs_mint_link_token_mcms.go index 3c6af817569..d9de3602889 100644 --- a/deployment/ccip/changeset/cs_mint_link_token_mcms.go +++ b/deployment/ccip/changeset/cs_mint_link_token_mcms.go @@ -10,20 +10,20 @@ import ( "github.com/ethereum/go-ethereum/common" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // This changeset generates a proposal to mint LINK when LINK is already owned by MCMS var MintLinkTokenMCMS = cldf.CreateChangeSet(MintLinkTokenMCMSLogic, MintLinkTokenMCMSPreconditions) type MintLinkTokenMCMSConfig struct { - Selector uint64 `json:"selector"` - ToAddress common.Address `json:"toAddress"` - Amount *big.Int `json:"amount"` - MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig"` + Selector uint64 `json:"selector"` + ToAddress common.Address `json:"toAddress"` + Amount *big.Int `json:"amount"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcmsConfig"` } func (cfg MintLinkTokenMCMSConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/cs_orchestrate_changesets.go b/deployment/ccip/changeset/cs_orchestrate_changesets.go index 48c58a1f058..0059488c286 100644 --- a/deployment/ccip/changeset/cs_orchestrate_changesets.go +++ b/deployment/ccip/changeset/cs_orchestrate_changesets.go @@ -6,13 +6,15 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" "github.com/smartcontractkit/mcms" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + tonstate "github.com/smartcontractkit/chainlink-ton/deployment/state" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // OrchestrateChangesets orchestrates the validation and application of multiple changesets. @@ -65,7 +67,7 @@ type MCMSAddressesForEVM struct { type OrchestrateChangesetsConfig struct { Description string MCMSOverridesForEVMChains map[uint64]MCMSAddressesForEVM - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig ChangeSets []WithConfig } @@ -146,13 +148,16 @@ func orchestrateChangesetsLogic(e cldf.Environment, c OrchestrateChangesetsConfi } // Aggregate all Timelock proposals into 1 proposal - proposal, err := proposalutils.AggregateProposalsV2( + if len(finalOutput.MCMSTimelockProposals) == 0 { + return finalOutput, nil + } + proposal, err := proposeutils.AggregateProposalsV2( e, - proposalutils.MCMSStates{ + proposeutils.MCMSStates{ MCMSEVMState: evmMCMSState, MCMSSolanaState: state.SolanaMCMSStateByChain(e), MCMSAptosState: state.AptosMCMSStateByChain(), - MCMSTONState: tonMCMSState, + MCMSTONState: tonMCMSStateForProposalutils(tonMCMSState), // TODO: update once ton state is moved to cld-changesets. }, finalOutput.MCMSTimelockProposals, c.Description, @@ -214,3 +219,33 @@ func MergeChangesetOutput(e cldf.Environment, dest *cldf.ChangesetOutput, src cl return nil } + +// tonMCMSStateForProposalutils adapts chainlink-ton MCMS chain state into the +// proposalutils type expected by cld-changesets (AggregateProposalsV2, etc.). +// Remove once TON on-chain state is consolidated on a single type (NONEVM-3181). +func tonMCMSStateForProposalutils(in map[uint64]tonstate.MCMSChainState) map[uint64]cldfproposalutils.TonMCMSChainState { + out := make(map[uint64]cldfproposalutils.TonMCMSChainState, len(in)) + for sel, st := range in { + out[sel] = tonMCMSChainStateForProposalutils(st) + } + return out +} + +func tonMCMSChainStateForProposalutils(in tonstate.MCMSChainState) cldfproposalutils.TonMCMSChainState { + out := cldfproposalutils.TonMCMSChainState{ + ByQualifier: make(map[string]*cldfproposalutils.TonMCMSSuiteState, len(in.ByQualifier)), + } + for q, suite := range in.ByQualifier { + if suite == nil { + out.ByQualifier[q] = nil + continue + } + out.ByQualifier[q] = &cldfproposalutils.TonMCMSSuiteState{ + Proposer: suite.Proposer, + Canceller: suite.Canceller, + Bypasser: suite.Bypasser, + Timelock: suite.Timelock, + } + } + return out +} diff --git a/deployment/ccip/changeset/cs_orchestrate_changesets_test.go b/deployment/ccip/changeset/cs_orchestrate_changesets_test.go index 1d6ae06793d..94c2de36ed6 100644 --- a/deployment/ccip/changeset/cs_orchestrate_changesets_test.go +++ b/deployment/ccip/changeset/cs_orchestrate_changesets_test.go @@ -28,7 +28,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var multiplyBy2 = operations.NewOperation( @@ -141,7 +140,7 @@ func TestOrchestrateChangesets_VerifyPreconditions(t *testing.T) { err = changeset.OrchestrateChangesets.VerifyPreconditions(*env, changeset.OrchestrateChangesetsConfig{ Description: "Test orchestrate changesets", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, ChangeSets: []changeset.WithConfig{ @@ -164,7 +163,7 @@ func TestOrchestrateChangesets_VerifyPreconditions(t *testing.T) { err = changeset.OrchestrateChangesets.VerifyPreconditions(*env, changeset.OrchestrateChangesetsConfig{ Description: "Test orchestrate changesets", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, ChangeSets: []changeset.WithConfig{ @@ -188,7 +187,7 @@ func TestOrchestrateChangesets_Apply(t *testing.T) { output, err := changeset.OrchestrateChangesets.Apply(rt.Environment(), changeset.OrchestrateChangesetsConfig{ Description: "Test orchestrate changesets", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, ChangeSets: []changeset.WithConfig{ @@ -211,7 +210,7 @@ func TestOrchestrateChangesets_Apply(t *testing.T) { output, err := changeset.OrchestrateChangesets.Apply(rt.Environment(), changeset.OrchestrateChangesetsConfig{ Description: "Test orchestrate changesets", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, ChangeSets: []changeset.WithConfig{ @@ -235,7 +234,7 @@ func TestOrchestrateChangesets_Apply(t *testing.T) { rt := newRuntimeWithMCMS(t) output, err := changeset.OrchestrateChangesets.Apply(rt.Environment(), changeset.OrchestrateChangesetsConfig{ Description: "Test orchestrate changesets", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, ChangeSets: []changeset.WithConfig{ @@ -275,7 +274,7 @@ func TestOrchestrateChangesetsConfig_MCMSGetsOverridden(t *testing.T) { } cfg := changeset.OrchestrateChangesetsConfig{ Description: "Test MCMS override", - MCMS: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMS: &cldfproposalutils.TimelockConfig{MinDelay: 0}, ChangeSets: nil, MCMSOverridesForEVMChains: map[uint64]changeset.MCMSAddressesForEVM{ chainSelector: override, diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_add_remote_chain.go b/deployment/ccip/changeset/solana_v0_1_0/cs_add_remote_chain.go index c71f3081bed..a9eef6c6423 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_add_remote_chain.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_add_remote_chain.go @@ -10,6 +10,7 @@ import ( "github.com/gagliardetto/solana-go" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -26,7 +27,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use these three changesets to add a remote chain to solana @@ -42,7 +42,7 @@ type AddRemoteChainToRouterConfig struct { UpdatesByChain map[uint64]*RouterConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type RouterConfig struct { @@ -292,7 +292,7 @@ type AddRemoteChainToFeeQuoterConfig struct { UpdatesByChain map[uint64]*FeeQuoterConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type FeeQuoterConfig struct { @@ -479,7 +479,7 @@ type AddRemoteChainToOffRampConfig struct { UpdatesByChain map[uint64]*OffRampConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type OffRampConfig struct { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_billing.go b/deployment/ccip/changeset/solana_v0_1_0/cs_billing.go index 50912f64380..c6c21474e4c 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_billing.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_billing.go @@ -8,6 +8,7 @@ import ( "github.com/gagliardetto/solana-go" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" @@ -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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to add a billing token to solana @@ -49,7 +49,7 @@ var _ cldf.ChangeSet[ModifyPriceUpdaterConfig] = ModifyPriceUpdater type BillingTokenConfig struct { ChainSelector uint64 Config solFeeQuoter.BillingTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // inferred from state IsUpdate bool @@ -89,7 +89,7 @@ func AddBillingToken( chain cldf_solana.Chain, chainState solanastateview.CCIPChainState, billingTokenConfig solFeeQuoter.BillingTokenConfig, - mcms *proposalutils.TimelockConfig, + mcms *cldfproposalutils.TimelockConfig, isUpdate bool, feeQuoterAddress solana.PublicKey, routerAddress solana.PublicKey, @@ -208,7 +208,7 @@ type TokenTransferFeeForRemoteChainConfig struct { // need to provide complete config, onchain does not do an upsert, it does a overwrite Config solFeeQuoter.TokenTransferFeeConfig TokenPubKey solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } const MinDestBytesOverhead = 32 @@ -314,7 +314,7 @@ type UpdatePricesConfig struct { TokenPriceUpdates []solFeeQuoter.TokenPriceUpdate GasPriceUpdates []solFeeQuoter.GasPriceUpdate PriceUpdater solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdatePricesConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -430,7 +430,7 @@ type ModifyPriceUpdaterConfig struct { ChainSelector uint64 PriceUpdater solana.PublicKey // price updater to add or remove PriceUpdaterAction PriceUpdaterAction // add or remove price updater - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type PriceUpdaterAction int @@ -536,10 +536,10 @@ func ModifyPriceUpdater(e cldf.Environment, cfg ModifyPriceUpdaterConfig) (cldf. type WithdrawBilledFundsConfig struct { ChainSelector uint64 - TransferAll bool // transfer all or specific amount - Amount uint64 // amount to transfer - TokenPubKey solana.PublicKey // billing token to transfer - MCMS *proposalutils.TimelockConfig // timelock config for mcms + TransferAll bool // transfer all or specific amount + Amount uint64 // amount to transfer + TokenPubKey solana.PublicKey // billing token to transfer + MCMS *cldfproposalutils.TimelockConfig // timelock config for mcms } func (cfg WithdrawBilledFundsConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -637,7 +637,7 @@ func WithdrawBilledFunds(e cldf.Environment, cfg WithdrawBilledFundsConfig) (cld type SetMaxFeeJuelsPerMsgConfig struct { ChainSelector uint64 MaxFeeJuelsPerMsg solBinary.Uint128 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetMaxFeeJuelsPerMsgConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_deploy_chain.go b/deployment/ccip/changeset/solana_v0_1_0/cs_deploy_chain.go index 37020ff2a7f..bc29998c42e 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_deploy_chain.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_deploy_chain.go @@ -28,7 +28,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/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" solBinary "github.com/gagliardetto/binary" @@ -110,7 +109,7 @@ type UpgradeConfig struct { SpillAddress solana.PublicKey UpgradeAuthority solana.PublicKey // MCMS config must be set for upgrades and offramp redeploys (to configure the fee quoter after redeploy) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpgradeConfig) Validate(e cldf.Environment, chainSelector uint64) error { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_disable_remote_chain.go b/deployment/ccip/changeset/solana_v0_1_0/cs_disable_remote_chain.go index dd047e5511d..6245d88c76e 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_disable_remote_chain.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_disable_remote_chain.go @@ -7,6 +7,7 @@ import ( "github.com/gagliardetto/solana-go" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -19,7 +20,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to disable a remote chain on solana @@ -28,7 +28,7 @@ var _ cldf.ChangeSet[DisableRemoteChainConfig] = DisableRemoteChain type DisableRemoteChainConfig struct { ChainSelector uint64 RemoteChains []uint64 // the remote chain selectors to disable - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg DisableRemoteChainConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_e2e.go b/deployment/ccip/changeset/solana_v0_1_0/cs_e2e.go index 8fe8fc755de..d878a81ebfc 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_e2e.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_e2e.go @@ -5,14 +5,14 @@ import ( "fmt" "github.com/gagliardetto/solana-go" - "github.com/smartcontractkit/mcms" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to @@ -31,7 +31,7 @@ type E2ETokenPoolConfig struct { SetPool []SetPoolConfig RemoteChainTokenPool []SetupTokenPoolForRemoteChainConfig // setup evm remote pools on solana ConfigureTokenPoolContractsChangesets []v1_5_1.ConfigureTokenPoolContractsConfig // setup evm/solana remote pools on evm - MCMS *proposalutils.TimelockConfig // set it to aggregate all the proposals + MCMS *cldfproposalutils.TimelockConfig // set it to aggregate all the proposals } func E2ETokenPool(e cldf.Environment, cfg E2ETokenPoolConfig) (cldf.ChangesetOutput, error) { @@ -111,15 +111,15 @@ func ProcessConfig[T any]( return nil } -func AggregateAndCleanup(e cldf.Environment, finalOutput *cldf.ChangesetOutput, abToRemove cldf.AddressBook, cfg *proposalutils.TimelockConfig, proposalDesc string) error { +func AggregateAndCleanup(e cldf.Environment, finalOutput *cldf.ChangesetOutput, abToRemove cldf.AddressBook, cfg *cldfproposalutils.TimelockConfig, proposalDesc string) error { allProposals := finalOutput.MCMSTimelockProposals if len(allProposals) > 0 { state, err := stateview.LoadOnchainState(e) if err != nil { return fmt.Errorf("failed to load onchain state: %w", err) } - proposal, err := proposalutils.AggregateProposalsV2( - e, proposalutils.MCMSStates{ + proposal, err := proposeutils.AggregateProposalsV2( + e, proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSSolanaState: state.SolanaMCMSStateByChain(e), }, @@ -170,7 +170,7 @@ type E2ETokenPoolConfigv2 struct { // this is also required if router is owned by timelock // so you cannot really have a case where router is owned by timelock but you want to // set deployer key as token admin - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func E2ETokenPoolv2(env cldf.Environment, cfg E2ETokenPoolConfigv2) (cldf.ChangesetOutput, error) { @@ -374,8 +374,8 @@ func E2ETokenPoolv2(env cldf.Environment, cfg E2ETokenPoolConfigv2) (cldf.Change if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) } - proposal, err := proposalutils.AggregateProposalsV2( - e, proposalutils.MCMSStates{ + proposal, err := proposeutils.AggregateProposalsV2( + e, proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSSolanaState: state.SolanaMCMSStateByChain(e), }, diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_idl.go b/deployment/ccip/changeset/solana_v0_1_0/cs_idl.go index bb9da0030a9..722407e6af4 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_idl.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_idl.go @@ -18,10 +18,10 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -40,17 +40,17 @@ const IdlIxTag uint64 = 0x0a69e9a778bcf440 // IDL type IDLConfig struct { ChainSelector uint64 - GitCommitSha string // this will be used to download the correct artifacts (idls) -> best if same as what was used to deploy the programs - Router bool // whether to upload the IDL for the router - FeeQuoter bool // whether to upload the IDL for the fee quoter - OffRamp bool // whether to upload the IDL for the off ramp - RMNRemote bool // whether to upload the IDL for the rmn remote - AccessController bool // whether to upload the IDL for the access controller - MCM bool // whether to upload the IDL for the mcm - Timelock bool // whether to upload the IDL for the timelock - BurnMintTokenPoolMetadata []string // whether to upload the IDL for the token pool (keyed my client identifier (metadata)) - LockReleaseTokenPoolMetadata []string // metadata for the lock release token pool (keyed my client identifier (metadata)) - MCMS *proposalutils.TimelockConfig // timelock config for mcms + GitCommitSha string // this will be used to download the correct artifacts (idls) -> best if same as what was used to deploy the programs + Router bool // whether to upload the IDL for the router + FeeQuoter bool // whether to upload the IDL for the fee quoter + OffRamp bool // whether to upload the IDL for the off ramp + RMNRemote bool // whether to upload the IDL for the rmn remote + AccessController bool // whether to upload the IDL for the access controller + MCM bool // whether to upload the IDL for the mcm + Timelock bool // whether to upload the IDL for the timelock + BurnMintTokenPoolMetadata []string // whether to upload the IDL for the token pool (keyed my client identifier (metadata)) + LockReleaseTokenPoolMetadata []string // metadata for the lock release token pool (keyed my client identifier (metadata)) + MCMS *cldfproposalutils.TimelockConfig // timelock config for mcms } // parse anchor version from running anchor --version diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_ops.go b/deployment/ccip/changeset/solana_v0_1_0/cs_ops.go index c7f2c9b0e11..5545ad53d7f 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_ops.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_ops.go @@ -11,6 +11,7 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -25,7 +26,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use these changesets to set the default code version @@ -62,7 +62,7 @@ type OffRampRefAddressesConfig struct { FeeQuoter solana.PublicKey AddressLookupTable solana.PublicKey RMNRemote solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg OffRampRefAddressesConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -177,11 +177,11 @@ func UpdateOffRampRefAddresses( type SetUpgradeAuthorityConfig struct { ChainSelector uint64 NewUpgradeAuthority solana.PublicKey - SetAfterInitialDeploy bool // set all of the programs after the initial deploy - SetOffRamp bool // offramp not upgraded in place, so may need to set separately - SetMCMSPrograms bool // these all deploy at once so just set them all - TransferKeys []solana.PublicKey // any keys not covered by the above e.g. partner programs - MCMS *proposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock + SetAfterInitialDeploy bool // set all of the programs after the initial deploy + SetOffRamp bool // offramp not upgraded in place, so may need to set separately + SetMCMSPrograms bool // these all deploy at once so just set them all + TransferKeys []solana.PublicKey // any keys not covered by the above e.g. partner programs + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock } func SetUpgradeAuthorityChangeset( @@ -305,7 +305,7 @@ func setUpgradeAuthority( type SetFeeAggregatorConfig struct { ChainSelector uint64 FeeAggregator string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetFeeAggregatorConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -507,7 +507,7 @@ func DeployReceiverForTest(e cldf.Environment, cfg DeployForTestConfig) (cldf.Ch type SetDefaultCodeVersionConfig struct { ChainSelector uint64 VersionEnum uint8 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetDefaultCodeVersionConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -670,7 +670,7 @@ func SetDefaultCodeVersion(e cldf.Environment, cfg SetDefaultCodeVersionConfig) type UpdateSvmChainSelectorConfig struct { OldChainSelector uint64 NewChainSelector uint64 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateSvmChainSelectorConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -797,7 +797,7 @@ func UpdateSvmChainSelector(e cldf.Environment, cfg UpdateSvmChainSelectorConfig type UpdateEnableManualExecutionAfterConfig struct { ChainSelector uint64 EnableManualExecution int64 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateEnableManualExecutionAfterConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -889,7 +889,7 @@ type ConfigureCCIPVersionConfig struct { ChainSelector uint64 DestChainSelector uint64 Operation CCIPVersionOp - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg ConfigureCCIPVersionConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -998,7 +998,7 @@ func ConfigureCCIPVersion(e cldf.Environment, cfg ConfigureCCIPVersionConfig) (c type RemoveOffRampConfig struct { ChainSelector uint64 OffRamp solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RemoveOffRampConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_set_ocr3.go b/deployment/ccip/changeset/solana_v0_1_0/cs_set_ocr3.go index 3bb13b019b5..fcf4e876755 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_set_ocr3.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_set_ocr3.go @@ -11,6 +11,7 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/mcms/sdk" @@ -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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -171,7 +171,7 @@ func SetOCR3ConfigSolana(e cldf.Environment, cfg v1_6.SetOCR3OffRampConfig) (cld } } if cfg.MCMS != nil { - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_token_admin_registry.go b/deployment/ccip/changeset/solana_v0_1_0/cs_token_admin_registry.go index e9f47ce41a6..3054449c11f 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_token_admin_registry.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_token_admin_registry.go @@ -8,6 +8,7 @@ import ( "github.com/gagliardetto/solana-go" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -19,7 +20,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use these changesets to register a token admin registry, transfer the admin role, and accept the admin role @@ -47,7 +47,7 @@ type RegisterTokenConfig struct { type RegisterTokenAdminRegistryConfig struct { ChainSelector uint64 RegisterTokenConfigs []RegisterTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RegisterTokenAdminRegistryConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -244,7 +244,7 @@ type TrasnferTokenAdminConfig struct { type TransferAdminRoleTokenAdminRegistryConfig struct { ChainSelector uint64 TransferTokenAdminConfigs []TrasnferTokenAdminConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg TransferAdminRoleTokenAdminRegistryConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -393,7 +393,7 @@ type AcceptAdminRoleTokenConfig struct { type AcceptAdminRoleTokenAdminRegistryConfig struct { ChainSelector uint64 AcceptAdminRoleTokenConfigs []AcceptAdminRoleTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg AcceptAdminRoleTokenAdminRegistryConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -534,7 +534,7 @@ type SetPoolConfig struct { ChainSelector uint64 SetPoolTokenConfigs []SetPoolTokenConfig WritableIndexes []uint8 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetPoolConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_token_pool.go b/deployment/ccip/changeset/solana_v0_1_0/cs_token_pool.go index 39142ec6d99..cd6d807e00e 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_token_pool.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_token_pool.go @@ -13,6 +13,7 @@ import ( solToken "github.com/gagliardetto/solana-go/programs/token" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -32,7 +33,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to add a token pool and lookup table @@ -113,7 +113,7 @@ type TokenPoolConfigWithMCM struct { PoolType cldf.ContractType TokenPubKey solana.PublicKey Metadata string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg TokenPoolConfigWithMCM) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -129,7 +129,7 @@ type NewMintTokenPoolConfig struct { PoolType cldf.ContractType TokenPubKey solana.PublicKey Metadata string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig NewMintAuthority solana.PublicKey // new mint authority to set for the token pool } @@ -386,7 +386,7 @@ type RemoteChainTokenPoolConfig struct { EVMRemoteConfigs map[uint64]EVMRemoteConfig } -func (cfg RemoteChainTokenPoolConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState, solChainSelector uint64, mcms *proposalutils.TimelockConfig) error { +func (cfg RemoteChainTokenPoolConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState, solChainSelector uint64, mcms *cldfproposalutils.TimelockConfig) error { chainState := state.SolChains[solChainSelector] if err := chainState.CommonValidation(e, solChainSelector, cfg.SolTokenPubKey); err != nil { return err @@ -415,7 +415,7 @@ func (cfg RemoteChainTokenPoolConfig) Validate(e cldf.Environment, state statevi type SetupTokenPoolForRemoteChainConfig struct { SolChainSelector uint64 RemoteTokenPoolConfigs []RemoteChainTokenPoolConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetupTokenPoolForRemoteChainConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -1056,7 +1056,7 @@ type ConfigureTokenPoolAllowListConfig struct { // input only the ones you want to add, onchain throws error when we pass already configured accounts Accounts []solana.PublicKey Enabled bool // enable or disable the allow list - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg ConfigureTokenPoolAllowListConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -1172,7 +1172,7 @@ type RemoveFromAllowListConfig struct { PoolType cldf.ContractType Metadata string // tag to identify which client/cll token pool executable to use Accounts []solana.PublicKey // accounts to remove from allow list - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RemoveFromAllowListConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -1285,7 +1285,7 @@ type LockReleaseLiquidityOpsConfig struct { SetCfg *SetLiquidityConfig LiquidityCfg *LiquidityConfig RebalancerCfg *RebalancerConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig Metadata string } @@ -1483,7 +1483,7 @@ type TokenPoolOpsCfg struct { Metadata string // tag to identify which client/cll token pool executable to use DeleteChainCfg *DeleteChainCfg // remove remote pool config corresponding to the set (solTokenPubKey, poolType, metadata, remoteChainSelector) SetRouterCfg *SetRouterCfg // set router address on token pool config pda - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type DeleteChainCfg struct { diff --git a/deployment/ccip/changeset/solana_v0_1_0/cs_verify_contracts.go b/deployment/ccip/changeset/solana_v0_1_0/cs_verify_contracts.go index c4666f56fba..0948df4c49b 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/cs_verify_contracts.go +++ b/deployment/ccip/changeset/solana_v0_1_0/cs_verify_contracts.go @@ -16,9 +16,9 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -49,7 +49,7 @@ type VerifyBuildConfig struct { // set to the same as upgrade authority of the program // timelock signer or deployer key UpgradeAuthority solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func runSolanaVerifyMCMS(e cldf.Environment, diff --git a/deployment/ccip/changeset/solana_v0_1_0/transfer_ccip_to_mcms_with_timelock.go b/deployment/ccip/changeset/solana_v0_1_0/transfer_ccip_to_mcms_with_timelock.go index a42ce4424f9..077759a6cfe 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/transfer_ccip_to_mcms_with_timelock.go +++ b/deployment/ccip/changeset/solana_v0_1_0/transfer_ccip_to_mcms_with_timelock.go @@ -5,21 +5,23 @@ import ( "fmt" "github.com/gagliardetto/solana-go" + chain_selectors "github.com/smartcontractkit/chain-selectors" solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" pdasol "github.com/smartcontractkit/cld-changesets/pkg/family/solana" "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/mcms/sdk" - - chain_selectors "github.com/smartcontractkit/chain-selectors" mcmsSolana "github.com/smartcontractkit/mcms/sdk/solana" mcmsTypes "github.com/smartcontractkit/mcms/types" solTokenUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" + + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -44,7 +46,7 @@ type TransferCCIPToMCMSWithTimelockSolanaConfig struct { CurrentOwner solana.PublicKey ProposedOwner solana.PublicKey // MCMSCfg is for the accept ownership proposal - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } // ValidateContracts checks if the required contracts are present on the chain @@ -297,7 +299,7 @@ func TransferCCIPToMCMSWithTimelockSolana( } } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, diff --git a/deployment/ccip/changeset/solana_v0_1_0/utils.go b/deployment/ccip/changeset/solana_v0_1_0/utils.go index 06bb2e6de90..8ceede38ac9 100644 --- a/deployment/ccip/changeset/solana_v0_1_0/utils.go +++ b/deployment/ccip/changeset/solana_v0_1_0/utils.go @@ -14,17 +14,18 @@ import ( mcmsTypes "github.com/smartcontractkit/mcms/types" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func ValidateMCMSConfigSolana( e cldf.Environment, - mcms *proposalutils.TimelockConfig, + mcms *cldfproposalutils.TimelockConfig, chain cldf_solana.Chain, chainState solanastateview.CCIPChainState, tokenAddress solana.PublicKey, @@ -92,14 +93,14 @@ func buildProposalCommon( proposers[chainSelector] = mcmsSolana.ContractAddress(mcmState.McmProgram, mcmsSolana.PDASeed(mcmState.ProposerMcmSeed)) inspectors[chainSelector] = mcmsSolana.NewInspector(chain.Client) - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, inspectors, batches, description, - proposalutils.TimelockConfig{MinDelay: minDelay}) + cldfproposalutils.TimelockConfig{MinDelay: minDelay}) if err != nil { return nil, fmt.Errorf("failed to build proposal: %w", err) } diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_add_remote_chain.go b/deployment/ccip/changeset/solana_v0_1_1/cs_add_remote_chain.go index 936bd4290cd..6803274fdcc 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_add_remote_chain.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_add_remote_chain.go @@ -20,12 +20,12 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use these three changesets to add a remote chain to solana @@ -41,7 +41,7 @@ type AddRemoteChainToRouterConfig struct { UpdatesByChain map[uint64]*RouterConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type RouterConfig struct { @@ -301,7 +301,7 @@ type AddRemoteChainToFeeQuoterConfig struct { UpdatesByChain map[uint64]*FeeQuoterConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type FeeQuoterConfig struct { @@ -496,7 +496,7 @@ type AddRemoteChainToOffRampConfig struct { UpdatesByChain map[uint64]*OffRampConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type OffRampConfig struct { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_billing.go b/deployment/ccip/changeset/solana_v0_1_1/cs_billing.go index bfd7f15e903..124e373a5ed 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_billing.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_billing.go @@ -24,10 +24,10 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to add a token transfer fee for a remote chain to solana (used for very specific cases) @@ -55,7 +55,7 @@ var _ cldf.ChangeSet[ModifyPriceUpdaterConfig] = ModifyPriceUpdater type BillingTokenConfig struct { ChainSelector uint64 Config solFeeQuoter.BillingTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // inferred from state IsUpdate bool @@ -95,7 +95,7 @@ func AddBillingToken( chain cldf_solana.Chain, chainState solanastateview.CCIPChainState, billingTokenConfig solFeeQuoter.BillingTokenConfig, - mcms *proposalutils.TimelockConfig, + mcms *cldfproposalutils.TimelockConfig, isUpdate bool, feeQuoterAddress solana.PublicKey, routerAddress solana.PublicKey, @@ -212,7 +212,7 @@ type TokenTransferFeeForRemoteChainConfig struct { ChainSelector uint64 RemoteChainConfigs map[uint64]solFeeQuoter.TokenTransferFeeConfig TokenPubKey solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } const MinDestBytesOverhead = 32 @@ -328,7 +328,7 @@ type UpdatePricesConfig struct { TokenPriceUpdates []solFeeQuoter.TokenPriceUpdate GasPriceUpdates []solFeeQuoter.GasPriceUpdate PriceUpdater solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdatePricesConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -444,7 +444,7 @@ type ModifyPriceUpdaterConfig struct { ChainSelector uint64 PriceUpdater solana.PublicKey // price updater to add or remove PriceUpdaterAction PriceUpdaterAction // add or remove price updater - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type PriceUpdaterAction int @@ -550,10 +550,10 @@ func ModifyPriceUpdater(e cldf.Environment, cfg ModifyPriceUpdaterConfig) (cldf. type WithdrawBilledFundsConfig struct { ChainSelector uint64 - TransferAll bool // transfer all or specific amount - Amount uint64 // amount to transfer - TokenPubKey solana.PublicKey // billing token to transfer - MCMS *proposalutils.TimelockConfig // timelock config for mcms + TransferAll bool // transfer all or specific amount + Amount uint64 // amount to transfer + TokenPubKey solana.PublicKey // billing token to transfer + MCMS *cldfproposalutils.TimelockConfig // timelock config for mcms } func (cfg WithdrawBilledFundsConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -651,7 +651,7 @@ func WithdrawBilledFunds(e cldf.Environment, cfg WithdrawBilledFundsConfig) (cld type SetMaxFeeJuelsPerMsgConfig struct { ChainSelector uint64 MaxFeeJuelsPerMsg solBinary.Uint128 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetMaxFeeJuelsPerMsgConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -748,7 +748,7 @@ type TokenTransferFeeForRemoteChainConfigV2 struct { InputsByChain map[uint64]map[uint64]TokenTransferFeeForRemoteChainConfigArgsV2 // Required MCMS config - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type TokenTransferFeeForRemoteChainConfigArgsV2 struct { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go index 88ad0d90a6c..7a5fb7b8df6 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_chain_contracts_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" cldfSolana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldfChain "github.com/smartcontractkit/chainlink-deployments-framework/chain" @@ -36,8 +37,6 @@ import ( solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) @@ -97,7 +96,7 @@ func doTestAddRemoteChain(t *testing.T, mcms bool) { require.NoError(t, err) evmChains := tenv.Env.BlockChains.ListChainSelectors(cldfChain.WithFamily(chainSelectors.FamilyEVM)) solChain := tenv.Env.BlockChains.ListChainSelectors(cldfChain.WithFamily(chainSelectors.FamilySolana))[0] - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcms { _, _ = testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChain, true, ccipChangesetSolana.CCIPContractsToTransfer{ @@ -105,7 +104,7 @@ func doTestAddRemoteChain(t *testing.T, mcms bool) { FeeQuoter: true, OffRamp: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } } @@ -343,7 +342,7 @@ func doTestBilling(t *testing.T, mcms bool) { bigNum, ok := new(big.Int).SetString("19816680000000000000", 10) require.True(t, ok) bigNum.FillBytes(value[:]) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig testPriceUpdater := e.BlockChains.SolanaChains()[solChain].DeployerKey.PublicKey() if mcms { _, _ = testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChain, true, @@ -352,7 +351,7 @@ func doTestBilling(t *testing.T, mcms bool) { Router: true, OffRamp: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } testPriceUpdater, err = ccipChangesetSolana.FetchTimelockSigner(e, solChain) @@ -668,7 +667,7 @@ func TestSetTokenAuthority(t *testing.T) { }) timelockSignerPDA, err := ccipChangesetSolana.FetchTimelockSigner(tenv.Env, solChain) require.NoError(t, err) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } newAdmin := tenv.Env.BlockChains.SolanaChains()[solChain].DeployerKey.PublicKey() @@ -760,13 +759,13 @@ func doTestTokenAdminRegistry(t *testing.T, mcms bool) { newAdminNonTimelock, _ := solana.NewRandomPrivateKey() newAdminRegistryAdmin := newAdminNonTimelock.PublicKey() - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcms { _, _ = testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChain, true, ccipChangesetSolana.CCIPContractsToTransfer{ Router: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } timelockSignerPDA, err := ccipChangesetSolana.FetchTimelockSigner(e, solChain) @@ -894,7 +893,7 @@ func doTestPoolLookupTable(t *testing.T, e cldf.Environment, mcms bool, tokenMet solChain := e.BlockChains.ListChainSelectors(cldfChain.WithFamily(chainSelectors.FamilySolana))[0] - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig newAdmin := e.BlockChains.SolanaChains()[solChain].DeployerKey.PublicKey() if mcms { _, _ = testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChain, true, @@ -903,7 +902,7 @@ func doTestPoolLookupTable(t *testing.T, e cldf.Environment, mcms bool, tokenMet FeeQuoter: true, OffRamp: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } timelockSignerPDA, err := ccipChangesetSolana.FetchTimelockSigner(e, solChain) @@ -1032,7 +1031,7 @@ func TestSetOcr3Active(t *testing.T) { HomeChainSel: homeChainSel, RemoteChainSels: solChainSelectors, CCIPHomeConfigType: globals.ConfigTypeActive, - MCMS: &proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMS: &cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, }, ), }) @@ -1060,7 +1059,7 @@ func TestSetOcr3Candidate(t *testing.T) { HomeChainSel: homeChainSel, RemoteChainSels: solChainSelectors, CCIPHomeConfigType: globals.ConfigTypeCandidate, - MCMS: &proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMS: &cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, }, ), }) diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain.go index cd1b30e2baf..7ec5a51d02d 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain.go @@ -27,7 +27,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/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" solBinary "github.com/gagliardetto/binary" @@ -112,7 +111,7 @@ type UpgradeConfig struct { // UpgradeAuthority must be set UpgradeAuthority solana.PublicKey // MCMS config must be set for upgrades and offramp redeploys (to configure the fee quoter after redeploy) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpgradeConfig) Validate(e cldf.Environment, chainSelector uint64) error { @@ -1253,7 +1252,7 @@ type CloseBuffersConfig struct { ChainSelector uint64 Buffers []string Programs []string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func CloseBuffersChangeset(e cldf.Environment, cfg CloseBuffersConfig) (cldf.ChangesetOutput, error) { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go index 3b95d3d6d4c..384412451f9 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_deploy_chain_test.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/quarantine" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" @@ -29,7 +30,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) @@ -244,7 +244,7 @@ func TestUpgrade(t *testing.T) { NewAccessControllerVersion: &deployment.Version1_1_0, NewTimelockVersion: &deployment.Version1_1_0, UpgradeAuthority: upgradeAuthority, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -277,7 +277,7 @@ func TestUpgrade(t *testing.T) { ccipChangesetSolana.SetFeeAggregatorConfig{ ChainSelector: solSelector, FeeAggregator: feeAggregatorPubKey2.String(), - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -300,7 +300,7 @@ func TestUpgrade(t *testing.T) { UpgradeConfig: ccipChangesetSolana.UpgradeConfig{ NewOffRampVersion: &deployment.Version1_1_0, UpgradeAuthority: upgradeAuthority, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -413,7 +413,7 @@ func TestClose(t *testing.T) { cldf.CreateLegacyChangeSet(ccipChangesetSolana.CloseBuffersChangeset), ccipChangesetSolana.CloseBuffersConfig{ ChainSelector: solSelector, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, Programs: []string{ @@ -482,7 +482,7 @@ func TestIDL(t *testing.T) { BurnMintTokenPoolMetadata: []string{ shared.CLLMetadata, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -518,7 +518,7 @@ func TestIDL(t *testing.T) { BurnMintTokenPoolMetadata: []string{ shared.CLLMetadata, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -573,7 +573,7 @@ func TestIDL(t *testing.T) { BurnMintTokenPoolMetadata: []string{ shared.CLLMetadata, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -589,7 +589,7 @@ func TestIDL(t *testing.T) { BurnMintTokenPoolMetadata: []string{ shared.CLLMetadata, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -606,7 +606,7 @@ func TestIDL(t *testing.T) { BurnMintTokenPoolMetadata: []string{ shared.CLLMetadata, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_disable_remote_chain.go b/deployment/ccip/changeset/solana_v0_1_1/cs_disable_remote_chain.go index 9d1a739f696..057db4c5595 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_disable_remote_chain.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_disable_remote_chain.go @@ -7,6 +7,7 @@ import ( "github.com/gagliardetto/solana-go" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -19,7 +20,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to disable a remote chain on solana @@ -28,7 +28,7 @@ var _ cldf.ChangeSet[DisableRemoteChainConfig] = DisableRemoteChain type DisableRemoteChainConfig struct { ChainSelector uint64 RemoteChains []uint64 // the remote chain selectors to disable - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg DisableRemoteChainConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_e2e.go b/deployment/ccip/changeset/solana_v0_1_1/cs_e2e.go index 983c0d3976f..0eba97a8a7e 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_e2e.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_e2e.go @@ -7,12 +7,14 @@ import ( "github.com/gagliardetto/solana-go" "github.com/smartcontractkit/mcms" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use this changeset to @@ -32,7 +34,7 @@ type E2ETokenPoolConfig struct { SetPool []SetPoolConfig RemoteChainTokenPool []SetupTokenPoolForRemoteChainConfig // setup evm remote pools on solana ConfigureTokenPoolContractsChangesets []v1_5_1.ConfigureTokenPoolContractsConfig // setup evm/solana remote pools on evm - MCMS *proposalutils.TimelockConfig // set it to aggregate all the proposals + MCMS *cldfproposalutils.TimelockConfig // set it to aggregate all the proposals } func E2ETokenPool(e cldf.Environment, cfg E2ETokenPoolConfig) (cldf.ChangesetOutput, error) { @@ -116,15 +118,15 @@ func ProcessConfig[T any]( return nil } -func AggregateAndCleanup(e cldf.Environment, finalOutput *cldf.ChangesetOutput, abToRemove cldf.AddressBook, cfg *proposalutils.TimelockConfig, proposalDesc string) error { +func AggregateAndCleanup(e cldf.Environment, finalOutput *cldf.ChangesetOutput, abToRemove cldf.AddressBook, cfg *cldfproposalutils.TimelockConfig, proposalDesc string) error { allProposals := finalOutput.MCMSTimelockProposals if len(allProposals) > 0 { state, err := stateview.LoadOnchainState(e) if err != nil { return fmt.Errorf("failed to load onchain state: %w", err) } - proposal, err := proposalutils.AggregateProposalsV2( - e, proposalutils.MCMSStates{ + proposal, err := proposeutils.AggregateProposalsV2( + e, proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSSolanaState: state.SolanaMCMSStateByChain(e), }, @@ -175,7 +177,7 @@ type E2ETokenPoolConfigv2 struct { // this is also required if router is owned by timelock // so you cannot really have a case where router is owned by timelock but you want to // set deployer key as token admin - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func E2ETokenPoolv2(env cldf.Environment, cfg E2ETokenPoolConfigv2) (cldf.ChangesetOutput, error) { @@ -402,8 +404,8 @@ func E2ETokenPoolv2(env cldf.Environment, cfg E2ETokenPoolConfigv2) (cldf.Change if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to load onchain state: %w", err) } - proposal, err := proposalutils.AggregateProposalsV2( - e, proposalutils.MCMSStates{ + proposal, err := proposeutils.AggregateProposalsV2( + e, proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSSolanaState: state.SolanaMCMSStateByChain(e), }, diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_idl.go b/deployment/ccip/changeset/solana_v0_1_1/cs_idl.go index 2767337f8a0..7599c16d85b 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_idl.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_idl.go @@ -17,11 +17,11 @@ import ( cldfsolana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -46,17 +46,17 @@ var _ cldf.ChangeSet[IDLConfig] = CloseIDLs type IDLConfig struct { ChainSelector uint64 - SolanaContractVersion string // Get the commit sha with VersionToShortCommitSHA[VersionSolanaV0_1_2] this will be used to download the correct artifacts (idls) -> best if same as what was used to deploy the programs - Router bool // whether to upload the IDL for the router - FeeQuoter bool // whether to upload the IDL for the fee quoter - OffRamp bool // whether to upload the IDL for the off ramp - RMNRemote bool // whether to upload the IDL for the rmn remote - AccessController bool // whether to upload the IDL for the access controller - MCM bool // whether to upload the IDL for the mcm - Timelock bool // whether to upload the IDL for the timelock - BurnMintTokenPoolMetadata []string // whether to upload the IDL for the token pool (keyed my client identifier (metadata)) - LockReleaseTokenPoolMetadata []string // metadata for the lock release token pool (keyed my client identifier (metadata)) - MCMS *proposalutils.TimelockConfig // timelock config for mcms + SolanaContractVersion string // Get the commit sha with VersionToShortCommitSHA[VersionSolanaV0_1_2] this will be used to download the correct artifacts (idls) -> best if same as what was used to deploy the programs + Router bool // whether to upload the IDL for the router + FeeQuoter bool // whether to upload the IDL for the fee quoter + OffRamp bool // whether to upload the IDL for the off ramp + RMNRemote bool // whether to upload the IDL for the rmn remote + AccessController bool // whether to upload the IDL for the access controller + MCM bool // whether to upload the IDL for the mcm + Timelock bool // whether to upload the IDL for the timelock + BurnMintTokenPoolMetadata []string // whether to upload the IDL for the token pool (keyed my client identifier (metadata)) + LockReleaseTokenPoolMetadata []string // metadata for the lock release token pool (keyed my client identifier (metadata)) + MCMS *cldfproposalutils.TimelockConfig // timelock config for mcms CCTPTokenPool bool IdlSpace uint64 } diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_ops.go b/deployment/ccip/changeset/solana_v0_1_1/cs_ops.go index 05c8c06690f..9178b9d6900 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_ops.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_ops.go @@ -10,6 +10,7 @@ import ( solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use these changesets to set the default code version @@ -66,7 +66,7 @@ type OffRampRefAddressesConfig struct { FeeQuoter solana.PublicKey AddressLookupTable solana.PublicKey RMNRemote solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg OffRampRefAddressesConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -181,11 +181,11 @@ func UpdateOffRampRefAddresses( type SetUpgradeAuthorityConfig struct { ChainSelector uint64 NewUpgradeAuthority solana.PublicKey - SetAfterInitialDeploy bool // set all of the programs after the initial deploy - SetOffRamp bool // offramp not upgraded in place, so may need to set separately - SetMCMSPrograms bool // these all deploy at once so just set them all - TransferKeys []solana.PublicKey // any keys not covered by the above e.g. partner programs - MCMS *proposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock + SetAfterInitialDeploy bool // set all of the programs after the initial deploy + SetOffRamp bool // offramp not upgraded in place, so may need to set separately + SetMCMSPrograms bool // these all deploy at once so just set them all + TransferKeys []solana.PublicKey // any keys not covered by the above e.g. partner programs + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock } func SetUpgradeAuthorityChangeset( @@ -302,7 +302,7 @@ func SetUpgradeAuthority(e *cldf.Environment, programID solana.PublicKey, curren type SetFeeAggregatorConfig struct { ChainSelector uint64 FeeAggregator string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetFeeAggregatorConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -561,7 +561,7 @@ func SetLinkToken(e cldf.Environment, cfg SetLinkTokenConfig) (cldf.ChangesetOut type SetDefaultCodeVersionConfig struct { ChainSelector uint64 VersionEnum uint8 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetDefaultCodeVersionConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -724,7 +724,7 @@ func SetDefaultCodeVersion(e cldf.Environment, cfg SetDefaultCodeVersionConfig) type UpdateSvmChainSelectorConfig struct { OldChainSelector uint64 NewChainSelector uint64 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateSvmChainSelectorConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -851,7 +851,7 @@ func UpdateSvmChainSelector(e cldf.Environment, cfg UpdateSvmChainSelectorConfig type UpdateEnableManualExecutionAfterConfig struct { ChainSelector uint64 EnableManualExecution int64 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateEnableManualExecutionAfterConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -943,7 +943,7 @@ type ConfigureCCIPVersionConfig struct { ChainSelector uint64 DestChainSelector uint64 Operation CCIPVersionOp - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg ConfigureCCIPVersionConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -1054,7 +1054,7 @@ func ConfigureCCIPVersion(e cldf.Environment, cfg ConfigureCCIPVersionConfig) (c type RemoveOffRampConfig struct { ChainSelector uint64 OffRamp solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RemoveOffRampConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go index a263184c37a..b7a6c8b5d28 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_ops_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/require" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) @@ -35,7 +35,7 @@ func doTestGenericOps(t *testing.T, mcms bool) { solChain := tenv.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilySolana))[0] e := tenv.Env - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcms { _, _ = testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChain, true, ccipChangesetSolana.CCIPContractsToTransfer{ @@ -43,7 +43,7 @@ func doTestGenericOps(t *testing.T, mcms bool) { FeeQuoter: true, OffRamp: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } } diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_set_ocr3.go b/deployment/ccip/changeset/solana_v0_1_1/cs_set_ocr3.go index 2e42054ceff..e6e1493396a 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_set_ocr3.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_set_ocr3.go @@ -9,6 +9,8 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" @@ -24,7 +26,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -169,7 +170,7 @@ func SetOCR3ConfigSolana(e cldf.Environment, cfg v1_6.SetOCR3OffRampConfig) (cld } } if cfg.MCMS != nil { - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token.go b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token.go index 3bed2e60c21..fc979032b79 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_solana_token.go @@ -15,11 +15,11 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" solCommonUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/common" @@ -312,7 +312,7 @@ type TokenAuthorityConfig struct { type SetTokenAuthorityConfig struct { ChainSelector uint64 TokenAuthorityConfigs []TokenAuthorityConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func SetTokenAuthority(e cldf.Environment, cfg SetTokenAuthorityConfig) (cldf.ChangesetOutput, error) { @@ -422,7 +422,7 @@ type TokenMetadata struct { type UploadTokenMetadataConfig struct { ChainSelector uint64 TokenMetadata []TokenMetadata - MCMS *proposalutils.TimelockConfig // timelock config for mcms + MCMS *cldfproposalutils.TimelockConfig // timelock config for mcms } func (cfg UploadTokenMetadataConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_token_admin_registry.go b/deployment/ccip/changeset/solana_v0_1_1/cs_token_admin_registry.go index 5bb1a09d820..acd8f96584e 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_token_admin_registry.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_token_admin_registry.go @@ -8,6 +8,7 @@ import ( "github.com/gagliardetto/solana-go" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" @@ -19,7 +20,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // use these changesets to register a token admin registry, transfer the admin role, and accept the admin role @@ -51,7 +51,7 @@ type RegisterTokenConfig struct { type RegisterTokenAdminRegistryConfig struct { ChainSelector uint64 RegisterTokenConfigs []RegisterTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RegisterTokenAdminRegistryConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -265,7 +265,7 @@ type TransferTokenAdminConfig struct { type TransferAdminRoleTokenAdminRegistryConfig struct { ChainSelector uint64 TransferTokenAdminConfigs []TransferTokenAdminConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg TransferAdminRoleTokenAdminRegistryConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -414,7 +414,7 @@ type AcceptAdminRoleTokenConfig struct { type AcceptAdminRoleTokenAdminRegistryConfig struct { ChainSelector uint64 AcceptAdminRoleTokenConfigs []AcceptAdminRoleTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg AcceptAdminRoleTokenAdminRegistryConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -617,7 +617,7 @@ type SetPoolTokenConfig struct { type SetPoolConfig struct { ChainSelector uint64 SetPoolTokenConfigs []SetPoolTokenConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetPoolConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -767,7 +767,7 @@ func SetPool(e cldf.Environment, cfg SetPoolConfig) (cldf.ChangesetOutput, error type RemovePoolConfig struct { ChainSelector uint64 TokenPubKeys []solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RemovePoolConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -894,7 +894,7 @@ type SetTokenPoolSupportAutoDerivationConfig struct { SolChainSelector uint64 TokenPubKey solana.PublicKey SupportsAutoDerivation bool - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig SkipRegistryCheck bool // set to true when you want to register, set pool, and set auto derivation flag in the same proposal } diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool.go b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool.go index 566da5d3d5c..165febef732 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool.go @@ -17,6 +17,7 @@ import ( solToken "github.com/gagliardetto/solana-go/programs/token" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/erc20" "github.com/smartcontractkit/mcms" @@ -39,7 +40,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -125,13 +125,13 @@ type TokenPoolConfig struct { type AddTokenPoolAndLookupTableConfig struct { ChainSelector uint64 TokenPoolConfigs []TokenPoolConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type TokenPoolConfigWithMCM struct { ChainSelector uint64 TokenPoolConfigs []TokenPoolConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg TokenPoolConfigWithMCM) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -168,7 +168,7 @@ type NewMintTokenPoolConfig struct { PoolType cldf.ContractType TokenPubKey solana.PublicKey Metadata string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig NewMintAuthority solana.PublicKey // new mint authority to set for the token pool OldMintAuthority solana.PublicKey // Only require when the current mint authority is a multisig } @@ -510,7 +510,7 @@ type RemoteChainTokenPoolConfig struct { EVMRemoteConfigs map[uint64]EVMRemoteConfig } -func (cfg RemoteChainTokenPoolConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState, solChainSelector uint64, mcms *proposalutils.TimelockConfig) error { +func (cfg RemoteChainTokenPoolConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState, solChainSelector uint64, mcms *cldfproposalutils.TimelockConfig) error { chainState := state.SolChains[solChainSelector] if err := chainState.CommonValidation(e, solChainSelector, cfg.SolTokenPubKey); err != nil { return err @@ -539,7 +539,7 @@ func (cfg RemoteChainTokenPoolConfig) Validate(e cldf.Environment, state statevi type SetupTokenPoolForRemoteChainConfig struct { SolChainSelector uint64 RemoteTokenPoolConfigs []RemoteChainTokenPoolConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetupTokenPoolForRemoteChainConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -938,7 +938,7 @@ type TransferMintAuthorityToSignerPDAConfig struct { TokenMint solana.PublicKey PoolType *cldf.ContractType Metadata string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg TransferMintAuthorityToSignerPDAConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -2061,7 +2061,7 @@ type ConfigureTokenPoolAllowListConfig struct { // input only the ones you want to add, onchain throws error when we pass already configured accounts Accounts []solana.PublicKey Enabled bool // enable or disable the allow list - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg ConfigureTokenPoolAllowListConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -2194,7 +2194,7 @@ type RemoveFromAllowListConfig struct { PoolType cldf.ContractType Metadata string // tag to identify which client/cll token pool executable to use Accounts []solana.PublicKey // accounts to remove from allow list - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg RemoveFromAllowListConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { @@ -2323,7 +2323,7 @@ type LockReleaseLiquidityOpsConfig struct { SetCfg *SetLiquidityConfig LiquidityCfg *LiquidityConfig RebalancerCfg *RebalancerConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig Metadata string } @@ -2520,7 +2520,7 @@ type TokenPoolOpsCfg struct { Metadata string // tag to identify which client/cll token pool executable to use DeleteChainCfg *DeleteChainCfg // remove remote pool config corresponding to the set (solTokenPubKey, poolType, metadata, remoteChainSelector) SetRouterCfg *SetRouterCfg // set router address on token pool config pda - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type DeleteChainCfg struct { @@ -2827,7 +2827,7 @@ type SyncDomainConfig struct { ChainSelector uint64 // cctpChainConfigMap maps chain selectors to their associated CctpChainConfig CCTPChainConfigMap map[uint64]CctpChainConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type CctpChainConfig struct { @@ -3128,7 +3128,7 @@ type RateLimitAdminConfig struct { type SetRateLimitAdminConfig struct { SolChainSelector uint64 RateLimitAdminConfigs []RateLimitAdminConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg SetRateLimitAdminConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go index 9f0fa465a1e..f937e65283d 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_token_pool_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" solTestUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/contracts/tests/testutils" solBaseTokenPool "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/base_token_pool" @@ -37,7 +38,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -125,7 +125,7 @@ func doTestTokenPool(t *testing.T, e cldf.Environment, config TokenPoolTestConfi deployerKey, ) rebalancer := deployerKey - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcms { timelockSignerPDA, _ := testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChain, true, ccipChangesetSolana.CCIPContractsToTransfer{ @@ -133,7 +133,7 @@ func doTestTokenPool(t *testing.T, e cldf.Environment, config TokenPoolTestConfi FeeQuoter: true, OffRamp: true, }) - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } rebalancer = timelockSignerPDA @@ -484,7 +484,7 @@ func doTestTokenPool(t *testing.T, e cldf.Environment, config TokenPoolTestConfi commonchangeset.Configure( cldf.CreateLegacyChangeSet(ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolana), ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, CurrentOwner: timelockSignerPDA, ProposedOwner: deployerKey, ContractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ @@ -503,7 +503,7 @@ func doTestTokenPool(t *testing.T, e cldf.Environment, config TokenPoolTestConfi commonchangeset.Configure( cldf.CreateLegacyChangeSet(ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolana), ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, CurrentOwner: timelockSignerPDA, ProposedOwner: deployerKey, ContractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ @@ -522,7 +522,7 @@ func doTestTokenPool(t *testing.T, e cldf.Environment, config TokenPoolTestConfi commonchangeset.Configure( cldf.CreateLegacyChangeSet(ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolana), ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, CurrentOwner: timelockSignerPDA, ProposedOwner: deployerKey, ContractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ @@ -563,7 +563,7 @@ func doTestTokenPool(t *testing.T, e cldf.Environment, config TokenPoolTestConfi ChainSelector: solChain, NewUpgradeAuthority: e.BlockChains.SolanaChains()[solChain].DeployerKey.PublicKey(), TransferKeys: transferKeys, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, }, @@ -692,7 +692,7 @@ func TestAddTokenPoolE2EWithMcms(t *testing.T) { FeeQuoter: true, OffRamp: true, }) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } _, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ diff --git a/deployment/ccip/changeset/solana_v0_1_1/cs_verify_contracts.go b/deployment/ccip/changeset/solana_v0_1_1/cs_verify_contracts.go index 9c82ea1aa92..3723e198e6c 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/cs_verify_contracts.go +++ b/deployment/ccip/changeset/solana_v0_1_1/cs_verify_contracts.go @@ -13,12 +13,12 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" mcmsTypes "github.com/smartcontractkit/mcms/types" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -50,7 +50,7 @@ type VerifyBuildConfig struct { // set to the same as upgrade authority of the program // timelock signer or deployer key UpgradeAuthority solana.PublicKey - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func runSolanaVerifyMCMS(e cldf.Environment, diff --git a/deployment/ccip/changeset/solana_v0_1_1/self_serve.go b/deployment/ccip/changeset/solana_v0_1_1/self_serve.go index 6c68f724c29..7557454d239 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/self_serve.go +++ b/deployment/ccip/changeset/solana_v0_1_1/self_serve.go @@ -17,11 +17,11 @@ import ( solTokenUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" cldfsolana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -38,7 +38,7 @@ type OnboardTokenPoolConfig struct { type OnboardTokenPoolsForSelfServeConfig struct { ChainSelector uint64 RegisterTokenConfigs []OnboardTokenPoolConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg OnboardTokenPoolsForSelfServeConfig) Validate(e cldf.Environment, chainState solanastateview.CCIPChainState) error { diff --git a/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go b/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go index 859d45fdbcd..7569e9409c3 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/self_serve_test.go @@ -14,6 +14,7 @@ import ( lockrelease "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/lockrelease_token_pool" "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" cldfsolana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" @@ -30,8 +31,6 @@ import ( ccipChangesetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_1" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" ) @@ -67,7 +66,7 @@ func doTestOnboardTokenPoolForSelfServe(t *testing.T, isMCMsOwner bool) { require.NoError(t, err) lockAndReleaseTokenPoolProgramID := state.SolChains[solChainSelector].LockReleaseTokenPools[shared.CLLMetadata] burnAndMintTokenPoolProgramID := state.SolChains[solChainSelector].BurnMintTokenPools[shared.CLLMetadata] - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if isMCMsOwner { timelockSignerPDA, _ := testhelpers.TransferOwnershipSolanaV0_1_1(t, &e, solChainSelector, true, ccipChangesetSolana.CCIPContractsToTransfer{ @@ -93,7 +92,7 @@ func doTestOnboardTokenPoolForSelfServe(t *testing.T, isMCMsOwner bool) { }) require.NoError(t, err) tenv.Env = e - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, } progDataAddr, err := solutils.GetProgramDataAddress(e.BlockChains.SolanaChains()[solChainSelector].Client, lockAndReleaseTokenPoolProgramID) diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock.go index f31cd49bdc6..4a6d69d525c 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock.go +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock.go @@ -5,21 +5,23 @@ import ( "fmt" "github.com/gagliardetto/solana-go" + chain_selectors "github.com/smartcontractkit/chain-selectors" solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" pdasol "github.com/smartcontractkit/cld-changesets/pkg/family/solana" "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/mcms/sdk" - - chain_selectors "github.com/smartcontractkit/chain-selectors" mcmsSolana "github.com/smartcontractkit/mcms/sdk/solana" mcmsTypes "github.com/smartcontractkit/mcms/types" solTokenUtil "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" + + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -45,7 +47,7 @@ type TransferCCIPToMCMSWithTimelockSolanaConfig struct { CurrentOwner solana.PublicKey ProposedOwner solana.PublicKey // MCMSCfg is for the accept ownership proposal - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } // ValidateContracts checks if the required contracts are present on the chain @@ -320,7 +322,7 @@ func TransferCCIPToMCMSWithTimelockSolana( } } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, diff --git a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go index 9534057c70d..4d130c9344c 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go +++ b/deployment/ccip/changeset/solana_v0_1_1/transfer_ccip_to_mcms_with_timelock_test.go @@ -43,7 +43,6 @@ import ( solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) @@ -178,7 +177,7 @@ func TestValidate(t *testing.T) { t.Run(tt.name, func(t *testing.T) { cfg := ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ ContractsByChain: tt.contractsByChain, - MCMSCfg: proposalutils.TimelockConfig{ + MCMSCfg: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, } @@ -474,7 +473,7 @@ func TestTransferCCIPFromMCMSWithTimelockSolana(t *testing.T) { commonchangeset.Configure( cldf.CreateLegacyChangeSet(ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolana), ccipChangesetSolana.TransferCCIPToMCMSWithTimelockSolanaConfig{ - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, CurrentOwner: timelockSignerPDA, ProposedOwner: solChain.DeployerKey.PublicKey(), ContractsByChain: map[uint64]ccipChangesetSolana.CCIPContractsToTransfer{ diff --git a/deployment/ccip/changeset/solana_v0_1_1/utils.go b/deployment/ccip/changeset/solana_v0_1_1/utils.go index 3a41d824099..86f2b8f0484 100644 --- a/deployment/ccip/changeset/solana_v0_1_1/utils.go +++ b/deployment/ccip/changeset/solana_v0_1_1/utils.go @@ -16,12 +16,13 @@ import ( mcmsTypes "github.com/smartcontractkit/mcms/types" cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type CCIPSolanaContractVersion string @@ -38,7 +39,7 @@ var ContractVersionShortSha = map[CCIPSolanaContractVersion]string{ func ValidateMCMSConfigSolana( e cldf.Environment, - mcms *proposalutils.TimelockConfig, + mcms *cldfproposalutils.TimelockConfig, chain cldf_solana.Chain, chainState solanastateview.CCIPChainState, tokenAddress solana.PublicKey, @@ -115,14 +116,14 @@ func buildProposalCommon( proposers[chainSelector] = mcmsSolana.ContractAddress(mcmState.McmProgram, mcmsSolana.PDASeed(mcmState.ProposerMcmSeed)) inspectors[chainSelector] = mcmsSolana.NewInspector(chain.Client) - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, inspectors, batches, description, - proposalutils.TimelockConfig{MinDelay: minDelay}) + cldfproposalutils.TimelockConfig{MinDelay: minDelay}) if err != nil { return nil, fmt.Errorf("failed to build proposal: %w", err) } @@ -241,7 +242,7 @@ func GetTokenProgramID(programName cldf.ContractType) (solana.PublicKey, error) return programID, nil } -func generateProposalIfMCMS(e cldf.Environment, chainSelector uint64, mcmsCfg *proposalutils.TimelockConfig, mcmsTxs []mcmsTypes.Transaction) (cldf.ChangesetOutput, error) { +func generateProposalIfMCMS(e cldf.Environment, chainSelector uint64, mcmsCfg *cldfproposalutils.TimelockConfig, mcmsTxs []mcmsTypes.Transaction) (cldf.ChangesetOutput, error) { if len(mcmsTxs) > 0 { if mcmsCfg == nil { return cldf.ChangesetOutput{}, errors.New("MCMS txn detected but no MCMS config provided. Please re-run with mcms specified") @@ -262,7 +263,7 @@ func generateProposalIfMCMS(e cldf.Environment, chainSelector uint64, mcmsCfg *p type ExecuteConfig struct { ChainSelector uint64 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig Chain cldf_solana.Chain } diff --git a/deployment/ccip/changeset/testhelpers/test_environment.go b/deployment/ccip/changeset/testhelpers/test_environment.go index aa4bed54234..3ee31b0b974 100644 --- a/deployment/ccip/changeset/testhelpers/test_environment.go +++ b/deployment/ccip/changeset/testhelpers/test_environment.go @@ -1301,9 +1301,9 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn } // Apply second set of changesets to configure the CCIP contracts. - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -1395,7 +1395,7 @@ func AddCCIPContractsToEnvironment(t *testing.T, allChains []uint64, tEnv TestEn HomeChainSel: e.HomeChainSel, RemoteChainSels: aptosChains, CCIPHomeConfigType: globals.ConfigTypeActive, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, diff --git a/deployment/ccip/changeset/testhelpers/test_helpers_aptos.go b/deployment/ccip/changeset/testhelpers/test_helpers_aptos.go index f84a3139ad5..5d4f1ee636c 100644 --- a/deployment/ccip/changeset/testhelpers/test_helpers_aptos.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers_aptos.go @@ -16,6 +16,7 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" aptosBind "github.com/smartcontractkit/chainlink-aptos/bindings/bind" @@ -48,7 +49,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" aptosstate "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/aptos" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -88,7 +88,7 @@ func DeployChainContractsToAptosCS(t *testing.T, e DeployedEnv, chainSelector ui TimelockMinDelay: big.NewInt(1), }, }, - MCMSTimelockConfigPerChain: map[uint64]proposalutils.TimelockConfig{ + MCMSTimelockConfigPerChain: map[uint64]cldfproposalutils.TimelockConfig{ chainSelector: { MinDelay: time.Duration(1) * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, @@ -312,7 +312,7 @@ func DeployTransferableTokenAptos( Decimals: 8, }, TokenMint: mintAmount, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, // TODO }, }, @@ -398,7 +398,7 @@ func DeployRegulatedTransferableTokenAptos( Decimals: 8, }, TokenMint: mintAmount, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, @@ -452,7 +452,7 @@ func DeployRegulatedTransferableTokenAptos( }, }, }, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, @@ -664,7 +664,7 @@ func DeployBnMTokenAptos( TokenPoolType: shared.BurnMintTokenPool, }, }, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, @@ -702,7 +702,7 @@ func DeployBnMTokenAptos( }, }, }, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, @@ -917,7 +917,7 @@ func DeployLnRTokenAptos( TokenPoolType: shared.LockReleaseTokenPool, }, }, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, @@ -955,7 +955,7 @@ func DeployLnRTokenAptos( }, }, }, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, diff --git a/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_0.go b/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_0.go index 3aaf76896b9..0e664d77b66 100644 --- a/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_0.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_0.go @@ -34,7 +34,7 @@ import ( mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" cldlegacysolmcms "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" - cldcommonchangesets "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + cldcommonchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil/changeset" pdasol "github.com/smartcontractkit/cld-changesets/pkg/family/solana" aptos_fee_quoter "github.com/smartcontractkit/chainlink-aptos/bindings/ccip/fee_quoter" @@ -86,7 +86,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/devenv" "github.com/smartcontractkit/chainlink/deployment/internal/jdtestutils" @@ -1266,7 +1265,7 @@ func AddLaneAptosChangesets(t *testing.T, srcChainSelector, destChainSelector ui commoncs.Configure( aptoscs.AddAptosLanes{}, config.UpdateAptosLanesConfig{ - AptosMCMSConfig: &proposalutils.TimelockConfig{ + AptosMCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, OverrideRoot: false, @@ -2436,7 +2435,7 @@ func TransferOwnershipSolanaV0_1_0( commoncs.Configure( cldf.CreateLegacyChangeSet(ccipChangeSetSolanaV0_1_0.TransferCCIPToMCMSWithTimelockSolana), ccipChangeSetSolanaV0_1_0.TransferCCIPToMCMSWithTimelockSolanaConfig{ - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, ContractsByChain: map[uint64]ccipChangeSetSolanaV0_1_0.CCIPContractsToTransfer{ solSelector: contractsToTransfer, }, @@ -2452,7 +2451,7 @@ func GenTestTransferOwnershipConfig( chains []uint64, state stateview.CCIPOnChainState, withTestRouterTransfer bool, -) commoncs.TransferToMCMSWithTimelockConfig { +) mcmschangesets.TransferToMCMSWithTimelockConfig { var ( contracts = make(map[uint64][]common.Address) ) @@ -2481,7 +2480,7 @@ func GenTestTransferOwnershipConfig( state.MustGetEVMChainState(e.HomeChainSel).RMNHome.Address(), ) - return commoncs.TransferToMCMSWithTimelockConfig{ + return mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contracts, } } @@ -2524,7 +2523,7 @@ func TransferToTimelock( // Transfer ownership to timelock so that we can promote the zero digest later down the line. _, err := commoncs.Apply(t, tenv.Env, commoncs.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), GenTestTransferOwnershipConfig(tenv, chains, state, withTestRouterTransfer), ), ) diff --git a/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go b/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go index a691b992fe0..0e0b89bc04c 100644 --- a/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go +++ b/deployment/ccip/changeset/testhelpers/test_helpers_solana_v0_1_1.go @@ -49,7 +49,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" ) @@ -100,7 +99,7 @@ func TransferOwnershipSolanaV0_1_1( commoncs.Configure( cldf.CreateLegacyChangeSet(ccipChangeSetSolanaV0_1_1.TransferCCIPToMCMSWithTimelockSolana), ccipChangeSetSolanaV0_1_1.TransferCCIPToMCMSWithTimelockSolanaConfig{ - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, ContractsByChain: map[uint64]ccipChangeSetSolanaV0_1_1.CCIPContractsToTransfer{ solSelector: contractsToTransfer, }, diff --git a/deployment/ccip/changeset/testhelpers/test_token_helpers.go b/deployment/ccip/changeset/testhelpers/test_token_helpers.go index 0cc6a490b0f..f257c378039 100644 --- a/deployment/ccip/changeset/testhelpers/test_token_helpers.go +++ b/deployment/ccip/changeset/testhelpers/test_token_helpers.go @@ -33,7 +33,6 @@ import ( token_governor "github.com/smartcontractkit/chainlink/deployment/ccip/shared/bindings/token_governor" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) const ( @@ -138,9 +137,9 @@ func SetupTwoChainEnvironmentWithTokens( if transferToTimelock { // Transfer ownership of token admin registry to the Timelock err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), commoncs.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: timelockOwnedContractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }), @@ -215,10 +214,10 @@ func DeployTestTokenPools( // Transfer ownership of token admin registry to the Timelock e, err = commoncs.Apply(t, e, commoncs.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: timelockOwnedContractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, diff --git a/deployment/ccip/changeset/v1_5/cs_rmn.go b/deployment/ccip/changeset/v1_5/cs_rmn.go index 12e000ef4d8..add5c88c91f 100644 --- a/deployment/ccip/changeset/v1_5/cs_rmn.go +++ b/deployment/ccip/changeset/v1_5/cs_rmn.go @@ -11,6 +11,7 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" mcmslib "github.com/smartcontractkit/mcms" mcmssdk "github.com/smartcontractkit/mcms/sdk" @@ -23,7 +24,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var _ cldf.ChangeSet[PermaBlessCommitStoreConfig] = PermaBlessCommitStoreChangeset @@ -65,7 +65,7 @@ type PermaBlessCommitStoreConfigPerDest struct { type PermaBlessCommitStoreConfig struct { Configs map[uint64]PermaBlessCommitStoreConfigPerDest - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (c PermaBlessCommitStoreConfig) Validate(env cldf.Environment) error { @@ -177,7 +177,7 @@ func PermaBlessCommitStoreChangeset(env cldf.Environment, c PermaBlessCommitStor if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to build mcm addresses per chain: %w", err) } - timelockProposal, err := proposalutils.BuildProposalFromBatchesV2( + timelockProposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocks, mcmsContractByChain, diff --git a/deployment/ccip/changeset/v1_5_1/commonconfig.go b/deployment/ccip/changeset/v1_5_1/commonconfig.go index 4e62ad4c511..3f2469126cb 100644 --- a/deployment/ccip/changeset/v1_5_1/commonconfig.go +++ b/deployment/ccip/changeset/v1_5_1/commonconfig.go @@ -14,6 +14,7 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" @@ -21,13 +22,12 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // TokenAdminRegistryChangesetConfig defines a config for all token admin registry actions. type TokenAdminRegistryChangesetConfig struct { // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // Pools defines the pools corresponding to the tokens we want to accept admin role for. Pools map[uint64]map[shared.TokenSymbol]TokenPoolInfo // SkipOwnershipValidation indicates whether or not to skip admin ownership validation of token in the registry. diff --git a/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go index ffcec8a6de7..3fd5cb9e622 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_accept_admin_role_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -14,7 +15,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -31,7 +31,7 @@ func TestAcceptAdminRoleChangeset_Validations(t *testing.T) { }, }, true) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, } @@ -120,7 +120,7 @@ func TestAcceptAdminRoleChangeset_Validations(t *testing.T) { } func TestAcceptAdminRoleChangeset_Execution(t *testing.T) { - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Accept admin role with MCMS" if mcmsConfig == nil { msg = "Accept admin role without MCMS" diff --git a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e.go b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e.go index d4376092847..622f3cdb5f9 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e.go +++ b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e.go @@ -8,6 +8,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/smartcontractkit/mcms" "golang.org/x/exp/maps" @@ -21,16 +22,16 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink/deployment" ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // AddTokensE2E is a changeset that deploys and configures token pools for multiple tokens across multiple chains in a single changeset. @@ -98,7 +99,7 @@ type AddTokenE2EConfig struct { // newConfigurePoolAndTokenAdminRegConfig populated internal fields in AddTokenE2EConfig. // It creates the configuration for deploying and configuring token pools and token admin registry. // It then validates the configuration. -func (c *AddTokenE2EConfig) newConfigurePoolAndTokenAdminRegConfig(e cldf.Environment, symbol shared.TokenSymbol, timelockCfg *proposalutils.TimelockConfig) error { +func (c *AddTokenE2EConfig) newConfigurePoolAndTokenAdminRegConfig(e cldf.Environment, symbol shared.TokenSymbol, timelockCfg *cldfproposalutils.TimelockConfig) error { c.deployPool = &DeployTokenPoolContractsConfig{ TokenSymbol: symbol, NewPools: make(map[uint64]DeployTokenPoolInput), @@ -232,7 +233,7 @@ type AddTokensE2EConfig struct { Tokens map[shared.TokenSymbol]AddTokenE2EConfig `json:"tokens"` // MCMS is the optional TimelockConfig used for governance proposals. - MCMS *proposalutils.TimelockConfig `json:"mcms,omitempty"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms,omitempty"` } func addTokenE2EPreconditionValidation(e cldf.Environment, config AddTokensE2EConfig) error { @@ -356,7 +357,7 @@ func addTokenE2ELogic(env cldf.Environment, config AddTokensE2EConfig) (cldf.Cha addresses = append(addresses, common.HexToAddress(addr)) } - transferOwnershipProposalOutput, err := commoncs.TransferToMCMSWithTimelockV2(e, commoncs.TransferToMCMSWithTimelockConfig{ + transferOwnershipProposalOutput, err := mcmschangesets.TransferToMCMSWithTimelockV2(e, mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ chainID: addresses, }, @@ -451,9 +452,14 @@ func addTokenE2ELogic(env cldf.Environment, config AddTokensE2EConfig) (cldf.Cha } // if there are multiple proposals, aggregate them so that we don't have to propose them separately if len(finalCSOut.MCMSTimelockProposals) > 1 { - aggregatedProposals, err := proposalutils.AggregateProposals( - e, state.EVMMCMSStateByChain(), nil, finalCSOut.MCMSTimelockProposals, - "Add Tokens E2E", config.MCMS) + aggregatedProposals, err := proposeutils.AggregateProposals( //nolint:staticcheck // SA1019: not migrating to AggregateProposalsV2 in this PR + e, + state.EVMMCMSStateByChain(), + nil, + finalCSOut.MCMSTimelockProposals, + "Add Tokens E2E", + config.MCMS, + ) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to aggregate proposals: %w", err) } diff --git a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go index 125ebea433d..dcaec4da591 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_add_token_e2e_test.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" mcmsTypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" @@ -20,6 +21,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -27,7 +29,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -80,13 +81,13 @@ func TestAddTokenE2E(t *testing.T) { var ( e cldf.Environment selectorA, selectorB uint64 - mcmsConfig *proposalutils.TimelockConfig + mcmsConfig *cldfproposalutils.TimelockConfig err error ) tokens := make(map[uint64]*cldf.ContractDeploy[*burn_mint_erc677.BurnMintERC677]) if test.withMCMS { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, MCMSAction: mcmsTypes.TimelockActionSchedule, } @@ -112,8 +113,8 @@ func TestAddTokenE2E(t *testing.T) { if test.withMCMS { e, err = commonchangeset.Apply(t, e, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: timelockOwnedContractsByChain, MCMSConfig: *mcmsConfig, }, diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools.go index 126334a34a1..5a694ad1f07 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools.go @@ -20,17 +20,18 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" aptosstate "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/aptos" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" @@ -349,7 +350,7 @@ func (c TokenPoolConfig) Validate(ctx context.Context, chain cldf_evm.Chain, cci // ConfigureTokenPoolContractsConfig is the configuration for the ConfigureTokenPoolContractsConfig changeset. type ConfigureTokenPoolContractsConfig struct { // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // PoolUpdates defines the changes that we want to make to the token pool on a chain PoolUpdates map[uint64]TokenPoolConfig @@ -827,7 +828,7 @@ func GetTokenStateFromPoolByAddressEVM( type ConfigureMultipleTokenPoolsConfig struct { Tokens []*ConfigureTokenPoolContractsConfig - MCMS *proposalutils.TimelockConfig // this will override the MCMS in the token pool configs + MCMS *cldfproposalutils.TimelockConfig // this will override the MCMS in the token pool configs } func configureMultiplePoolPreconditionValidation(env cldf.Environment, c ConfigureMultipleTokenPoolsConfig) error { @@ -866,9 +867,14 @@ func ConfigureMultiplePoolLogic(env cldf.Environment, c ConfigureMultipleTokenPo } // if there are multiple proposals, aggregate them so that we don't have to propose them separately if len(finalOutput.MCMSTimelockProposals) > 1 { - aggregatedProposals, err := proposalutils.AggregateProposals( - env, state.EVMMCMSStateByChain(), nil, finalOutput.MCMSTimelockProposals, - "Add Tokens E2E", c.MCMS) + aggregatedProposals, err := proposeutils.AggregateProposals( //nolint:staticcheck // SA1019: not migrating to AggregateProposalsV2 in this PR + env, + state.EVMMCMSStateByChain(), + nil, + finalOutput.MCMSTimelockProposals, + "Add Tokens E2E", + c.MCMS, + ) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to aggregate proposals: %w", err) } diff --git a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go index ae571b71c4a..e02a06ae9ee 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_configure_token_pools_test.go @@ -21,6 +21,7 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink/deployment" @@ -31,7 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // createSymmetricRateLimits is a utility to quickly create a rate limiter config with equal inbound and outbound values. @@ -431,7 +431,7 @@ func TestValidateConfigureTokenPoolContracts(t *testing.T) { } for _, test := range tests { - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { // Run all tests with and without MCMS + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { // Run all tests with and without MCMS t.Run(test.Msg, func(t *testing.T) { e, selectorA, selectorB, tokens := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.Test(t), mcmsConfig != nil) diff --git a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools.go b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools.go index 93ffcf81d07..5cb5fbc4e15 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools.go +++ b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_5_1" @@ -19,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -112,7 +112,7 @@ type FastTransferWithdrawPoolFeesConfig struct { ContractVersion semver.Version Withdrawals map[uint64]common.Address // chainSelector -> recipient address // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c FastTransferWithdrawPoolFeesConfig) Validate(env cldf.Environment) error { @@ -166,7 +166,7 @@ type FastTransferUpdateLaneConfigConfig struct { ContractVersion semver.Version Updates map[uint64](map[uint64]UpdateLaneConfig) // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c FastTransferUpdateLaneConfigConfig) Validate(env cldf.Environment) error { @@ -259,7 +259,7 @@ type FastTransferFillerAllowlistConfig struct { ContractVersion semver.Version Updates map[uint64]FillerAllowlistConfig // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c FastTransferFillerAllowlistConfig) Validate(env cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go index 46234224bd3..8e40993cca3 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_fast_transfer_token_pools_test.go @@ -9,13 +9,13 @@ import ( "github.com/stretchr/testify/require" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/bindings" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -516,9 +516,9 @@ func TestFastTransferUpdateLaneConfigChangeset_WithMCMS(t *testing.T) { }, }, tc.mcmsEnabled) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -584,9 +584,9 @@ func TestFastTransferFillerAllowlistChangeset_WithMCMS(t *testing.T) { }, }, tc.mcmsEnabled) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } diff --git a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups.go b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups.go index af734ec33b6..aa91e1536e2 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups.go +++ b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups.go @@ -8,6 +8,7 @@ import ( "github.com/Masterminds/semver/v3" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_5_1" @@ -17,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -83,7 +83,7 @@ type HybridTokenPoolUpdateGroupsConfig struct { ContractVersion semver.Version Updates map[uint64][]GroupUpdateConfig // chain selector -> group updates // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c HybridTokenPoolUpdateGroupsConfig) Validate(env cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go index dfb4f579fad..fd085a3d589 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_hybrid_token_pool_groups_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/require" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" @@ -50,9 +50,9 @@ func configureHybridTokenPoolChains(t *testing.T, e cldf.Environment, selectorA, }, } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -356,9 +356,9 @@ func TestHybridTokenPoolUpdateGroupsChangeset_WithMCMS(t *testing.T) { configureHybridTokenPoolChains(t, e, selectorA, selectorB, tc.mcmsEnabled) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } diff --git a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role.go b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role.go index 25018f24eb2..0aa06f3630c 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role.go +++ b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role.go @@ -11,8 +11,8 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" @@ -39,7 +39,7 @@ var ( type ProposeAdminRoleConfig struct { ProposeAdminByChain map[uint64][]TokenAdminInfo `json:"proposeAdminByChain"` // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // OverridePendingAdmin allows overriding existing pending administrators if set to true. // Use with caution as this will replace any existing pending admin proposals. OverridePendingAdmin bool `json:"overridePendingAdmin"` diff --git a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go index 69f45a35154..56448115eff 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_propose_admin_role_test.go @@ -9,6 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -16,7 +17,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -33,7 +33,7 @@ func TestProposeAdminRoleChangeset_Validations(t *testing.T) { }, }, true) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, } @@ -161,7 +161,7 @@ func TestProposeAdminRoleChangeset_Validations(t *testing.T) { } func TestProposeAdminRoleChangeset_ExecutionWithoutExternalAdmin(t *testing.T) { - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Propose admin role without external admin with MCMS" if mcmsConfig == nil { msg = "Propose admin role without external admin without MCMS" @@ -233,7 +233,7 @@ func TestProposeAdminRoleChangeset_ExecutionWithoutExternalAdmin(t *testing.T) { } func TestProposeAdminRoleChangeset_ExecutionWithExternalAdmin(t *testing.T) { - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Propose admin role with external admin with MCMS" if mcmsConfig == nil { msg = "Propose admin role with external admin without MCMS" @@ -305,7 +305,7 @@ func TestProposeAdminRoleChangesetV2_Validations(t *testing.T) { e, _, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} tokenAddress := utils.RandomAddress() tests := []struct { @@ -456,7 +456,7 @@ func TestProposeAdminRoleChangesetV2_Validations(t *testing.T) { func TestProposeAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) // Use random addresses - no need to deploy actual tokens @@ -558,7 +558,7 @@ func TestProposeAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { func TestProposeAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) // Use random addresses for multiple tokens - no need to deploy actual tokens @@ -635,7 +635,7 @@ func TestProposeAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { func TestProposeAdminRoleChangesetV2_PendingAdminValidation(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) tokenAddress := utils.RandomAddress() @@ -715,7 +715,7 @@ func TestProposeAdminRoleChangesetV2_PendingAdminValidation(t *testing.T) { func TestProposeAdminRoleChangesetV2_OverrideFunctionality(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) // Test case 1: Override with same admin address should fail diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go index 36e5f55beca..72e3ebdaa24 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_pool_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -14,7 +15,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -31,7 +31,7 @@ func TestSetPoolChangeset_Validations(t *testing.T) { }, }, true) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, } @@ -120,7 +120,7 @@ func TestSetPoolChangeset_Validations(t *testing.T) { } func TestSetPoolChangeset_Execution(t *testing.T) { - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Set pool with MCMS" if mcmsConfig == nil { msg = "Set pool without MCMS" diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config.go b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config.go index 8b775509c0b..84daa6aeb82 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config.go @@ -9,8 +9,8 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" @@ -33,7 +33,7 @@ type SetTokenTransferFeeConfig struct { InputsByChain map[uint64]map[uint64]SetTokenTransferFeeArgs `json:"inputsByChain"` // The timelock config - all updates can be merged into one MCMS proposal with this setting - MCMS *proposalutils.TimelockConfig `json:"mcms"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms"` } type SetTokenTransferFeeArgs struct { diff --git a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go index 1a6d8f0515e..2a89b6ce814 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_set_token_transfer_fee_config_test.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/stretchr/testify/require" chain_selectors "github.com/smartcontractkit/chain-selectors" @@ -16,12 +17,13 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers/v1_5" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" @@ -80,7 +82,7 @@ func TestSetTokenTransferFeeConfig_Validations(t *testing.T) { }) // Define helper vars - mcmCfg := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmCfg := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} tokenA := utils.RandomAddress() tokenB := utils.RandomAddress() @@ -330,7 +332,7 @@ func TestSetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { }) // Define helper vars - mcmCfg := proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmCfg := cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} tokenA := utils.RandomAddress() tokenB := utils.RandomAddress() // will be reset via MCMS @@ -365,8 +367,8 @@ func TestSetTokenTransferFeeConfig_Execution_WithMCMS(t *testing.T) { require.NoError(t, err) e.Env, err = commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - deployment.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + deployment.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ src: {state.MustGetEVMChainState(src).EVM2EVMOnRamp[dst].Address()}, dst: {state.MustGetEVMChainState(dst).EVM2EVMOnRamp[src].Address()}, diff --git a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains.go b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains.go index 47ee2d55db5..e7a3d33c5e0 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains.go +++ b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains.go @@ -11,12 +11,12 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/usdc_token_pool" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var _ cldf.ChangeSet[SyncUSDCDomainsWithChainsConfig] = SyncUSDCDomainsWithChainsChangeset @@ -28,7 +28,7 @@ type SyncUSDCDomainsWithChainsConfig struct { // ChainSelectorToUSDCDomain maps chains selectors to their USDC domain identifiers. ChainSelectorToUSDCDomain map[uint64]uint32 // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c SyncUSDCDomainsWithChainsConfig) Validate(env cldf.Environment, state stateview.CCIPOnChainState) error { diff --git a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go index 1435bbd88ea..f86b11f6f83 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_sync_usdc_domains_with_chains_test.go @@ -6,6 +6,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" @@ -14,6 +15,7 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -22,7 +24,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestValidateSyncUSDCDomainsWithChainsConfig(t *testing.T) { @@ -97,7 +98,7 @@ func TestValidateSyncUSDCDomainsWithChainsConfig(t *testing.T) { selector: deployment.Version1_5_1, }, ChainSelectorToUSDCDomain: map[uint64]uint32{}, - MCMS: &proposalutils.TimelockConfig{MinDelay: 0 * time.Second}, + MCMS: &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second}, } }, DeployUSDC: true, @@ -186,7 +187,7 @@ func TestValidateSyncUSDCDomainsWithChainsConfig(t *testing.T) { func TestSyncUSDCDomainsWithChainsChangeset(t *testing.T) { t.Parallel() - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Sync domains without MCMS" if mcmsConfig != nil { msg = "Sync domains with MCMS" @@ -217,8 +218,8 @@ func TestSyncUSDCDomainsWithChainsChangeset(t *testing.T) { // Transfer ownership of token pools to timelock e, err = commoncs.Apply(t, e, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: timelockOwnedContractsByChain, MCMSConfig: *mcmsConfig, }, diff --git a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role.go b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role.go index e8799e77826..fea3cac404d 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role.go +++ b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role.go @@ -11,8 +11,8 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" @@ -36,7 +36,7 @@ var ( type TransferAdminRoleConfig struct { TransferAdminByChain map[uint64][]TokenAdminInfo `json:"transferAdminByChain"` // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func validateTransferAdminRole( diff --git a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go index 0a24ed57a02..ddf690e87e0 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_transfer_admin_role_test.go @@ -11,6 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -18,7 +19,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) @@ -35,7 +35,7 @@ func TestTransferAdminRoleChangeset_Validations(t *testing.T) { }, }, true) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, } @@ -140,7 +140,7 @@ func TestTransferAdminRoleChangeset_Validations(t *testing.T) { } func TestTransferAdminRoleChangeset_Execution(t *testing.T) { - for _, mcmsConfig := range []*proposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { + for _, mcmsConfig := range []*cldfproposalutils.TimelockConfig{nil, {MinDelay: 0 * time.Second}} { msg := "Transfer admin role with MCMS" if mcmsConfig == nil { msg = "Transfer admin role without MCMS" @@ -261,7 +261,7 @@ func TestTransferAdminRoleChangesetV2_EmptyConfigReturnsError(t *testing.T) { func TestTransferAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) tokenAddressA := utils.RandomAddress() @@ -418,7 +418,7 @@ func TestTransferAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { func TestTransferAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) token1 := utils.RandomAddress() @@ -459,7 +459,7 @@ func TestTransferAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { func TestTransferAdminRoleChangesetV2_Validations(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) tokenAddress := utils.RandomAddress() diff --git a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role.go b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role.go index 54b334cdb42..862cf404b49 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role.go +++ b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ccipcommoncs "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" @@ -33,7 +33,7 @@ type UpdateAdminRoleConfig struct { ChainUpdates map[uint64][]TokenAdminInfo `json:"ChainUpdates"` // The timelock config - all updates can be folded into one MCMS proposal with this setting - MCMS *proposalutils.TimelockConfig `json:"mcms"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms"` // Internal property for caching purposes configs *updateAdminRoleConfigs diff --git a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go index fb91dbcf5ea..19baba3a764 100644 --- a/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go +++ b/deployment/ccip/changeset/v1_5_1/cs_update_admin_role_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" @@ -14,14 +16,13 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_5_1" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/logger" ) func TestUpdateAdminRoleChangesetV2_Validations(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) tokenAddress := utils.RandomAddress() @@ -257,7 +258,7 @@ func TestUpdateAdminRoleChangesetV2_ExecutionWithoutMCMS(t *testing.T) { func TestUpdateAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, selectorB, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) tokenAddressA := utils.RandomAddress() @@ -308,7 +309,7 @@ func TestUpdateAdminRoleChangesetV2_ExecutionWithMCMS(t *testing.T) { func TestUpdateAdminRoleChangesetV2_MultipleTokensPerChain(t *testing.T) { t.Parallel() - mcmsConfig := &proposalutils.TimelockConfig{MinDelay: 0 * time.Second} + mcmsConfig := &cldfproposalutils.TimelockConfig{MinDelay: 0 * time.Second} e, selectorA, _, _ := testhelpers.SetupTwoChainEnvironmentWithTokens(t, logger.TestLogger(t), true) token1 := utils.RandomAddress() diff --git a/deployment/ccip/changeset/v1_6/accept_ownership_test.go b/deployment/ccip/changeset/v1_6/accept_ownership_test.go index b75a3fa19d7..67f35ac7161 100644 --- a/deployment/ccip/changeset/v1_6/accept_ownership_test.go +++ b/deployment/ccip/changeset/v1_6/accept_ownership_test.go @@ -3,6 +3,7 @@ package v1_6_test import ( "testing" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/stretchr/testify/require" "golang.org/x/exp/maps" @@ -30,7 +31,7 @@ func Test_NewAcceptOwnershipChangeset(t *testing.T) { _, err = commonchangeset.Apply(t, e.Env, // note this doesn't have proposals. commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), testhelpers.GenTestTransferOwnershipConfig(e, allChains, state, true), ), ) diff --git a/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go b/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go index 33ebd1b7b45..4b9ad80dbd7 100644 --- a/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go +++ b/deployment/ccip/changeset/v1_6/cs_active_candidate_test.go @@ -6,12 +6,14 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/stretchr/testify/require" "golang.org/x/exp/maps" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" @@ -19,7 +21,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" @@ -127,7 +128,7 @@ func Test_ActiveCandidate(t *testing.T) { // and set new config digest on the offramp. _, err = commonchangeset.Apply(t, tenv.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), testhelpers.GenTestTransferOwnershipConfig(tenv, allChains, state, true), ), ) @@ -199,7 +200,7 @@ func Test_ActiveCandidate(t *testing.T) { SetCandidateConfigBase: v1_6.SetCandidateConfigBase{ HomeChainSelector: tenv.HomeChainSel, FeedChainSelector: tenv.FeedChainSel, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }, diff --git a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go index 09ef90943ed..e62bd7f1442 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go +++ b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" mcmslib "github.com/smartcontractkit/mcms" cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" @@ -23,10 +24,9 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/cldfutil/changeset" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/don_id_claimer" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" @@ -108,7 +108,7 @@ type AddCandidatesForNewChainConfig struct { // MCMSDeploymentConfig configures the MCMS deployment to the new chain. MCMSDeploymentConfig *cldfproposalutils.MCMSWithTimelockConfig `json:"mcmsDeploymentConfig,omitempty"` // MCMSConfig defines the MCMS configuration for the changeset. - MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` // The offset to adjust the donID in DonIDClaimer (useful when certain DON IDs are dropped) // This is a pointer to distinguish between an explicitly set value (including 0) and an unset value (nil). // We can OffSet by 0 as well sync nextDonID with CapReg. @@ -325,7 +325,7 @@ func addCandidatesForNewChainLogic(e cldf.Environment, c AddCandidatesForNewChai if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to get owner of RMN proxy on chain with selector %d: %w", c.NewChain.Selector, err) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if owner == state.Chains[c.NewChain.Selector].Timelock.Address() { mcmsConfig = c.MCMSConfig } @@ -463,16 +463,19 @@ func addCandidatesForNewChainLogic(e cldf.Environment, c AddCandidatesForNewChai return cldf.ChangesetOutput{}, fmt.Errorf("failed to reset existing addresses: %w", err) } - proposal, err := proposalutils.AggregateProposals( - e, - state.EVMMCMSStateByChain(), - nil, - allProposals, - fmt.Sprintf("Deploy and set candidates for chain with selector %d", c.NewChain.Selector), - c.MCMSConfig, - ) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to build proposal: %w", err) + var proposal *mcmslib.TimelockProposal + if c.MCMSConfig != nil && len(allProposals) > 0 { + proposal, err = proposeutils.AggregateProposals( //nolint:staticcheck // SA1019: not migrating to AggregateProposalsV2 yet + e, + state.EVMMCMSStateByChain(), + nil, + allProposals, + fmt.Sprintf("Deploy and set candidates for chain with selector %d", c.NewChain.Selector), + c.MCMSConfig, + ) + if err != nil { + return cldf.ChangesetOutput{}, fmt.Errorf("failed to build proposal: %w", err) + } } ds, err := shared.PopulateDataStore(newAddresses) @@ -509,7 +512,7 @@ type PromoteNewChainForConfig struct { // TestRouter is true if we want to connect via test routers. TestRouter *bool `json:"testRouter,omitempty"` // MCMSConfig defines the MCMS configuration for the changeset. - MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` } func (c PromoteNewChainForConfig) promoteCandidateConfig() PromoteCandidateChangesetConfig { @@ -651,7 +654,10 @@ func promoteNewChainForConfigLogic(e cldf.Environment, c PromoteNewChainForConfi } allProposals = append(allProposals, out.MCMSTimelockProposals...) - proposal, err := proposalutils.AggregateProposals( + if c.MCMSConfig == nil || len(allProposals) == 0 { + return cldf.ChangesetOutput{}, nil + } + proposal, err := proposeutils.AggregateProposals( //nolint:staticcheck // SA1019: not migrating to AggregateProposalsV2 in this PR e, state.EVMMCMSStateByChain(), nil, @@ -696,7 +702,7 @@ type ConnectNewChainConfig struct { // TestRouter is true if we want to connect via test routers. TestRouter *bool `json:"testRouter,omitempty"` // MCMSConfig is the MCMS configuration, omit to use deployer key only. - MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` } func (c ConnectNewChainConfig) validateNewChain(env cldf.Environment, state stateview.CCIPOnChainState) error { @@ -821,7 +827,7 @@ func connectNewChainLogic(env cldf.Environment, c ConnectNewChainConfig) (cldf.C addressesToTransfer = append(addressesToTransfer, contract.Address()) } } - out, err := commoncs.TransferToMCMSWithTimelockV2(env, commoncs.TransferToMCMSWithTimelockConfig{ + out, err := mcmschangesets.TransferToMCMSWithTimelockV2(env, mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ c.NewChainSelector: addressesToTransfer, }, @@ -854,7 +860,7 @@ func connectNewChainLogic(env cldf.Environment, c ConnectNewChainConfig) (cldf.C // Enable the production router on [new chain -> each remote chain] and [each remote chain -> new chain]. var allEnablementProposals []mcmslib.TimelockProposal - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if !*c.TestRouter { mcmsConfig = c.MCMSConfig } @@ -871,7 +877,10 @@ func connectNewChainLogic(env cldf.Environment, c ConnectNewChainConfig) (cldf.C allProposals := slices.Concat(ownershipTransferProposals, allEnablementProposals) - proposal, err := proposalutils.AggregateProposals( + if c.MCMSConfig == nil || len(allProposals) == 0 { + return cldf.ChangesetOutput{}, nil + } + proposal, err := proposeutils.AggregateProposals( //nolint:staticcheck // SA1019: not migrating to AggregateProposalsV2 in this PR env, state.EVMMCMSStateByChain(), nil, @@ -896,7 +905,7 @@ func connectRampsAndRouters( e cldf.Environment, chainSelector uint64, remoteChains map[uint64]ConnectionConfig, - mcmsConfig *proposalutils.TimelockConfig, + mcmsConfig *cldfproposalutils.TimelockConfig, testRouter bool, proposalAggregate []mcmslib.TimelockProposal, ) ([]mcmslib.TimelockProposal, error) { diff --git a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go index fb3d10d8c30..15cd8bb6c26 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go +++ b/deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go @@ -7,6 +7,11 @@ import ( "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" + "github.com/smartcontractkit/chainlink-ccip/chainconfig" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/ccip_home" @@ -15,7 +20,6 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" "github.com/stretchr/testify/require" @@ -32,8 +36,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -80,11 +82,11 @@ func TestConnectNewChain(t *testing.T) { Msg string TransferRemoteChainsToMCMS bool TestRouter bool - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig ErrStr string } - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, } @@ -149,10 +151,10 @@ func TestConnectNewChain(t *testing.T) { } e, err = commonchangeset.Apply(t, e, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsToTransfer, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, @@ -239,14 +241,14 @@ func TestAddAndPromoteCandidatesForNewChain(t *testing.T) { t.Parallel() type test struct { Msg string - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig DonIDOffSet *uint32 ErrStr string } offset := uint32(0) - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, } @@ -368,10 +370,10 @@ func TestAddAndPromoteCandidatesForNewChain(t *testing.T) { ) e, err = commonchangeset.Apply(t, e, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsToTransfer, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, @@ -657,7 +659,7 @@ func TestValidateTransmitterAddresses(t *testing.T) { NewChain: newChainConfigHelper(chain_selectors.ETHEREUM_TESTNET_SEPOLIA_OPTIMISM_1.Selector, deployedEnvironment.FeedChainSel, linkAddress, &nodeInfo, 6), RemoteChains: remoteChains, MCMSDeploymentConfig: &mcmsDeploymentCfg, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, }, diff --git a/deployment/ccip/changeset/v1_6/cs_add_registry_module.go b/deployment/ccip/changeset/v1_6/cs_add_registry_module.go index ae5d84f9b0c..18f1ce39556 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_registry_module.go +++ b/deployment/ccip/changeset/v1_6/cs_add_registry_module.go @@ -17,11 +17,11 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var _ cldf.ChangeSet[AddRegistryModuleConfig] = AddRegistryModuleChangeset @@ -30,7 +30,7 @@ type AddRegistryModuleConfig struct { // Map of chain selector to registry module 1.6 address RegistryModuleAddrs map[uint64]common.Address // MCMS config - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (c AddRegistryModuleConfig) Validate(e cldf.Environment) error { @@ -163,7 +163,7 @@ func AddRegistryModuleChangeset(e cldf.Environment, cfg AddRegistryModuleConfig) inspectors[chainSel] = inspector } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, diff --git a/deployment/ccip/changeset/v1_6/cs_add_registry_module_test.go b/deployment/ccip/changeset/v1_6/cs_add_registry_module_test.go index 0ae1534d1a9..e7d9bfc0ca5 100644 --- a/deployment/ccip/changeset/v1_6/cs_add_registry_module_test.go +++ b/deployment/ccip/changeset/v1_6/cs_add_registry_module_test.go @@ -21,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestAddRegistryModuleChangeset(t *testing.T) { @@ -82,7 +81,7 @@ func TestAddRegistryModuleChangeset(t *testing.T) { } // Create MCMS config for testing - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0, } @@ -177,7 +176,7 @@ func TestAddRegistryModuleChangeset(t *testing.T) { } // Create MCMS config for testing - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0, } @@ -259,7 +258,7 @@ func TestAddRegistryModuleChangeset(t *testing.T) { break } - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0, } @@ -372,7 +371,7 @@ func TestAddRegistryModuleConfig_Validate(t *testing.T) { cfg := v1_6.AddRegistryModuleConfig{ RegistryModuleAddrs: map[uint64]common.Address{}, - MCMSConfig: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMSConfig: &cldfproposalutils.TimelockConfig{MinDelay: 0}, } err = cfg.Validate(*env) @@ -391,7 +390,7 @@ func TestAddRegistryModuleConfig_Validate(t *testing.T) { cfg := v1_6.AddRegistryModuleConfig{ RegistryModuleAddrs: nil, - MCMSConfig: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMSConfig: &cldfproposalutils.TimelockConfig{MinDelay: 0}, } err = cfg.Validate(*env) @@ -431,7 +430,7 @@ func TestAddRegistryModuleConfig_Validate(t *testing.T) { RegistryModuleAddrs: map[uint64]common.Address{ chain1: common.Address{}, // Zero address }, - MCMSConfig: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMSConfig: &cldfproposalutils.TimelockConfig{MinDelay: 0}, } err = cfg.Validate(*env) @@ -452,7 +451,7 @@ func TestAddRegistryModuleConfig_Validate(t *testing.T) { RegistryModuleAddrs: map[uint64]common.Address{ 999999: common.HexToAddress("0x1234567890123456789012345678901234567890"), }, - MCMSConfig: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMSConfig: &cldfproposalutils.TimelockConfig{MinDelay: 0}, } err = cfg.Validate(*env) @@ -476,7 +475,7 @@ func TestAddRegistryModuleConfig_Validate(t *testing.T) { RegistryModuleAddrs: map[uint64]common.Address{ chain2: common.HexToAddress("0x1234567890123456789012345678901234567890"), }, - MCMSConfig: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMSConfig: &cldfproposalutils.TimelockConfig{MinDelay: 0}, } err = cfg.Validate(*env) @@ -556,7 +555,7 @@ func TestAddRegistryModuleConfig_Validate(t *testing.T) { RegistryModuleAddrs: map[uint64]common.Address{ chain1: common.HexToAddress("0x1234567890123456789012345678901234567890"), }, - MCMSConfig: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMSConfig: &cldfproposalutils.TimelockConfig{MinDelay: 0}, } err = cfg.Validate(*env) diff --git a/deployment/ccip/changeset/v1_6/cs_ccip_home.go b/deployment/ccip/changeset/v1_6/cs_ccip_home.go index 22df8ae4d88..1453a74f1b4 100644 --- a/deployment/ccip/changeset/v1_6/cs_ccip_home.go +++ b/deployment/ccip/changeset/v1_6/cs_ccip_home.go @@ -9,22 +9,15 @@ import ( "slices" "strings" + "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/gagliardetto/solana-go" "golang.org/x/exp/maps" - cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - - "github.com/Masterminds/semver/v3" chain_selectors "github.com/smartcontractkit/chain-selectors" - mcmslib "github.com/smartcontractkit/mcms" - mcmssdk "github.com/smartcontractkit/mcms/sdk" - mcmsevmsdk "github.com/smartcontractkit/mcms/sdk/evm" - mcmstypes "github.com/smartcontractkit/mcms/types" - - "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/chainlink-ccip/chainconfig" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/ccip_home" @@ -32,14 +25,20 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/tokens" "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" - "github.com/smartcontractkit/chainlink-deployments-framework/datastore" - - capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + + mcmslib "github.com/smartcontractkit/mcms" + mcmssdk "github.com/smartcontractkit/mcms/sdk" + mcmsevmsdk "github.com/smartcontractkit/mcms/sdk/evm" + mcmstypes "github.com/smartcontractkit/mcms/types" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/smartcontractkit/chainlink/deployment" @@ -49,8 +48,9 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" + + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) var ( @@ -368,7 +368,7 @@ type PromoteCandidateChangesetConfig struct { // MCMS is optional MCMS configuration, if provided the changeset will generate an MCMS proposal. // If nil, the changeset will execute the commands directly using the deployer key // of the provided environment. - MCMS *proposalutils.TimelockConfig `json:"mcms,omitempty"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms,omitempty"` } func (p PromoteCandidateChangesetConfig) Validate(e cldf.Environment) (map[uint64]uint32, error) { @@ -598,7 +598,7 @@ type SetCandidateConfigBase struct { // MCMS is optional MCMS configuration, if provided the changeset will generate an MCMS proposal. // If nil, the changeset will execute the commands directly using the deployer key // of the provided environment. - MCMS *proposalutils.TimelockConfig `json:"mcms,omitempty"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms,omitempty"` } func (s SetCandidateConfigBase) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -916,7 +916,7 @@ type RevokeCandidateChangesetConfig struct { // MCMS is optional MCMS configuration, if provided the changeset will generate an MCMS proposal. // If nil, the changeset will execute the commands directly using the deployer key // of the provided environment. - MCMS *proposalutils.TimelockConfig `json:"mcms,omitempty"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms,omitempty"` } func (r RevokeCandidateChangesetConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) (donID uint32, err error) { @@ -1014,7 +1014,7 @@ func RevokeCandidateChangeset(e cldf.Environment, cfg RevokeCandidateChangesetCo if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to build mcm addresses per chain: %w", err) } - prop, err := proposalutils.BuildProposalFromBatchesV2( + prop, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, @@ -1104,10 +1104,10 @@ type ChainConfig struct { } type UpdateChainConfigConfig struct { - HomeChainSelector uint64 `json:"homeChainSelector"` - RemoteChainRemoves []uint64 `json:"remoteChainRemoves"` - RemoteChainAdds map[uint64]ChainConfig `json:"remoteChainAdds"` - MCMS *proposalutils.TimelockConfig `json:"mcms,omitempty"` + HomeChainSelector uint64 `json:"homeChainSelector"` + RemoteChainRemoves []uint64 `json:"remoteChainRemoves"` + RemoteChainAdds map[uint64]ChainConfig `json:"remoteChainAdds"` + MCMS *cldfproposalutils.TimelockConfig `json:"mcms,omitempty"` } func (c UpdateChainConfigConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go b/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go index 8f1eef4656c..6907deef005 100644 --- a/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/v1_6/cs_ccip_home_test.go @@ -16,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chainconfig" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" @@ -38,7 +39,6 @@ import ( "github.com/stretchr/testify/require" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestInvalidOCR3Params(t *testing.T) { @@ -153,9 +153,9 @@ func Test_PromoteCandidate(t *testing.T) { require.NoError(t, err) require.NotEqual(t, [32]byte{}, ActiveDigestExecBefore) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -244,9 +244,9 @@ func Test_SetCandidate(t *testing.T) { require.NoError(t, err) require.Equal(t, [32]byte{}, candidateDigestExecBefore) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -374,9 +374,9 @@ func Test_RevokeCandidate(t *testing.T) { require.NoError(t, err) require.Equal(t, [32]byte{}, candidateDigestExecBefore) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -497,9 +497,9 @@ func Test_UpdateChainConfigs(t *testing.T) { require.NoError(t, err) assert.NotZero(t, otherChainConfig.FChain) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } diff --git a/deployment/ccip/changeset/v1_6/cs_chain_contracts.go b/deployment/ccip/changeset/v1_6/cs_chain_contracts.go index 49fdf663a10..52e914f5405 100644 --- a/deployment/ccip/changeset/v1_6/cs_chain_contracts.go +++ b/deployment/ccip/changeset/v1_6/cs_chain_contracts.go @@ -19,39 +19,39 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper" ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - mcmslib "github.com/smartcontractkit/mcms" - mcmssdk "github.com/smartcontractkit/mcms/sdk" - mcmstypes "github.com/smartcontractkit/mcms/types" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-evm/pkg/utils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/nonce_manager" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp" + "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/onramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-evm/pkg/utils" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + mcmslib "github.com/smartcontractkit/mcms" + mcmssdk "github.com/smartcontractkit/mcms/sdk" + mcmstypes "github.com/smartcontractkit/mcms/types" + + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" ccipops1_2 "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_2" ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_6" ccipseqs "github.com/smartcontractkit/chainlink/deployment/ccip/sequence/evm/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" + commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/nonce_manager" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/onramp" - - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" - "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" - commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -96,7 +96,7 @@ var ( type UpdateNonceManagerConfig struct { UpdatesByChain map[uint64]NonceManagerUpdate // source -> dest -> update - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // SkipOwnershipCheck allows you to bypass the ownership check for the NonceManager. // WARNING: This should only be used when running this changeset within another changeset that is managing contract ownership! // Never use this option when running this changeset in isolation. @@ -264,7 +264,7 @@ type UpdateOnRampDestsConfig struct { // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // SkipOwnershipCheck allows you to bypass the ownership check for the onRamp. // WARNING: This should only be used when running this changeset within another changeset that is managing contract ownership! // Never use this option when running this changeset in isolation. @@ -381,7 +381,7 @@ type UpdateOnRampDynamicConfig struct { UpdatesByChain map[uint64]OnRampDynamicConfigUpdate // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateOnRampDynamicConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -470,7 +470,7 @@ func UpdateOnRampDynamicConfigChangeset(e cldf.Environment, cfg UpdateOnRampDyna if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("error getting mcms contract by chain: %w", err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, inspectors, batches, "update onramp dynamic config", *cfg.MCMS) @@ -492,7 +492,7 @@ type UpdateOnRampAllowListConfig struct { UpdatesByChain map[uint64]map[uint64]OnRampAllowListUpdate // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateOnRampAllowListConfig) Validate(env cldf.Environment) error { @@ -627,7 +627,7 @@ func UpdateOnRampAllowListChangeset(e cldf.Environment, cfg UpdateOnRampAllowLis if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("error getting mcms contract by chain: %w", err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, @@ -645,7 +645,7 @@ func UpdateOnRampAllowListChangeset(e cldf.Environment, cfg UpdateOnRampAllowLis type WithdrawOnRampFeeTokensConfig struct { FeeTokensByChain map[uint64][]common.Address - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg WithdrawOnRampFeeTokensConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -724,7 +724,7 @@ func WithdrawOnRampFeeTokensChangeset(e cldf.Environment, cfg WithdrawOnRampFeeT if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("error getting mcms contract by chain: %w", err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, @@ -742,7 +742,7 @@ func WithdrawOnRampFeeTokensChangeset(e cldf.Environment, cfg WithdrawOnRampFeeT type UpdateFeeQuoterPricesConfig struct { PricesByChain map[uint64]FeeQuoterPriceUpdatePerSource // source -> PriceDetails - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type FeeQuoterPriceUpdatePerSource struct { @@ -885,7 +885,7 @@ type UpdateFeeQuoterDestsConfig struct { UpdatesByChain map[uint64]map[uint64]fee_quoter.FeeQuoterDestChainConfig // Disallow mixing MCMS/non-MCMS per chain for simplicity. // (can still be achieved by calling this function multiple times) - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateFeeQuoterDestsConfig) Validate(e cldf.Environment) error { @@ -1081,7 +1081,7 @@ type UpdateOffRampSourcesConfig struct { // UpdatesByChain is a mapping from dest chain -> source chain -> source chain // update on the dest chain offramp. UpdatesByChain map[uint64]map[uint64]OffRampSourceUpdate - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // SkipOwnershipCheck allows you to bypass the ownership check for the offRamp. // WARNING: This should only be used when running this changeset within another changeset that is managing contract ownership! // Never use this option when running this changeset in isolation. @@ -1194,7 +1194,7 @@ type UpdateRouterRampsConfig struct { // on all chains. Disallow mixing test router/non-test router per chain for simplicity. TestRouter bool UpdatesByChain map[uint64]RouterUpdates - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // SkipOwnershipCheck allows you to bypass the ownership check for the router. // WARNING: This should only be used when running this changeset within another changeset that is managing contract ownership! // Never use this option when running this changeset in isolation. @@ -1379,7 +1379,7 @@ type SetOCR3OffRampConfig struct { HomeChainSel uint64 RemoteChainSels []uint64 CCIPHomeConfigType globals.ConfigType - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig PluginTypes []cctypes.PluginType // empty plugin type list defaults to both commit and exec } @@ -1546,7 +1546,7 @@ func SetOCR3OffRampChangeset(e cldf.Environment, cfg SetOCR3OffRampConfig) (cldf if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("error getting mcms contract by chain: %w", err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, @@ -1565,7 +1565,7 @@ func SetOCR3OffRampChangeset(e cldf.Environment, cfg SetOCR3OffRampConfig) (cldf type UpdateDynamicConfigOffRampConfig struct { Updates map[uint64]ccipops.OffRampParams - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateDynamicConfigOffRampConfig) Validate(e cldf.Environment) error { @@ -1661,7 +1661,7 @@ func UpdateDynamicConfigOffRampChangeset(e cldf.Environment, cfg UpdateDynamicCo if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("error getting mcms contract by chain: %w", err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, @@ -1751,7 +1751,7 @@ func DefaultFeeQuoterDestChainConfig(configEnabled bool, destChainSelector ...ui type ApplyFeeTokensUpdatesConfig struct { UpdatesByChain map[uint64]ApplyFeeTokensUpdatesConfigPerChain - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } type ApplyFeeTokensUpdatesConfigPerChain struct { @@ -1850,7 +1850,7 @@ func (cfg ApplyFeeTokensUpdatesConfig) ToSequenceInput(state stateview.CCIPOnCha type UpdateTokenPriceFeedsConfig struct { Updates map[uint64][]UpdateTokenPriceFeedsConfigPerChain FeedChainSelector uint64 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type UpdateTokenPriceFeedsConfigPerChain struct { @@ -1985,7 +1985,7 @@ func UpdateTokenPriceFeedsFeeQuoterChangeset(e cldf.Environment, cfg UpdateToken if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("error getting mcms contract by chain: %w", err) } - p, err := proposalutils.BuildProposalFromBatchesV2( + p, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractByChain, @@ -2004,7 +2004,7 @@ func UpdateTokenPriceFeedsFeeQuoterChangeset(e cldf.Environment, cfg UpdateToken type PremiumMultiplierWeiPerEthUpdatesConfig struct { Updates map[uint64][]PremiumMultiplierWeiPerEthUpdatesConfigPerChain - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg PremiumMultiplierWeiPerEthUpdatesConfig) Validate(e cldf.Environment) error { @@ -2096,7 +2096,7 @@ func (cfg PremiumMultiplierWeiPerEthUpdatesConfig) ToSequenceInput(state statevi type ApplyTokenTransferFeeConfigUpdatesConfig struct { UpdatesByChain map[uint64]ApplyTokenTransferFeeConfigUpdatesConfigPerChain - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg ApplyTokenTransferFeeConfigUpdatesConfig) Validate(e cldf.Environment) error { @@ -2249,7 +2249,7 @@ func (cfg ApplyTokenTransferFeeConfigUpdatesConfig) ToSequenceInput(state statev type UpdateWrappedNativeOnRouterConfig struct { UpdatesByChain map[uint64]common.Address - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg UpdateWrappedNativeOnRouterConfig) Validate(e cldf.Environment) error { @@ -2336,7 +2336,7 @@ type ApplyTokenTransferFeeConfigUpdatesConfigV2Input struct { type ApplyTokenTransferFeeConfigUpdatesConfigV2 struct { InputsByChain map[uint64]map[uint64]ApplyTokenTransferFeeConfigUpdatesConfigV2Input - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type OptionalFeeQuoterTokenTransferFeeConfig struct { diff --git a/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go b/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go index 6d8af23e446..c88a7905d43 100644 --- a/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go +++ b/deployment/ccip/changeset/v1_6/cs_chain_contracts_test.go @@ -12,6 +12,7 @@ import ( "golang.org/x/exp/maps" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chainconfig" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" @@ -35,7 +36,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -78,9 +78,9 @@ func TestUpdateOnRampsDests(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -154,9 +154,9 @@ func TestUpdateOnRampDynamicConfig(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -222,9 +222,9 @@ func TestUpdateOnRampAllowList(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -301,9 +301,9 @@ func TestWithdrawOnRampFeeTokens(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -412,9 +412,9 @@ func TestUpdateOffRampsSources(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -488,9 +488,9 @@ func TestUpdateFQDests(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -671,9 +671,9 @@ func TestUpdateRouterRamps(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, chains, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -750,9 +750,9 @@ func TestUpdateDynamicConfigOffRampChangeset(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -810,9 +810,9 @@ func TestUpdateNonceManagersCS(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -1113,9 +1113,9 @@ func TestApplyFeeTokensUpdatesFeeQuoterChangeset(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -1172,9 +1172,9 @@ func TestApplyPremiumMultiplierWeiPerEthUpdatesFeeQuoterChangeset(t *testing.T) testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -1308,9 +1308,9 @@ func TestUpdateTokenPriceFeedsFeeQuoterChangeset(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -1401,9 +1401,9 @@ func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangeset(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{source, dest}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -1508,11 +1508,11 @@ func TestApplyTokenTransferFeeConfigUpdatesFeeQuoterChangesetV2(t *testing.T) { require.NoError(t, err) // MCMS setup - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { // Transfer ownership to timelock so that we can promote the zero digest later down the line. testhelpers.TransferToTimelock(t, tenv, state, []uint64{src, dst}, true) - mcmsConfig = &proposalutils.TimelockConfig{MinDelay: 0} + mcmsConfig = &cldfproposalutils.TimelockConfig{MinDelay: 0} } // Tokens under test @@ -1645,9 +1645,9 @@ func TestUpdateWrappedNativeOnRouterChangeset(t *testing.T) { testhelpers.TransferToTimelock(t, tenv, state, []uint64{chainSel}, true) } - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{MinDelay: 0} + mcmsConfig = &cldfproposalutils.TimelockConfig{MinDelay: 0} } _, err = commonchangeset.Apply(t, tenv.Env, diff --git a/deployment/ccip/changeset/v1_6/cs_home_chain.go b/deployment/ccip/changeset/v1_6/cs_home_chain.go index f1042e6fac5..2e963b12bb0 100644 --- a/deployment/ccip/changeset/v1_6/cs_home_chain.go +++ b/deployment/ccip/changeset/v1_6/cs_home_chain.go @@ -24,6 +24,9 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_home" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" @@ -32,9 +35,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" - "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" @@ -492,7 +492,7 @@ func addNodes( type RemoveDONsConfig struct { HomeChainSel uint64 DonIDs []uint32 - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c RemoveDONsConfig) Validate(homeChain evm.CCIPChainState) error { @@ -561,7 +561,7 @@ func RemoveDONs(e cldf.Environment, cfg RemoveDONsConfig) (cldf.ChangesetOutput, if err != nil { return cldf.ChangesetOutput{}, err } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmsContractsByActionPerChain, @@ -581,7 +581,7 @@ func RemoveDONs(e cldf.Environment, cfg RemoveDONsConfig) (cldf.ChangesetOutput, type RemoveNodesConfig struct { HomeChainSel uint64 P2PIDsToRemove [][32]byte - MCMSCfg *proposalutils.TimelockConfig + MCMSCfg *cldfproposalutils.TimelockConfig } func removeNodesPrecondition(env cldf.Environment, c RemoveNodesConfig) error { @@ -703,7 +703,7 @@ func removeNodesLogic(env cldf.Environment, c RemoveNodesConfig) (cldf.Changeset if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to get mcms inspector for chain %s: %w", homeChain.String(), err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocks, mcmContract, @@ -743,7 +743,7 @@ type AddOrUpdateNopsConfig struct { homeChainSel uint64 ExistingNops []capabilities_registry.CapabilitiesRegistryNodeOperator // existing node operators, will be empty in case of adding new node operators NopUpdates map[string]capabilities_registry.CapabilitiesRegistryNodeOperator // node operators to add or update, key nop name, will be empty in case of removing node operators - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func addUpdateOrRemoveNopsPrecondition(env cldf.Environment, c AddOrUpdateNopsConfig) error { diff --git a/deployment/ccip/changeset/v1_6/cs_home_chain_test.go b/deployment/ccip/changeset/v1_6/cs_home_chain_test.go index f6363f65cf5..6a8bee5480c 100644 --- a/deployment/ccip/changeset/v1_6/cs_home_chain_test.go +++ b/deployment/ccip/changeset/v1_6/cs_home_chain_test.go @@ -6,10 +6,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/stretchr/testify/require" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" "github.com/smartcontractkit/chainlink-common/pkg/logger" @@ -22,7 +24,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -245,12 +246,12 @@ func TestRemoveDons(t *testing.T) { donsBefore, err = homeChain.CapabilityRegistry.GetDONs(nil) require.NoError(t, err) e.Env, err = commoncs.Apply(t, e.Env, commoncs.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ e.HomeChainSel: {homeChain.CapabilityRegistry.Address()}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }, @@ -259,7 +260,7 @@ func TestRemoveDons(t *testing.T) { v1_6.RemoveDONsConfig{ HomeChainSel: e.HomeChainSel, DonIDs: []uint32{donsBefore[0].Id}, - MCMS: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMS: &cldfproposalutils.TimelockConfig{MinDelay: 0}, }, )) require.NoError(t, err) @@ -380,9 +381,9 @@ func TestAddUpdateAndRemoveNops(t *testing.T) { require.NoError(t, err) homeChain := s.Chains[e.HomeChainSel] - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -390,8 +391,8 @@ func TestAddUpdateAndRemoveNops(t *testing.T) { // Transfer ownership to timelock so that we can promote the zero digest later down the line. _, err := commoncs.Apply(t, e.Env, commoncs.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ e.HomeChainSel: {homeChain.CapabilityRegistry.Address()}, }, @@ -514,9 +515,9 @@ func TestRemoveNodes(t *testing.T) { homeChain := s.Chains[e.HomeChainSel] allChains := e.Env.BlockChains.ListChainSelectors(cldf_chain.WithFamily(chain_selectors.FamilyEVM)) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -524,8 +525,8 @@ func TestRemoveNodes(t *testing.T) { // Transfer ownership to timelock so that we can promote the zero digest later down the line. _, err := commoncs.Apply(t, e.Env, commoncs.Configure( - cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2), - commoncs.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ e.HomeChainSel: {homeChain.CapabilityRegistry.Address()}, }, diff --git a/deployment/ccip/changeset/v1_6/cs_hybrid_with_external_minter_token_pool.go b/deployment/ccip/changeset/v1_6/cs_hybrid_with_external_minter_token_pool.go index f948b121694..1c0e367991f 100644 --- a/deployment/ccip/changeset/v1_6/cs_hybrid_with_external_minter_token_pool.go +++ b/deployment/ccip/changeset/v1_6/cs_hybrid_with_external_minter_token_pool.go @@ -9,12 +9,12 @@ import ( "github.com/smartcontractkit/ccip-contract-examples/chains/evm/gobindings/generated/1_6_1/hybrid_with_external_minter_token_pool" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var _ cldf.ChangeSet[ConfigureHybridWithExternalMinterTokenPoolConfig] = UpdateGroupsOnHybridWithExternalMinterTokenPool @@ -31,7 +31,7 @@ type HybridGroupConfig struct { type ConfigureHybridWithExternalMinterTokenPoolConfig struct { // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig // Symbol is the symbol of the token of interest. TokenSymbol shared.TokenSymbol diff --git a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5.go b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5.go index af1e91e1b8b..1a45b151be0 100644 --- a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5.go +++ b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5.go @@ -10,14 +10,16 @@ import ( "github.com/smartcontractkit/mcms" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" migrate_seq "github.com/smartcontractkit/chainlink/deployment/ccip/sequence/evm/migration" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -74,7 +76,7 @@ type InitChainUpgradesConfig struct { // SourceChains is a map of source chain selectors to their upgrade configurations. SourceChains map[uint64]SourceChainConfig // MCMSConfig is the configuration for the MCMS. - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } // NewFeeQuoterParamsForDestinationBySource returns a map of source chain selectors to their new FeeQuoter parameters for the given destination chain selector. @@ -468,9 +470,9 @@ func initChainUpgradesLogic(e cldf.Environment, c InitChainUpgradesConfig) (cldf } } - proposal, err := proposalutils.AggregateProposalsV2( + proposal, err := proposeutils.AggregateProposalsV2( e, - proposalutils.MCMSStates{ + proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), }, allProposals, @@ -496,7 +498,7 @@ type PromoteChainUpgradesConfig struct { // The sources of these chains will be promoted as well. DestChains []uint64 // MCMSConfig is the configuration for MCMS. - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func promoteChainUpgradesPrecondition(e cldf.Environment, c PromoteChainUpgradesConfig) error { @@ -745,9 +747,9 @@ func promoteChainUpgradesLogic(e cldf.Environment, c PromoteChainUpgradesConfig) } } - proposal, err := proposalutils.AggregateProposalsV2( + proposal, err := proposeutils.AggregateProposalsV2( e, - proposalutils.MCMSStates{ + proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), }, allProposals, @@ -783,7 +785,7 @@ func getSourceChainsForSelector(state stateview.CCIPOnChainState, chainSel uint6 return sourceChains } -func ensureTimelockOwnership(e cldf.Environment, chainSel uint64, contracts []commoncs.Ownable, mcmsCfg proposalutils.TimelockConfig) (cldf.ChangesetOutput, error) { +func ensureTimelockOwnership(e cldf.Environment, chainSel uint64, contracts []commoncs.Ownable, mcmsCfg cldfproposalutils.TimelockConfig) (cldf.ChangesetOutput, error) { addressesToTransfer := make([]common.Address, 0, len(contracts)) for _, contract := range contracts { if contract == nil { @@ -800,7 +802,7 @@ func ensureTimelockOwnership(e cldf.Environment, chainSel uint64, contracts []co if len(addressesToTransfer) == 0 { return cldf.ChangesetOutput{}, nil // Nothing to transfer, no ownership change needed. } - return commoncs.TransferToMCMSWithTimelockV2(e, commoncs.TransferToMCMSWithTimelockConfig{ + return mcmschangesets.TransferToMCMSWithTimelockV2(e, mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ chainSel: addressesToTransfer, }, diff --git a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go index eb392ea9458..436cefeec1c 100644 --- a/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go +++ b/deployment/ccip/changeset/v1_6/cs_migration_from_v1_5_test.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind/v2" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" @@ -18,7 +19,9 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf_deploy "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" @@ -29,9 +32,9 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ccipocr3types "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" cciptypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -87,7 +90,7 @@ var ( } ) -func initMigrationEnvironment(t *testing.T, numChains int, mcmsCfg proposalutils.TimelockConfig) cldf_deploy.Environment { +func initMigrationEnvironment(t *testing.T, numChains int, mcmsCfg cldfproposalutils.TimelockConfig) cldf_deploy.Environment { dEnv, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(numChains), testhelpers.WithDONConfigurationSkipped(), @@ -110,7 +113,7 @@ func initMigrationEnvironment(t *testing.T, numChains int, mcmsCfg proposalutils // Transfer home chain contracts to MCMS timelock if sel == homeChainSel { e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure(cldf_deploy.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), commonchangeset.TransferToMCMSWithTimelockConfig{ + commonchangeset.Configure(cldf_deploy.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ MCMSConfig: mcmsCfg, ContractsByChain: map[uint64][]common.Address{ sel: { @@ -127,7 +130,7 @@ func initMigrationEnvironment(t *testing.T, numChains int, mcmsCfg proposalutils // Transfer TokenAdminRegistry, Router, & RMN Proxy to MCMS timelock on all chains e, _, err = commonchangeset.ApplyChangesets(t, e, []commonchangeset.ConfiguredChangeSet{ - commonchangeset.Configure(cldf_deploy.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), commonchangeset.TransferToMCMSWithTimelockConfig{ + commonchangeset.Configure(cldf_deploy.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ MCMSConfig: mcmsCfg, ContractsByChain: map[uint64][]common.Address{ sel: { @@ -341,7 +344,7 @@ func initMigrationEnvironment(t *testing.T, numChains int, mcmsCfg proposalutils } func TestInitAndPromoteChainUpgrades(t *testing.T) { - mcmsCfg := proposalutils.TimelockConfig{ + mcmsCfg := cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, } diff --git a/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go b/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go index 9750ce018d5..532e633e71f 100644 --- a/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go +++ b/deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go @@ -17,6 +17,7 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" aptosCCIP "github.com/smartcontractkit/chainlink-aptos/bindings/ccip" aptosOffRamp "github.com/smartcontractkit/chainlink-aptos/bindings/ccip_offramp" @@ -26,7 +27,9 @@ import ( solState "github.com/smartcontractkit/chainlink-ccip/chains/solana/utils/state" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/dependency" aptosUtils "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/aptos/utils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" @@ -37,7 +40,6 @@ import ( aptosstateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/aptos" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" solanastateview "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -57,7 +59,7 @@ type RMNCurseAction struct { type CurseAction func(e cldf.Environment) ([]RMNCurseAction, error) type RMNCurseConfig struct { - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig CurseActions []CurseAction // Use this if you need to include lanes that are not in sourcechain in the offramp. i.e. not yet migrated lane from 1.5 IncludeNotConnectedLanes bool @@ -481,9 +483,9 @@ func RMNCurseChangeset(e cldf.Environment, cfg RMNCurseConfig) (cldf.ChangesetOu } proposals := partialOut.MCMSTimelockProposals proposals = append(proposals, aptosProposals...) - aggProposal, err := proposalutils.AggregateProposalsV2( + aggProposal, err := proposeutils.AggregateProposalsV2( e, - proposalutils.MCMSStates{ + proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSSolanaState: state.SolanaMCMSStateByChain(e), MCMSAptosState: state.AptosMCMSStateByChain(), @@ -615,9 +617,9 @@ func RMNUncurseChangeset(e cldf.Environment, cfg RMNCurseConfig) (cldf.Changeset } proposals := partialOut.MCMSTimelockProposals proposals = append(proposals, aptosProposals...) - aggProposal, err := proposalutils.AggregateProposalsV2( + aggProposal, err := proposeutils.AggregateProposalsV2( e, - proposalutils.MCMSStates{ + proposeutils.MCMSStates{ MCMSEVMState: state.EVMMCMSStateByChain(), MCMSSolanaState: state.SolanaMCMSStateByChain(e), MCMSAptosState: state.AptosMCMSStateByChain(), diff --git a/deployment/ccip/changeset/v1_6/cs_token_governor.go b/deployment/ccip/changeset/v1_6/cs_token_governor.go index 6d40cd9dc2a..a66ef48e7fb 100644 --- a/deployment/ccip/changeset/v1_6/cs_token_governor.go +++ b/deployment/ccip/changeset/v1_6/cs_token_governor.go @@ -11,12 +11,12 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/ccip-contract-examples/chains/evm/gobindings/generated/1_6_1/token_governor" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/erc20" "github.com/smartcontractkit/chainlink/deployment" @@ -58,7 +58,7 @@ type TokenGovernor struct { type TokenGovernorChangesetConfig struct { Tokens map[uint64]map[shared.TokenSymbol]TokenGovernor - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type TokenGovernorGrantRole struct { @@ -68,7 +68,7 @@ type TokenGovernorGrantRole struct { type TokenGovernorRoleChangesetConfig struct { Tokens map[uint64]map[shared.TokenSymbol]TokenGovernorGrantRole - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } // String returns the string representation of the TokenGovernorRole. diff --git a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter.go b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter.go index 8485f926b1b..b35e2bfcc5d 100644 --- a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter.go +++ b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter.go @@ -7,6 +7,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_6" @@ -15,7 +16,6 @@ import ( migrate_seq "github.com/smartcontractkit/chainlink/deployment/ccip/sequence/evm/migration" ccipseqs "github.com/smartcontractkit/chainlink/deployment/ccip/sequence/evm/v1_6" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -26,7 +26,7 @@ var ( type TranslateEVM2EVMOnRampsToFeeQuoterConfig struct { DestChainSelector uint64 NewFeeQuoterParamsPerSource map[uint64]migrate_seq.NewFeeQuoterDestChainConfigParams - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (cfg TranslateEVM2EVMOnRampsToFeeQuoterConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go index 9d6971956a6..d3562e9c455 100644 --- a/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go +++ b/deployment/ccip/changeset/v1_6/cs_translate_onramp_to_feequoter_test.go @@ -45,7 +45,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" ) @@ -299,7 +298,7 @@ func TestTranslateEVM2EVMOnRampsToFeeQuoterChangeset_WithMCMS(t *testing.T) { GasMultiplierWeiPerEth: 11e17, NetworkFeeUSDCents: 10, } - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, } @@ -315,12 +314,12 @@ func TestTranslateEVM2EVMOnRampsToFeeQuoterChangeset_WithMCMS(t *testing.T) { // changeset proposal can be routed through it. tenv, err = commonchangeset.Apply(t, tenv, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ sourceChainSelector: {state.MustGetEVMChainState(sourceChainSelector).FeeQuoter.Address()}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, }, diff --git a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes.go b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes.go index bc3674f256f..6f7f3774581 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes.go +++ b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes.go @@ -15,6 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/nonce_manager" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" @@ -24,11 +25,11 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // UpdateBidirectionalLanesChangeset enables or disables multiple bidirectional lanes on CCIP. @@ -54,7 +55,7 @@ type laneDefinition struct { // UpdateBidirectionalLanesConfig is a configuration struct for UpdateBidirectionalLanesChangeset. type UpdateBidirectionalLanesConfig struct { // MCMSConfig defines the MCMS configuration for the changeset. - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig // Lanes describes the lanes that we want to create. Lanes []BidirectionalLaneDefinition // TestRouter indicates if we want to enable these lanes on the test router. @@ -226,7 +227,7 @@ func updateBidirectionalLanesLogic(e cldf.Environment, c UpdateBidirectionalLane // On chains where a v2 FeeQuoter is deployed alongside the active v1.6 FeeQuoter, both are updated. // Already-configured destinations are skipped to ensure idempotency. Configs provided can be unidirectional // TODO: UpdateBidirectionalLanesChangesetConfigs name is misleading, it also accepts unidirectional lane updates -func UpdateLanesLogic(e cldf.Environment, mcmsConfig *proposalutils.TimelockConfig, skipNonceManagerUpdates bool, configs UpdateBidirectionalLanesChangesetConfigs) (cldf.ChangesetOutput, error) { +func UpdateLanesLogic(e cldf.Environment, mcmsConfig *cldfproposalutils.TimelockConfig, skipNonceManagerUpdates bool, configs UpdateBidirectionalLanesChangesetConfigs) (cldf.ChangesetOutput, error) { var loadOpts []stateview.LoadOption if !skipNonceManagerUpdates { loadOpts = append(loadOpts, stateview.WithLoadLegacyContracts(true)) @@ -372,9 +373,9 @@ func UpdateLanesLogic(e cldf.Environment, mcmsConfig *proposalutils.TimelockConf output.MCMSTimelockProposals = append(output.MCMSTimelockProposals, mcmslib.TimelockProposal{ Operations: v2BatchOps, }) - aggProposal, err := proposalutils.AggregateProposalsV2( + aggProposal, err := proposeutils.AggregateProposalsV2( e, - proposalutils.MCMSStates{MCMSEVMState: state.EVMMCMSStateByChain()}, + proposeutils.MCMSStates{MCMSEVMState: state.EVMMCMSStateByChain()}, output.MCMSTimelockProposals, "Update lanes on CCIP", mcmsConfig, @@ -570,7 +571,7 @@ func buildNonceManagerUpdatesFromV15Contracts( e cldf.Environment, state stateview.CCIPOnChainState, configs UpdateBidirectionalLanesChangesetConfigs, - mcmsConfig *proposalutils.TimelockConfig, + mcmsConfig *cldfproposalutils.TimelockConfig, ) (ccipseqs.NonceManagerUpdatesSequenceInput, error) { updates := make(map[uint64]ccipseqs.NonceManagerUpdateInput) @@ -613,7 +614,7 @@ func maybeAddPreviousRampUpdate( state stateview.CCIPOnChainState, updates map[uint64]ccipseqs.NonceManagerUpdateInput, sourceChain, destChain uint64, - mcmsConfig *proposalutils.TimelockConfig, + mcmsConfig *cldfproposalutils.TimelockConfig, ) error { chainState := state.Chains[sourceChain] if chainState.NonceManager == nil { diff --git a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go index 2f4b018c483..301cc665a49 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go +++ b/deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go @@ -12,12 +12,14 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" fqv2ops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/operations/fee_quoter" fqv2seq "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v2_0_0/sequences" @@ -34,7 +36,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type laneDefinition struct { @@ -183,7 +184,7 @@ func TestBuildConfigs(t *testing.T) { cfg := v1_6.UpdateBidirectionalLanesConfig{ TestRouter: false, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, }, @@ -285,11 +286,11 @@ func TestUpdateBidirectionalLanesChangeset(t *testing.T) { type test struct { Msg string TestRouter bool - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig Disable bool } - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, } @@ -346,10 +347,10 @@ func TestUpdateBidirectionalLanesChangeset(t *testing.T) { } e, err = commonchangeset.Apply(t, e, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsToTransfer, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, }, @@ -852,7 +853,7 @@ func TestUpdateBidirectionalLanesChangesetWithV2FeeQuoterWithMCMS(t *testing.T) e.DataStore = ds.Seal() // Transfer contracts to MCMS timelock - mcmsConfig := &proposalutils.TimelockConfig{ + mcmsConfig := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, } @@ -875,10 +876,10 @@ func TestUpdateBidirectionalLanesChangesetWithV2FeeQuoterWithMCMS(t *testing.T) e, err = commonchangeset.Apply(t, e, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsToTransfer, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: types.TimelockActionSchedule, }, diff --git a/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go b/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go index 7aec4835dfc..f8f4497d2ee 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" mcmslib "github.com/smartcontractkit/mcms" mcmssdk "github.com/smartcontractkit/mcms/sdk" @@ -31,7 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -45,7 +45,7 @@ var ( type SetRMNRemoteOnRMNProxyConfig struct { ChainSelectors []uint64 - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (c SetRMNRemoteOnRMNProxyConfig) Validate(e cldf.Environment, state stateview.CCIPOnChainState) error { @@ -138,7 +138,7 @@ func (c RMNNopConfig) SetBit(bitmap *big.Int, value bool) { } } -func getDeployer(e cldf.Environment, chain uint64, mcmConfig *proposalutils.TimelockConfig) *bind.TransactOpts { +func getDeployer(e cldf.Environment, chain uint64, mcmConfig *cldfproposalutils.TimelockConfig) *bind.TransactOpts { if mcmConfig == nil { return e.BlockChains.EVMChains()[chain].DeployerKey } @@ -151,7 +151,7 @@ type SetRMNHomeCandidateConfig struct { RMNStaticConfig rmn_home.RMNHomeStaticConfig RMNDynamicConfig rmn_home.RMNHomeDynamicConfig DigestToOverride [32]byte - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (c SetRMNHomeCandidateConfig) Validate(state stateview.CCIPOnChainState) error { @@ -257,7 +257,7 @@ func isRMNDynamicConfigEqual(a, b rmn_home.RMNHomeDynamicConfig) bool { type PromoteRMNHomeCandidateConfig struct { HomeChainSelector uint64 DigestToPromote [32]byte - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig } func (c PromoteRMNHomeCandidateConfig) Validate(state stateview.CCIPOnChainState) error { @@ -350,7 +350,7 @@ func SetRMNHomeCandidateConfigChangeset(e cldf.Environment, config SetRMNHomeCan return cldf.ChangesetOutput{}, fmt.Errorf("failed to get mcms inspector for chain %s: %w", homeChain.String(), err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmContract, @@ -435,7 +435,7 @@ func PromoteRMNHomeCandidateConfigChangeset(e cldf.Environment, config PromoteRM return cldf.ChangesetOutput{}, fmt.Errorf("failed to get mcms inspector for chain %s: %w", homeChain.String(), err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmContract, @@ -465,7 +465,7 @@ type SetRMNHomeDynamicConfigConfig struct { HomeChainSelector uint64 RMNDynamicConfig rmn_home.RMNHomeDynamicConfig ActiveDigest [32]byte - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c SetRMNHomeDynamicConfigConfig) Validate(e cldf.Environment) error { @@ -540,7 +540,7 @@ func SetRMNHomeDynamicConfigChangeset(e cldf.Environment, cfg SetRMNHomeDynamicC type RevokeCandidateConfig struct { HomeChainSelector uint64 CandidateDigest [32]byte - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c RevokeCandidateConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_6_1/cs_proxy_admin.go b/deployment/ccip/changeset/v1_6_1/cs_proxy_admin.go index ec8f6d100c3..dc0bf812385 100644 --- a/deployment/ccip/changeset/v1_6_1/cs_proxy_admin.go +++ b/deployment/ccip/changeset/v1_6_1/cs_proxy_admin.go @@ -7,10 +7,10 @@ import ( "github.com/smartcontractkit/ccip-contract-examples/chains/evm/gobindings/generated/1_6_1/proxy_admin" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -24,7 +24,7 @@ type ProxyAdmin struct { type ProxyAdminChangesetConfig struct { Tokens map[uint64]map[string]ProxyAdmin - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c ProxyAdminChangesetConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_6_1/cs_transparent_upgradeable_proxy.go b/deployment/ccip/changeset/v1_6_1/cs_transparent_upgradeable_proxy.go index ae945f6e649..b11dfdda46d 100644 --- a/deployment/ccip/changeset/v1_6_1/cs_transparent_upgradeable_proxy.go +++ b/deployment/ccip/changeset/v1_6_1/cs_transparent_upgradeable_proxy.go @@ -15,12 +15,12 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/1_5_0/burn_mint_erc20_transparent" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -44,7 +44,7 @@ type TransparentUpgradeableProxy struct { type TransparentUpgradeableProxyChangesetConfig struct { Tokens map[uint64]map[string]TransparentUpgradeableProxy - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type TransparentUpgradeableProxyRole string @@ -62,7 +62,7 @@ type TransparentUpgradeableProxyGrantRole struct { type TransparentUpgradeableProxyGrantRoleChangesetConfig struct { Tokens map[uint64]map[string][]TransparentUpgradeableProxyGrantRole - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func (c TransparentUpgradeableProxyChangesetConfig) Validate(e cldf.Environment) error { diff --git a/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy.go b/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy.go index 84c6094ad6f..1b6b9b8ab90 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy.go +++ b/deployment/ccip/changeset/v1_6_2/cs_configure_cctp_message_transmitter_proxy.go @@ -12,11 +12,11 @@ import ( cmtp "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_2/cctp_message_transmitter_proxy" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/deployment" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" @@ -104,7 +104,7 @@ type ConfigureCCTPMessageTransmitterProxyContractConfig struct { CCTPProxies map[uint64]ConfigureCCTPMessageTransmitterProxyInput // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func configureCCTPMessageTransmitterProxyContractPrecondition(env cldf.Environment, c ConfigureCCTPMessageTransmitterProxyContractConfig) error { diff --git a/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool.go b/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool.go index 7995157e227..8b3584248a3 100644 --- a/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool.go +++ b/deployment/ccip/changeset/v1_6_2/cs_configure_usdc_token_pool.go @@ -14,11 +14,10 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - utp "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_2/usdc_token_pool" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" @@ -122,7 +121,7 @@ type ConfigUSDCTokenPoolConfig struct { USDCPools map[uint64]ConfigUSDCTokenPoolInput // MCMS defines the delay to use for Timelock (if absent, the changeset will attempt to use the deployer key). - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func configUSDCTokenPoolPrecondition(env cldf.Environment, c ConfigUSDCTokenPoolConfig) error { diff --git a/deployment/ccip/operation/evm/v1_6/ops_rmnremote.go b/deployment/ccip/operation/evm/v1_6/ops_rmnremote.go index da7fc02cc82..bade085b018 100644 --- a/deployment/ccip/operation/evm/v1_6/ops_rmnremote.go +++ b/deployment/ccip/operation/evm/v1_6/ops_rmnremote.go @@ -9,16 +9,16 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_0_0/rmn_proxy_contract" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_remote" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type SetRMNRemoteConfig struct { - ChainSelector uint64 `json:"chainSelector"` - RMNRemoteConfig RMNRemoteConfig `json:"rmnRemoteConfigs"` - MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` + ChainSelector uint64 `json:"chainSelector"` + RMNRemoteConfig RMNRemoteConfig `json:"rmnRemoteConfigs"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` } type RMNRemoteConfig struct { diff --git a/deployment/ccip/sequence/evm/v1_6/seq_rmn.go b/deployment/ccip/sequence/evm/v1_6/seq_rmn.go index 9dce29cb8a4..96c9fd4daee 100644 --- a/deployment/ccip/sequence/evm/v1_6/seq_rmn.go +++ b/deployment/ccip/sequence/evm/v1_6/seq_rmn.go @@ -9,6 +9,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_remote" cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" @@ -16,7 +17,6 @@ import ( ccipops "github.com/smartcontractkit/chainlink/deployment/ccip/operation/evm/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -70,7 +70,7 @@ type SetRMNRemoteOnRMNProxySequenceInput struct { type SetRMNRemoteConfig struct { RMNRemoteConfigs map[uint64]ccipops.RMNRemoteConfig `json:"rmnRemoteConfigs"` - MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` } func (c SetRMNRemoteConfig) Validate(env cldf.Environment, state stateview.CCIPOnChainState) error { diff --git a/deployment/ccip/shared/bindings/signer_registry_solana/accounts.go b/deployment/ccip/shared/bindings/signer_registry_solana/accounts.go index 6e796788b17..9ec44a6f904 100644 --- a/deployment/ccip/shared/bindings/signer_registry_solana/accounts.go +++ b/deployment/ccip/shared/bindings/signer_registry_solana/accounts.go @@ -5,6 +5,7 @@ package signer_registry_solana import ( "fmt" + binary "github.com/gagliardetto/binary" ) diff --git a/deployment/ccip/shared/bindings/signer_registry_solana/events.go b/deployment/ccip/shared/bindings/signer_registry_solana/events.go index 8af13bde518..a02adde7c98 100644 --- a/deployment/ccip/shared/bindings/signer_registry_solana/events.go +++ b/deployment/ccip/shared/bindings/signer_registry_solana/events.go @@ -5,6 +5,7 @@ package signer_registry_solana import ( "fmt" + binary "github.com/gagliardetto/binary" ) diff --git a/deployment/ccip/shared/bindings/signer_registry_solana/instructions.go b/deployment/ccip/shared/bindings/signer_registry_solana/instructions.go index f921e0acbd6..570e9d2896f 100644 --- a/deployment/ccip/shared/bindings/signer_registry_solana/instructions.go +++ b/deployment/ccip/shared/bindings/signer_registry_solana/instructions.go @@ -6,6 +6,7 @@ package signer_registry_solana import ( "bytes" "fmt" + errors "github.com/gagliardetto/anchor-go/errors" binary "github.com/gagliardetto/binary" solanago "github.com/gagliardetto/solana-go" diff --git a/deployment/ccip/shared/bindings/signer_registry_solana/types.go b/deployment/ccip/shared/bindings/signer_registry_solana/types.go index 963a3619807..b175f4f8790 100644 --- a/deployment/ccip/shared/bindings/signer_registry_solana/types.go +++ b/deployment/ccip/shared/bindings/signer_registry_solana/types.go @@ -6,6 +6,7 @@ package signer_registry_solana import ( "bytes" "fmt" + errors "github.com/gagliardetto/anchor-go/errors" binary "github.com/gagliardetto/binary" solanago "github.com/gagliardetto/solana-go" diff --git a/deployment/ccip/shared/deployergroup/deployer_group.go b/deployment/ccip/shared/deployergroup/deployer_group.go index 3a2357b5fdb..d3f727f3476 100644 --- a/deployment/ccip/shared/deployergroup/deployer_group.go +++ b/deployment/ccip/shared/deployergroup/deployer_group.go @@ -26,16 +26,16 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type DeployerGroup struct { e cldf.Environment state stateview.CCIPOnChainState - mcmConfig *proposalutils.TimelockConfig + mcmConfig *cldfproposalutils.TimelockConfig deploymentContext *DeploymentContext txDecoder *shared.TxCallDecoder describeContext *shared.ArgumentContext @@ -125,7 +125,7 @@ type DeployerGroupWithContext interface { type deployerGroupBuilder struct { e cldf.Environment state stateview.CCIPOnChainState - mcmConfig *proposalutils.TimelockConfig + mcmConfig *cldfproposalutils.TimelockConfig txDecoder *shared.TxCallDecoder describeContext *shared.ArgumentContext } @@ -153,7 +153,7 @@ func (d *deployerGroupBuilder) WithDeploymentContext(description string) *Deploy // state.Chains[selector].RMNRemote.Curse() // # Execute the transaction or create the proposal // deployerGroup.Enact("Curse RMNRemote") -func NewDeployerGroup(e cldf.Environment, state stateview.CCIPOnChainState, mcmConfig *proposalutils.TimelockConfig) DeployerGroupWithContext { +func NewDeployerGroup(e cldf.Environment, state stateview.CCIPOnChainState, mcmConfig *cldfproposalutils.TimelockConfig) DeployerGroupWithContext { addresses, _ := e.ExistingAddresses.Addresses() d := &deployerGroupBuilder{ e: e, @@ -340,7 +340,7 @@ func (d *DeployerGroup) Enact() (cldf.ChangesetOutput, error) { return d.enactDeployer() } -func ValidateMCMSWithState(env cldf.Environment, selector uint64, mcmConfig *proposalutils.TimelockConfig, state stateview.CCIPOnChainState) error { +func ValidateMCMSWithState(env cldf.Environment, selector uint64, mcmConfig *cldfproposalutils.TimelockConfig, state stateview.CCIPOnChainState) error { family, err := chain_selectors.GetSelectorFamily(selector) if err != nil { return fmt.Errorf("failed to get chain selector family: %w", err) @@ -417,7 +417,7 @@ func (d *DeployerGroup) enactMcms() (cldf.ChangesetOutput, error) { return cldf.ChangesetOutput{}, fmt.Errorf("failed to get mcms inspector for chain: %w", err) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( d.e, timelocks, mcmContractByAction, @@ -539,7 +539,7 @@ func BuildTimelockAddressPerChain(e cldf.Environment, onchainState stateview.CCI return addressPerChain, nil } -func BuildMcmAddressesPerChainByAction(e cldf.Environment, onchainState stateview.CCIPOnChainState, mcmCfg *proposalutils.TimelockConfig, mcmQualifier map[uint64]string) (map[uint64]string, error) { +func BuildMcmAddressesPerChainByAction(e cldf.Environment, onchainState stateview.CCIPOnChainState, mcmCfg *cldfproposalutils.TimelockConfig, mcmQualifier map[uint64]string) (map[uint64]string, error) { if mcmCfg == nil { return nil, errors.New("mcm config is nil, cannot get mcms address") } diff --git a/deployment/ccip/shared/deployergroup/deployer_group_test.go b/deployment/ccip/shared/deployergroup/deployer_group_test.go index acffaed78ff..99b1f86b456 100644 --- a/deployment/ccip/shared/deployergroup/deployer_group_test.go +++ b/deployment/ccip/shared/deployergroup/deployer_group_test.go @@ -28,7 +28,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) type mintConfig struct { @@ -39,18 +38,18 @@ type mintConfig struct { type dummyMultiChainDeployerGroupChangesetConfig struct { address common.Address mints []mintConfig - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type dummyDeployerGroupChangesetConfig struct { selector uint64 address common.Address mints []*big.Int - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } type dummyEmptyBatchChangesetConfig struct { - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig } func dummyEmptyBatchChangeset(e cldf.Environment, cfg dummyEmptyBatchChangesetConfig) (cldf.ChangesetOutput, error) { @@ -239,7 +238,7 @@ func TestDeployerGroupMCMS(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) tc.cfg.selector = e.HomeChainSel - tc.cfg.MCMS = &proposalutils.TimelockConfig{ + tc.cfg.MCMS = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } state, err := stateview.LoadOnchainState(e.Env) @@ -250,10 +249,10 @@ func TestDeployerGroupMCMS(t *testing.T) { _, err = commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }, @@ -311,7 +310,7 @@ func TestDeployerGroupWithTimelockAddressQualifier(t *testing.T) { amount: big.NewInt(4), }, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0, // we will set the qualifier below after we know the chain selector }, @@ -352,8 +351,8 @@ func TestDeployerGroupWithTimelockAddressQualifier(t *testing.T) { contractsByChain[chain] = []common.Address{token.Address()} e.Env, err = commonchangeset.Apply(t, e.Env, - commonchangeset.Configure(cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + commonchangeset.Configure(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, MCMSConfig: *testCfg.MCMS, }, @@ -397,7 +396,7 @@ func TestDeployerGroupGenerateMultipleProposals(t *testing.T) { amount: big.NewInt(4), }, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0, }, } @@ -412,10 +411,10 @@ func TestDeployerGroupGenerateMultipleProposals(t *testing.T) { _, err = commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }, @@ -459,7 +458,7 @@ func TestDeployerGroupMultipleProposalsMCMS(t *testing.T) { amount: big.NewInt(2), }, }, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0, }, } @@ -476,10 +475,10 @@ func TestDeployerGroupMultipleProposalsMCMS(t *testing.T) { _, err = commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }, @@ -523,7 +522,7 @@ func TestEmptyBatch(t *testing.T) { e, _ := testhelpers.NewMemoryEnvironment(t, testhelpers.WithNumOfChains(2)) cfg := dummyEmptyBatchChangesetConfig{ - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 0, }, } diff --git a/deployment/ccip/shared/stateview/state.go b/deployment/ccip/shared/stateview/state.go index 9720c582ac0..62c221513eb 100644 --- a/deployment/ccip/shared/stateview/state.go +++ b/deployment/ccip/shared/stateview/state.go @@ -35,6 +35,7 @@ import ( cldf_chain_utils "github.com/smartcontractkit/chainlink-deployments-framework/chain/utils" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/link_token" @@ -47,8 +48,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/evm" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/erc20" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/erc677" @@ -555,7 +554,7 @@ func (c CCIPOnChainState) SupportedChains() map[uint64]struct{} { // EnforceMCMSUsageIfProd determines if an MCMS config should be enforced for this particular environment. // It checks if the CCIPHome and CapabilitiesRegistry contracts are owned by the Timelock because all other contracts should follow this precedent. // If the home chain contracts are owned by the Timelock and no mcmsConfig is provided, this function will return an error. -func (c CCIPOnChainState) EnforceMCMSUsageIfProd(ctx context.Context, mcmsConfig *proposalutils.TimelockConfig) error { +func (c CCIPOnChainState) EnforceMCMSUsageIfProd(ctx context.Context, mcmsConfig *cldfproposalutils.TimelockConfig) error { // Instead of accepting a homeChainSelector, we simply look for the CCIPHome and CapabilitiesRegistry in state. // This is because the home chain selector is not always available in the input to a changeset. // Also, if the underlying rules to EnforceMCMSUsageIfProd change (i.e. what determines "prod" changes), @@ -611,7 +610,7 @@ func (c CCIPOnChainState) EnforceMCMSUsageIfProd(ctx context.Context, mcmsConfig // ValidateOwnershipOfChain validates the ownership of every CCIP contract on a chain. // If mcmsConfig is nil, the expected owner of each contract is the chain's deployer key. // If provided, the expected owner is the Timelock contract. -func (c CCIPOnChainState) ValidateOwnershipOfChain(e cldf.Environment, chainSel uint64, mcmsConfig *proposalutils.TimelockConfig, ownedContracts map[string]commoncs.Ownable) error { +func (c CCIPOnChainState) ValidateOwnershipOfChain(e cldf.Environment, chainSel uint64, mcmsConfig *cldfproposalutils.TimelockConfig, ownedContracts map[string]commoncs.Ownable) error { chain, ok := e.BlockChains.EVMChains()[chainSel] if !ok { return fmt.Errorf("chain with selector %d not found in the environment", chainSel) @@ -1772,7 +1771,7 @@ func LoadChainState(ctx context.Context, chain cldf_evm.Chain, addresses map[str return state, nil } -func ValidateChain(env cldf.Environment, state CCIPOnChainState, chainSel uint64, mcmsCfg *proposalutils.TimelockConfig) error { +func ValidateChain(env cldf.Environment, state CCIPOnChainState, chainSel uint64, mcmsCfg *cldfproposalutils.TimelockConfig) error { err := cldf.IsValidChainSelector(chainSel) if err != nil { return fmt.Errorf("is not valid chain selector %d: %w", chainSel, err) diff --git a/deployment/ccip/shared/stateview/state_test.go b/deployment/ccip/shared/stateview/state_test.go index 08f5c5a0ef9..d42f5cc9e3f 100644 --- a/deployment/ccip/shared/stateview/state_test.go +++ b/deployment/ccip/shared/stateview/state_test.go @@ -34,8 +34,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -329,7 +327,7 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { TransferCCIPHomeToMCMS bool TransferCapRegToMCMS bool ExpectedErr string - MCMSConfig *proposalutils.TimelockConfig + MCMSConfig *cldfproposalutils.TimelockConfig }{ { Msg: "CCIPHome & CapReg ownership mismatch", @@ -338,7 +336,7 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { DeployMCMS: true, TransferCCIPHomeToMCMS: true, TransferCapRegToMCMS: false, - MCMSConfig: &proposalutils.TimelockConfig{}, + MCMSConfig: &cldfproposalutils.TimelockConfig{}, ExpectedErr: "CCIPHome and CapabilitiesRegistry owners do not match", }, { @@ -348,7 +346,7 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { DeployMCMS: true, TransferCCIPHomeToMCMS: true, TransferCapRegToMCMS: true, - MCMSConfig: &proposalutils.TimelockConfig{}, + MCMSConfig: &cldfproposalutils.TimelockConfig{}, ExpectedErr: "", }, { @@ -368,7 +366,7 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { DeployMCMS: true, TransferCCIPHomeToMCMS: false, TransferCapRegToMCMS: false, - MCMSConfig: &proposalutils.TimelockConfig{}, + MCMSConfig: &cldfproposalutils.TimelockConfig{}, ExpectedErr: "", }, { @@ -388,7 +386,7 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { DeployMCMS: false, TransferCCIPHomeToMCMS: false, TransferCapRegToMCMS: false, - MCMSConfig: &proposalutils.TimelockConfig{}, + MCMSConfig: &cldfproposalutils.TimelockConfig{}, ExpectedErr: "", }, { @@ -408,7 +406,7 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { DeployMCMS: false, TransferCCIPHomeToMCMS: false, TransferCapRegToMCMS: false, - MCMSConfig: &proposalutils.TimelockConfig{}, + MCMSConfig: &cldfproposalutils.TimelockConfig{}, ExpectedErr: "", }, { @@ -484,11 +482,11 @@ func TestEnforceMCMSUsageIfProd(t *testing.T) { } if len(addrs) > 0 { err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), commonchangeset.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ homeChainSelector: addrs, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }), diff --git a/deployment/ccip/view/v1_0/rmn_proxy_contract.go b/deployment/ccip/view/v1_0/rmn_proxy_contract.go index 05912332906..8cadb7d96a0 100644 --- a/deployment/ccip/view/v1_0/rmn_proxy_contract.go +++ b/deployment/ccip/view/v1_0/rmn_proxy_contract.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_0_0/rmn_proxy_contract" ) diff --git a/deployment/ccip/view/v1_2/price_registry.go b/deployment/ccip/view/v1_2/price_registry.go index 5105f72f3e6..6d408fe2023 100644 --- a/deployment/ccip/view/v1_2/price_registry.go +++ b/deployment/ccip/view/v1_2/price_registry.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" price_registry_1_2_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/price_registry" ) diff --git a/deployment/ccip/view/v1_2/router.go b/deployment/ccip/view/v1_2/router.go index 5c8e18a2ee9..945cfab76a7 100644 --- a/deployment/ccip/view/v1_2/router.go +++ b/deployment/ccip/view/v1_2/router.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" ) diff --git a/deployment/ccip/view/v1_5/commit_store.go b/deployment/ccip/view/v1_5/commit_store.go index b66070bb0d7..0bbf722d002 100644 --- a/deployment/ccip/view/v1_5/commit_store.go +++ b/deployment/ccip/view/v1_5/commit_store.go @@ -3,7 +3,7 @@ package v1_5 import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/commit_store" ) diff --git a/deployment/ccip/view/v1_5/offramp.go b/deployment/ccip/view/v1_5/offramp.go index 2cab1d852db..758768ffdfa 100644 --- a/deployment/ccip/view/v1_5/offramp.go +++ b/deployment/ccip/view/v1_5/offramp.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_offramp" ) diff --git a/deployment/ccip/view/v1_5/onramp.go b/deployment/ccip/view/v1_5/onramp.go index 7d9cdb23060..6a17d438465 100644 --- a/deployment/ccip/view/v1_5/onramp.go +++ b/deployment/ccip/view/v1_5/onramp.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" ) diff --git a/deployment/ccip/view/v1_5/rmn.go b/deployment/ccip/view/v1_5/rmn.go index 3b2d7a85979..b401d7f86c4 100644 --- a/deployment/ccip/view/v1_5/rmn.go +++ b/deployment/ccip/view/v1_5/rmn.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/rmn_contract" ) diff --git a/deployment/ccip/view/v1_5/token_pool.go b/deployment/ccip/view/v1_5/token_pool.go index 209e97b035b..003dd876ab4 100644 --- a/deployment/ccip/view/v1_5/token_pool.go +++ b/deployment/ccip/view/v1_5/token_pool.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/burn_mint_token_pool_and_proxy" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" diff --git a/deployment/ccip/view/v1_5/tokenadminregistry.go b/deployment/ccip/view/v1_5/tokenadminregistry.go index 0fed714d05a..bdf74c09e8a 100644 --- a/deployment/ccip/view/v1_5/tokenadminregistry.go +++ b/deployment/ccip/view/v1_5/tokenadminregistry.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "golang.org/x/sync/errgroup" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/token_admin_registry" diff --git a/deployment/ccip/view/v1_5_1/token_pool.go b/deployment/ccip/view/v1_5_1/token_pool.go index 6473ca041aa..25933e362e0 100644 --- a/deployment/ccip/view/v1_5_1/token_pool.go +++ b/deployment/ccip/view/v1_5_1/token_pool.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "golang.org/x/exp/maps" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_from_mint_token_pool" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_mint_token_pool" diff --git a/deployment/ccip/view/v1_6/ccip_home.go b/deployment/ccip/view/v1_6/ccip_home.go index ad12f5a1545..e022fdb84cf 100644 --- a/deployment/ccip/view/v1_6/ccip_home.go +++ b/deployment/ccip/view/v1_6/ccip_home.go @@ -15,12 +15,13 @@ import ( "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/ccip_home" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink/deployment/ccip/shared" cciptypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) diff --git a/deployment/ccip/view/v1_6/feequoter.go b/deployment/ccip/view/v1_6/feequoter.go index 8809da1a196..1ee6375f626 100644 --- a/deployment/ccip/view/v1_6/feequoter.go +++ b/deployment/ccip/view/v1_6/feequoter.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" router1_2 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" diff --git a/deployment/ccip/view/v1_6/noncemanager.go b/deployment/ccip/view/v1_6/noncemanager.go index bae529b1ec9..fbd49368d8f 100644 --- a/deployment/ccip/view/v1_6/noncemanager.go +++ b/deployment/ccip/view/v1_6/noncemanager.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/nonce_manager" ) diff --git a/deployment/ccip/view/v1_6/offramp.go b/deployment/ccip/view/v1_6/offramp.go index 91e4fa4f266..54343fbc18f 100644 --- a/deployment/ccip/view/v1_6/offramp.go +++ b/deployment/ccip/view/v1_6/offramp.go @@ -8,7 +8,7 @@ import ( router1_2 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/offramp" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink/deployment/ccip/view/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/view/v1_2" diff --git a/deployment/ccip/view/v1_6/onramp.go b/deployment/ccip/view/v1_6/onramp.go index 1589481bb0a..6f8c8bbde4d 100644 --- a/deployment/ccip/view/v1_6/onramp.go +++ b/deployment/ccip/view/v1_6/onramp.go @@ -10,7 +10,7 @@ import ( router1_2 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/onramp" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink/deployment/ccip/view/v1_2" ) diff --git a/deployment/ccip/view/v1_6/rmnhome.go b/deployment/ccip/view/v1_6/rmnhome.go index f9fbfbe2178..82c021dd565 100644 --- a/deployment/ccip/view/v1_6/rmnhome.go +++ b/deployment/ccip/view/v1_6/rmnhome.go @@ -8,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_home" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" diff --git a/deployment/ccip/view/v1_6/rmnremote.go b/deployment/ccip/view/v1_6/rmnremote.go index 64c31d09e75..e78f5a9e12a 100644 --- a/deployment/ccip/view/v1_6/rmnremote.go +++ b/deployment/ccip/view/v1_6/rmnremote.go @@ -5,9 +5,10 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_remote" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" ) diff --git a/deployment/common/changeset/deploy_mcms_with_timelock.go b/deployment/common/changeset/deploy_mcms_with_timelock.go index e295d1c019f..7ad7e7421a2 100644 --- a/deployment/common/changeset/deploy_mcms_with_timelock.go +++ b/deployment/common/changeset/deploy_mcms_with_timelock.go @@ -12,7 +12,6 @@ import ( evminternal "github.com/smartcontractkit/chainlink/deployment/common/changeset/evm/mcms" "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -27,7 +26,7 @@ var ( type GrantRoleInput struct { ExistingProposerByChain map[uint64]common.Address // if needed in the future, need to add bypasser and canceller here - MCMS *proposalutils.TimelockConfig + MCMS *cldfproposalutils.TimelockConfig GasBoostConfigPerChain map[uint64]cldfproposalutils.GasBoostConfig } diff --git a/deployment/common/changeset/deploy_mcms_with_timelock_test.go b/deployment/common/changeset/deploy_mcms_with_timelock_test.go index f32fa8351bd..d75846938c1 100644 --- a/deployment/common/changeset/deploy_mcms_with_timelock_test.go +++ b/deployment/common/changeset/deploy_mcms_with_timelock_test.go @@ -40,7 +40,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -114,7 +113,7 @@ func TestGrantRoleInTimeLock(t *testing.T) { ExistingProposerByChain: map[uint64]common.Address{ selector: existingProposer.Address(), }, - MCMS: &proposalutils.TimelockConfig{MinDelay: 0}, + MCMS: &cldfproposalutils.TimelockConfig{MinDelay: 0}, }, )) require.NoError(t, err) diff --git a/deployment/common/changeset/evm/approve_token.go b/deployment/common/changeset/evm/approve_token.go index 96681b20134..c2a7eee690d 100644 --- a/deployment/common/changeset/evm/approve_token.go +++ b/deployment/common/changeset/evm/approve_token.go @@ -6,7 +6,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + "github.com/smartcontractkit/cld-changesets/pkg/cldfutil/changeset" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" diff --git a/deployment/common/changeset/example/link_transfer.go b/deployment/common/changeset/example/link_transfer.go index 7a1b23e2c58..59d84ea508b 100644 --- a/deployment/common/changeset/example/link_transfer.go +++ b/deployment/common/changeset/example/link_transfer.go @@ -11,8 +11,11 @@ import ( ethTypes "github.com/ethereum/go-ethereum/core/types" chain_selectors "github.com/smartcontractkit/chain-selectors" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" mcmslib "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/mcms/sdk" @@ -20,7 +23,6 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -34,10 +36,10 @@ type TransferConfig struct { type LinkTransferConfig struct { Transfers map[uint64][]TransferConfig From common.Address - McmsConfig *proposalutils.TimelockConfig + McmsConfig *cldfproposalutils.TimelockConfig } -func getDeployer(e cldf.Environment, chain uint64, mcmConfig *proposalutils.TimelockConfig) *bind.TransactOpts { +func getDeployer(e cldf.Environment, chain uint64, mcmConfig *cldfproposalutils.TimelockConfig) *bind.TransactOpts { if mcmConfig == nil { return e.BlockChains.EVMChains()[chain].DeployerKey } @@ -145,7 +147,7 @@ func transferOrBuildTx( transfer TransferConfig, opts *bind.TransactOpts, chain cldf_evm.Chain, - mcmsConfig *proposalutils.TimelockConfig) (*ethTypes.Transaction, error) { + mcmsConfig *cldfproposalutils.TimelockConfig) (*ethTypes.Transaction, error) { tx, err := linkState.LinkToken.Transfer(opts, transfer.To, transfer.Value) if err != nil { return nil, fmt.Errorf("error packing transfer tx data: %w", err) @@ -209,7 +211,7 @@ func LinkTransferV2(e cldf.Environment, cfg *LinkTransferConfig) (cldf.Changeset } if cfg.McmsConfig != nil { - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelockAddressesPerChain, proposerAddressPerChain, diff --git a/deployment/common/changeset/example/link_transfer_test.go b/deployment/common/changeset/example/link_transfer_test.go index a7728204ad6..907b437744e 100644 --- a/deployment/common/changeset/example/link_transfer_test.go +++ b/deployment/common/changeset/example/link_transfer_test.go @@ -22,7 +22,6 @@ import ( linkchangesets "github.com/smartcontractkit/cld-changesets/link/changesets" "github.com/smartcontractkit/chainlink/deployment/common/changeset/example" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/stretchr/testify/require" @@ -94,7 +93,7 @@ func TestValidate(t *testing.T) { Transfers: map[uint64][]example.TransferConfig{ selector: {{To: mcmsState.Timelock.Address(), Value: big.NewInt(100)}}}, From: chain.DeployerKey.From, - McmsConfig: &proposalutils.TimelockConfig{ + McmsConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Hour, }, }, @@ -118,7 +117,7 @@ func TestValidate(t *testing.T) { }, }, From: mcmsState.Timelock.Address(), - McmsConfig: &proposalutils.TimelockConfig{ + McmsConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Hour, }, }, @@ -202,7 +201,7 @@ func TestValidate(t *testing.T) { Transfers: map[uint64][]example.TransferConfig{ selector: {{To: mcmsState.Timelock.Address(), Value: big.NewInt(100)}}}, From: chain.DeployerKey.From, - McmsConfig: &proposalutils.TimelockConfig{ + McmsConfig: &cldfproposalutils.TimelockConfig{ MinDelay: time.Hour * 24 * 10, }, }, @@ -269,7 +268,7 @@ func TestLinkTransferMCMSV2(t *testing.T) { Transfers: map[uint64][]example.TransferConfig{ selector: {{To: chain.DeployerKey.From, Value: big.NewInt(500)}}, }, - McmsConfig: &proposalutils.TimelockConfig{ + McmsConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0, OverrideRoot: true, }, diff --git a/deployment/common/changeset/example/solana_transfer_mcm.go b/deployment/common/changeset/example/solana_transfer_mcm.go index 199170867bb..68da9465294 100644 --- a/deployment/common/changeset/example/solana_transfer_mcm.go +++ b/deployment/common/changeset/example/solana_transfer_mcm.go @@ -13,10 +13,10 @@ import ( mcmssolanasdk "github.com/smartcontractkit/mcms/sdk/solana" "github.com/smartcontractkit/mcms/types" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var _ cldf.ChangeSetV2[TransferFromTimelockConfig] = TransferFromTimelock{} @@ -26,7 +26,7 @@ type TransferData struct { Amount uint64 } type TransferFromTimelockConfig struct { - TimelockCfg proposalutils.TimelockConfig + TimelockCfg cldfproposalutils.TimelockConfig AmountsPerChain map[uint64]TransferData } @@ -122,7 +122,7 @@ func (f TransferFromTimelock) Apply(e cldf.Environment, config TransferFromTimel Transactions: transactions, }) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, diff --git a/deployment/common/changeset/example/solana_transfer_mcm_test.go b/deployment/common/changeset/example/solana_transfer_mcm_test.go index f61750e9504..b63ca2696d6 100644 --- a/deployment/common/changeset/example/solana_transfer_mcm_test.go +++ b/deployment/common/changeset/example/solana_transfer_mcm_test.go @@ -29,7 +29,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/changeset/example" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" "github.com/smartcontractkit/chainlink/deployment/utils/solutils" @@ -235,7 +234,7 @@ func TestTransferFromTimelockConfig_Apply(t *testing.T) { err = rt.Exec( runtime.ChangesetTask(example.TransferFromTimelock{}, example.TransferFromTimelockConfig{ - TimelockCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + TimelockCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, AmountsPerChain: map[uint64]example.TransferData{ selector: cfgAmounts, }, diff --git a/deployment/common/changeset/set_config_mcms.go b/deployment/common/changeset/set_config_mcms.go deleted file mode 100644 index 4c33a275b37..00000000000 --- a/deployment/common/changeset/set_config_mcms.go +++ /dev/null @@ -1,454 +0,0 @@ -package changeset - -import ( - "context" - "errors" - "fmt" - "math/big" - - aptos "github.com/aptos-labs/aptos-go-sdk" - "github.com/ethereum/go-ethereum/core/types" - solanasdk "github.com/gagliardetto/solana-go" - "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" - chain_selectors "github.com/smartcontractkit/chain-selectors" - aptosstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/aptos" - evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" - solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" - mcmslib "github.com/smartcontractkit/mcms" - aptosmcms "github.com/smartcontractkit/mcms/sdk/aptos" - "github.com/smartcontractkit/mcms/sdk/evm" - "github.com/smartcontractkit/mcms/sdk/solana" - mcmstypes "github.com/smartcontractkit/mcms/types" - - cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - - cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" - cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - - "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" -) - -type ConfigPerRoleV2 struct { - Proposer *mcmstypes.Config - Canceller *mcmstypes.Config - Bypasser *mcmstypes.Config -} - -type MCMSConfigV2 struct { - ConfigsPerChain map[uint64]ConfigPerRoleV2 - ProposalConfig *proposalutils.TimelockConfig -} - -var _ cldf.ChangeSet[MCMSConfigV2] = SetConfigMCMSV2 - -// Validate checks that the MCMSConfigV2 is valid -func (cfg MCMSConfigV2) Validate(e cldf.Environment, selectors []uint64) error { - if len(cfg.ConfigsPerChain) == 0 { - return errors.New("no chain configs provided") - } - - err := deployment.ValidateSelectorsInEnvironment(e, selectors) - if err != nil { - return err - } - - for chainSelector, c := range cfg.ConfigsPerChain { - // Ensure at least one config is provided - if c.Proposer == nil && c.Canceller == nil && c.Bypasser == nil { - return fmt.Errorf("at least one config (Proposer, Canceller, or Bypasser) must be provided for chain %d", chainSelector) - } - - family, err := chain_selectors.GetSelectorFamily(chainSelector) - if err != nil { - return err - } - - switch family { - case chain_selectors.FamilyEVM: - qualifier := "" - if cfg.ProposalConfig != nil { - qualifier = cfg.ProposalConfig.TimelockQualifierPerChain[chainSelector] - } - state, err := evmstate.MaybeLoadMCMSWithTimelockStateWithQualifier(e, []uint64{chainSelector}, qualifier) - if err != nil { - return err - } - chainState, ok := state[chainSelector] - if !ok { - return fmt.Errorf("chain selector: %d not found for MCMS state", chainSelector) - } - if cfg.ProposalConfig != nil { - err := cfg.ProposalConfig.Validate(e.BlockChains.EVMChains()[chainSelector], *chainState) - if err != nil { - return err - } - } - case chain_selectors.FamilySolana: - state, err := solstate.MaybeLoadMCMSWithTimelockState(e, []uint64{chainSelector}) - if err != nil { - return err - } - _, ok := state[chainSelector] - if !ok { - return fmt.Errorf("chain selector: %d not found for MCMS state", chainSelector) - } - case chain_selectors.FamilyAptos: - _, err := aptosstate.LoadMCMSAddresses(e, []uint64{chainSelector}) - if err != nil { - return err - } - } - - if c.Proposer != nil { - if err := c.Proposer.Validate(); err != nil { - return err - } - } - if c.Canceller != nil { - if err := c.Canceller.Validate(); err != nil { - return err - } - } - if c.Bypasser != nil { - if err := c.Bypasser.Validate(); err != nil { - return err - } - } - } - return nil -} - -// setConfigOrTxDataV2 executes set config tx or gets the tx data for the MCMS proposal -func setConfigOrTxDataV2(ctx context.Context, lggr logger.Logger, chain cldf_evm.Chain, cfg mcmstypes.Config, contract *gethwrappers.ManyChainMultiSig, useMCMS bool) (*types.Transaction, error) { - opts := cldf.SimTransactOpts() - if !useMCMS { - opts = chain.DeployerKey - } - opts.Context = ctx - - configurer := evm.NewConfigurer(chain.Client, opts) - res, err := configurer.SetConfig(ctx, contract.Address().Hex(), &cfg, false) - if err != nil { - return nil, err - } - - transaction := res.RawData.(*types.Transaction) - if !useMCMS { - _, err = cldf.ConfirmIfNoErrorWithABI(chain, transaction, gethwrappers.ManyChainMultiSigABI, err) - if err != nil { - return nil, err - } - lggr.Infow("SetConfigMCMS tx confirmed", "txHash", res.Hash) - } - return transaction, nil -} - -type setConfigTxs struct { - proposerTx *types.Transaction - cancellerTx *types.Transaction - bypasserTx *types.Transaction -} - -// setConfigPerRoleV2 sets the configuration for each of the MCMS contract roles on the mcmsState. -func setConfigPerRoleV2(ctx context.Context, lggr logger.Logger, chain cldf_evm.Chain, cfg ConfigPerRoleV2, mcmsState *evmstate.MCMSWithTimelockState, useMCMS bool) (setConfigTxs, error) { - var proposerTx, cancellerTx, bypasserTx *types.Transaction - var err error - - // Proposer set config (only if provided) - if cfg.Proposer != nil { - proposerTx, err = setConfigOrTxDataV2(ctx, lggr, chain, *cfg.Proposer, mcmsState.ProposerMcm, useMCMS) - if err != nil { - return setConfigTxs{}, err - } - } - - // Canceller set config (only if provided) - if cfg.Canceller != nil { - cancellerTx, err = setConfigOrTxDataV2(ctx, lggr, chain, *cfg.Canceller, mcmsState.CancellerMcm, useMCMS) - if err != nil { - return setConfigTxs{}, err - } - } - - // Bypasser set config (only if provided) - if cfg.Bypasser != nil { - bypasserTx, err = setConfigOrTxDataV2(ctx, lggr, chain, *cfg.Bypasser, mcmsState.BypasserMcm, useMCMS) - if err != nil { - return setConfigTxs{}, err - } - } - - return setConfigTxs{ - proposerTx: proposerTx, - cancellerTx: cancellerTx, - bypasserTx: bypasserTx, - }, nil -} - -// SetConfigMCMSV2 is a reimplementation of SetConfigMCMS that uses the new MCMS library. -func SetConfigMCMSV2(e cldf.Environment, cfg MCMSConfigV2) (cldf.ChangesetOutput, error) { - selectors := []uint64{} - lggr := e.Logger - ctx := e.GetContext() - for chainSelector := range cfg.ConfigsPerChain { - selectors = append(selectors, chainSelector) - } - useMCMS := cfg.ProposalConfig != nil - err := cfg.Validate(e, selectors) - if err != nil { - return cldf.ChangesetOutput{}, err - } - - var batches []mcmstypes.BatchOperation - timelockAddressesPerChain := map[uint64]string{} - proposerMcmsPerChain := map[uint64]string{} - inspectorPerChain, err := cldfproposalutils.McmsInspectors(e) - if err != nil { - return cldf.ChangesetOutput{}, err - } - - for chainSelector, c := range cfg.ConfigsPerChain { - family, err := chain_selectors.GetSelectorFamily(chainSelector) - if err != nil { - return cldf.ChangesetOutput{}, err - } - - switch family { - case chain_selectors.FamilyEVM: - chain := e.BlockChains.EVMChains()[chainSelector] - qualifier := "" - if cfg.ProposalConfig != nil { - qualifier = cfg.ProposalConfig.TimelockQualifierPerChain[chainSelector] - } - mcmsStatePerChain, err := evmstate.MaybeLoadMCMSWithTimelockStateWithQualifier(e, []uint64{chainSelector}, qualifier) - if err != nil { - return cldf.ChangesetOutput{}, err - } - state := mcmsStatePerChain[chainSelector] - timelockAddressesPerChain[chainSelector] = state.Timelock.Address().Hex() - if cfg.ProposalConfig != nil { - mcmsContract, err := cfg.ProposalConfig.MCMBasedOnAction(*state) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to get MCMS contract: %w", err) - } - proposerMcmsPerChain[chainSelector] = mcmsContract.Address().Hex() - } - setConfigTxsChain, err := setConfigPerRoleV2(ctx, lggr, chain, c, state, useMCMS) - if err != nil { - return cldf.ChangesetOutput{}, err - } - if useMCMS { - batch := addTxsToProposalBatchV2(setConfigTxsChain, chainSelector, *state) - batches = append(batches, batch) - } - case chain_selectors.FamilySolana: - batch, err := setConfigSolana(e, chainSelector, c, timelockAddressesPerChain, proposerMcmsPerChain, useMCMS) - if err != nil { - return cldf.ChangesetOutput{}, err - } - - if useMCMS { - batches = append(batches, batch...) - } - case chain_selectors.FamilyAptos: - operation, err := setConfigAptos(e, chainSelector, c, timelockAddressesPerChain, proposerMcmsPerChain, useMCMS) - if err != nil { - return cldf.ChangesetOutput{}, err - } - batches = append(batches, operation) - } - } - - if useMCMS { - proposal, err := proposalutils.BuildProposalFromBatchesV2(e, timelockAddressesPerChain, - proposerMcmsPerChain, inspectorPerChain, batches, "Set config proposal", *cfg.ProposalConfig) - if err != nil { - return cldf.ChangesetOutput{}, fmt.Errorf("failed to build proposal from batch: %w", err) - } - lggr.Infow("SetConfigMCMS proposal created", "proposal", proposal) - return cldf.ChangesetOutput{MCMSTimelockProposals: []mcmslib.TimelockProposal{*proposal}}, nil - } - - return cldf.ChangesetOutput{}, nil -} - -func addTxsToProposalBatchV2(setConfigTxsChain setConfigTxs, chainSelector uint64, state evmstate.MCMSWithTimelockState) mcmstypes.BatchOperation { - result := mcmstypes.BatchOperation{ - ChainSelector: mcmstypes.ChainSelector(chainSelector), - Transactions: []mcmstypes.Transaction{}, - } - - // Only add transactions for configs that were actually set - if setConfigTxsChain.proposerTx != nil { - result.Transactions = append(result.Transactions, - evm.NewTransaction(state.ProposerMcm.Address(), - setConfigTxsChain.proposerTx.Data(), big.NewInt(0), string(commontypes.ProposerManyChainMultisig), nil)) - } - - if setConfigTxsChain.cancellerTx != nil { - result.Transactions = append(result.Transactions, evm.NewTransaction(state.CancellerMcm.Address(), - setConfigTxsChain.cancellerTx.Data(), big.NewInt(0), string(commontypes.CancellerManyChainMultisig), nil)) - } - - if setConfigTxsChain.bypasserTx != nil { - result.Transactions = append(result.Transactions, - evm.NewTransaction(state.BypasserMcm.Address(), - setConfigTxsChain.bypasserTx.Data(), big.NewInt(0), string(commontypes.BypasserManyChainMultisig), nil)) - } - return result -} - -func setConfigSolana( - e cldf.Environment, chainSelector uint64, cfg ConfigPerRoleV2, - timelockAddressesPerChain, proposerMcmsPerChain map[uint64]string, useMCMS bool, -) ([]mcmstypes.BatchOperation, error) { - chain := e.BlockChains.SolanaChains()[chainSelector] - mcmsStatePerChain, err := solstate.MaybeLoadMCMSWithTimelockState(e, []uint64{chainSelector}) - if err != nil { - return nil, err - } - solState := mcmsStatePerChain[chainSelector] - timelockAddressesPerChain[chainSelector] = solana.ContractAddress(solState.TimelockProgram, solana.PDASeed(solState.TimelockSeed)) - proposerMcmsPerChain[chainSelector] = solana.ContractAddress(solState.McmProgram, solana.PDASeed(solState.ProposerMcmSeed)) - cancellerAddress := solana.ContractAddress(solState.McmProgram, solana.PDASeed(solState.CancellerMcmSeed)) - bypasserAddress := solana.ContractAddress(solState.McmProgram, solana.PDASeed(solState.BypasserMcmSeed)) - proposerAddress := solana.ContractAddress(solState.McmProgram, solana.PDASeed(solState.ProposerMcmSeed)) - - timelockSignerPDA, err := solana.FindTimelockSignerPDA(solState.TimelockProgram, solana.PDASeed(solState.TimelockSeed)) - if err != nil { - return nil, err - } - - batches := []mcmstypes.BatchOperation{} - // broken into single batch per role (total 3 batches) due to size constraints on solana when all instructions were in the same single batch - - // Only set configs that are provided (non-nil) - if cfg.Proposer != nil { - proposerOps, err := setConfigForRoleSolana(e, chain, *cfg.Proposer, proposerAddress, string(commontypes.ProposerManyChainMultisig), useMCMS, timelockSignerPDA) - if err != nil { - return nil, err - } - batches = append(batches, proposerOps) - } - - if cfg.Canceller != nil { - cancellerOps, err := setConfigForRoleSolana(e, chain, *cfg.Canceller, cancellerAddress, string(commontypes.CancellerManyChainMultisig), useMCMS, timelockSignerPDA) - if err != nil { - return nil, err - } - batches = append(batches, cancellerOps) - } - - if cfg.Bypasser != nil { - bypasserOps, err := setConfigForRoleSolana(e, chain, *cfg.Bypasser, bypasserAddress, string(commontypes.BypasserManyChainMultisig), useMCMS, timelockSignerPDA) - if err != nil { - return nil, err - } - batches = append(batches, bypasserOps) - } - - return batches, nil -} - -func setConfigForRoleSolana(e cldf.Environment, chain cldf_solana.Chain, cfg mcmstypes.Config, mcmAddress string, contractType string, useMCMS bool, timelockSignerPDA solanasdk.PublicKey) (mcmstypes.BatchOperation, error) { - var configurer *solana.Configurer - - if useMCMS { - configurer = solana.NewConfigurer(chain.Client, *chain.DeployerKey, mcmstypes.ChainSelector(chain.Selector), - solana.WithDoNotSendInstructionsOnChain(), solana.WithAuthorityAccount(timelockSignerPDA)) - } else { - configurer = solana.NewConfigurer(chain.Client, *chain.DeployerKey, mcmstypes.ChainSelector(chain.Selector)) - } - - res, err := configurer.SetConfig(e.GetContext(), mcmAddress, &cfg, false) - if err != nil { - return mcmstypes.BatchOperation{}, err - } - - if useMCMS { - instructions := res.RawData.([]solanasdk.Instruction) - - txs := make([]mcmstypes.Transaction, 0, len(instructions)) - for _, ix := range instructions { - tx, err := solana.NewTransactionFromInstruction(ix, contractType, []string{}) - if err != nil { - return mcmstypes.BatchOperation{}, err - } - txs = append(txs, tx) - } - - return mcmstypes.BatchOperation{ - ChainSelector: mcmstypes.ChainSelector(chain.Selector), - Transactions: txs, - }, nil - } - - e.Logger.Infow("SetConfig tx confirmed", "txHash", res.Hash) - return mcmstypes.BatchOperation{}, nil -} - -func setConfigAptos( - e cldf.Environment, chainSelector uint64, cfg ConfigPerRoleV2, - timelockAddressesPerChain, proposerMcmsPerChain map[uint64]string, useMCMS bool, -) (mcmstypes.BatchOperation, error) { - if !useMCMS { - return mcmstypes.BatchOperation{}, errors.New("can only set Aptos MCMS config using MCMS") - } - chain, ok := e.BlockChains.AptosChains()[chainSelector] - if !ok { - return mcmstypes.BatchOperation{}, fmt.Errorf("aptos chain %d not found", chainSelector) - } - mcmsAddresses, err := aptosstate.LoadMCMSAddresses(e, []uint64{chainSelector}) - if err != nil { - return mcmstypes.BatchOperation{}, fmt.Errorf("loading mcmsAddresses: %w", err) - } - mcmsAddress := mcmsAddresses[chain.Selector] - timelockAddressesPerChain[chain.Selector] = mcmsAddress.StringLong() - proposerMcmsPerChain[chain.Selector] = mcmsAddress.StringLong() - - var transactions []mcmstypes.Transaction - - // Only set configs that are provided (non-nil) - if cfg.Bypasser != nil { - bypasserTx, err := setConfigForRoleAptos(e.GetContext(), mcmsAddress, aptosmcms.TimelockRoleBypasser, chain.Client, chain.DeployerSigner, *cfg.Bypasser) - if err != nil { - return mcmstypes.BatchOperation{}, err - } - transactions = append(transactions, bypasserTx) - } - - if cfg.Canceller != nil { - cancellerTx, err := setConfigForRoleAptos(e.GetContext(), mcmsAddress, aptosmcms.TimelockRoleCanceller, chain.Client, chain.DeployerSigner, *cfg.Canceller) - if err != nil { - return mcmstypes.BatchOperation{}, err - } - transactions = append(transactions, cancellerTx) - } - - if cfg.Proposer != nil { - proposerTx, err := setConfigForRoleAptos(e.GetContext(), mcmsAddress, aptosmcms.TimelockRoleProposer, chain.Client, chain.DeployerSigner, *cfg.Proposer) - if err != nil { - return mcmstypes.BatchOperation{}, err - } - transactions = append(transactions, proposerTx) - } - - return mcmstypes.BatchOperation{ - ChainSelector: mcmstypes.ChainSelector(chain.Selector), - Transactions: transactions, - }, nil -} - -func setConfigForRoleAptos(ctx context.Context, mcmsAddress aptos.AccountAddress, role aptosmcms.TimelockRole, client aptos.AptosRpcClient, auth aptos.TransactionSigner, cfg mcmstypes.Config) (mcmstypes.Transaction, error) { - configurer := aptosmcms.NewConfigurer(client, auth, role, aptosmcms.WithDoNotSendInstructionsOnChain()) - result, err := configurer.SetConfig(ctx, mcmsAddress.StringLong(), &cfg, false) - if err != nil { - return mcmstypes.Transaction{}, fmt.Errorf("failed to set config for role %v: %w", role.String(), err) - } - return result.RawData.(mcmstypes.Transaction), nil -} diff --git a/deployment/common/changeset/set_config_mcms_test.go b/deployment/common/changeset/set_config_mcms_test.go deleted file mode 100644 index c486851ee0c..00000000000 --- a/deployment/common/changeset/set_config_mcms_test.go +++ /dev/null @@ -1,683 +0,0 @@ -package changeset_test - -import ( - "crypto/ecdsa" - "testing" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - solanago "github.com/gagliardetto/solana-go" - chain_selectors "github.com/smartcontractkit/chain-selectors" - mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" - evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" - solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" - linkchangesets "github.com/smartcontractkit/cld-changesets/link/changesets" - "github.com/smartcontractkit/mcms/sdk/evm" - "github.com/smartcontractkit/mcms/sdk/solana" - mcmstypes "github.com/smartcontractkit/mcms/types" - "github.com/stretchr/testify/require" - - cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - - cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - - cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment" - "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" - - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - commonchangesetsolana "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" -) - -func TestSetConfigMCMSV2EVM(t *testing.T) { - t.Parallel() - - selector1 := chain_selectors.TEST_90000001.Selector - selector2 := chain_selectors.TEST_90000002.Selector - - rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( - environment.WithEVMSimulated(t, []uint64{selector1, selector2}), - environment.WithLogger(logger.Test(t)), - )) - require.NoError(t, err) - - chain1 := rt.Environment().BlockChains.EVMChains()[selector1] - chain2 := rt.Environment().BlockChains.EVMChains()[selector2] - - config := cldftesthelpers.SingleGroupTimelockConfig(t) - - // Deploy MCMS and Timelock for selector1 & selector2 - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.DeployMCMSWithTimelockV2), map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - selector1: config, - selector2: config, - }), - ) - require.NoError(t, err) - - // Transfer MCMS contracts to timelock for selector2 for testing setConfig on MCMS owned contracts - chain2Addrs, err := rt.State().AddressBook.AddressesForChain(selector2) - require.NoError(t, err) - require.Len(t, chain2Addrs, 5) - chain2MCMSState, err := commonchangeset.MaybeLoadMCMSWithTimelockChainState(chain2, chain2Addrs) - require.NoError(t, err) - - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), commonchangeset.TransferToMCMSWithTimelockConfig{ - ContractsByChain: map[uint64][]common.Address{ - selector2: { - chain2MCMSState.ProposerMcm.Address(), - chain2MCMSState.BypasserMcm.Address(), - chain2MCMSState.CancellerMcm.Address(), - }, - }, - }), - runtime.SignAndExecuteProposalsTask([]*ecdsa.PrivateKey{cldftesthelpers.TestXXXMCMSSigner}), - ) - require.NoError(t, err) - - // Add the timelock as a signer to check state changes - for _, tt := range []struct { - name string - chain cldf_evm.Chain - changeSets func(selector uint64, cfgProp, cfgCancel, cfgBypass mcmstypes.Config) []runtime.Executable - }{ - { - name: "MCMS disabled", - chain: chain1, - changeSets: func(selector uint64, cfgProp, cfgCancel, cfgBypass mcmstypes.Config) []runtime.Executable { - return []runtime.Executable{ - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.SetConfigMCMSV2), commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - selector: { - Proposer: &cfgProp, - Canceller: &cfgCancel, - Bypasser: &cfgBypass, - }, - }, - }), - } - }, - }, - { - name: "MCMS enabled", - chain: chain2, - changeSets: func(selector uint64, cfgProp, cfgCancel, cfgBypass mcmstypes.Config) []runtime.Executable { - return []runtime.Executable{ - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.SetConfigMCMSV2), commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: 0, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - selector: { - Proposer: &cfgProp, - Canceller: &cfgCancel, - Bypasser: &cfgBypass, - }, - }, - }), - runtime.SignAndExecuteProposalsTask([]*ecdsa.PrivateKey{cldftesthelpers.TestXXXMCMSSigner}), - } - }, - }, - } { - t.Run(tt.name, func(t *testing.T) { - // Get the mcms addresses for the chain - addrs, err := rt.State().AddressBook.AddressesForChain(tt.chain.Selector) - require.NoError(t, err) - - // Check new State - mcmsState, err := commonchangeset.MaybeLoadMCMSWithTimelockChainState(tt.chain, addrs) - require.NoError(t, err) - timelockAddress := mcmsState.Timelock.Address() - - // Create new configs for the MCMS contracts - cfgProposer := cldftesthelpers.SingleGroupMCMS(t) - cfgProposer.Signers = append(cfgProposer.Signers, timelockAddress) - cfgProposer.Quorum = 2 // quorum should change to 2 out of 2 signers - cfgCanceller := cldftesthelpers.SingleGroupMCMS(t) // quorum should not change - cfgBypasser := cldftesthelpers.SingleGroupMCMS(t) - cfgBypasser.Signers = append(cfgBypasser.Signers, timelockAddress) - cfgBypasser.Signers = append(cfgBypasser.Signers, mcmsState.ProposerMcm.Address()) - cfgBypasser.Quorum = 3 // quorum should change to 3 out of 3 signers - - // Set config on all 3 MCMS contracts - err = rt.Exec(tt.changeSets(tt.chain.Selector, cfgProposer, cfgCanceller, cfgBypasser)...) - require.NoError(t, err) - - inspector := evm.NewInspector(tt.chain.Client) - newConf, err := inspector.GetConfig(t.Context(), mcmsState.ProposerMcm.Address().Hex()) - require.NoError(t, err) - require.ElementsMatch(t, cfgProposer.Signers, newConf.Signers) - require.Equal(t, cfgProposer.Quorum, newConf.Quorum) - - newConf, err = inspector.GetConfig(t.Context(), mcmsState.BypasserMcm.Address().Hex()) - require.NoError(t, err) - require.ElementsMatch(t, cfgBypasser.Signers, newConf.Signers) - require.Equal(t, cfgBypasser.Quorum, newConf.Quorum) - - newConf, err = inspector.GetConfig(t.Context(), mcmsState.CancellerMcm.Address().Hex()) - require.NoError(t, err) - require.ElementsMatch(t, cfgCanceller.Signers, newConf.Signers) - require.Equal(t, cfgCanceller.Quorum, newConf.Quorum) - }) - } -} - -func TestSetConfigMCMSV2Solana(t *testing.T) { - t.Parallel() - - selector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector - - programsPath, programIDs, ab := soltestutils.PreloadMCMS(t, selector) - - rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( - environment.WithSolanaContainer(t, []uint64{selector}, programsPath, programIDs), - environment.WithAddressBook(ab), - environment.WithLogger(logger.Test(t)), - )) - require.NoError(t, err) - - chain := rt.Environment().BlockChains.SolanaChains()[selector] - - // Deploy MCMS and Timelock - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.DeployMCMSWithTimelockV2), map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - selector: cldftesthelpers.SingleGroupTimelockConfig(t), - }), - ) - require.NoError(t, err) - - // Load the MCMS state - addrs, err := rt.State().AddressBook.AddressesForChain(selector) - require.NoError(t, err) - mcmsState, err := solstate.MaybeLoadMCMSWithTimelockChainState(chain, addrs) - require.NoError(t, err) - - // Fund the signer PDAs for the MCMS contracts - soltestutils.FundSignerPDAs(t, chain, mcmsState) - - // Used to check the chain state after the changeset is applied - inspector := solana.NewInspector(chain.Client) - - // Create some signers to set into the config - signer1Key, signer1Addr := createSolSigner(t) - _, signer2Addr := createSolSigner(t) - - newCfgProposer := cldftesthelpers.SingleGroupMCMS(t) - newCfgProposer.Signers = append(newCfgProposer.Signers, signer1Addr) - newCfgProposer.Quorum = 2 - newCfgCanceller := cldftesthelpers.SingleGroupMCMS(t) - newCfgBypasser := cldftesthelpers.SingleGroupMCMS(t) - newCfgBypasser.Signers = append(newCfgBypasser.Signers, signer1Addr) - newCfgBypasser.Quorum = 2 - - t.Run("MCMS disabled", func(t *testing.T) { - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.SetConfigMCMSV2), commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - selector: { - Proposer: &newCfgProposer, - Canceller: &newCfgCanceller, - Bypasser: &newCfgBypasser, - }, - }, - }), - ) - require.NoError(t, err) - - assertSolConfigEquals(t, inspector, mcmsState.McmProgram, mcmsState.ProposerMcmSeed, newCfgProposer) - assertSolConfigEquals(t, inspector, mcmsState.McmProgram, mcmsState.BypasserMcmSeed, newCfgBypasser) - assertSolConfigEquals(t, inspector, mcmsState.McmProgram, mcmsState.CancellerMcmSeed, newCfgCanceller) - }) - - t.Run("MCMS enabled", func(t *testing.T) { - // Now we transfer the MCMS contracts to the timelock for testing setConfig on MCMS owned contracts - err = rt.Exec( - runtime.ChangesetTask(commonchangesetsolana.TransferMCMSToTimelockSolana{}, commonchangesetsolana.TransferMCMSToTimelockSolanaConfig{ - Chains: []uint64{selector}, - MCMSCfg: proposalutils.TimelockConfig{MinDelay: time.Second * 1}, - }), - // We must sign with an additional signer since we changed the config quorum previously. - runtime.SignAndExecuteProposalsTask([]*ecdsa.PrivateKey{cldftesthelpers.TestXXXMCMSSigner, signer1Key}), - ) - require.NoError(t, err) - - // Update the configs with yet another additional signer - newCfgProposer.Signers = append(newCfgProposer.Signers, signer2Addr) - newCfgProposer.Quorum = 3 - newCfgBypasser.Signers = append(newCfgBypasser.Signers, signer2Addr) - newCfgBypasser.Quorum = 3 - - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.SetConfigMCMSV2), commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: time.Second * 1, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - selector: { - Proposer: &newCfgProposer, - Canceller: &newCfgCanceller, - Bypasser: &newCfgBypasser, - }, - }, - }), - runtime.SignAndExecuteProposalsTask([]*ecdsa.PrivateKey{cldftesthelpers.TestXXXMCMSSigner, signer1Key}), - ) - require.NoError(t, err) - - assertSolConfigEquals(t, inspector, mcmsState.McmProgram, mcmsState.ProposerMcmSeed, newCfgProposer) - assertSolConfigEquals(t, inspector, mcmsState.McmProgram, mcmsState.BypasserMcmSeed, newCfgBypasser) - assertSolConfigEquals(t, inspector, mcmsState.McmProgram, mcmsState.CancellerMcmSeed, newCfgCanceller) - }) -} - -func TestValidateV2(t *testing.T) { - tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/DX-439") - - t.Parallel() - - evmSelector := chain_selectors.TEST_90000001.Selector - solSelector := chain_selectors.TEST_22222222222222222222222222222222222222222222.Selector - - programsPath, programIDs, ab := soltestutils.PreloadMCMS(t, solSelector) - - rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( - environment.WithEVMSimulated(t, []uint64{evmSelector}), - environment.WithSolanaContainer(t, []uint64{solSelector}, programsPath, programIDs), - environment.WithAddressBook(ab), - environment.WithLogger(logger.Test(t)), - )) - require.NoError(t, err) - - config := cldftesthelpers.SingleGroupTimelockConfig(t) - - // Deploy MCMS and Timelock - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(linkchangesets.DeployLinkToken), []uint64{evmSelector}), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.DeployMCMSWithTimelockV2), map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - evmSelector: config, - solSelector: config, - }), - ) - require.NoError(t, err) - - cfg := cldftesthelpers.SingleGroupMCMS(t) - cfgInvalid := cldftesthelpers.SingleGroupMCMS(t) - cfgInvalid.Quorum = 0 - - tests := []struct { - name string - cfg commonchangeset.MCMSConfigV2 - errorMsg string - }{ - { - name: "valid config", - cfg: commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: 0, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - solSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - }, - { - name: "valid non mcms config", - cfg: commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - solSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - }, - { - name: "no chain configurations", - cfg: commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{}, - }, - errorMsg: "no chain configs provided", - }, - { - name: "chain selector not found in environment", - cfg: commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - 123: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - errorMsg: "unknown chain selector 123", - }, - { - name: "invalid proposer config", - cfg: commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: 0, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - Proposer: &cfgInvalid, - Canceller: &cfg, - Bypasser: &cfg, - }, - solSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - errorMsg: "invalid MCMS config: Quorum must be greater than 0", - }, - { - name: "invalid canceller config", - cfg: commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: 0, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - Proposer: &cfg, - Canceller: &cfgInvalid, - Bypasser: &cfg, - }, - solSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - errorMsg: "invalid MCMS config: Quorum must be greater than 0", - }, - { - name: "invalid bypasser config", - cfg: commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: 0, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfgInvalid, - }, - solSelector: { - Proposer: &cfg, - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - errorMsg: "invalid MCMS config: Quorum must be greater than 0", - }, - { - name: "valid partial config - only proposer", - cfg: commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - Proposer: &cfg, - // Canceller and Bypasser are nil - }, - solSelector: { - Proposer: &cfg, - // Canceller and Bypasser are nil - }, - }, - }, - }, - { - name: "valid partial config - only canceller and bypasser", - cfg: commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - // Proposer is nil - Canceller: &cfg, - Bypasser: &cfg, - }, - solSelector: { - // Proposer is nil - Canceller: &cfg, - Bypasser: &cfg, - }, - }, - }, - }, - { - name: "invalid - no configs provided", - cfg: commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - evmSelector: { - // All are nil - }, - }, - }, - errorMsg: "at least one config (Proposer, Canceller, or Bypasser) must be provided", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - selectors := []uint64{evmSelector, solSelector} - - err := tt.cfg.Validate(rt.Environment(), selectors) - if tt.errorMsg != "" { - require.Error(t, err) - require.ErrorContains(t, err, tt.errorMsg) - } else { - require.NoError(t, err) - } - }) - } -} - -func assertSolConfigEquals( - t *testing.T, inspector *solana.Inspector, programID solanago.PublicKey, seed solstate.PDASeed, want mcmstypes.Config, -) { - t.Helper() - - cfg, err := inspector.GetConfig(t.Context(), solana.ContractAddress(programID, solana.PDASeed(seed))) - require.NoError(t, err) - require.ElementsMatch(t, want.Signers, cfg.Signers) - require.Equal(t, want.Quorum, cfg.Quorum) -} - -// createSolSigner creates a new Solana signer and returns the private key and address -func createSolSigner(t *testing.T) (*ecdsa.PrivateKey, common.Address) { - t.Helper() - - key, err := crypto.GenerateKey() - require.NoError(t, err) - publicKey := key.Public().(*ecdsa.PublicKey) - - return key, crypto.PubkeyToAddress(*publicKey) -} - -func TestSetConfigMCMSV2WithTimelockQualifier(t *testing.T) { - t.Parallel() - - selector := chain_selectors.TEST_90000001.Selector - cllccipQualifier := "CLLCCIP" - rmnmcmsQualifier := "RMNMCMS" - - rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( - environment.WithEVMSimulated(t, []uint64{selector}), - environment.WithLogger(logger.Test(t)), - )) - require.NoError(t, err) - - // Deploy two MCMS instances on the same chain with different qualifiers, - // mirroring the production setup where each chain has CLLCCIP and RMNMCMS deployments - cllccipConfig := cldftesthelpers.SingleGroupTimelockConfig(t) - cllccipConfig.Qualifier = &cllccipQualifier - - rmnmcmsConfig := cldftesthelpers.SingleGroupTimelockConfig(t) - rmnmcmsConfig.Qualifier = &rmnmcmsQualifier - - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.DeployMCMSWithTimelockV2), map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - selector: cllccipConfig, - }), - ) - require.NoError(t, err) - - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.DeployMCMSWithTimelockV2), map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - selector: rmnmcmsConfig, - }), - ) - require.NoError(t, err) - - // Load state via the CLLCCIP qualifier to build a valid proposer config - cllccipState, err := evmstate.MaybeLoadMCMSWithTimelockStateWithQualifier(rt.Environment(), []uint64{selector}, cllccipQualifier) - require.NoError(t, err) - require.NotNil(t, cllccipState[selector]) - - cfgProposer := cldftesthelpers.SingleGroupMCMS(t) - cfgProposer.Signers = append(cfgProposer.Signers, cllccipState[selector].Timelock.Address()) - cfgProposer.Quorum = 2 - - for _, tt := range []struct { - name string - qualifier string - wantErr string - }{ - { - name: "CLLCCIP qualifier matches qualified deployment", - qualifier: "CLLCCIP", - }, - { - name: "RMNMCMS qualifier matches qualified deployment", - qualifier: "RMNMCMS", - }, - { - name: "no qualifier fails with duplicate MCMS instances", - qualifier: "", - wantErr: "found more than one instance", - }, - { - name: "non-existent qualifier fails", - qualifier: "does-not-exist", - wantErr: "no addresses found", - }, - } { - t.Run(tt.name, func(t *testing.T) { - mcmsCfg := commonchangeset.MCMSConfigV2{ - ProposalConfig: &proposalutils.TimelockConfig{ - MinDelay: 0, - TimelockQualifierPerChain: map[uint64]string{ - selector: tt.qualifier, - }, - }, - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - selector: { - Proposer: &cfgProposer, - }, - }, - } - err := mcmsCfg.Validate(rt.Environment(), []uint64{selector}) - if tt.wantErr != "" { - require.Error(t, err) - require.ErrorContains(t, err, tt.wantErr) - } else { - require.NoError(t, err) - } - }) - } -} - -func TestSetConfigMCMSV2Partial(t *testing.T) { - t.Parallel() - - selector := chain_selectors.TEST_90000001.Selector - - rt, err := runtime.New(t.Context(), runtime.WithEnvOpts( - environment.WithEVMSimulated(t, []uint64{selector}), - environment.WithLogger(logger.Test(t)), - )) - require.NoError(t, err) - - chain := rt.Environment().BlockChains.EVMChains()[selector] - config := cldftesthelpers.SingleGroupTimelockConfig(t) - - // Deploy MCMS and Timelock - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.DeployMCMSWithTimelockV2), map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - selector: config, - }), - ) - require.NoError(t, err) - - // Get the MCMS addresses for the chain - addrs, err := rt.State().AddressBook.AddressesForChain(selector) - require.NoError(t, err) - mcmsState, err := commonchangeset.MaybeLoadMCMSWithTimelockChainState(chain, addrs) - require.NoError(t, err) - - // Create a new config for only the proposer - cfgProposer := cldftesthelpers.SingleGroupMCMS(t) - cfgProposer.Signers = append(cfgProposer.Signers, mcmsState.Timelock.Address()) - cfgProposer.Quorum = 2 - - // Set only the proposer config (partial config) - err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.SetConfigMCMSV2), commonchangeset.MCMSConfigV2{ - ConfigsPerChain: map[uint64]commonchangeset.ConfigPerRoleV2{ - selector: { - Proposer: &cfgProposer, // Only setting proposer - // Canceller and Bypasser are nil, so they won't be changed - }, - }, - }), - ) - require.NoError(t, err) - - // Verify only the proposer config was changed - inspector := evm.NewInspector(chain.Client) - - // Check proposer config was updated - newConf, err := inspector.GetConfig(t.Context(), mcmsState.ProposerMcm.Address().Hex()) - require.NoError(t, err) - require.ElementsMatch(t, cfgProposer.Signers, newConf.Signers) - require.Equal(t, cfgProposer.Quorum, newConf.Quorum) - - // Check canceller and bypasser configs were not changed (should still be original) - originalCfg := cldftesthelpers.SingleGroupMCMS(t) - - cancellerConf, err := inspector.GetConfig(t.Context(), mcmsState.CancellerMcm.Address().Hex()) - require.NoError(t, err) - require.ElementsMatch(t, originalCfg.Signers, cancellerConf.Signers) - require.Equal(t, originalCfg.Quorum, cancellerConf.Quorum) - - bypasserConf, err := inspector.GetConfig(t.Context(), mcmsState.BypasserMcm.Address().Hex()) - require.NoError(t, err) - require.ElementsMatch(t, originalCfg.Signers, bypasserConf.Signers) - require.Equal(t, originalCfg.Quorum, bypasserConf.Quorum) -} diff --git a/deployment/common/changeset/solana/transfer_ownership.go b/deployment/common/changeset/solana/transfer_ownership.go index 8429c04323d..b3f62894d79 100644 --- a/deployment/common/changeset/solana/transfer_ownership.go +++ b/deployment/common/changeset/solana/transfer_ownership.go @@ -18,14 +18,16 @@ import ( accessControllerBindings "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/access_controller" mcmBindings "github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings/v0_1_1/mcm" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldfsol "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -34,7 +36,7 @@ const maxAcceptInstructionsPerBatch = 5 // TransferToTimelockSolanaConfig holds the configuration for an ownership transfer changeset type TransferToTimelockSolanaConfig struct { ContractsByChain map[uint64][]OwnableContract - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } type OwnableContract struct { @@ -159,7 +161,7 @@ func (t *TransferToTimelockSolana) Apply( } // create timelock proposal with accept transactions - proposal, err := proposalutils.BuildProposalFromBatchesV2(env, timelocks, proposers, inspectors, + proposal, err := proposeutils.BuildProposalFromBatchesV2(env, timelocks, proposers, inspectors, batches, "proposal to transfer ownership of contracts to timelock", cfg.MCMSCfg) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to build proposal: %w", err) @@ -183,7 +185,7 @@ type TransferOwnershipRequest struct { CurrentOwner, ProposedOwner solana.PublicKey Version string Qualifier string - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig ContractConfig ContractConfig } @@ -252,7 +254,7 @@ func GenericTransferOwnership(env cldf.Environment, req *TransferOwnershipReques proposers[req.ChainSel] = mcmssolanasdk.ContractAddress(mcmsState.McmProgram, mcmssolanasdk.PDASeed(mcmsState.ProposerMcmSeed)) // Create timelock proposal - proposal, err := proposalutils.BuildProposalFromBatchesV2(env, timelocks, proposers, inspectors, + proposal, err := proposeutils.BuildProposalFromBatchesV2(env, timelocks, proposers, inspectors, execOut.Output.Batches, fmt.Sprintf("proposal to transfer ownership of %s to timelock", req.ContractConfig.ContractType), req.MCMSCfg) if err != nil { return out, fmt.Errorf("failed to build proposal: %w", err) @@ -294,7 +296,7 @@ type ( TransferToTimelockInput struct { Contract OwnableContract - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } TransferToTimelockOutput struct { @@ -360,7 +362,7 @@ func TransferToTimelockSolanaOp(b operations.Bundle, deps Deps, in TransferToTim type TransferMCMSToTimelockSolanaConfig struct { Chains []uint64 - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } // TransferMCMSToTimelockSolana transfers set MCMS "contracts" to the timelock diff --git a/deployment/common/changeset/solana/transfer_ownership_test.go b/deployment/common/changeset/solana/transfer_ownership_test.go index c5bb9c4d60f..15b4f28810b 100644 --- a/deployment/common/changeset/solana/transfer_ownership_test.go +++ b/deployment/common/changeset/solana/transfer_ownership_test.go @@ -19,9 +19,8 @@ import ( cldf_solana "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestTransferToMCMSToTimelockSolana(t *testing.T) { @@ -48,7 +47,7 @@ func TestTransferToMCMSToTimelockSolana(t *testing.T) { err = rt.Exec( runtime.ChangesetTask(&TransferMCMSToTimelockSolana{}, TransferMCMSToTimelockSolanaConfig{ Chains: []uint64{selector}, - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, }), runtime.SignAndExecuteProposalsTask([]*ecdsa.PrivateKey{cldftesthelpers.TestXXXMCMSSigner}), ) diff --git a/deployment/common/changeset/transfer_to_mcms_with_timelock.go b/deployment/common/changeset/transfer_to_mcms_with_timelock.go index 2332a01197a..fe24c293db1 100644 --- a/deployment/common/changeset/transfer_to_mcms_with_timelock.go +++ b/deployment/common/changeset/transfer_to_mcms_with_timelock.go @@ -16,19 +16,21 @@ import ( "github.com/smartcontractkit/mcms/sdk/evm" mcmstypes "github.com/smartcontractkit/mcms/types" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc677" "github.com/smartcontractkit/chainlink/deployment/common/changeset/evm/mcms/seqs" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) type TransferToMCMSWithTimelockConfig struct { ContractsByChain map[uint64][]common.Address // MCMSConfig is for the accept ownership proposal - MCMSConfig proposalutils.TimelockConfig + MCMSConfig cldfproposalutils.TimelockConfig // Optional flag: Only runs accept ownership (not transfer ownership) if enabled OnlyAcceptOwnership bool @@ -163,7 +165,7 @@ func TransferToMCMSWithTimelockV2( Transactions: seqReport.Output.OpsMcms, }) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelockAddressByChain, proposerAddressByChain, inspectorPerChain, batches, "Transfer ownership to timelock", cfg.MCMSConfig) diff --git a/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go b/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go index d0145673e29..b9e9f9ec0e1 100644 --- a/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go +++ b/deployment/common/changeset/transfer_to_mcms_with_timelock_test.go @@ -28,7 +28,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -64,7 +63,7 @@ func TestTransferToMCMSWithTimelockV2(t *testing.T) { ContractsByChain: map[uint64][]common.Address{ selector: {link.LinkToken.Address()}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }), @@ -157,7 +156,7 @@ func TestTransferToMCMSWithTimelockV2DataStore(t *testing.T) { ContractsByChain: map[uint64][]common.Address{ selector: {link.LinkToken.Address()}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, }, }), diff --git a/deployment/common/opsutils/evm.go b/deployment/common/opsutils/evm.go index 5c8fdc18ed0..40ffd0ca1fa 100644 --- a/deployment/common/opsutils/evm.go +++ b/deployment/common/opsutils/evm.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" "github.com/zksync-sdk/zksync2-go/accounts" "github.com/zksync-sdk/zksync2-go/clients" @@ -25,8 +26,6 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" - - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // EVMCallInput is the input structure for an EVM call operation. @@ -120,7 +119,7 @@ func AddEVMCallSequenceToCSOutput[IN any]( seqReport operations.SequenceReport[IN, map[uint64][]EVMCallOutput], seqErr error, mcmsStateByChain map[uint64]evmstate.MCMSWithTimelockState, - mcmsCfg *proposalutils.TimelockConfig, + mcmsCfg *cldfproposalutils.TimelockConfig, mcmsDescription string, ) (cldf.ChangesetOutput, error) { defer func() { csOutput.Reports = append(csOutput.Reports, seqReport.ExecutionReports...) }() @@ -172,7 +171,7 @@ func AddEVMCallSequenceToCSOutput[IN any]( } // Build new proposal from the batches and MCMS configuration. - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, mcmContractByChain, @@ -199,7 +198,14 @@ func AddEVMCallSequenceToCSOutput[IN any]( builder.WriteString(", ") } } - aggProposal, err := proposalutils.AggregateProposals(e, mcmsStateByChain, nil, csOutput.MCMSTimelockProposals, builder.String(), mcmsCfg) + aggProposal, err := proposeutils.AggregateProposals( //nolint:staticcheck // SA1019: not migrating to AggregateProposalsV2 yet + e, + mcmsStateByChain, + nil, + csOutput.MCMSTimelockProposals, + builder.String(), + mcmsCfg, + ) if err != nil { return csOutput, fmt.Errorf("failed to aggregate proposals: %w", err) } diff --git a/deployment/common/opsutils/evm_test.go b/deployment/common/opsutils/evm_test.go index 75be18caff4..dd23bca8c54 100644 --- a/deployment/common/opsutils/evm_test.go +++ b/deployment/common/opsutils/evm_test.go @@ -32,7 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/testhelpers" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" "github.com/smartcontractkit/chainlink/deployment/common/opsutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func TestCloneTransactOptsWithGas(t *testing.T) { @@ -168,7 +167,7 @@ func TestAddEVMCallSequenceToCSOutput_AllConfirmed(t *testing.T) { csOutput := cldf.ChangesetOutput{} seqReport := operations.SequenceReport[string, map[uint64][]opsutils.EVMCallOutput]{} - mcmsCfg := &proposalutils.TimelockConfig{} + mcmsCfg := &cldfproposalutils.TimelockConfig{} result, err := opsutils.AddEVMCallSequenceToCSOutput( *env, @@ -253,7 +252,7 @@ func TestAddEVMCallSequenceToCSOutput_ProposalCombination(t *testing.T) { }, } - mcmsCfg := &proposalutils.TimelockConfig{ + mcmsCfg := &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, // No delay for testing MCMSAction: mcmstypes.TimelockActionSchedule, } diff --git a/deployment/common/proposalutils/propose.go b/deployment/common/proposalutils/propose.go deleted file mode 100644 index 632c82f7aa8..00000000000 --- a/deployment/common/proposalutils/propose.go +++ /dev/null @@ -1,605 +0,0 @@ -package proposalutils - -import ( - "encoding/json" - "errors" - "fmt" - "reflect" - "time" - - "github.com/aptos-labs/aptos-go-sdk" - mapset "github.com/deckarep/golang-set/v2" - "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" - chain_selectors "github.com/smartcontractkit/chain-selectors" - evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" - mcmslib "github.com/smartcontractkit/mcms" - mcmschainwrappers "github.com/smartcontractkit/mcms/chainwrappers" - mcmssdk "github.com/smartcontractkit/mcms/sdk" - mcmssolanasdk "github.com/smartcontractkit/mcms/sdk/solana" - "github.com/smartcontractkit/mcms/types" - - commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" - cldf_aptos "github.com/smartcontractkit/chainlink-deployments-framework/chain/aptos" - cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" - cldf_adapters "github.com/smartcontractkit/chainlink-deployments-framework/chain/mcms/adapters" - "github.com/smartcontractkit/chainlink-deployments-framework/datastore" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - tonstate "github.com/smartcontractkit/chainlink-ton/deployment/state" - - solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" - - ccipTypes "github.com/smartcontractkit/chainlink/deployment/common/types" -) - -const ( - DefaultValidUntil = 72 * time.Hour -) - -type TimelockConfig struct { - MinDelay time.Duration `json:"minDelay"` // delay for timelock worker to execute the transfers. - MCMSAction types.TimelockAction `json:"mcmsAction"` - OverrideRoot bool `json:"overrideRoot"` // if true, override the previous root with the new one. - TimelockQualifierPerChain map[uint64]string `json:"timelockQualifierPerChain,omitempty"` // optional qualifier to fetch timelock address from datastore - ValidDuration *commonconfig.Duration `json:"validDuration" yaml:"validDuration"` -} - -func (tc *TimelockConfig) MCMBasedOnActionSolana(s solstate.MCMSWithTimelockState) (string, error) { - // if MCMSAction is not set, default to timelock.Schedule, this is to ensure no breaking changes for existing code - if tc.MCMSAction == "" { - tc.MCMSAction = types.TimelockActionSchedule - } - switch tc.MCMSAction { - case types.TimelockActionSchedule: - contractID := mcmssolanasdk.ContractAddress(s.McmProgram, mcmssolanasdk.PDASeed(s.ProposerMcmSeed)) - return contractID, nil - case types.TimelockActionCancel: - contractID := mcmssolanasdk.ContractAddress(s.McmProgram, mcmssolanasdk.PDASeed(s.CancellerMcmSeed)) - return contractID, nil - case types.TimelockActionBypass: - contractID := mcmssolanasdk.ContractAddress(s.McmProgram, mcmssolanasdk.PDASeed(s.BypasserMcmSeed)) - return contractID, nil - default: - return "", errors.New("invalid MCMS action") - } -} - -func (tc *TimelockConfig) MCMBasedOnActionTON(s *tonstate.MCMSSuiteState) (string, error) { - // if MCMSAction is not set, default to timelock.Schedule, this is to ensure no breaking changes for existing code - if tc.MCMSAction == "" { - tc.MCMSAction = types.TimelockActionSchedule - } - switch tc.MCMSAction { - case types.TimelockActionSchedule: - if s.Proposer == nil { - return "", errors.New("missing TON proposer") - } - return s.Proposer.String(), nil - case types.TimelockActionCancel: - if s.Canceller == nil { - return "", errors.New("missing TON canceller") - } - return s.Canceller.String(), nil - case types.TimelockActionBypass: - if s.Bypasser == nil { - return "", errors.New("missing TON bypasser") - } - return s.Bypasser.String(), nil - default: - return "", errors.New("invalid MCMS action") - } -} - -func (tc *TimelockConfig) MCMBasedOnAction(s evmstate.MCMSWithTimelockState) (*gethwrappers.ManyChainMultiSig, error) { - // if MCMSAction is not set, default to timelock.Schedule, this is to ensure no breaking changes for existing code - if tc.MCMSAction == "" { - tc.MCMSAction = types.TimelockActionSchedule - } - switch tc.MCMSAction { - case types.TimelockActionSchedule: - if s.ProposerMcm == nil { - return nil, errors.New("missing proposerMcm") - } - return s.ProposerMcm, nil - case types.TimelockActionCancel: - if s.CancellerMcm == nil { - return nil, errors.New("missing cancellerMcm") - } - return s.CancellerMcm, nil - case types.TimelockActionBypass: - if s.BypasserMcm == nil { - return nil, errors.New("missing bypasserMcm") - } - return s.BypasserMcm, nil - default: - return nil, errors.New("invalid MCMS action") - } -} - -func (tc *TimelockConfig) validateCommon() error { - // if MCMSAction is not set, default to timelock.Schedule - if tc.MCMSAction == "" { - tc.MCMSAction = types.TimelockActionSchedule - } - if tc.MCMSAction != types.TimelockActionSchedule && - tc.MCMSAction != types.TimelockActionCancel && - tc.MCMSAction != types.TimelockActionBypass { - return fmt.Errorf("invalid MCMS type %s", tc.MCMSAction) - } - return nil -} - -func (tc *TimelockConfig) Validate(chain cldf_evm.Chain, s evmstate.MCMSWithTimelockState) error { - err := tc.validateCommon() - if err != nil { - return err - } - if s.Timelock == nil { - return fmt.Errorf("missing timelock on %s", chain) - } - if tc.MCMSAction == types.TimelockActionSchedule && s.ProposerMcm == nil { - return fmt.Errorf("missing proposerMcm on %s", chain) - } - if tc.MCMSAction == types.TimelockActionCancel && s.CancellerMcm == nil { - return fmt.Errorf("missing cancellerMcm on %s", chain) - } - if tc.MCMSAction == types.TimelockActionBypass && s.BypasserMcm == nil { - return fmt.Errorf("missing bypasserMcm on %s", chain) - } - if s.Timelock == nil { - return fmt.Errorf("missing timelock on %s", chain) - } - if s.CallProxy == nil { - return fmt.Errorf("missing callProxy on %s", chain) - } - return nil -} - -func (tc *TimelockConfig) ValidateSolana(e cldf.Environment, chainSelector uint64) error { - err := tc.validateCommon() - if err != nil { - return err - } - - validateContract := func(contractType cldf.ContractType) error { - timelockID, err := cldf.SearchAddressBook(e.ExistingAddresses, chainSelector, contractType) - if err != nil { - return fmt.Errorf("%s not present on the chain %w", contractType, err) - } - // Make sure addresses are correctly parsed. Format is: "programID.PDASeed" - _, _, err = mcmssolanasdk.ParseContractAddress(timelockID) - if err != nil { - return fmt.Errorf("failed to parse timelock address: %w", err) - } - return nil - } - - err = validateContract(ccipTypes.RBACTimelock) - if err != nil { - return err - } - - switch tc.MCMSAction { - case types.TimelockActionSchedule: - err = validateContract(ccipTypes.ProposerManyChainMultisig) - if err != nil { - return err - } - case types.TimelockActionCancel: - err = validateContract(ccipTypes.CancellerManyChainMultisig) - if err != nil { - return err - } - case types.TimelockActionBypass: - err = validateContract(ccipTypes.BypasserManyChainMultisig) - if err != nil { - return err - } - default: - return fmt.Errorf("invalid MCMS action %s", tc.MCMSAction) - } - - return nil -} - -func (tc *TimelockConfig) ValidateAptos(chain cldf_aptos.Chain, mcmsAddress aptos.AccountAddress) error { - if err := tc.validateCommon(); err != nil { - return err - } - - if (mcmsAddress == aptos.AccountAddress{}) { - return fmt.Errorf("aptos MCMS contract not present on chain %s", chain) - } - - return nil -} - -type ChainMetadata map[uint64]map[string]any - -func (c *ChainMetadata) Set(chainSelector uint64, key string, value any) *ChainMetadata { - _, exists := (*c)[chainSelector] - if !exists { - (*c)[chainSelector] = make(map[string]any) - } - - (*c)[chainSelector][key] = value - - return c -} - -type BuildProposalOption func(*buildProposalOptions) - -type buildProposalOptions struct { - chainMetadata ChainMetadata -} - -func WithChainMetadata(chainMetadata ChainMetadata) BuildProposalOption { - return func(opts *buildProposalOptions) { - opts.chainMetadata = chainMetadata - } -} - -// BuildProposalFromBatchesV2 uses the new MCMS library which replaces the implementation in BuildProposalFromBatches. -func BuildProposalFromBatchesV2( - e cldf.Environment, - timelockAddressPerChain map[uint64]string, - mcmsAddressPerChain map[uint64]string, - inspectorPerChain map[uint64]mcmssdk.Inspector, // optional - batches []types.BatchOperation, - description string, - mcmsCfg TimelockConfig, - opts ...BuildProposalOption, -) (*mcmslib.TimelockProposal, error) { - buildOptions := buildProposalOptions{} - for _, opt := range opts { - opt(&buildOptions) - } - - // default to schedule if not set, this is to be consistent with the old implementation - // and to avoid breaking changes - if mcmsCfg.MCMSAction == "" { - mcmsCfg.MCMSAction = types.TimelockActionSchedule - } - if len(batches) == 0 { - return nil, errors.New("no operations in batch") - } - - chains := mapset.NewSet[uint64]() - for _, op := range batches { - chains.Add(uint64(op.ChainSelector)) - } - tlsPerChainID := make(map[types.ChainSelector]string) - for chainID, tl := range timelockAddressPerChain { - tlsPerChainID[types.ChainSelector(chainID)] = tl - } - mcmsMd, err := buildProposalMetadataV2(e, chains.ToSlice(), inspectorPerChain, mcmsAddressPerChain, - mcmsCfg.MCMSAction, buildOptions.chainMetadata) - if err != nil { - return nil, err - } - - proposalDuration := DefaultValidUntil - if mcmsCfg.ValidDuration != nil { - proposalDuration = mcmsCfg.ValidDuration.Duration() - } - validUntil := time.Now().Add(proposalDuration).Unix() - - builder := mcmslib.NewTimelockProposalBuilder() - builder. - SetVersion("v1"). - SetAction(mcmsCfg.MCMSAction). - //nolint:gosec // G115 - SetValidUntil(uint32(validUntil)). - SetDescription(description). - SetDelay(types.NewDuration(mcmsCfg.MinDelay)). - SetOverridePreviousRoot(mcmsCfg.OverrideRoot). - SetChainMetadata(mcmsMd). - SetTimelockAddresses(tlsPerChainID). - SetOperations(batches) - - build, err := builder.Build() - if err != nil { - return nil, err - } - return build, nil -} - -func buildProposalMetadataV2( - env cldf.Environment, - chainSelectors []uint64, - inspectorPerChain map[uint64]mcmssdk.Inspector, // optional - mcmAddresses map[uint64]string, // can be proposer, canceller or bypasser - mcmsAction types.TimelockAction, - additionalChainMetadata ChainMetadata, -) (map[types.ChainSelector]types.ChainMetadata, error) { - proposalChainMetadata := make(map[types.ChainSelector]types.ChainMetadata) - - if len(additionalChainMetadata) == 0 { - additionalChainMetadata = make(ChainMetadata) - } - - for _, selector := range chainSelectors { - mcmAddress, ok := mcmAddresses[selector] - if !ok { - return nil, fmt.Errorf("missing mcm address for chain %d", selector) - } - - chainID := types.ChainSelector(selector) - family, err := chain_selectors.GetSelectorFamily(selector) - if err != nil { - return nil, fmt.Errorf("failed to get family for chain %d: %w", selector, err) - } - - switch family { - case chain_selectors.FamilySolana: - solanaState, err := getSolanaState(env, selector) - if err != nil { - return nil, err - } - - var instanceSeed mcmssolanasdk.PDASeed - switch mcmsAction { - case types.TimelockActionSchedule: - instanceSeed = mcmssolanasdk.PDASeed(solanaState.ProposerMcmSeed) - case types.TimelockActionCancel: - instanceSeed = mcmssolanasdk.PDASeed(solanaState.CancellerMcmSeed) - case types.TimelockActionBypass: - instanceSeed = mcmssolanasdk.PDASeed(solanaState.BypasserMcmSeed) - default: - return nil, fmt.Errorf("invalid MCMS action %s", mcmsAction) - } - - proposalChainMetadata[chainID], err = mcmssolanasdk.NewChainMetadata( - 0, // opCount is set later - solanaState.McmProgram, - instanceSeed, - solanaState.ProposerAccessControllerAccount, - solanaState.CancellerAccessControllerAccount, - solanaState.BypasserAccessControllerAccount) - if err != nil { - return nil, fmt.Errorf("failed to create chain metadata: %w", err) - } - - case chain_selectors.FamilyAptos: - role, err := cldfproposalutils.GetAptosRoleFromAction(mcmsAction) - if err != nil { - return nil, fmt.Errorf("failed to get role from action: %w", err) - } - additionalChainMetadata.Set(selector, "role", role) - - proposalChainMetadata[chainID] = types.ChainMetadata{MCMAddress: mcmAddress} - - default: - proposalChainMetadata[chainID] = types.ChainMetadata{MCMAddress: mcmAddress} - } - } - - if len(inspectorPerChain) == 0 { - mcmsChains := cldf_adapters.Wrap(env.BlockChains) - inspectors, err := mcmschainwrappers.BuildInspectors(&mcmsChains, proposalChainMetadata, mcmsAction) - if err != nil { - return nil, fmt.Errorf("failed to build inspectors: %w", err) - } - - inspectorPerChain = make(map[uint64]mcmssdk.Inspector) - for selector, inspector := range inspectors { - inspectorPerChain[uint64(selector)] = inspector - } - } - - for selector, metadata := range proposalChainMetadata { - inspector, ok := inspectorPerChain[uint64(selector)] - if !ok { - return nil, fmt.Errorf("failed to get inspector for chain %d", selector) - } - - opCount, err := inspector.GetOpCount(env.GetContext(), metadata.MCMAddress) - if err != nil { - return nil, fmt.Errorf("failed to get op count for chain %d: %w", selector, err) - } - metadata.StartingOpCount = opCount - - additionalMetadata, exists := additionalChainMetadata[uint64(selector)] - if exists { - marshalledAdditionalMetadata, err := json.Marshal(additionalMetadata) - if err != nil { - return nil, fmt.Errorf("failed to marshal extra chain metadata for chain %d: %w", selector, err) - } - metadata.AdditionalFields = marshalledAdditionalMetadata - } - - proposalChainMetadata[selector] = metadata - } - - return proposalChainMetadata, nil -} - -func getSolanaState(env cldf.Environment, selector uint64) (*solstate.MCMSWithTimelockState, error) { - solanaChains := env.BlockChains.SolanaChains() - addresses, err := env.ExistingAddresses.AddressesForChain(selector) - solanaState, err1 := solstate.MaybeLoadMCMSWithTimelockChainState(solanaChains[selector], addresses) - if err == nil { - return solanaState, nil - } - - env.Logger.Info("failed to load MCMSState from address book") - solanaState, err2 := solstate.MaybeLoadMCMSWithTimelockChainStateV2(env.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(selector))) - if err2 != nil { - return nil, fmt.Errorf("failed to load solana state: %w", errors.Join(err1, err2)) - } - - return solanaState, nil -} - -// AggregateProposals aggregates multiple MCMS proposals into a single proposal by combining their operations, and -// setting up the proposers and inspectors for each chain. It returns a single MCMS proposal that can be executed -// and signed. -// -// Deprecated: Use extensible AggregateProposalsV2 instead. Which accepts multiple chain families. -func AggregateProposals( - env cldf.Environment, - mcmsEVMState map[uint64]evmstate.MCMSWithTimelockState, - mcmsSolanaState map[uint64]solstate.MCMSWithTimelockState, - proposals []mcmslib.TimelockProposal, - description string, - mcmsConfig *TimelockConfig, -) (*mcmslib.TimelockProposal, error) { - return AggregateProposalsV2( - env, - MCMSStates{ - MCMSEVMState: mcmsEVMState, - MCMSSolanaState: mcmsSolanaState, - }, - proposals, - description, - mcmsConfig, - ) -} - -type MCMSStates struct { - MCMSEVMState map[uint64]evmstate.MCMSWithTimelockState - MCMSSolanaState map[uint64]solstate.MCMSWithTimelockState - MCMSAptosState map[uint64]aptos.AccountAddress - MCMSTONState map[uint64]tonstate.MCMSChainState -} - -// AggregateProposalsV2 aggregates multiple MCMS proposals into a single proposal by combining their operations, and -// setting up the proposers and inspectors for each chain. It returns a single MCMS proposal that can be executed -// and signed. -// It has an extensible signature to allow for future chain families implementations -func AggregateProposalsV2( - env cldf.Environment, - mcmsTimelockStates MCMSStates, - proposals []mcmslib.TimelockProposal, - description string, - mcmsConfig *TimelockConfig, - opts ...BuildProposalOption, -) (*mcmslib.TimelockProposal, error) { - if mcmsConfig == nil { - return nil, nil - } - - var batches []types.BatchOperation - chainMetadata := make(map[types.ChainSelector]types.ChainMetadata) - - // Add proposals to the aggregate. - for _, proposal := range proposals { - batches = append(batches, proposal.Operations...) - - for selector, metadata := range proposal.ChainMetadata { - existingMetadata, exists := chainMetadata[selector] - if exists { - if !jsonEqual(existingMetadata.AdditionalFields, metadata.AdditionalFields) { - return nil, fmt.Errorf("conflicting metadata for chain selector %d: %#v vs %#v", selector, existingMetadata, metadata) - } - } else { - chainMetadata[selector] = metadata - } - } - } - - // Return early if there are no operations. - if len(batches) == 0 { - return nil, nil - } - - // Store the timelock and mcm addresses for each chain. - timelocks := make(map[uint64]string) - mcmsPerChain := make(map[uint64]string) - for _, op := range batches { - chainSel := uint64(op.ChainSelector) - var err error - - family, err := chain_selectors.GetSelectorFamily(chainSel) - if err != nil { - return nil, fmt.Errorf("failed to get family for chain %d: %w", chainSel, err) - } - switch family { - case chain_selectors.FamilyEVM: - mcmsEVMState, exists := mcmsTimelockStates.MCMSEVMState[chainSel] - if !exists { - return nil, fmt.Errorf("missing MCMS state for chain with selector %d", chainSel) - } - mcmsContract, err := mcmsConfig.MCMBasedOnAction(mcmsEVMState) - if err != nil { - return &mcmslib.TimelockProposal{}, fmt.Errorf("failed to get MCMS contract for chain with selector %d: %w", chainSel, err) - } - timelocks[chainSel] = mcmsEVMState.Timelock.Address().Hex() - mcmsPerChain[chainSel] = mcmsContract.Address().Hex() - case chain_selectors.FamilySolana: - solanaState, existsInSolana := mcmsTimelockStates.MCMSSolanaState[chainSel] - if !existsInSolana { - return nil, fmt.Errorf("missing MCMS state for chain with selector %d", chainSel) - } - timelocks[chainSel] = mcmssolanasdk.ContractAddress( - solanaState.TimelockProgram, - mcmssolanasdk.PDASeed(solanaState.TimelockSeed), - ) - mcmsAddr, err := mcmsConfig.MCMBasedOnActionSolana(solanaState) - if err != nil { - return nil, err - } - mcmsPerChain[chainSel] = mcmsAddr - case chain_selectors.FamilyAptos: - // Set MCMS addresses. Aptos uses the same address for MCMS and Timelock - aptosMCMSAddress, existsInAptos := mcmsTimelockStates.MCMSAptosState[chainSel] - if !existsInAptos { - return nil, fmt.Errorf("missing MCMS state for chain with selector %d", chainSel) - } - timelocks[chainSel] = aptosMCMSAddress.StringLong() - mcmsPerChain[chainSel] = aptosMCMSAddress.StringLong() - case chain_selectors.FamilyTon: - tonMCMS, exists := mcmsTimelockStates.MCMSTONState[chainSel] - if !exists { - return nil, fmt.Errorf("missing MCMS state for TON chain %d", chainSel) - } - qualifier := mcmsConfig.TimelockQualifierPerChain[chainSel] - // Get the default qualifier suite (or iterate ByQualifier) - suite, ok := tonMCMS.ByQualifier[qualifier] // default qualifier? - if !ok || suite == nil { - return nil, fmt.Errorf("missing TON timelock for chain %d qualifier %q", chainSel, qualifier) - } - if suite.Timelock == nil { - return nil, fmt.Errorf("missing TON timelock address for chain %d", chainSel) - } - timelocks[chainSel] = suite.Timelock.String() - // Select MCMS address based on action - mcmsAddr, err := mcmsConfig.MCMBasedOnActionTON(suite) - if err != nil { - return nil, err - } - mcmsPerChain[chainSel] = mcmsAddr - } - } - - return BuildProposalFromBatchesV2( - env, - timelocks, - mcmsPerChain, - nil, // inspectors will be set automatically - batches, - description, - *mcmsConfig, - opts..., - ) -} - -func jsonEqual(messageA, messageB json.RawMessage) bool { - var unmarshalledA any - if len(messageA) > 0 { - err := json.Unmarshal(messageA, &unmarshalledA) - if err != nil { - return false - } - } - - var unmarshalledB any - if len(messageB) > 0 { - err := json.Unmarshal(messageB, &unmarshalledB) - if err != nil { - return false - } - } - - return reflect.DeepEqual(unmarshalledA, unmarshalledB) -} diff --git a/deployment/common/proposalutils/propose_test.go b/deployment/common/proposalutils/propose_test.go index ec6d562b507..c0be32aec94 100644 --- a/deployment/common/proposalutils/propose_test.go +++ b/deployment/common/proposalutils/propose_test.go @@ -11,6 +11,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" chain_selectors "github.com/smartcontractkit/chain-selectors" mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" "github.com/smartcontractkit/mcms" mcmssdk "github.com/smartcontractkit/mcms/sdk" @@ -30,7 +31,6 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/runtime" "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" ) @@ -153,7 +153,7 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { name string batches []types.BatchOperation inspectors map[uint64]mcmssdk.Inspector - options []proposalutils.BuildProposalOption + options []proposeutils.BuildProposalOption want *mcms.TimelockProposal wantErr string }{ @@ -161,22 +161,22 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { name: "success: explicit inspectors", batches: batches, inspectors: inspectorPerChain, - options: []proposalutils.BuildProposalOption{}, + options: []proposeutils.BuildProposalOption{}, want: wantProposal, }, { name: "success: implicit inspectors", batches: batches, inspectors: nil, - options: []proposalutils.BuildProposalOption{}, + options: []proposeutils.BuildProposalOption{}, want: wantProposal, }, { name: "success: extra chain metadata", batches: batches, inspectors: nil, - options: []proposalutils.BuildProposalOption{ - proposalutils.WithChainMetadata(proposalutils.ChainMetadata{ + options: []proposeutils.BuildProposalOption{ + proposeutils.WithChainMetadata(proposeutils.ChainMetadata{ evmSelector: map[string]any{ "gasLimit": 100, "gasPrice": 50, @@ -206,22 +206,22 @@ func TestBuildProposalFromBatchesV2(t *testing.T) { Transactions: []types.Transaction{{To: "0xRecipient1", Data: []byte("data1")}}, }, }, - options: []proposalutils.BuildProposalOption{}, + options: []proposeutils.BuildProposalOption{}, wantErr: "Key: 'TimelockProposal.Operations[0].Transactions[0].AdditionalFields' Error:Field validation for 'AdditionalFields' failed on the 'required' tag", }, { name: "empty batches", batches: []types.BatchOperation{}, - options: []proposalutils.BuildProposalOption{}, + options: []proposeutils.BuildProposalOption{}, wantErr: "no operations in batch", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - proposal, err := proposalutils.BuildProposalFromBatchesV2(rt.Environment(), + proposal, err := proposeutils.BuildProposalFromBatchesV2(rt.Environment(), timelockAddressPerChain, proposerAddressPerChain, tt.inspectors, tt.batches, description, - proposalutils.TimelockConfig{MinDelay: minDelay}, tt.options...) + cldfproposalutils.TimelockConfig{MinDelay: minDelay}, tt.options...) if tt.wantErr == "" { require.NoError(t, err) diff --git a/deployment/common/view/v1_0/capreg.go b/deployment/common/view/v1_0/capreg.go index d94e9ab97d1..a2cb0a0168e 100644 --- a/deployment/common/view/v1_0/capreg.go +++ b/deployment/common/view/v1_0/capreg.go @@ -10,7 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" diff --git a/deployment/common/view/v1_0/capreg_test.go b/deployment/common/view/v1_0/capreg_test.go index 7f806d74bbb..fcfdc3239ea 100644 --- a/deployment/common/view/v1_0/capreg_test.go +++ b/deployment/common/view/v1_0/capreg_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" cr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" ) diff --git a/deployment/common/view/v1_0/mcms.go b/deployment/common/view/v1_0/mcms.go index ba7737b29e4..d291f57c754 100644 --- a/deployment/common/view/v1_0/mcms.go +++ b/deployment/common/view/v1_0/mcms.go @@ -14,7 +14,7 @@ import ( mcmssolanasdk "github.com/smartcontractkit/mcms/sdk/solana" mcmstypes "github.com/smartcontractkit/mcms/types" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink-evm/pkg/utils" ) diff --git a/deployment/common/view/v1_0/workflowreg.go b/deployment/common/view/v1_0/workflowreg.go index 3d8a56bbbeb..f1d75b16768 100644 --- a/deployment/common/view/v1_0/workflowreg.go +++ b/deployment/common/view/v1_0/workflowreg.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" workflow_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/workflow_registry_wrapper_v1" ) diff --git a/deployment/common/view/v2_0/capreg.go b/deployment/common/view/v2_0/capreg.go index f3b1a4178e9..419dc14d514 100644 --- a/deployment/common/view/v2_0/capreg.go +++ b/deployment/common/view/v2_0/capreg.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" creocr3 "github.com/smartcontractkit/chainlink/deployment/cre/ocr3" diff --git a/deployment/common/view/v2_0/capreg_test.go b/deployment/common/view/v2_0/capreg_test.go index 6a9090685dc..c5fbe7398ee 100644 --- a/deployment/common/view/v2_0/capreg_test.go +++ b/deployment/common/view/v2_0/capreg_test.go @@ -8,9 +8,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" cr "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink/deployment/common/view/v2_0" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" ) diff --git a/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go b/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go index 5d0d99ccae6..217f2533790 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/common/view/v2_0" @@ -111,8 +111,7 @@ func TestSetDONsFamilies_Apply(t *testing.T) { t.Run("set families for existing DON - MCMS", func(t *testing.T) { mcmsEnv := test.SetupEnvV2(t, true) - duration, testErr := commonconfig.NewDuration(1 * time.Second) - require.NoError(t, testErr) + duration := mcmstypes.NewDuration(1 * time.Second) csOut, testErr := cs.Apply(*mcmsEnv.Env, changeset.SetDONsFamiliesInput{ RegistrySelector: chainSelector, RegistryQualifier: test.RegistryQualifier, diff --git a/deployment/cre/common/strategies/mcms_transaction.go b/deployment/cre/common/strategies/mcms_transaction.go index 983be30a157..47e02ec9d3f 100644 --- a/deployment/cre/common/strategies/mcms_transaction.go +++ b/deployment/cre/common/strategies/mcms_transaction.go @@ -15,9 +15,10 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" ) @@ -79,7 +80,7 @@ func (m *MCMSTransaction) BuildProposal(operations []mcmstypes.BatchOperation) ( m.ChainSel: inspector, } - return proposalutils.BuildProposalFromBatchesV2( + return proposeutils.BuildProposalFromBatchesV2( m.Env, timelocksPerChain, mcmsAddressesPerChain, diff --git a/deployment/cre/common/strategies/mcms_transaction_test.go b/deployment/cre/common/strategies/mcms_transaction_test.go index 9b5cee2f401..00f5a1e3c0c 100644 --- a/deployment/cre/common/strategies/mcms_transaction_test.go +++ b/deployment/cre/common/strategies/mcms_transaction_test.go @@ -13,7 +13,6 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" @@ -207,8 +206,7 @@ func TestMCMSTransaction_BuildProposal(t *testing.T) { t.Run("uses custom ValidDuration value to set the proposal duration", func(t *testing.T) { m := getMCMSTransaction(t, *fixture.Env) - validDuration, err := commonconfig.NewDuration(2 * time.Second) - require.NoError(t, err) + validDuration := mcmstypes.NewDuration(2 * time.Second) cfg := contracts.MCMSConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ @@ -228,7 +226,7 @@ func TestMCMSTransaction_BuildProposal(t *testing.T) { p, err := m.BuildProposal([]mcmstypes.BatchOperation{op}) require.NoError(t, err) - expectedValidUntil := time.Now().Add(validDuration.Duration()).Unix() + expectedValidUntil := time.Now().Add(validDuration.Duration).Unix() // Using InDelta to allow for slight timing differences during test execution assert.InDelta(t, uint32(expectedValidUntil), p.ValidUntil, 1, "ValidUntil should be within 1 second of expected value") //nolint:gosec // G115 }) diff --git a/deployment/cre/common/strategies/strategies.go b/deployment/cre/common/strategies/strategies.go index 5b2d68fe4e1..ca9a8c62509 100644 --- a/deployment/cre/common/strategies/strategies.go +++ b/deployment/cre/common/strategies/strategies.go @@ -63,6 +63,7 @@ func CreateStrategy( } // Legacy aliases for backward compatibility with existing CRE modules +// // Deprecated: Use TransactionStrategy instead type StrategyV2 = TransactionStrategy diff --git a/deployment/cre/contracts/contracts.go b/deployment/cre/contracts/contracts.go index ae84e4ecc81..b6d905aa9bf 100644 --- a/deployment/cre/contracts/contracts.go +++ b/deployment/cre/contracts/contracts.go @@ -11,9 +11,9 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" shard_config "github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings/dev/generated/latest/shard_config" @@ -38,7 +38,7 @@ var ( MockKeystoneForwarder cldf.ContractType = "MockKeystoneForwarder" // https://github.com/smartcontractkit/chainlink-evm/blob/f2272e4b4aa6a3e315126ce7d928472bb035f940/contracts/cre/src/dev/MockKeystoneForwarder.sol#L38 ) -type MCMSConfig = proposalutils.TimelockConfig +type MCMSConfig = cldfproposalutils.TimelockConfig // Ownable is an interface for contracts that have an owner. type Ownable interface { diff --git a/deployment/cre/contracts/contracts_test.go b/deployment/cre/contracts/contracts_test.go index 5c9902cd0fc..59fdb46aa66 100644 --- a/deployment/cre/contracts/contracts_test.go +++ b/deployment/cre/contracts/contracts_test.go @@ -26,8 +26,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" "github.com/smartcontractkit/chainlink/deployment" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" @@ -313,14 +311,14 @@ func TestNewOwnableV2(t *testing.T) { t.Run("creates OwnedContract for MCMS owner", func(t *testing.T) { // Transfer ownership to MCMS with timelock - cfg := commonchangeset.TransferToMCMSWithTimelockConfig{ + cfg := mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{selector: {common.HexToAddress(targetAddrStr)}}, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: time.Duration(0), }, } err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), cfg), + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), cfg), runtime.SignAndExecuteProposalsTask([]*ecdsa.PrivateKey{cldftesthelpers.TestXXXMCMSSigner}), ) require.NoError(t, err) diff --git a/deployment/cre/forwarder/solana/cs_ownership.go b/deployment/cre/forwarder/solana/cs_ownership.go index 08a5c90cdf4..4bee94eb577 100644 --- a/deployment/cre/forwarder/solana/cs_ownership.go +++ b/deployment/cre/forwarder/solana/cs_ownership.go @@ -4,8 +4,8 @@ import ( "github.com/gagliardetto/solana-go" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // TransferOwnershipForwarderRequest wraps the generic request for forwarder contracts @@ -14,7 +14,7 @@ type TransferOwnershipForwarderRequest struct { CurrentOwner, ProposedOwner solana.PublicKey Version string Qualifier string - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } // TransferOwnershipForwarder implementation diff --git a/deployment/cre/forwarder/solana/deploy_forwarder.go b/deployment/cre/forwarder/solana/deploy_forwarder.go index e2cccc162bd..4efc7d2c53b 100644 --- a/deployment/cre/forwarder/solana/deploy_forwarder.go +++ b/deployment/cre/forwarder/solana/deploy_forwarder.go @@ -16,11 +16,13 @@ import ( mcmsSolana "github.com/smartcontractkit/mcms/sdk/solana" mcmsTypes "github.com/smartcontractkit/mcms/types" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/cre/forwarder" seq "github.com/smartcontractkit/chainlink/deployment/cre/forwarder/solana/sequence" "github.com/smartcontractkit/chainlink/deployment/cre/forwarder/solana/sequence/operation" @@ -133,7 +135,7 @@ type SetForwarderUpgradeAuthorityRequest = struct { NewUpgradeAuthority solana.PublicKey Qualifier string Version string - MCMS *proposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock } var _ cldf.ChangeSetV2[*SetForwarderUpgradeAuthorityRequest] = SetForwarderUpgradeAuthority{} @@ -209,7 +211,7 @@ func (cs SetForwarderUpgradeAuthority) Apply(env cldf.Environment, req *SetForwa type ConfigureForwarderRequest struct { DON forwarder.DonConfiguration - MCMS *proposalutils.TimelockConfig // if set, assumes current ownership is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current ownership is the timelock // Chains is optional. Defines chains for which request will be executed. If empty, runs for all available chains. Chains map[uint64]struct{} @@ -284,7 +286,7 @@ func (cs ConfigureForwarders) Apply(env cldf.Environment, req *ConfigureForwarde proposers[solChain.Selector] = mcmsSolana.ContractAddress(mcmState.McmProgram, mcmsSolana.PDASeed(mcmState.ProposerMcmSeed)) inspectors[solChain.Selector] = mcmsSolana.NewInspector(solChain.Client) - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocks, proposers, diff --git a/deployment/cre/forwarder/solana/deploy_forwarder_test.go b/deployment/cre/forwarder/solana/deploy_forwarder_test.go index d4c6cd70d3c..3645c32bdde 100644 --- a/deployment/cre/forwarder/solana/deploy_forwarder_test.go +++ b/deployment/cre/forwarder/solana/deploy_forwarder_test.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/wsrpc/logger" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" cldfchain "github.com/smartcontractkit/chainlink-deployments-framework/chain" @@ -22,7 +23,6 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" solanaMCMS "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana/mcms" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/cre/forwarder" "github.com/smartcontractkit/chainlink/deployment/helpers" @@ -241,7 +241,7 @@ func TestConfigureForwarder(t *testing.T) { runtime.ChangesetTask(TransferOwnershipForwarder{}, &TransferOwnershipForwarderRequest{ ChainSel: solSel, - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, Qualifier: testQualifier, Version: "1.0.0", }, @@ -265,7 +265,7 @@ func TestConfigureForwarder(t *testing.T) { DON: donConfig, Version: "1.0.0", Qualifier: testQualifier, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: time.Second, }, }, diff --git a/deployment/cre/forwarder/solana/sequence/operation/operation.go b/deployment/cre/forwarder/solana/sequence/operation/operation.go index 893ec380b51..8a79391d75a 100644 --- a/deployment/cre/forwarder/solana/sequence/operation/operation.go +++ b/deployment/cre/forwarder/solana/sequence/operation/operation.go @@ -14,11 +14,11 @@ import ( cldfsol "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" ks_forwarder "github.com/smartcontractkit/chainlink-solana/contracts/generated/keystone_forwarder" commonOps "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/helpers" ) @@ -71,7 +71,7 @@ type ( ChainSel uint64 ProgramID string NewUpgradeAuthority string - MCMS *proposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock } SetUpgradeAuthorityOutput struct { @@ -79,7 +79,7 @@ type ( } ConfigureForwarderInput struct { - MCMS *proposalutils.TimelockConfig // if set, assumes current owner is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current owner is the timelock ConfigPDA string ProgramID solana.PublicKey ForwarderState solana.PublicKey diff --git a/deployment/cre/mcms/changeset/configure.go b/deployment/cre/mcms/changeset/configure.go index 7af607cad3e..8eb3da7f68a 100644 --- a/deployment/cre/mcms/changeset/configure.go +++ b/deployment/cre/mcms/changeset/configure.go @@ -3,10 +3,11 @@ package changeset import ( "errors" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" ) @@ -39,17 +40,17 @@ func (CsMCMSConfigure) VerifyPreconditions(env cldf.Environment, input Configure } func (CsMCMSConfigure) Apply(env cldf.Environment, input ConfigureChangesetInput) (cldf.ChangesetOutput, error) { - mcmsConfigPerChain := make(map[uint64]changeset.ConfigPerRoleV2, len(input.ChainSelectors)) + mcmsConfigPerChain := make(map[uint64]mcmschangesets.ConfigPerRoleV2, len(input.ChainSelectors)) for _, s := range input.ChainSelectors { c := input.MCMSContractConfiguration.Config - mcmsConfigPerChain[s] = changeset.ConfigPerRoleV2{ + mcmsConfigPerChain[s] = mcmschangesets.ConfigPerRoleV2{ Proposer: &c.Proposer, Canceller: &c.Canceller, Bypasser: &c.Bypasser, } } - cfg := changeset.MCMSConfigV2{ + cfg := mcmschangesets.MCMSConfigV2{ ConfigsPerChain: mcmsConfigPerChain, } // MCMSConfig.validateCommon enforces that MCMSAction is set. If there isn't, presume empty. @@ -57,7 +58,7 @@ func (CsMCMSConfigure) Apply(env cldf.Environment, input ConfigureChangesetInput cfg.ProposalConfig = &input.MCMSConfig } - o, err := changeset.SetConfigMCMSV2(env, cfg) + o, err := mcmschangesets.SetConfigMCMSV2(env, cfg) if err != nil { return cldf.ChangesetOutput{}, err } diff --git a/deployment/cre/mcms/changeset/configure_test.go b/deployment/cre/mcms/changeset/configure_test.go index 1ae765c527c..ee918b3707e 100644 --- a/deployment/cre/mcms/changeset/configure_test.go +++ b/deployment/cre/mcms/changeset/configure_test.go @@ -104,7 +104,7 @@ var testMCMSCfg2 = cldfproposalutils.MCMSWithTimelockConfig{ Canceller: pkg.MustGetMCMSConfig(1, []common.Address{updatedEOA}, nil), } -// var mcmsConfig = proposalutils.TimelockConfig{ +// var mcmsConfig = cldfproposalutils.TimelockConfig{ // MinDelay: 5 * time.Second, // MCMSAction: mcmstypes.TimelockActionSchedule, // } diff --git a/deployment/data-feeds/changeset/confirm_aggregator_test.go b/deployment/data-feeds/changeset/confirm_aggregator_test.go index fddadfc030d..f85ee3995e5 100644 --- a/deployment/data-feeds/changeset/confirm_aggregator_test.go +++ b/deployment/data-feeds/changeset/confirm_aggregator_test.go @@ -20,8 +20,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -83,11 +81,11 @@ func TestConfirmAggregator(t *testing.T) { ProxyAddress: common.HexToAddress(proxyAddress), NewAggregatorAddress: common.HexToAddress("0x124"), }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(proxyAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/new_feed_with_proxy.go b/deployment/data-feeds/changeset/new_feed_with_proxy.go index 44d8cf59f6c..93a995f5d1c 100644 --- a/deployment/data-feeds/changeset/new_feed_with_proxy.go +++ b/deployment/data-feeds/changeset/new_feed_with_proxy.go @@ -12,7 +12,7 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/cldfutil/changeset" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commonTypes "github.com/smartcontractkit/chainlink/deployment/common/types" diff --git a/deployment/data-feeds/changeset/new_feed_with_proxy_test.go b/deployment/data-feeds/changeset/new_feed_with_proxy_test.go index 3ff491373a1..f31e1e26d98 100644 --- a/deployment/data-feeds/changeset/new_feed_with_proxy_test.go +++ b/deployment/data-feeds/changeset/new_feed_with_proxy_test.go @@ -22,8 +22,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -68,11 +66,11 @@ func TestNewFeedWithProxy(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/proposal.go b/deployment/data-feeds/changeset/proposal.go index 45e879033fa..5bf44bb622d 100644 --- a/deployment/data-feeds/changeset/proposal.go +++ b/deployment/data-feeds/changeset/proposal.go @@ -12,9 +12,10 @@ import ( "github.com/smartcontractkit/mcms/sdk/evm" mcmstypes "github.com/smartcontractkit/mcms/types" - cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) type ProposalData struct { @@ -68,14 +69,14 @@ func BuildMultiChainProposals(env cldf.Environment, description string, proposal Transactions: transactions, }) } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, inspectorPerChain, batches, description, - proposalutils.TimelockConfig{MinDelay: minDelay}, + cldfproposalutils.TimelockConfig{MinDelay: minDelay}, ) if err != nil { return nil, err diff --git a/deployment/data-feeds/changeset/propose_aggregator_test.go b/deployment/data-feeds/changeset/propose_aggregator_test.go index 06a99372731..c5d524b9d95 100644 --- a/deployment/data-feeds/changeset/propose_aggregator_test.go +++ b/deployment/data-feeds/changeset/propose_aggregator_test.go @@ -20,8 +20,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -71,11 +69,11 @@ func TestProposeAggregator(t *testing.T) { // with MCMS err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(proxyAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go b/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go index 25fc4a94f19..55afd3b8f34 100644 --- a/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go +++ b/deployment/data-feeds/changeset/remove_dataid_proxy_mapping_test.go @@ -20,8 +20,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -92,11 +90,11 @@ func TestRemoveFeedProxyMapping(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/remove_feed_config_test.go b/deployment/data-feeds/changeset/remove_feed_config_test.go index 6c4ffc38d13..4429f9e5c8d 100644 --- a/deployment/data-feeds/changeset/remove_feed_config_test.go +++ b/deployment/data-feeds/changeset/remove_feed_config_test.go @@ -22,8 +22,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -100,11 +98,11 @@ func TestRemoveFeedConfig(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/remove_feed_test.go b/deployment/data-feeds/changeset/remove_feed_test.go index b08b6e560df..0a6a7884af1 100644 --- a/deployment/data-feeds/changeset/remove_feed_test.go +++ b/deployment/data-feeds/changeset/remove_feed_test.go @@ -22,8 +22,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -101,11 +99,11 @@ func TestRemoveFeed(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/set_bundle_feed_config_test.go b/deployment/data-feeds/changeset/set_bundle_feed_config_test.go index 5a789e0c653..f67dde52eee 100644 --- a/deployment/data-feeds/changeset/set_bundle_feed_config_test.go +++ b/deployment/data-feeds/changeset/set_bundle_feed_config_test.go @@ -22,8 +22,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -96,11 +94,11 @@ func TestSetBundleFeedConfig(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/set_feed_admin_test.go b/deployment/data-feeds/changeset/set_feed_admin_test.go index e6675f2e83a..f76b74e031e 100644 --- a/deployment/data-feeds/changeset/set_feed_admin_test.go +++ b/deployment/data-feeds/changeset/set_feed_admin_test.go @@ -20,8 +20,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -68,11 +66,11 @@ func TestSetCacheAdmin(t *testing.T) { // with MCMS err = rt.Exec( - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/set_feed_config_test.go b/deployment/data-feeds/changeset/set_feed_config_test.go index 3ba75814c55..515be16de6c 100644 --- a/deployment/data-feeds/changeset/set_feed_config_test.go +++ b/deployment/data-feeds/changeset/set_feed_config_test.go @@ -22,8 +22,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -95,11 +93,11 @@ func TestSetFeedConfig(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/changeset/solana/configure_cache.go b/deployment/data-feeds/changeset/solana/configure_cache.go index a24018e16d7..4881dd7a15b 100644 --- a/deployment/data-feeds/changeset/solana/configure_cache.go +++ b/deployment/data-feeds/changeset/solana/configure_cache.go @@ -9,8 +9,8 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/solana/sequence/operation" df_cache "github.com/smartcontractkit/chainlink-solana/contracts/generated/data_feeds_cache" @@ -22,7 +22,7 @@ type Sender struct { } type ConfigureCacheDecimalReportRequest struct { - MCMS *proposalutils.TimelockConfig // if set, assumes current ownership is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current ownership is the timelock ChainSel uint64 Qualifier string diff --git a/deployment/data-feeds/changeset/solana/deploy_cache.go b/deployment/data-feeds/changeset/solana/deploy_cache.go index e17ad316c39..6ab76b8a7bb 100644 --- a/deployment/data-feeds/changeset/solana/deploy_cache.go +++ b/deployment/data-feeds/changeset/solana/deploy_cache.go @@ -12,8 +12,8 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" seq "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/solana/sequence" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/solana/sequence/operation" "github.com/smartcontractkit/chainlink/deployment/helpers" @@ -124,7 +124,7 @@ type SetCacheUpgradeAuthorityRequest struct { NewUpgradeAuthority string // Use string for consistency with solana.PublicKey.String() Qualifier string Version string - MCMS *proposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock } var _ cldf.ChangeSetV2[*SetCacheUpgradeAuthorityRequest] = SetCacheUpgradeAuthority{} @@ -200,7 +200,7 @@ type InitCacheDecimalReportRequest struct { ChainSel uint64 Version string Qualifier string - MCMS *proposalutils.TimelockConfig // if set, assumes current ownership + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current ownership DataIDs []string FeedAdmin solana.PublicKey } diff --git a/deployment/data-feeds/changeset/solana/deploy_cache_test.go b/deployment/data-feeds/changeset/solana/deploy_cache_test.go index 917fac99d90..af949d4813f 100644 --- a/deployment/data-feeds/changeset/solana/deploy_cache_test.go +++ b/deployment/data-feeds/changeset/solana/deploy_cache_test.go @@ -12,6 +12,7 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" @@ -21,7 +22,6 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" solanaMCMS "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana/mcms" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/helpers" "github.com/smartcontractkit/chainlink/deployment/internal/soltestutils" @@ -152,9 +152,13 @@ func TestConfigureCache(t *testing.T) { senderList := make([]Sender, len(forwarderProgramID)) for i := range forwarderProgramID { + var stateID solana.PublicKey + if i < len(forwarderCacheID) { + stateID = forwarderCacheID[i] + } senderList[i] = Sender{ ProgramID: forwarderProgramID[i], - StateID: forwarderCacheID[i], + StateID: stateID, } } @@ -297,7 +301,7 @@ func TestConfigureCache(t *testing.T) { transferOwnershipChangeset := commonchangeset.Configure(TransferOwnershipCache{}, &TransferOwnershipCacheRequest{ ChainSel: selector, - MCMSCfg: proposalutils.TimelockConfig{MinDelay: 1 * time.Second}, + MCMSCfg: cldfproposalutils.TimelockConfig{MinDelay: 1 * time.Second}, Qualifier: testQualifier, Version: "1.0.0", }) diff --git a/deployment/data-feeds/changeset/solana/ownership.go b/deployment/data-feeds/changeset/solana/ownership.go index 91debdd79e9..2c8743c65c1 100644 --- a/deployment/data-feeds/changeset/solana/ownership.go +++ b/deployment/data-feeds/changeset/solana/ownership.go @@ -4,8 +4,8 @@ import ( "github.com/gagliardetto/solana-go" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) // TransferOwnershipCacheRequest wraps the generic request for cache contracts @@ -14,7 +14,7 @@ type TransferOwnershipCacheRequest struct { CurrentOwner, ProposedOwner solana.PublicKey Version string Qualifier string - MCMSCfg proposalutils.TimelockConfig + MCMSCfg cldfproposalutils.TimelockConfig } // TransferOwnershipCache implementation diff --git a/deployment/data-feeds/changeset/solana/sequence/operation/operation.go b/deployment/data-feeds/changeset/solana/sequence/operation/operation.go index d45be611356..15343f11007 100644 --- a/deployment/data-feeds/changeset/solana/sequence/operation/operation.go +++ b/deployment/data-feeds/changeset/solana/sequence/operation/operation.go @@ -13,11 +13,11 @@ import ( cldfsol "github.com/smartcontractkit/chainlink-deployments-framework/chain/solana" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink-deployments-framework/operations" df_cache "github.com/smartcontractkit/chainlink-solana/contracts/generated/data_feeds_cache" commonOps "github.com/smartcontractkit/chainlink/deployment/common/changeset/solana/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/helpers" ) @@ -79,7 +79,7 @@ type ( ChainSel uint64 ProgramID string NewUpgradeAuthority string - MCMS *proposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current upgrade authority is the timelock } SetUpgradeAuthorityOutput struct { @@ -90,7 +90,7 @@ type ( ChainSel uint64 Descriptions [][32]uint8 DataIDs [][16]uint8 - MCMS *proposalutils.TimelockConfig // if set, assumes current owner is the timelock + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current owner is the timelock WorkflowMetadatas []df_cache.WorkflowMetadata FeedAdmin solana.PublicKey State solana.PublicKey @@ -106,7 +106,7 @@ type ( ChainSel uint64 Version string Qualifier string - MCMS *proposalutils.TimelockConfig // if set, assumes current + MCMS *cldfproposalutils.TimelockConfig // if set, assumes current DataIDs [][16]uint8 FeedAdmin solana.PublicKey State solana.PublicKey @@ -119,7 +119,7 @@ func confirmInstructionOrBuildProposal( deps Deps, chainSel uint64, instruction solana.Instruction, - mcmsConfig *proposalutils.TimelockConfig, + mcmsConfig *cldfproposalutils.TimelockConfig, proposalDescription string, ) ([]mcms.TimelockProposal, error) { if mcmsConfig == nil { @@ -136,7 +136,7 @@ func buildMCMSProposal( deps Deps, chainSel uint64, instruction solana.Instruction, - mcmsConfig *proposalutils.TimelockConfig, + mcmsConfig *cldfproposalutils.TimelockConfig, description string, ) ([]mcms.TimelockProposal, error) { tx, err := helpers.BuildMCMSTxn( @@ -162,7 +162,7 @@ func buildMCMSProposal( return []mcms.TimelockProposal{*proposal}, nil } -func getCurrentAuthority(deps Deps, chainSel uint64, mcmsConfig *proposalutils.TimelockConfig) (solana.PublicKey, error) { +func getCurrentAuthority(deps Deps, chainSel uint64, mcmsConfig *cldfproposalutils.TimelockConfig) (solana.PublicKey, error) { if mcmsConfig == nil { return deps.Chain.DeployerKey.PublicKey(), nil } diff --git a/deployment/data-feeds/changeset/update_data_id_proxy_test.go b/deployment/data-feeds/changeset/update_data_id_proxy_test.go index 5b95c7f5352..cdeca6c3ea4 100644 --- a/deployment/data-feeds/changeset/update_data_id_proxy_test.go +++ b/deployment/data-feeds/changeset/update_data_id_proxy_test.go @@ -20,8 +20,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - commonChangesets "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -86,11 +84,11 @@ func TestUpdateDataIDProxyMap(t *testing.T) { AdminAddress: common.HexToAddress(timeLockAddress), IsAdmin: true, }), - runtime.ChangesetTask(cldf.CreateLegacyChangeSet(commonChangesets.TransferToMCMSWithTimelockV2), commonChangesets.TransferToMCMSWithTimelockConfig{ + runtime.ChangesetTask(cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ selector: {common.HexToAddress(cacheAddress)}, }, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0, TimelockQualifierPerChain: map[uint64]string{ selector: MCMSQualifier, diff --git a/deployment/data-feeds/view/v1_0/cache_contract.go b/deployment/data-feeds/view/v1_0/cache_contract.go index d8f77934867..d39c4a9b025 100644 --- a/deployment/data-feeds/view/v1_0/cache_contract.go +++ b/deployment/data-feeds/view/v1_0/cache_contract.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/common" + commoncldchangesets "github.com/smartcontractkit/cld-changesets/pkg/cldfutil" cache "github.com/smartcontractkit/chainlink-evm/gethwrappers/data-feeds/generated/data_feeds_cache" ) diff --git a/deployment/data-streams/changeset/types/types.go b/deployment/data-streams/changeset/types/types.go index 909d34d92a0..8da6e6e58c6 100644 --- a/deployment/data-streams/changeset/types/types.go +++ b/deployment/data-streams/changeset/types/types.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -61,7 +61,7 @@ type OwnershipFeature struct { ShouldTransfer bool // If true, MCMS takes ownership ShouldDeployMCMS bool DeployMCMSConfig *commontypes.MCMSWithTimelockConfigV2 - MCMSProposalConfig *proposalutils.TimelockConfig + MCMSProposalConfig *cldfproposalutils.TimelockConfig } func (f OwnershipFeature) Validate() error { @@ -83,5 +83,5 @@ func (f OwnershipFeature) AsSettings() OwnershipSettings { type OwnershipSettings struct { ShouldTransfer bool - MCMSProposalConfig *proposalutils.TimelockConfig + MCMSProposalConfig *cldfproposalutils.TimelockConfig } diff --git a/deployment/go.mod b/deployment/go.mod index 43a6472b6c4..4e1bf913815 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -19,7 +19,7 @@ require ( github.com/aws/aws-sdk-go v1.55.8 github.com/block-vision/sui-go-sdk v1.2.1 github.com/deckarep/golang-set/v2 v2.8.0 - github.com/ethereum/go-ethereum v1.17.2 + github.com/ethereum/go-ethereum v1.17.3 github.com/fbsobreira/gotron-sdk v0.0.0-20250403083053-2943ce8c759b github.com/gagliardetto/anchor-go v1.0.0 github.com/gagliardetto/binary v0.8.0 @@ -44,7 +44,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260504204047-af9826978b72 github.com/smartcontractkit/chainlink-common v0.11.2-0.20260515125558-1eb2e4fc64a1 github.com/smartcontractkit/chainlink-common/keystore v1.1.0 - github.com/smartcontractkit/chainlink-deployments-framework v0.101.1 + github.com/smartcontractkit/chainlink-deployments-framework v0.103.0 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260512150409-b4068bf735e6 github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260421142741-9c7fbaf7c828 @@ -59,10 +59,10 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.8 github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260430134932-681b7a7fe426 github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260430134932-681b7a7fe426 - github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849 + github.com/smartcontractkit/cld-changesets v0.3.1-0.20260515223158-4b85408bf951 github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c - github.com/smartcontractkit/mcms v0.41.1 + github.com/smartcontractkit/mcms v0.43.0 github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9 github.com/smartcontractkit/smdkg v0.0.0-20251029093710-c38905e58aeb github.com/smartcontractkit/wsrpc v0.8.5-0.20250502134807-c57d3d995945 @@ -124,7 +124,7 @@ require ( github.com/avast/retry-go v3.0.0+incompatible // indirect github.com/avast/retry-go/v4 v4.7.0 // indirect github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect - github.com/aws/aws-sdk-go-v2 v1.41.4 // indirect + github.com/aws/aws-sdk-go-v2 v1.41.7 // indirect github.com/aws/aws-sdk-go-v2/config v1.32.12 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.19.12 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.20 // indirect @@ -142,7 +142,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sts v1.41.9 // indirect github.com/aws/constructs-go/constructs/v10 v10.4.2 // indirect github.com/aws/jsii-runtime-go v1.104.0 // indirect - github.com/aws/smithy-go v1.24.2 // indirect + github.com/aws/smithy-go v1.25.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beevik/ntp v1.5.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect @@ -401,7 +401,7 @@ require ( github.com/rs/xid v1.6.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect - github.com/samber/lo v1.52.0 // indirect + github.com/samber/lo v1.53.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.5 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 52f1862fca9..e0f9cdbf2b8 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -172,8 +172,8 @@ github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ= github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk= -github.com/aws/aws-sdk-go-v2 v1.41.4 h1:10f50G7WyU02T56ox1wWXq+zTX9I1zxG46HYuG1hH/k= -github.com/aws/aws-sdk-go-v2 v1.41.4/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o= +github.com/aws/aws-sdk-go-v2 v1.41.7 h1:DWpAJt66FmnnaRIOT/8ASTucrvuDPZASqhhLey6tLY8= +github.com/aws/aws-sdk-go-v2 v1.41.7/go.mod h1:4LAfZOPHNVNQEckOACQx60Y8pSRjIkNZQz1w92xpMJc= github.com/aws/aws-sdk-go-v2/config v1.32.12 h1:O3csC7HUGn2895eNrLytOJQdoL2xyJy0iYXhoZ1OmP0= github.com/aws/aws-sdk-go-v2/config v1.32.12/go.mod h1:96zTvoOFR4FURjI+/5wY1vc1ABceROO4lWgWJuxgy0g= github.com/aws/aws-sdk-go-v2/credentials v1.19.12 h1:oqtA6v+y5fZg//tcTWahyN9PEn5eDU/Wpvc2+kJ4aY8= @@ -208,8 +208,8 @@ github.com/aws/constructs-go/constructs/v10 v10.4.2 h1:+hDLTsFGLJmKIn0Dg20vWpKBr github.com/aws/constructs-go/constructs/v10 v10.4.2/go.mod h1:cXsNCKDV+9eR9zYYfwy6QuE4uPFp6jsq6TtH1MwBx9w= github.com/aws/jsii-runtime-go v1.104.0 h1:651Sh6J2FtatfnVzlOQ3/Ye1WWPAseZ6E/tSQxEKdSI= github.com/aws/jsii-runtime-go v1.104.0/go.mod h1:7ZmQXxV0AAhhvv/GaHX4n6zbgA1tSRVdnQYAJbIhXHk= -github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= -github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/smithy-go v1.25.1 h1:J8ERsGSU7d+aCmdQur5Txg6bVoYelvQJgtZehD12GkI= +github.com/aws/smithy-go v1.25.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= @@ -481,8 +481,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn2 github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.2 h1:ag6geu0kn8Hv5FLKTpH+Hm2DHD+iuFtuqKxEuwUsDOI= -github.com/ethereum/go-ethereum v1.17.2/go.mod h1:KHcRXfGOUfUmKg51IhQ0IowiqZ6PqZf08CMtk0g5K1o= +github.com/ethereum/go-ethereum v1.17.3 h1:Ev/sQHH+UdKZHWjuVzhu2pxhi/sXaPZl23Q+Q5LDd4Q= +github.com/ethereum/go-ethereum v1.17.3/go.mod h1:f2EhRwqewIZkGoQekywI2Y2RZAMTSavLNkD9qItFy1A= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= @@ -1309,8 +1309,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= -github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw= -github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= +github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM= +github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= @@ -1389,8 +1389,8 @@ github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-data-streams v0.1.14-0.20260512145107-b41c0e2855ec h1:ey01SlGfe0zSWAWDZmFEgQ52trcwQFfjoLiWzrk7GTM= github.com/smartcontractkit/chainlink-data-streams v0.1.14-0.20260512145107-b41c0e2855ec/go.mod h1:LXRm6NpaJOsobRs8zEjO0Qm45TnkVavLtHvlZlcNH8w= -github.com/smartcontractkit/chainlink-deployments-framework v0.101.1 h1:qrDRItygGaDbhJZt1cvyqkMDYQkPGx0K6FQ0u2hZGoY= -github.com/smartcontractkit/chainlink-deployments-framework v0.101.1/go.mod h1:20FF4a6oDrytZdljIbdMheANLRXpU/pfuBL1ODq4hLA= +github.com/smartcontractkit/chainlink-deployments-framework v0.103.0 h1:jR3DXHNwEb8UcxseDmhC3tB/GxsJdwJAcHcww8LfsA8= +github.com/smartcontractkit/chainlink-deployments-framework v0.103.0/go.mod h1:fFJ//1iOM8VI2QO8+cAn+WIhTrqeWYp5rJxaFEhS5hA= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260512150409-b4068bf735e6 h1:XQr7oODxrpssu4OL2QReo8CJSGo7KF99xV3NLCFFIJk= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260512150409-b4068bf735e6/go.mod h1:ow+Q/Tl8iDgDFaMkQveJJWEL6odFZAmuYRUm/dwk26M= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 h1:QJiXTG9CmaQAuMRn5JGi+Jhji7fSkehVnKpjc8oNJJY= @@ -1465,8 +1465,8 @@ github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20260408092456-3c63 github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20260408092456-3c6369888d4a/go.mod h1:1eaXR+Fe6TlpP+CKXozfYlFM8QgN/N5C7OMvTRWNT8I= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20260218133534-cbd44da2856b h1:RarA5fTnBzQY9wHhl6g7Ac7Nv0d/izr2/zuSWhveB4c= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20260218133534-cbd44da2856b/go.mod h1:ea1LESxlSSOgc2zZBqf1RTkXTMthHaspdqUHd7W4lF0= -github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849 h1:FitDxi3A3eft25jdpzZ902l7WHzgWy3kRsSKsuwDrFg= -github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849/go.mod h1:MHVK1rkaNxvNgrTH1QjdP0Kk8Iq7o8AgnxIv2VBOfQw= +github.com/smartcontractkit/cld-changesets v0.3.1-0.20260515223158-4b85408bf951 h1:pKrqyw2OkXATo/ShN/K/cpYt+BO/8n9V+2Y7ASyI/zY= +github.com/smartcontractkit/cld-changesets v0.3.1-0.20260515223158-4b85408bf951/go.mod h1:OCugu9Vrxb6fGsZl0TGscqWzSo5LD+/YsHEk681bkL0= github.com/smartcontractkit/cre-sdk-go v1.5.0 h1:kepW3QDKARrOOHjXwWAZ9j5KLk6bxLzvi6OMrLsFwVo= github.com/smartcontractkit/cre-sdk-go v1.5.0/go.mod h1:yYrQFz1UH7hhRbPO0q4fgo1tfsJNd4yXnI3oCZE0RzM= github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad h1:lgHxTHuzJIF3Vj6LSMOnjhqKgRqYW+0MV2SExtCYL1Q= @@ -1475,8 +1475,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c h1:meDKygNIR0tdT3Xmxe9NwyuiaCCDL0a9COqZ+4cL89g= github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c/go.mod h1:PLdNK6GlqfxIWXzziPkU7dCAVlVFeYkyyW7AQY0R+4Q= -github.com/smartcontractkit/mcms v0.41.1 h1:rK5X7if29gRhL6yqpUwxwaLYV0CqgwSJivdDqEJGFv4= -github.com/smartcontractkit/mcms v0.41.1/go.mod h1:9AJhwHSVwV2mETizHBNfEF9CemL/Fmf0yPxNGdTtL/0= +github.com/smartcontractkit/mcms v0.43.0 h1:vYgisvIPGfwILLRVwfPhs/WuQXC7N+ObIsh2tnIYOfY= +github.com/smartcontractkit/mcms v0.43.0/go.mod h1:PoM/B+mN65NykqBAJvOlc35c9GshTIyzRBaHkmETd0I= github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9 h1:MOEuXYogv+RStASb8dWsyescu/xkigSi/Sv45NEjV7A= github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9/go.mod h1:iwy4yWFuK+1JeoIRTaSOA9pl+8Kf//26zezxEXrAQEQ= github.com/smartcontractkit/smdkg v0.0.0-20251029093710-c38905e58aeb h1:kLHdQQkijaPGsBbtV2rJgpzVpQ96e7T10pzjNlWfK8U= diff --git a/deployment/helpers/deploy_solana.go b/deployment/helpers/deploy_solana.go index 5346f832658..b61a8f1d6e0 100644 --- a/deployment/helpers/deploy_solana.go +++ b/deployment/helpers/deploy_solana.go @@ -9,15 +9,16 @@ import ( solstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/solana" pdasol "github.com/smartcontractkit/cld-changesets/pkg/family/solana" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/mcms" "github.com/smartcontractkit/mcms/sdk" mcmsSolana "github.com/smartcontractkit/mcms/sdk/solana" mcmsTypes "github.com/smartcontractkit/mcms/types" - - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) func BuildMCMSTxn(ixn solana.Instruction, programID string, contractType cldf.ContractType) (*mcmsTypes.Transaction, error) { @@ -101,14 +102,14 @@ func BuildProposalsForTxns( ChainSelector: mcmsTypes.ChainSelector(chainSelector), Transactions: txns, }) - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( e, timelocks, proposers, inspectors, batches, description, - proposalutils.TimelockConfig{MinDelay: minDelay}) + cldfproposalutils.TimelockConfig{MinDelay: minDelay}) if err != nil { return nil, fmt.Errorf("failed to build proposal: %w", err) } diff --git a/deployment/keystone/changeset/accept_ownership.go b/deployment/keystone/changeset/accept_ownership.go index 19ac9aaf874..996a84a1f8b 100644 --- a/deployment/keystone/changeset/accept_ownership.go +++ b/deployment/keystone/changeset/accept_ownership.go @@ -4,12 +4,11 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - - "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) type AcceptAllOwnershipRequest struct { @@ -24,15 +23,15 @@ func AcceptAllOwnershipsProposal(e cldf.Environment, req *AcceptAllOwnershipRequ chainSelector := req.ChainSelector // Construct the configuration - cfg := changeset.TransferToMCMSWithTimelockConfig{ + cfg := mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: map[uint64][]common.Address{ chainSelector: getTransferableContracts(e.DataStore.Addresses(), chainSelector), }, - MCMSConfig: proposalutils.TimelockConfig{MinDelay: req.MinDelay}, + MCMSConfig: cldfproposalutils.TimelockConfig{MinDelay: req.MinDelay}, } // Create and return the changeset - return changeset.TransferToMCMSWithTimelockV2(e, cfg) + return mcmschangesets.TransferToMCMSWithTimelockV2(e, cfg) } func getTransferableContracts(addressStore datastore.AddressRefStore, chainSelector uint64) []common.Address { diff --git a/deployment/keystone/changeset/add_capabilities.go b/deployment/keystone/changeset/add_capabilities.go index 7c578a3d3f7..05e7ada13e7 100644 --- a/deployment/keystone/changeset/add_capabilities.go +++ b/deployment/keystone/changeset/add_capabilities.go @@ -12,11 +12,12 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -143,7 +144,7 @@ func AddCapabilities(env cldf.Environment, req *AddCapabilitiesRequest) (cldf.Ch req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/add_dons.go b/deployment/keystone/changeset/add_dons.go index 73dbf7fdcbb..eadbb5d6d66 100644 --- a/deployment/keystone/changeset/add_dons.go +++ b/deployment/keystone/changeset/add_dons.go @@ -17,13 +17,14 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -197,7 +198,7 @@ func AddDons(env cldf.Environment, req *AddDonsRequest) (cldf.ChangesetOutput, e req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/add_nodes.go b/deployment/keystone/changeset/add_nodes.go index 55f1f9a8fbe..79f15fa4512 100644 --- a/deployment/keystone/changeset/add_nodes.go +++ b/deployment/keystone/changeset/add_nodes.go @@ -10,12 +10,13 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -258,7 +259,7 @@ func AddNodes(env cldf.Environment, req *AddNodesRequest) (cldf.ChangesetOutput, req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/add_nops.go b/deployment/keystone/changeset/add_nops.go index 51273516375..b6d8e37dbc6 100644 --- a/deployment/keystone/changeset/add_nops.go +++ b/deployment/keystone/changeset/add_nops.go @@ -10,12 +10,13 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -95,7 +96,7 @@ func AddNops(env cldf.Environment, req *AddNopsRequest) (cldf.ChangesetOutput, e req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/append_node_capabilities.go b/deployment/keystone/changeset/append_node_capabilities.go index 13746520918..4307bb1eb0e 100644 --- a/deployment/keystone/changeset/append_node_capabilities.go +++ b/deployment/keystone/changeset/append_node_capabilities.go @@ -12,10 +12,11 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -58,7 +59,7 @@ func AppendNodeCapabilities(env cldf.Environment, req *AppendNodeCapabilitiesReq req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go index 3b6c3e71d5f..0d0862f3671 100644 --- a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go +++ b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go @@ -13,6 +13,8 @@ import ( mcmsevm "github.com/smartcontractkit/mcms/sdk/evm" mcmstypes "github.com/smartcontractkit/mcms/types" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" @@ -25,7 +27,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" mcmsOps "github.com/smartcontractkit/chainlink/deployment/common/changeset/evm/mcms/ops" mcmsSeqs "github.com/smartcontractkit/chainlink/deployment/common/changeset/evm/mcms/seqs" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/common/types" contracts2 "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" @@ -145,7 +146,7 @@ var DeployConfigureForwardersSeq = operations.NewSequence[DeployConfigureForward // build proposal for transfer ownership to timelock if MCMS is used if input.UseMCMS() { b.Logger.Infof("Building MCMS proposal for ownership transfer to timelock") - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( *deps.Env, timelockAddressByChain, proposerAddressByChain, inspectorPerChain, batches, "Transfer ownership to timelock", *input.MCMSConfig) diff --git a/deployment/keystone/changeset/remove_dons.go b/deployment/keystone/changeset/remove_dons.go index a0cd03c54d0..d86f6de608e 100644 --- a/deployment/keystone/changeset/remove_dons.go +++ b/deployment/keystone/changeset/remove_dons.go @@ -11,10 +11,11 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -103,7 +104,7 @@ func RemoveDONs(env cldf.Environment, req *RemoveDONsRequest) (cldf.ChangesetOut req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go index 437303f97d1..659cf0f720f 100644 --- a/deployment/keystone/changeset/update_node_capabilities.go +++ b/deployment/keystone/changeset/update_node_capabilities.go @@ -12,11 +12,12 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" @@ -144,7 +145,7 @@ func UpdateNodeCapabilities(env cldf.Environment, req *UpdateNodeCapabilitiesReq inspectorPerChain := map[uint64]mcmssdk.Inspector{ req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go index 585952231b8..33292e7d1ca 100644 --- a/deployment/keystone/changeset/update_nodes.go +++ b/deployment/keystone/changeset/update_nodes.go @@ -11,10 +11,11 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" @@ -111,7 +112,7 @@ func UpdateNodes(env cldf.Environment, req *UpdateNodesRequest) (cldf.ChangesetO req.RegistryChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/keystone/changeset/workflowregistry/strategies.go b/deployment/keystone/changeset/workflowregistry/strategies.go index 9d6947fa431..147028820fa 100644 --- a/deployment/keystone/changeset/workflowregistry/strategies.go +++ b/deployment/keystone/changeset/workflowregistry/strategies.go @@ -13,10 +13,11 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) @@ -74,7 +75,7 @@ func (m *mcmsTransaction) Apply(callFn func(opts *bind.TransactOpts) (*types.Tra m.ChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( m.Env, timelocksPerChain, proposerMCMSes, @@ -146,7 +147,7 @@ func (m *MCMSTransactionV2) Apply(callFn func(opts *bind.TransactOpts) (*types.T m.ChainSel: inspector, } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( m.Env, timelocksPerChain, proposerMCMSes, diff --git a/deployment/vault/changeset/batch_native_transfer_test.go b/deployment/vault/changeset/batch_native_transfer_test.go index 90a429ecf0d..02824ce0b2a 100644 --- a/deployment/vault/changeset/batch_native_transfer_test.go +++ b/deployment/vault/changeset/batch_native_transfer_test.go @@ -19,7 +19,6 @@ import ( cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/vault/changeset/types" ) @@ -372,7 +371,7 @@ func executeBatchTransfersWithMCMS(t *testing.T, rt *runtime.Runtime, chainSelec transferConfig := types.BatchNativeTransferConfig{ TransfersByChain: make(map[uint64][]types.NativeTransfer), - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0, }, Description: "Integration test batch transfer", diff --git a/deployment/vault/changeset/operations.go b/deployment/vault/changeset/operations.go index dfaec259fa8..ec2d6c258bb 100644 --- a/deployment/vault/changeset/operations.go +++ b/deployment/vault/changeset/operations.go @@ -15,12 +15,13 @@ import ( cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + proposeutils "github.com/smartcontractkit/cld-changesets/legacy/mcms/proposeutils" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/vault/changeset/types" ) @@ -243,7 +244,7 @@ var ExecuteNativeTransferOp = operations.NewOperation( // BatchNativeTransferSequenceInput is the input for the batch transfer sequence type BatchNativeTransferSequenceInput struct { TransfersByChain map[uint64][]types.NativeTransfer `json:"transfers_by_chain"` - MCMSConfig *proposalutils.TimelockConfig `json:"mcms_config,omitempty"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcms_config,omitempty"` Description string `json:"description"` } @@ -411,7 +412,7 @@ func generateMCMSProposals(b operations.Bundle, deps VaultDeps, input BatchNativ description = "Batch Native Token Transfer" } - proposal, err := proposalutils.BuildProposalFromBatchesV2( + proposal, err := proposeutils.BuildProposalFromBatchesV2( deps.Environment, timelockAddressByChain, mcmAddressByChain, diff --git a/deployment/vault/changeset/transfer_from_datastore.go b/deployment/vault/changeset/transfer_from_datastore.go index 1c0f8972f81..a6f6856e3a7 100644 --- a/deployment/vault/changeset/transfer_from_datastore.go +++ b/deployment/vault/changeset/transfer_from_datastore.go @@ -5,12 +5,12 @@ import ( "fmt" "github.com/ethereum/go-ethereum/common" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" ) @@ -63,7 +63,7 @@ func TransferMCMSOwnershipFromDataStore(e cldf.Environment, input TransferFromDa contractsByChain[chainSel] = addrs } - mcmsConfig := proposalutils.TimelockConfig{MinDelay: 0} + mcmsConfig := cldfproposalutils.TimelockConfig{MinDelay: 0} if mcmsConfig.TimelockQualifierPerChain == nil { mcmsConfig.TimelockQualifierPerChain = make(map[uint64]string) } @@ -71,10 +71,10 @@ func TransferMCMSOwnershipFromDataStore(e cldf.Environment, input TransferFromDa mcmsConfig.TimelockQualifierPerChain[chainSel] = input.TimelockIdentifier } - cfg := commonchangeset.TransferToMCMSWithTimelockConfig{ + cfg := mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, MCMSConfig: mcmsConfig, } - return commonchangeset.TransferToMCMSWithTimelockV2(e, cfg) + return mcmschangesets.TransferToMCMSWithTimelockV2(e, cfg) } diff --git a/deployment/vault/changeset/types/types.go b/deployment/vault/changeset/types/types.go index 0055537bfb2..d666be52009 100644 --- a/deployment/vault/changeset/types/types.go +++ b/deployment/vault/changeset/types/types.go @@ -3,7 +3,7 @@ package types import ( "math/big" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" ) type NativeTransfer struct { @@ -17,7 +17,7 @@ type BatchNativeTransferConfig struct { TransfersByChain map[uint64][]NativeTransfer `json:"transfers_by_chain"` // MCMSConfig contains timelock and MCMS configuration - MCMSConfig *proposalutils.TimelockConfig `json:"mcms_config"` + MCMSConfig *cldfproposalutils.TimelockConfig `json:"mcms_config"` // Description for the MCMS proposal Description string `json:"description"` diff --git a/deployment/vault/changeset/validation.go b/deployment/vault/changeset/validation.go index 65806e40e27..6010cae23cb 100644 --- a/deployment/vault/changeset/validation.go +++ b/deployment/vault/changeset/validation.go @@ -10,11 +10,11 @@ import ( chainSel "github.com/smartcontractkit/chain-selectors" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" evmstate "github.com/smartcontractkit/cld-changesets/legacy/pkg/family/evm" "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/vault/changeset/types" ) @@ -131,7 +131,7 @@ func validateTimelockBalance(e cldf.Environment, chainSelector uint64, requiredA return nil } -func validateMCMSConfig(e cldf.Environment, mcmsConfig *proposalutils.TimelockConfig, transfersByChain map[uint64][]types.NativeTransfer) error { +func validateMCMSConfig(e cldf.Environment, mcmsConfig *cldfproposalutils.TimelockConfig, transfersByChain map[uint64][]types.NativeTransfer) error { if mcmsConfig != nil { if mcmsConfig.MinDelay < 0 { return fmt.Errorf("MCMS minimum delay cannot be negative: %d", mcmsConfig.MinDelay) diff --git a/integration-tests/go.mod b/integration-tests/go.mod index ceadc558328..d9949403387 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -13,7 +13,7 @@ require ( github.com/avast/retry-go/v4 v4.7.0 github.com/block-vision/sui-go-sdk v1.2.1 github.com/deckarep/golang-set/v2 v2.8.0 - github.com/ethereum/go-ethereum v1.17.2 + github.com/ethereum/go-ethereum v1.17.3 github.com/gagliardetto/solana-go v1.13.0 github.com/google/uuid v1.6.0 github.com/jmoiron/sqlx v1.4.0 @@ -31,7 +31,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260511195239-0f6e1b177fc7 github.com/smartcontractkit/chainlink-common v0.11.2-0.20260515125558-1eb2e4fc64a1 github.com/smartcontractkit/chainlink-common/keystore v1.1.0 - github.com/smartcontractkit/chainlink-deployments-framework v0.101.1 + github.com/smartcontractkit/chainlink-deployments-framework v0.103.0 github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260512150409-b4068bf735e6 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260421142741-9c7fbaf7c828 github.com/smartcontractkit/chainlink-protos/job-distributor v0.18.0 @@ -42,9 +42,9 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.5 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/v2 v2.29.0 - github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849 + github.com/smartcontractkit/cld-changesets v0.3.1-0.20260515223158-4b85408bf951 github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c - github.com/smartcontractkit/mcms v0.41.1 + github.com/smartcontractkit/mcms v0.43.0 github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9 github.com/stretchr/testify v1.11.1 github.com/subosito/gotenv v1.6.0 @@ -94,7 +94,7 @@ require ( github.com/avast/retry-go v3.0.0+incompatible // indirect github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect github.com/aws/aws-sdk-go v1.55.8 // indirect - github.com/aws/aws-sdk-go-v2 v1.41.4 // indirect + github.com/aws/aws-sdk-go-v2 v1.41.7 // indirect github.com/aws/aws-sdk-go-v2/config v1.32.12 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.19.12 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.20 // indirect @@ -112,7 +112,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sts v1.41.9 // indirect github.com/aws/constructs-go/constructs/v10 v10.4.2 // indirect github.com/aws/jsii-runtime-go v1.104.0 // indirect - github.com/aws/smithy-go v1.24.2 // indirect + github.com/aws/smithy-go v1.25.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beevik/ntp v1.5.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect @@ -374,7 +374,7 @@ require ( github.com/rs/xid v1.6.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.11.0 // indirect - github.com/samber/lo v1.52.0 // indirect + github.com/samber/lo v1.53.0 // indirect github.com/sanity-io/litter v1.5.5 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sasha-s/go-deadlock v0.3.5 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 407c7c23f8d..bda669568be 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -163,8 +163,8 @@ github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.55.8 h1:JRmEUbU52aJQZ2AjX4q4Wu7t4uZjOu71uyNmaWlUkJQ= github.com/aws/aws-sdk-go v1.55.8/go.mod h1:ZkViS9AqA6otK+JBBNH2++sx1sgxrPKcSzPPvQkUtXk= -github.com/aws/aws-sdk-go-v2 v1.41.4 h1:10f50G7WyU02T56ox1wWXq+zTX9I1zxG46HYuG1hH/k= -github.com/aws/aws-sdk-go-v2 v1.41.4/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o= +github.com/aws/aws-sdk-go-v2 v1.41.7 h1:DWpAJt66FmnnaRIOT/8ASTucrvuDPZASqhhLey6tLY8= +github.com/aws/aws-sdk-go-v2 v1.41.7/go.mod h1:4LAfZOPHNVNQEckOACQx60Y8pSRjIkNZQz1w92xpMJc= github.com/aws/aws-sdk-go-v2/config v1.32.12 h1:O3csC7HUGn2895eNrLytOJQdoL2xyJy0iYXhoZ1OmP0= github.com/aws/aws-sdk-go-v2/config v1.32.12/go.mod h1:96zTvoOFR4FURjI+/5wY1vc1ABceROO4lWgWJuxgy0g= github.com/aws/aws-sdk-go-v2/credentials v1.19.12 h1:oqtA6v+y5fZg//tcTWahyN9PEn5eDU/Wpvc2+kJ4aY8= @@ -199,8 +199,8 @@ github.com/aws/constructs-go/constructs/v10 v10.4.2 h1:+hDLTsFGLJmKIn0Dg20vWpKBr github.com/aws/constructs-go/constructs/v10 v10.4.2/go.mod h1:cXsNCKDV+9eR9zYYfwy6QuE4uPFp6jsq6TtH1MwBx9w= github.com/aws/jsii-runtime-go v1.104.0 h1:651Sh6J2FtatfnVzlOQ3/Ye1WWPAseZ6E/tSQxEKdSI= github.com/aws/jsii-runtime-go v1.104.0/go.mod h1:7ZmQXxV0AAhhvv/GaHX4n6zbgA1tSRVdnQYAJbIhXHk= -github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= -github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/smithy-go v1.25.1 h1:J8ERsGSU7d+aCmdQur5Txg6bVoYelvQJgtZehD12GkI= +github.com/aws/smithy-go v1.25.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= @@ -464,8 +464,8 @@ github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn2 github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8= -github.com/ethereum/go-ethereum v1.17.2 h1:ag6geu0kn8Hv5FLKTpH+Hm2DHD+iuFtuqKxEuwUsDOI= -github.com/ethereum/go-ethereum v1.17.2/go.mod h1:KHcRXfGOUfUmKg51IhQ0IowiqZ6PqZf08CMtk0g5K1o= +github.com/ethereum/go-ethereum v1.17.3 h1:Ev/sQHH+UdKZHWjuVzhu2pxhi/sXaPZl23Q+Q5LDd4Q= +github.com/ethereum/go-ethereum v1.17.3/go.mod h1:f2EhRwqewIZkGoQekywI2Y2RZAMTSavLNkD9qItFy1A= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= @@ -1293,8 +1293,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDcg+AAIFXc= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= -github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw= -github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= +github.com/samber/lo v1.53.0 h1:t975lj2py4kJPQ6haz1QMgtId2gtmfktACxIXArw3HM= +github.com/samber/lo v1.53.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= github.com/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= @@ -1375,8 +1375,8 @@ github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-data-streams v0.1.14-0.20260512145107-b41c0e2855ec h1:ey01SlGfe0zSWAWDZmFEgQ52trcwQFfjoLiWzrk7GTM= github.com/smartcontractkit/chainlink-data-streams v0.1.14-0.20260512145107-b41c0e2855ec/go.mod h1:LXRm6NpaJOsobRs8zEjO0Qm45TnkVavLtHvlZlcNH8w= -github.com/smartcontractkit/chainlink-deployments-framework v0.101.1 h1:qrDRItygGaDbhJZt1cvyqkMDYQkPGx0K6FQ0u2hZGoY= -github.com/smartcontractkit/chainlink-deployments-framework v0.101.1/go.mod h1:20FF4a6oDrytZdljIbdMheANLRXpU/pfuBL1ODq4hLA= +github.com/smartcontractkit/chainlink-deployments-framework v0.103.0 h1:jR3DXHNwEb8UcxseDmhC3tB/GxsJdwJAcHcww8LfsA8= +github.com/smartcontractkit/chainlink-deployments-framework v0.103.0/go.mod h1:fFJ//1iOM8VI2QO8+cAn+WIhTrqeWYp5rJxaFEhS5hA= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260512150409-b4068bf735e6 h1:XQr7oODxrpssu4OL2QReo8CJSGo7KF99xV3NLCFFIJk= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260512150409-b4068bf735e6/go.mod h1:ow+Q/Tl8iDgDFaMkQveJJWEL6odFZAmuYRUm/dwk26M= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260403151002-2c91155b5501 h1:QJiXTG9CmaQAuMRn5JGi+Jhji7fSkehVnKpjc8oNJJY= @@ -1449,8 +1449,8 @@ github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20260408092456-3c63 github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20260408092456-3c6369888d4a/go.mod h1:1eaXR+Fe6TlpP+CKXozfYlFM8QgN/N5C7OMvTRWNT8I= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20260218133534-cbd44da2856b h1:RarA5fTnBzQY9wHhl6g7Ac7Nv0d/izr2/zuSWhveB4c= github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20260218133534-cbd44da2856b/go.mod h1:ea1LESxlSSOgc2zZBqf1RTkXTMthHaspdqUHd7W4lF0= -github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849 h1:FitDxi3A3eft25jdpzZ902l7WHzgWy3kRsSKsuwDrFg= -github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849/go.mod h1:MHVK1rkaNxvNgrTH1QjdP0Kk8Iq7o8AgnxIv2VBOfQw= +github.com/smartcontractkit/cld-changesets v0.3.1-0.20260515223158-4b85408bf951 h1:pKrqyw2OkXATo/ShN/K/cpYt+BO/8n9V+2Y7ASyI/zY= +github.com/smartcontractkit/cld-changesets v0.3.1-0.20260515223158-4b85408bf951/go.mod h1:OCugu9Vrxb6fGsZl0TGscqWzSo5LD+/YsHEk681bkL0= github.com/smartcontractkit/cre-sdk-go v1.5.0 h1:kepW3QDKARrOOHjXwWAZ9j5KLk6bxLzvi6OMrLsFwVo= github.com/smartcontractkit/cre-sdk-go v1.5.0/go.mod h1:yYrQFz1UH7hhRbPO0q4fgo1tfsJNd4yXnI3oCZE0RzM= github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad h1:lgHxTHuzJIF3Vj6LSMOnjhqKgRqYW+0MV2SExtCYL1Q= @@ -1459,8 +1459,8 @@ github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12i github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c h1:meDKygNIR0tdT3Xmxe9NwyuiaCCDL0a9COqZ+4cL89g= github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c/go.mod h1:PLdNK6GlqfxIWXzziPkU7dCAVlVFeYkyyW7AQY0R+4Q= -github.com/smartcontractkit/mcms v0.41.1 h1:rK5X7if29gRhL6yqpUwxwaLYV0CqgwSJivdDqEJGFv4= -github.com/smartcontractkit/mcms v0.41.1/go.mod h1:9AJhwHSVwV2mETizHBNfEF9CemL/Fmf0yPxNGdTtL/0= +github.com/smartcontractkit/mcms v0.43.0 h1:vYgisvIPGfwILLRVwfPhs/WuQXC7N+ObIsh2tnIYOfY= +github.com/smartcontractkit/mcms v0.43.0/go.mod h1:PoM/B+mN65NykqBAJvOlc35c9GshTIyzRBaHkmETd0I= github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9 h1:MOEuXYogv+RStASb8dWsyescu/xkigSi/Sv45NEjV7A= github.com/smartcontractkit/quarantine v0.0.0-20251203215908-fd0551c6adf9/go.mod h1:iwy4yWFuK+1JeoIRTaSOA9pl+8Kf//26zezxEXrAQEQ= github.com/smartcontractkit/smdkg v0.0.0-20251029093710-c38905e58aeb h1:kLHdQQkijaPGsBbtV2rJgpzVpQ96e7T10pzjNlWfK8U= diff --git a/integration-tests/smoke/ccip/ccip_add_chain_e2e_test.go b/integration-tests/smoke/ccip/ccip_add_chain_e2e_test.go index 0b5fb432506..cda9247c034 100644 --- a/integration-tests/smoke/ccip/ccip_add_chain_e2e_test.go +++ b/integration-tests/smoke/ccip/ccip_add_chain_e2e_test.go @@ -8,15 +8,18 @@ import ( "github.com/AlekSi/pointer" "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" + cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" + "github.com/smartcontractkit/chainlink-ccip/chainconfig" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" "github.com/smartcontractkit/chainlink/deployment" @@ -28,8 +31,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" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - testsetups "github.com/smartcontractkit/chainlink/integration-tests/testsetups/ccip" ) @@ -234,7 +235,7 @@ func SetupNewChain( NewChain: newChainDefinition, RemoteChains: remoteChainsDefinition, MCMSDeploymentConfig: &mcmsDeploymentCfg, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, }, @@ -254,7 +255,7 @@ func SetupNewChain( NewChain: newChainDefinition, RemoteChains: remoteChainsDefinition, TestRouter: pointer.ToBool(false), - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, MCMSAction: mcmstypes.TimelockActionSchedule, }, @@ -344,10 +345,10 @@ func TransferOwnership( return commonchangeset.Apply(t, env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsToTransfer, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, diff --git a/integration-tests/smoke/ccip/ccip_add_chain_test.go b/integration-tests/smoke/ccip/ccip_add_chain_test.go index 594ade485d6..22d1e047bb5 100644 --- a/integration-tests/smoke/ccip/ccip_add_chain_test.go +++ b/integration-tests/smoke/ccip/ccip_add_chain_test.go @@ -8,16 +8,16 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" - chain_selectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/router" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" @@ -433,9 +433,9 @@ func setupInboundWiring( testRouterEnabled, mcmsEnabled bool, ) testhelpers.DeployedEnv { - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -471,9 +471,9 @@ func setupOutboundWiring( testRouterEnabled, mcmsEnabled bool, ) testhelpers.DeployedEnv { - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if mcmsEnabled { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -777,7 +777,7 @@ func transferToMCMSAndRenounceTimelockDeployer( cfg.ContractsByChain[e.HomeChainSel] = chainContracts } apps = append(apps, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), cfg, )) for _, chain := range chains { diff --git a/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go b/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go index 8d9b5ed0873..1968d204b5b 100644 --- a/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go +++ b/integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + mcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" + "github.com/ethereum/go-ethereum/common" "github.com/gagliardetto/solana-go" "github.com/stretchr/testify/require" @@ -13,6 +15,7 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cldfproposalutils "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils" cldmcmschangesets "github.com/smartcontractkit/cld-changesets/legacy/mcms/changesets" @@ -22,7 +25,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) const ( @@ -553,7 +555,7 @@ func TestRMNCurseUncurseAptos(t *testing.T) { CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", IncludeNotConnectedLanes: true, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, MCMSAction: types.TimelockActionSchedule, }, @@ -636,10 +638,10 @@ func transferRMNContractToMCMS(t *testing.T, e *testhelpers.DeployedEnv, state s // This is required because RMN Contracts is initially owned by the deployer _, err := commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, @@ -690,7 +692,7 @@ func runRmnUncurseMCMSTest(t *testing.T, tc CurseTestCase, action types.Timelock config := v1_6.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, MCMSAction: action, }, @@ -830,7 +832,7 @@ func runRmnCurseMCMSTest(t *testing.T, tc CurseTestCase, action types.TimelockAc config := v1_6.RMNCurseConfig{ CurseActions: tc.curseActionsBuilder(mapIDToSelector), Reason: "test curse", - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, MCMSAction: action, }, @@ -1014,7 +1016,7 @@ func TestRMNUncurseForceOption(t *testing.T) { CurseActions: []v1_6.CurseAction{v1_6.CurseChain(mapIDToSelector(Evm1))}, Reason: "test curse", IncludeNotConnectedLanes: true, - MCMS: &proposalutils.TimelockConfig{ + MCMS: &cldfproposalutils.TimelockConfig{ MinDelay: 1 * time.Second, }, Force: tc.force, diff --git a/integration-tests/smoke/ccip/ccip_cs_update_rmn_config_test.go b/integration-tests/smoke/ccip/ccip_cs_update_rmn_config_test.go index 79f4f7f6cf6..4473ec818b7 100644 --- a/integration-tests/smoke/ccip/ccip_cs_update_rmn_config_test.go +++ b/integration-tests/smoke/ccip/ccip_cs_update_rmn_config_test.go @@ -32,7 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" ) var ( @@ -211,10 +210,10 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { // This is required because RMNHome is initially owned by the deployer _, err = commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, @@ -230,10 +229,10 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) { previousActiveDigest, err := rmnHome.GetActiveDigest(nil) require.NoError(t, err) - var mcmsConfig *proposalutils.TimelockConfig + var mcmsConfig *cldfproposalutils.TimelockConfig if tc.useMCMS { - mcmsConfig = &proposalutils.TimelockConfig{ + mcmsConfig = &cldfproposalutils.TimelockConfig{ MinDelay: 0, } } @@ -394,10 +393,10 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { envNodes, err := deployment.NodeInfo(e.Env.NodeIDs, e.Env.Offchain) require.NoError(t, err) e.Env, err = commonchangeset.Apply(t, e.Env, commonchangeset.Configure( - cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2), - commonchangeset.TransferToMCMSWithTimelockConfig{ + cldf.CreateLegacyChangeSet(mcmschangesets.TransferToMCMSWithTimelockV2), + mcmschangesets.TransferToMCMSWithTimelockConfig{ ContractsByChain: contractsByChain, - MCMSConfig: proposalutils.TimelockConfig{ + MCMSConfig: cldfproposalutils.TimelockConfig{ MinDelay: 0 * time.Second, }, }, @@ -422,7 +421,7 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) { cldf.CreateLegacyChangeSet(v1_6.SetRMNRemoteOnRMNProxyChangeset), v1_6.SetRMNRemoteOnRMNProxyConfig{ ChainSelectors: allChains, - MCMSConfig: &proposalutils.TimelockConfig{ + MCMSConfig: &cldfproposalutils.TimelockConfig{ MinDelay: 0, }, },