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 ae4f845361b..69882871cae 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 @@ -22,11 +22,14 @@ import ( "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/stateview" - "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" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" 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-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" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" ) @@ -103,7 +106,7 @@ type AddCandidatesForNewChainConfig struct { // RemoteChains defines the remote chains to be connected to the new chain. RemoteChains []ChainDefinition `json:"remoteChains"` // MCMSDeploymentConfig configures the MCMS deployment to the new chain. - MCMSDeploymentConfig *cldfproposalutils.MCMSWithTimelockConfig `json:"mcmsDeploymentConfig,omitempty"` + MCMSDeploymentConfig *commontypes.MCMSWithTimelockConfigV2 `json:"mcmsDeploymentConfig,omitempty"` // MCMSConfig defines the MCMS configuration for the changeset. MCMSConfig *proposalutils.TimelockConfig `json:"mcmsConfig,omitempty"` // The offset to adjust the donID in DonIDClaimer (useful when certain DON IDs are dropped) @@ -287,7 +290,7 @@ func addCandidatesForNewChainLogic(e cldf.Environment, c AddCandidatesForNewChai if c.MCMSDeploymentConfig != nil { err = runAndSaveAddresses(func() (cldf.ChangesetOutput, error) { return commoncs.DeployMCMSWithTimelockV2(e, map[uint64]cldfproposalutils.MCMSWithTimelockConfig{ - c.NewChain.Selector: *c.MCMSDeploymentConfig, + c.NewChain.Selector: cldfproposalutils.MCMSWithTimelockConfig(*c.MCMSDeploymentConfig), }) }, newAddresses, e.ExistingAddresses) if err != nil { @@ -374,7 +377,7 @@ func addCandidatesForNewChainLogic(e cldf.Environment, c AddCandidatesForNewChai } if c.DonIDOffSet != nil { - _, err = commoncs.RunChangeset(DonIDClaimerOffSetChangeset, e, DonIDClaimerOffSetConfig{ + _, err = cldchangeset.RunChangeset(DonIDClaimerOffSetChangeset, e, DonIDClaimerOffSetConfig{ OffSet: *c.DonIDOffSet, }) if err != nil { @@ -487,13 +490,13 @@ func addCandidatesForNewChainLogic(e cldf.Environment, c AddCandidatesForNewChai }, nil } -/////////////////////////////////// +// ///////////////////////////////// // END AddCandidatesForNewChainChangeset -/////////////////////////////////// +// ///////////////////////////////// -/////////////////////////////////// +// ///////////////////////////////// // START PromoteNewChainForConfigChangeset -/////////////////////////////////// +// ///////////////////////////////// // PromoteNewChainForConfig is a configuration struct for PromoteNewChainForConfigChangeset. type PromoteNewChainForConfig struct { @@ -666,13 +669,13 @@ func promoteNewChainForConfigLogic(e cldf.Environment, c PromoteNewChainForConfi return cldf.ChangesetOutput{MCMSTimelockProposals: []mcmslib.TimelockProposal{*proposal}}, nil } -/////////////////////////////////// +// ///////////////////////////////// // END PromoteNewChainForConfigChangeset -/////////////////////////////////// +// ///////////////////////////////// -/////////////////////////////////// +// ///////////////////////////////// // START ConnectNewChainChangeset -/////////////////////////////////// +// ///////////////////////////////// // ConnectionConfig defines how a chain should connect with other chains. type ConnectionConfig struct { @@ -969,9 +972,9 @@ func connectRampsAndRouters( return proposalAggregate, nil } -/////////////////////////////////// +// ///////////////////////////////// // END ConnectNewChainChangeset -/////////////////////////////////// +// ///////////////////////////////// func runAndSaveAddresses(fn func() (cldf.ChangesetOutput, error), newAddresses cldf.AddressBook, existingAddresses cldf.AddressBook) error { output, err := fn() 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 b460c919510..6ff80effa8d 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,8 +7,6 @@ import ( "github.com/ethereum/go-ethereum/common" chain_selectors "github.com/smartcontractkit/chain-selectors" - 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" @@ -399,7 +397,7 @@ func TestAddAndPromoteCandidatesForNewChain(t *testing.T) { // Build new chain configuration nodeInfo, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) require.NoError(t, err, "must get node info") - mcmsDeploymentCfg := cldftesthelpers.SingleGroupTimelockConfig(t) + mcmsDeploymentCfg := proposalutils.SingleGroupTimelockConfigV2(t) newChain := newChainConfigHelper(newChainSelector, deployedEnvironment.FeedChainSel, linkAddress, &nodeInfo, len(nodeInfo.NonBootstraps().PeerIDs())) if test.ErrStr != "" { @@ -644,7 +642,7 @@ func TestValidateTransmitterAddresses(t *testing.T) { FeeQuoterDestChainConfig: v1_6.DefaultFeeQuoterDestChainConfig(true), } - mcmsDeploymentCfg := cldftesthelpers.SingleGroupTimelockConfig(t) + mcmsDeploymentCfg := proposalutils.SingleGroupTimelockConfigV2(t) donIDOffSet := uint32(0) state, err := stateview.LoadOnchainState(e) require.NoError(t, err, "must load onchain state") diff --git a/deployment/common/changeset/run_changeset.go b/deployment/common/changeset/run_changeset.go deleted file mode 100644 index 77d310cc163..00000000000 --- a/deployment/common/changeset/run_changeset.go +++ /dev/null @@ -1,28 +0,0 @@ -package changeset - -import ( - "fmt" - - "github.com/smartcontractkit/chainlink-deployments-framework/deployment" -) - -type WrappedChangeSet[C any] struct { - operation deployment.ChangeSetV2[C] -} - -// RunChangeset is used to run a changeset in another changeset -// It executes VerifyPreconditions internally to handle changeset errors. -func RunChangeset[C any]( - operation deployment.ChangeSetV2[C], - env deployment.Environment, - config C, -) (deployment.ChangesetOutput, error) { - cs := WrappedChangeSet[C]{operation: operation} - - err := cs.operation.VerifyPreconditions(env, config) - if err != nil { - return deployment.ChangesetOutput{}, fmt.Errorf("failed to run precondition: %w", err) - } - - return cs.operation.Apply(env, config) -} diff --git a/deployment/data-feeds/changeset/new_feed_with_proxy.go b/deployment/data-feeds/changeset/new_feed_with_proxy.go index 86d10fa67c5..44d8cf59f6c 100644 --- a/deployment/data-feeds/changeset/new_feed_with_proxy.go +++ b/deployment/data-feeds/changeset/new_feed_with_proxy.go @@ -12,7 +12,9 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/deployment/common/changeset" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" commonTypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" ) @@ -54,7 +56,7 @@ func newFeedWithProxyLogic(env cldf.Environment, c types.NewFeedWithProxyConfig) Labels: append([]string{c.Descriptions[index]}, c.Labels...), Qualifier: c.Qualifiers[index], } - newEnv, err := changeset.RunChangeset(DeployAggregatorProxyChangeset, env, proxyConfig) + newEnv, err := cldchangeset.RunChangeset(DeployAggregatorProxyChangeset, env, proxyConfig) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to execute DeployAggregatorProxyChangeset: %w", err) @@ -76,7 +78,7 @@ func newFeedWithProxyLogic(env cldf.Environment, c types.NewFeedWithProxyConfig) // transfer proxy ownership timelockAddr, _ := cldf.SearchAddressBook(env.ExistingAddresses, c.ChainSelector, commonTypes.RBACTimelock) - _, proxyContract, err := changeset.LoadOwnableContract(common.HexToAddress(proxyAddress), chain.Client) + _, proxyContract, err := commonchangeset.LoadOwnableContract(common.HexToAddress(proxyAddress), chain.Client) if err != nil { return cldf.ChangesetOutput{}, fmt.Errorf("failed to load proxy contract %w", err) } 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 7df04387b11..afc466e86fe 100644 --- a/integration-tests/smoke/ccip/ccip_add_chain_e2e_test.go +++ b/integration-tests/smoke/ccip/ccip_add_chain_e2e_test.go @@ -10,8 +10,6 @@ import ( mcmstypes "github.com/smartcontractkit/mcms/types" "github.com/stretchr/testify/require" - cldftesthelpers "github.com/smartcontractkit/chainlink-deployments-framework/engine/cld/mcms/proposalutils/testhelpers" - "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" chain_selectors "github.com/smartcontractkit/chain-selectors" @@ -163,7 +161,7 @@ func SetupNewChain( ) cldf.Environment { nodeInfo, err := deployment.NodeInfo(env.NodeIDs, env.Offchain) require.NoError(t, err, "must get node info") - mcmsDeploymentCfg := cldftesthelpers.SingleGroupTimelockConfig(t) + mcmsDeploymentCfg := proposalutils.SingleGroupTimelockConfigV2(t) tokenConfig := shared.NewTestTokenConfig(state.MustGetEVMChainState(feedChain).USDFeeds) // Build remote chain configurations diff --git a/system-tests/lib/cre/contracts/contracts.go b/system-tests/lib/cre/contracts/contracts.go index 33e900131a8..a1d460aa1c0 100644 --- a/system-tests/lib/cre/contracts/contracts.go +++ b/system-tests/lib/cre/contracts/contracts.go @@ -12,9 +12,10 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/data-feeds/generated/data_feeds_cache" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" df_changeset "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" df_changeset_types "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" @@ -148,7 +149,7 @@ func ConfigureDataFeedsCache(testLogger zerolog.Logger, input *cre.ConfigureData AdminAddress: input.AdminAddress, IsAdmin: true, } - _, setAdminErr := commonchangeset.RunChangeset(df_changeset.SetFeedAdminChangeset, *input.CldEnv, setAdminConfig) + _, setAdminErr := cldchangeset.RunChangeset(df_changeset.SetFeedAdminChangeset, *input.CldEnv, setAdminConfig) if setAdminErr != nil { return nil, errors.Wrap(setAdminErr, "failed to set feed admin") } @@ -168,7 +169,7 @@ func ConfigureDataFeedsCache(testLogger zerolog.Logger, input *cre.ConfigureData feeIDs = append(feeIDs, feedID[:32]) } - _, setFeedConfigErr := commonchangeset.RunChangeset(df_changeset.SetFeedConfigChangeset, *input.CldEnv, df_changeset_types.SetFeedDecimalConfig{ + _, setFeedConfigErr := cldchangeset.RunChangeset(df_changeset.SetFeedConfigChangeset, *input.CldEnv, df_changeset_types.SetFeedDecimalConfig{ ChainSelector: input.ChainSelector, CacheAddress: input.DataFeedsCacheAddress, DataIDs: feeIDs, @@ -204,7 +205,7 @@ func DeployDataFeedsCacheContract(testLogger zerolog.Logger, chainSelector uint6 Labels: []string{"data-feeds"}, // label required by the changeset } - dfOutput, dfErr := commonchangeset.RunChangeset(df_changeset.DeployCacheChangeset, *creEnvironment.CldfEnvironment, deployDfConfig) + dfOutput, dfErr := cldchangeset.RunChangeset(df_changeset.DeployCacheChangeset, *creEnvironment.CldfEnvironment, deployDfConfig) if dfErr != nil { return common.Address{}, errors.Wrapf(dfErr, "failed to deploy Data Feeds Cache contract on chain %d", chainSelector) } diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index be8368abe1b..1309c9fb39f 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -49,6 +49,7 @@ 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/libocr v0.0.0-20260508200755-99940c85383c github.com/smartcontractkit/smdkg v0.0.0-20251029093710-c38905e58aeb github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20251120172354-e8ec0386b06c @@ -477,7 +478,6 @@ require ( github.com/smartcontractkit/chainlink-ton v1.0.5-0.20260430134932-681b7a7fe426 // indirect github.com/smartcontractkit/chainlink-ton/deployment v0.0.0-20260430134932-681b7a7fe426 // indirect github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20260408092456-3c6369888d4a // indirect - github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849 // indirect github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/mcms v0.41.1 // indirect diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 657e11fae3b..46943bbfba7 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -82,6 +82,7 @@ require ( github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre/evmread v0.0.0-20250917232237-c4ecf802c6f8 github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre/solana/solwrite 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/stretchr/testify v1.11.1 golang.org/x/sync v0.20.0 google.golang.org/protobuf v1.36.11 @@ -151,7 +152,6 @@ require ( github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-20260513123719-d347eaf314e1 // indirect github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260427132612-76b9f754a556 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.8 // indirect - github.com/smartcontractkit/cld-changesets v0.3.1-0.20260511171704-b04f4d990849 // indirect github.com/smartcontractkit/libocr v0.0.0-20260508200755-99940c85383c // indirect github.com/stellar/go-stellar-sdk v0.1.0 // indirect github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 // indirect diff --git a/system-tests/tests/smoke/cre/por_helpers.go b/system-tests/tests/smoke/cre/por_helpers.go index 443fbbf5cfb..2a6fa26ced6 100644 --- a/system-tests/tests/smoke/cre/por_helpers.go +++ b/system-tests/tests/smoke/cre/por_helpers.go @@ -24,7 +24,8 @@ import ( tron_df_changeset "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/tron" df_changeset_types "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset/types" - "github.com/smartcontractkit/chainlink/deployment/common/changeset" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" + df_changeset "github.com/smartcontractkit/chainlink/deployment/data-feeds/changeset" keystone_changeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" tron_keystone_changeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/tron" @@ -337,10 +338,10 @@ func deployAndConfigureTronContracts(t *testing.T, testLogger zerolog.Logger, ch DeployOptions: deployOptions, } - dfOutput, dfErr := changeset.RunChangeset(tron_df_changeset.DeployCacheChangeset, *creEnvironment.CldfEnvironment, tronDeployConfig) + dfOutput, dfErr := cldchangeset.RunChangeset(tron_df_changeset.DeployCacheChangeset, *creEnvironment.CldfEnvironment, tronDeployConfig) require.NoError(t, dfErr, "failed to deploy Data Feeds Cache contract on chain %d", chainSelector) - rbOutput, rbErr := changeset.RunChangeset(tron_keystone_changeset.DeployReadBalanceChangeset, *creEnvironment.CldfEnvironment, tronDeployConfig) + rbOutput, rbErr := cldchangeset.RunChangeset(tron_keystone_changeset.DeployReadBalanceChangeset, *creEnvironment.CldfEnvironment, tronDeployConfig) require.NoError(t, rbErr, "failed to deploy Read Balances contract on chain %d", chainSelector) crecontracts.MergeAllDataStores(creEnvironment, dfOutput, rbOutput) @@ -379,7 +380,7 @@ func deployAndConfigureTronContracts(t *testing.T, testLogger zerolog.Logger, ch TriggerOptions: triggerOptions, } - _, setDeployerAdminErr := changeset.RunChangeset(tron_df_changeset.SetFeedAdminChangeset, *creEnvironment.CldfEnvironment, setDeployerAdminConfig) + _, setDeployerAdminErr := cldchangeset.RunChangeset(tron_df_changeset.SetFeedAdminChangeset, *creEnvironment.CldfEnvironment, setDeployerAdminConfig) require.NoError(t, setDeployerAdminErr, "failed to set deployer as admin for Tron chain") workflowNameBytes := df_changeset.HashedWorkflowName(uniqueWorkflowName) @@ -407,7 +408,7 @@ func deployAndConfigureTronContracts(t *testing.T, testLogger zerolog.Logger, ch TriggerOptions: triggerOptions, } - _, setConfigErr := changeset.RunChangeset(tron_df_changeset.SetFeedConfigChangeset, *creEnvironment.CldfEnvironment, setFeedConfigConfig) + _, setConfigErr := cldchangeset.RunChangeset(tron_df_changeset.SetFeedConfigChangeset, *creEnvironment.CldfEnvironment, setFeedConfigConfig) require.NoError(t, setConfigErr, "failed to set feed config for Tron chain") testLogger.Info().Msgf("Successfully configured Tron data feeds cache for chain %d", chainSelector) diff --git a/system-tests/tests/smoke/cre/sharding_test.go b/system-tests/tests/smoke/cre/sharding_test.go index a536428b434..97fa169b8bc 100644 --- a/system-tests/tests/smoke/cre/sharding_test.go +++ b/system-tests/tests/smoke/cre/sharding_test.go @@ -13,6 +13,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" "github.com/rs/zerolog" + cldchangeset "github.com/smartcontractkit/cld-changesets/pkg/common/changeset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" @@ -26,7 +27,6 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/framework" crontypes "github.com/smartcontractkit/chainlink/core/scripts/cre/environment/examples/workflows/cron/types" - commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" deployment_contracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" shard_config_changeset "github.com/smartcontractkit/chainlink/deployment/cre/shard_config/v1/changeset" "github.com/smartcontractkit/chainlink/system-tests/lib/cre" @@ -384,7 +384,7 @@ func getShardCountFromContract(t *testing.T, testEnv *ttypes.TestEnvironment, ch func updateShardCount(t *testing.T, testEnv *ttypes.TestEnvironment, chainSelector uint64, shardConfigRef datastore.AddressRefKey, count uint64) { t.Helper() - _, err := commonchangeset.RunChangeset( + _, err := cldchangeset.RunChangeset( shard_config_changeset.UpdateShardCount{}, *testEnv.CreEnvironment.CldfEnvironment, shard_config_changeset.UpdateShardCountInput{