Skip to content

Commit 13d3b1a

Browse files
committed
chore: remove the legacy TransferToMCMS changeset
This changeset was deprecated in favor of the new `TransferToMCMSWithTimelockV2` changeset and has been removed. Existing references to the legacy changeset have been updated to use the new changeset.
1 parent 963cd7f commit 13d3b1a

12 files changed

+17
-155
lines changed

deployment/ccip/changeset/v1_6/accept_ownership_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func Test_NewAcceptOwnershipChangeset(t *testing.T) {
4444
_, err = commonchangeset.Apply(t, e.Env, timelockContracts,
4545
// note this doesn't have proposals.
4646
commonchangeset.Configure(
47-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
47+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
4848
testhelpers.GenTestTransferOwnershipConfig(e, allChains, state, true),
4949
),
5050
)

deployment/ccip/changeset/v1_6/cs_active_candidate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func Test_ActiveCandidate(t *testing.T) {
133133
// and set new config digest on the offramp.
134134
_, err = commonchangeset.Apply(t, tenv.Env, tenv.TimelockContracts(t),
135135
commonchangeset.Configure(
136-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
136+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
137137
testhelpers.GenTestTransferOwnershipConfig(tenv, allChains, state, true),
138138
),
139139
)

deployment/ccip/changeset/v1_6/cs_add_new_chain_e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func TestConnectNewChain(t *testing.T) {
153153
}
154154
e, err = commonchangeset.Apply(t, e, timelockContracts,
155155
commonchangeset.Configure(
156-
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelock),
156+
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2),
157157
commoncs.TransferToMCMSWithTimelockConfig{
158158
ContractsByChain: contractsToTransfer,
159159
MCMSConfig: proposalutils.TimelockConfig{
@@ -367,7 +367,7 @@ func TestAddAndPromoteCandidatesForNewChain(t *testing.T) {
367367
)
368368
e, err = commonchangeset.Apply(t, e, timelockContracts,
369369
commonchangeset.Configure(
370-
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelock),
370+
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2),
371371
commoncs.TransferToMCMSWithTimelockConfig{
372372
ContractsByChain: contractsToTransfer,
373373
MCMSConfig: proposalutils.TimelockConfig{

deployment/ccip/changeset/v1_6/cs_home_chain_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func TestRemoveDons(t *testing.T) {
249249
},
250250
},
251251
commoncs.Configure(
252-
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelock),
252+
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2),
253253
commoncs.TransferToMCMSWithTimelockConfig{
254254
ContractsByChain: map[uint64][]common.Address{
255255
e.HomeChainSel: {homeChain.CapabilityRegistry.Address()},
@@ -402,7 +402,7 @@ func TestAddUpdateAndRemoveNops(t *testing.T) {
402402
},
403403
},
404404
commoncs.Configure(
405-
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelock),
405+
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2),
406406
commoncs.TransferToMCMSWithTimelockConfig{
407407
ContractsByChain: map[uint64][]common.Address{
408408
e.HomeChainSel: {homeChain.CapabilityRegistry.Address()},
@@ -560,7 +560,7 @@ func TestRemoveNodes(t *testing.T) {
560560
},
561561
},
562562
commoncs.Configure(
563-
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelock),
563+
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2),
564564
commoncs.TransferToMCMSWithTimelockConfig{
565565
ContractsByChain: map[uint64][]common.Address{
566566
e.HomeChainSel: {homeChain.CapabilityRegistry.Address()},

deployment/ccip/changeset/v1_6/cs_update_bidirectional_lanes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ func TestUpdateBidirectiConalLanesChangeset(t *testing.T) {
341341
}
342342
e, err = commonchangeset.Apply(t, e, timelockContracts,
343343
commonchangeset.Configure(
344-
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelock),
344+
cldf.CreateLegacyChangeSet(commoncs.TransferToMCMSWithTimelockV2),
345345
commoncs.TransferToMCMSWithTimelockConfig{
346346
ContractsByChain: contractsToTransfer,
347347
MCMSConfig: proposalutils.TimelockConfig{

deployment/ccip/shared/deployergroup/deployer_group_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func TestDeployerGroupMCMS(t *testing.T) {
243243

244244
_, err = commonchangeset.Apply(t, e.Env, timelocksPerChain,
245245
commonchangeset.Configure(
246-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
246+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
247247
commonchangeset.TransferToMCMSWithTimelockConfig{
248248
ContractsByChain: contractsByChain,
249249
MCMSConfig: proposalutils.TimelockConfig{
@@ -322,7 +322,7 @@ func TestDeployerGroupGenerateMultipleProposals(t *testing.T) {
322322

323323
_, err = commonchangeset.Apply(t, e.Env, timelocksPerChain,
324324
commonchangeset.Configure(
325-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
325+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
326326
commonchangeset.TransferToMCMSWithTimelockConfig{
327327
ContractsByChain: contractsByChain,
328328
MCMSConfig: proposalutils.TimelockConfig{
@@ -388,7 +388,7 @@ func TestDeployerGroupMultipleProposalsMCMS(t *testing.T) {
388388

389389
_, err = commonchangeset.Apply(t, e.Env, timelocksPerChain,
390390
commonchangeset.Configure(
391-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
391+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
392392
commonchangeset.TransferToMCMSWithTimelockConfig{
393393
ContractsByChain: contractsByChain,
394394
MCMSConfig: proposalutils.TimelockConfig{

deployment/common/changeset/transfer_to_mcms_with_timelock.go

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ import (
1111
"github.com/ethereum/go-ethereum/common"
1212
gethtypes "github.com/ethereum/go-ethereum/core/types"
1313
owner_helpers "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers"
14-
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms"
15-
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"
1614
mcmslib "github.com/smartcontractkit/mcms"
1715
"github.com/smartcontractkit/mcms/sdk"
1816
"github.com/smartcontractkit/mcms/sdk/evm"
1917
mcmstypes "github.com/smartcontractkit/mcms/types"
2018

21-
"github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/burn_mint_erc677"
22-
2319
cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
24-
20+
"github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/burn_mint_erc677"
2521
"github.com/smartcontractkit/chainlink/deployment/common/proposalutils"
2622
"github.com/smartcontractkit/chainlink/deployment/common/types"
2723
)
@@ -83,75 +79,6 @@ func (t TransferToMCMSWithTimelockConfig) Validate(e cldf.Environment) error {
8379
return nil
8480
}
8581

86-
var _ cldf.ChangeSet[TransferToMCMSWithTimelockConfig] = TransferToMCMSWithTimelock
87-
88-
// TransferToMCMSWithTimelock creates a changeset that transfers ownership of all the
89-
// contracts in the provided configuration to the timelock on the chain and generates
90-
// a corresponding accept ownership proposal to complete the transfer.
91-
// It assumes that DeployMCMSWithTimelockV2 has already been run s.t.
92-
// the timelock and mcmses exist on the chain and that the proposed addresses to transfer ownership
93-
// are currently owned by the deployer key.
94-
// Deprecated: Use TransferToMCMSWithTimelockV2 instead.
95-
func TransferToMCMSWithTimelock(
96-
e cldf.Environment,
97-
cfg TransferToMCMSWithTimelockConfig,
98-
) (cldf.ChangesetOutput, error) {
99-
if err := cfg.Validate(e); err != nil {
100-
return cldf.ChangesetOutput{}, err
101-
}
102-
var batches []timelock.BatchChainOperation
103-
timelocksByChain := make(map[uint64]common.Address)
104-
proposersByChain := make(map[uint64]*owner_helpers.ManyChainMultiSig)
105-
for chainSelector, contracts := range cfg.ContractsByChain {
106-
// Already validated that the timelock/proposer exists.
107-
timelockAddr, _ := cldf.SearchAddressBook(e.ExistingAddresses, chainSelector, types.RBACTimelock)
108-
proposerAddr, _ := cldf.SearchAddressBook(e.ExistingAddresses, chainSelector, types.ProposerManyChainMultisig)
109-
timelocksByChain[chainSelector] = common.HexToAddress(timelockAddr)
110-
proposer, err := owner_helpers.NewManyChainMultiSig(common.HexToAddress(proposerAddr), e.Chains[chainSelector].Client)
111-
if err != nil {
112-
return cldf.ChangesetOutput{}, fmt.Errorf("failed to create proposer mcms: %w", err)
113-
}
114-
proposersByChain[chainSelector] = proposer
115-
116-
var ops []mcms.Operation
117-
for _, contract := range contracts {
118-
// Just using the ownership interface.
119-
// Already validated is ownable.
120-
owner, c, _ := LoadOwnableContract(contract, e.Chains[chainSelector].Client)
121-
if owner.String() == timelockAddr {
122-
// Already owned by timelock.
123-
e.Logger.Infof("contract %s already owned by timelock", contract)
124-
continue
125-
}
126-
tx, err := c.TransferOwnership(e.Chains[chainSelector].DeployerKey, common.HexToAddress(timelockAddr))
127-
_, err = cldf.ConfirmIfNoError(e.Chains[chainSelector], tx, err)
128-
if err != nil {
129-
return cldf.ChangesetOutput{}, fmt.Errorf("failed to transfer ownership of contract %T: %w", contract, err)
130-
}
131-
tx, err = c.AcceptOwnership(cldf.SimTransactOpts())
132-
if err != nil {
133-
return cldf.ChangesetOutput{}, fmt.Errorf("failed to generate accept ownership calldata of %s: %w", contract, err)
134-
}
135-
ops = append(ops, mcms.Operation{
136-
To: contract,
137-
Data: tx.Data(),
138-
Value: big.NewInt(0),
139-
})
140-
}
141-
batches = append(batches, timelock.BatchChainOperation{
142-
ChainIdentifier: mcms.ChainIdentifier(chainSelector),
143-
Batch: ops,
144-
})
145-
}
146-
proposal, err := proposalutils.BuildProposalFromBatches(
147-
timelocksByChain, proposersByChain, batches, "Transfer ownership to timelock", cfg.MCMSConfig.MinDelay)
148-
if err != nil {
149-
return cldf.ChangesetOutput{}, fmt.Errorf("failed to build proposal from batch: %w, batches: %+v", err, batches)
150-
}
151-
152-
return cldf.ChangesetOutput{Proposals: []timelock.MCMSWithTimelockProposal{*proposal}}, nil
153-
}
154-
15582
var _ cldf.ChangeSet[TransferToMCMSWithTimelockConfig] = TransferToMCMSWithTimelockV2
15683

15784
// TransferToMCMSWithTimelockV2 is a reimplementation of TransferToMCMSWithTimelock which uses the new MCMS library.

deployment/common/changeset/transfer_to_mcms_with_timelock_test.go

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -19,71 +19,6 @@ import (
1919
"github.com/smartcontractkit/chainlink/v2/core/logger"
2020
)
2121

22-
func TestTransferToMCMSWithTimelock(t *testing.T) {
23-
lggr := logger.TestLogger(t)
24-
e := memory.NewMemoryEnvironment(t, lggr, 0, memory.MemoryEnvironmentConfig{
25-
Chains: 1,
26-
Nodes: 1,
27-
})
28-
chain1 := e.AllChainSelectors()[0]
29-
e, err := Apply(t, e, nil,
30-
Configure(
31-
cldf.CreateLegacyChangeSet(DeployLinkToken),
32-
[]uint64{chain1},
33-
),
34-
Configure(
35-
cldf.CreateLegacyChangeSet(DeployMCMSWithTimelockV2),
36-
map[uint64]types.MCMSWithTimelockConfigV2{
37-
chain1: proposalutils.SingleGroupTimelockConfigV2(t),
38-
},
39-
),
40-
)
41-
require.NoError(t, err)
42-
addrs, err := e.ExistingAddresses.AddressesForChain(chain1)
43-
require.NoError(t, err)
44-
state, err := MaybeLoadMCMSWithTimelockChainState(e.Chains[chain1], addrs)
45-
require.NoError(t, err)
46-
link, err := MaybeLoadLinkTokenChainState(e.Chains[chain1], addrs)
47-
require.NoError(t, err)
48-
e, err = Apply(t, e,
49-
map[uint64]*proposalutils.TimelockExecutionContracts{
50-
chain1: {Timelock: state.Timelock, CallProxy: state.CallProxy},
51-
},
52-
Configure(
53-
cldf.CreateLegacyChangeSet(TransferToMCMSWithTimelock),
54-
TransferToMCMSWithTimelockConfig{
55-
ContractsByChain: map[uint64][]common.Address{
56-
chain1: {link.LinkToken.Address()},
57-
},
58-
MCMSConfig: proposalutils.TimelockConfig{MinDelay: 0},
59-
},
60-
),
61-
)
62-
require.NoError(t, err)
63-
// We expect now that the link token is owned by the MCMS timelock.
64-
link, err = MaybeLoadLinkTokenChainState(e.Chains[chain1], addrs)
65-
require.NoError(t, err)
66-
o, err := link.LinkToken.Owner(nil)
67-
require.NoError(t, err)
68-
require.Equal(t, state.Timelock.Address(), o)
69-
70-
// Try a rollback to the deployer.
71-
e, err = Apply(t, e, nil,
72-
Configure(
73-
cldf.CreateLegacyChangeSet(TransferToDeployer),
74-
TransferToDeployerConfig{
75-
ContractAddress: link.LinkToken.Address(),
76-
ChainSel: chain1,
77-
},
78-
),
79-
)
80-
require.NoError(t, err)
81-
82-
o, err = link.LinkToken.Owner(nil)
83-
require.NoError(t, err)
84-
require.Equal(t, e.Chains[chain1].DeployerKey.From, o)
85-
}
86-
8722
func TestTransferToMCMSWithTimelockV2(t *testing.T) {
8823
lggr := logger.TestLogger(t)
8924
e := memory.NewMemoryEnvironment(t, lggr, 0, memory.MemoryEnvironmentConfig{

integration-tests/smoke/ccip/ccip_add_chain_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ func transferToMCMSAndRenounceTimelockDeployer(
778778
cfg.ContractsByChain[e.HomeChainSel] = chainContracts
779779
}
780780
apps = append(apps, commonchangeset.Configure(
781-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
781+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
782782
cfg,
783783
))
784784
for _, chain := range chains {

integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ func transferRMNContractToMCMS(t *testing.T, e *testhelpers.DeployedEnv, state s
500500
// This is required because RMN Contracts is initially owned by the deployer
501501
_, err := commonchangeset.Apply(t, e.Env, timelocksPerChain,
502502
commonchangeset.Configure(
503-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
503+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
504504
commonchangeset.TransferToMCMSWithTimelockConfig{
505505
ContractsByChain: contractsByChain,
506506
MCMSConfig: proposalutils.TimelockConfig{

integration-tests/smoke/ccip/ccip_cs_update_rmn_config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func updateRMNConfig(t *testing.T, tc updateRMNConfigTestCase) {
201201
// This is required because RMNHome is initially owned by the deployer
202202
_, err = commonchangeset.Apply(t, e.Env, timelocksPerChain,
203203
commonchangeset.Configure(
204-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
204+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
205205
commonchangeset.TransferToMCMSWithTimelockConfig{
206206
ContractsByChain: contractsByChain,
207207
MCMSConfig: proposalutils.TimelockConfig{
@@ -396,7 +396,7 @@ func TestSetRMNRemoteOnRMNProxy(t *testing.T) {
396396
e.Env, err = commonchangeset.Apply(t, e.Env, timelockContractsPerChain,
397397
// transfer ownership of RMNProxy to timelock
398398
commonchangeset.Configure(
399-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
399+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
400400
commonchangeset.TransferToMCMSWithTimelockConfig{
401401
ContractsByChain: contractsByChain,
402402
MCMSConfig: proposalutils.TimelockConfig{

integration-tests/smoke/ccip/ccip_migration_to_v_1_6_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ func TestMigrateFromV1_5ToV1_6(t *testing.T) {
621621

622622
e.Env, err = commonchangeset.Apply(t, e.Env, e.TimelockContracts(t),
623623
commonchangeset.Configure(
624-
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelock),
624+
cldf.CreateLegacyChangeSet(commonchangeset.TransferToMCMSWithTimelockV2),
625625
commonchangeset.TransferToMCMSWithTimelockConfig{
626626
ContractsByChain: contractsByChain,
627627
MCMSConfig: proposalutils.TimelockConfig{

0 commit comments

Comments
 (0)