Skip to content

[CLD-1916]: fix(aptos): port LoadMCMSAddresses#8

Merged
graham-chainlink merged 1 commit intomainfrom
ggoh/cld-1916/aptos-state-load
Apr 22, 2026
Merged

[CLD-1916]: fix(aptos): port LoadMCMSAddresses#8
graham-chainlink merged 1 commit intomainfrom
ggoh/cld-1916/aptos-state-load

Conversation

@graham-chainlink
Copy link
Copy Markdown
Collaborator

@graham-chainlink graham-chainlink commented Apr 22, 2026

Move the aptos LoadMCMSAddresses function from chainlink repo to here.

  • updated from addressbook to datastore.
  • updated function to accept contract version instead of assuming it is 1.6.0

JIRA: https://smartcontract-it.atlassian.net/browse/CLD-1916

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves Aptos MCMS address loading logic into this repository, adding the supporting Aptos family package code and tests so Aptos deployments can resolve MCMS addresses from the CLDF datastore.

Changes:

  • Add LoadMCMSAddresses for Aptos to load MCMS account addresses from the environment datastore.
  • Introduce Aptos-specific contract type constant(s) for datastore entries.
  • Add unit tests covering success and several error scenarios; update go.mod requirements accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/family/aptos/state.go Adds LoadMCMSAddresses implementation to read Aptos MCMS addresses from the datastore.
pkg/family/aptos/state_test.go Adds unit tests for LoadMCMSAddresses using an in-memory CLDF environment/datastore.
pkg/family/aptos/contract.go Defines Aptos-specific datastore contract type for MCMS.
pkg/contract/version.go Adds a semver constant for the supported contract version (1.6.0).
go.mod Promotes required dependencies (aptos-go-sdk, chain-selectors, solana-go, mcms) to direct requirements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/family/aptos/state_test.go
Comment thread pkg/family/aptos/state.go Outdated
Comment thread pkg/family/aptos/state.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from fb49896 to a1fba55 Compare April 22, 2026 04:12
@graham-chainlink graham-chainlink marked this pull request as ready for review April 22, 2026 04:22
@graham-chainlink graham-chainlink requested a review from a team as a code owner April 22, 2026 04:22
Copilot AI review requested due to automatic review settings April 22, 2026 04:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/family/aptos/state.go Outdated
Comment thread pkg/family/aptos/state_test.go Outdated
Comment thread pkg/family/aptos/state.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from a1fba55 to 96d802f Compare April 22, 2026 04:33
Copilot AI review requested due to automatic review settings April 22, 2026 04:39
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from 96d802f to ea7d8ee Compare April 22, 2026 04:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/family/aptos/state.go
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from ea7d8ee to 278adeb Compare April 22, 2026 04:49
@graham-chainlink graham-chainlink changed the title [CLD-1916]: fix(aptos): move state load [CLD-1916]: fix(aptos): move LoadMCMSAddresses Apr 22, 2026
@graham-chainlink graham-chainlink changed the title [CLD-1916]: fix(aptos): move LoadMCMSAddresses [CLD-1916]: fix(aptos): port LoadMCMSAddresses Apr 22, 2026
Comment thread pkg/family/aptos/contract.go Outdated
)

const (
AptosMCMSType cldf.ContractType = "AptosManyChainMultisig"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a contract type in cldf here https://github.com/smartcontractkit/chainlink-deployments-framework/blob/main/engine/cld/mcms/proposalutils/contract_types.go these are mostly used in evm, but raising this as I'm not sure if we should move those to cld-changesets or move aptos to cldf

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good to know! let me update it!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are mostly used in evm, but raising this as I'm not sure if we should move those to cld-changesets or move aptos to cldf

yeah good questions, will those contract types be used outside of changesets?

Copilot AI review requested due to automatic review settings April 22, 2026 14:00
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from 278adeb to cfbd0b5 Compare April 22, 2026 14:00
)

// GetState loads the MCMSWithTimelockState from the environment
func GetState(env cldf.Environment, selector uint64) (*MCMSWithTimelockState, error) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 2nd thought i think we can remove this as it is just a light wrapper around maybeLoadMCMSWithTimelockChainState

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/family/solana/state.go Outdated
Comment thread pkg/family/aptos/state.go
Comment thread pkg/contract/version.go Outdated
Comment thread pkg/family/solana/state.go Outdated
Comment thread pkg/family/solana/state.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from cfbd0b5 to c2b249c Compare April 22, 2026 14:12
Copilot AI review requested due to automatic review settings April 22, 2026 14:13
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from c2b249c to f3fbeab Compare April 22, 2026 14:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from f3fbeab to a157dc4 Compare April 22, 2026 14:19
Comment thread pkg/contract/contract.go Outdated
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLDF already has this as pointed out by pablo

@graham-chainlink graham-chainlink enabled auto-merge (squash) April 22, 2026 14:25
Copilot AI review requested due to automatic review settings April 22, 2026 14:32
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from a157dc4 to b86626e Compare April 22, 2026 14:32
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from b86626e to efd52db Compare April 22, 2026 14:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/family/solana/state.go
Comment thread pkg/family/aptos/state_test.go Outdated
@graham-chainlink graham-chainlink force-pushed the ggoh/cld-1916/aptos-state-load branch from efd52db to bbb5e19 Compare April 22, 2026 14:39
Comment thread pkg/family/aptos/state.go

const (
// todo: move to CLDF?
AptosMCMSType cldf.ContractType = "AptosManyChainMultisig"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May move this to CLDF with others , so i dont have to move 1 at a time

Comment thread pkg/family/aptos/state.go
for _, selector := range chainSelectors {
var mcmsAddress aptos.AccountAddress
found := false
refs := env.DataStore.Addresses().Filter(datastore.AddressRefByChainSelector(selector))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this from addressbook to datastore

@graham-chainlink graham-chainlink merged commit de58102 into main Apr 22, 2026
10 checks passed
@graham-chainlink graham-chainlink deleted the ggoh/cld-1916/aptos-state-load branch April 22, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants