feat: new mcms deploy changeset#89
Conversation
Refactor and redesigne to better accomodate new chains and utilising the new utils method integrated in cldf. The deploy changeset is chain agonistic and uses the registry pattern to add new chains that we want to deploy, each chain specific implementation is localised in its own folder eg mcms/evm. new structure ``` mcms/ ├── changesets/ │ ├── deploy/ # deploy changeset + deploy registry + types │ │ ├── changeset.go │ │ ├── registry.go │ │ └── types.go │ └── setconfig/ # setconfig changeset + setconfig registry + types │ ├── changeset.go │ ├── registry.go │ └── types.go ├── evm/ │ ├── deploy/ # registers with changesets/deploy │ └── setconfig/ # registers with changesets/setconfig ├── solana/ │ └── ... └── operations/ # legacy — consider moving under evm/ or legacy/ ``` This new folder structure feels more intuitive and user wanting to extend mcms with new chain should be able to follow the pattern easily JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2719
Release impact (release-please)
PR title: Merging this PR as-is will contribute a minor bump to the next release-please release PR. Conventional commit → bump
Update the PR title before merge if you need a different bump (squash commit message = PR title). Preview is based on this PR title only. The release-please release PR may include other unreleased commits already on |
| func (d *deployer) getTimelockAdminAddresses(timelockAddr common.Address) ([]common.Address, error) { | ||
| timelock, err := bindings.NewRBACTimelock(timelockAddr, d.chain.Client) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("bind timelock: %w", err) | ||
| } | ||
|
|
||
| callOpts := &bind.CallOpts{Context: d.b.GetContext()} | ||
| count, err := timelock.GetRoleMemberCount(callOpts, mcmsrole.AdminRole.ID) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("get admin count: %w", err) | ||
| } | ||
|
|
||
| admins := make([]common.Address, 0, count.Uint64()) | ||
| for i := range count.Uint64() { | ||
| member, err := timelock.GetRoleMember(callOpts, mcmsrole.AdminRole.ID, new(big.Int).SetUint64(i)) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("get admin member %d: %w", i, err) | ||
| } | ||
| admins = append(admins, member) | ||
| } | ||
|
|
||
| return admins, nil | ||
| } |
There was a problem hiding this comment.
IS there better way to do this like using the mcms inspector?
There was a problem hiding this comment.
Pull request overview
Introduces a new chain-family–agnostic MCMS “deploy with timelock” changeset using a registry pattern, with an EVM family implementation and accompanying tests.
Changes:
- Added
mcms/changesets/deploychangeset package (registry, types, changeset implementation, and docs) to dispatch per-chain deployments by chain family. - Added EVM deploy family implementation under
mcms/evm/deploy(sequence, datastore address helpers, and auto-registration). - Updated Go module dependencies (notably
chainlink-deployments-frameworkandmcms) and added EVM-focused changeset tests.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| mcms/evm/deploy/sequence.go | EVM per-chain deployment sequence for MCMS+timelock and role grants. |
| mcms/evm/deploy/register.go | Auto-registers EVM family in deploy registry and validates EVM chains. |
| mcms/evm/deploy/addresses.go | Loads existing deployed addresses from datastore and builds AddressRefs for new deployments. |
| mcms/changesets/deploy/types.go | Defines shared input/deps/types for family implementations. |
| mcms/changesets/deploy/registry.go | Implements the registry for per-family deploy implementations and chain grouping. |
| mcms/changesets/deploy/families.go | Exposes RegisterFamilies helper for external family registrations. |
| mcms/changesets/deploy/doc.go | Godoc describing usage and how to add new chain families. |
| mcms/changesets/deploy/changeset.go | Main changeset: verifies, runs per-chain sequences in parallel, merges metadata into datastore. |
| mcms/changesets/deploy/changeset_evm_test.go | Tests for fresh, partial, and multi-chain EVM deployments and timelock roles. |
| go.mod | Bumps core deps and adds new indirect deps. |
| go.sum | Updates dependency checksums accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refactor and redesigne to better accomodate new chains and utilising the new utils method integrated in cldf. The deploy changeset is chain agonistic and uses the registry pattern to add new chains that we want to deploy, each chain specific implementation is localised in its own folder eg mcms/evm.
ds.WriteMetadataandChangesetOutputBuilder.new structure
This new folder structure feels more intuitive and user wanting to extend mcms with new chain should be able to follow the pattern easily
JIRA: https://smartcontract-it.atlassian.net/browse/CLD-2719