Skip to content

Conversation

@jhweintraub
Copy link
Contributor

This PR modifies the previous v1_6_4 changesets to use the addressRef to acquire necessary deployed contract addresses rather than have them be supplied by the user. This reduces the amount of potential errors in the durable pipeline creation process as there are fewer possible fields for the creator to fill out incorrectly.

Copilot AI review requested due to automatic review settings November 24, 2025 18:13
@jhweintraub jhweintraub requested review from a team as code owners November 24, 2025 18:13
Copy link

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

This PR refactors v1_6_4 changesets to retrieve deployed contract addresses from the datastore using addressRef lookups rather than requiring users to supply them as input parameters. This simplification reduces the potential for configuration errors during the durable pipeline creation process.

Key Changes:

  • Modified changeset input structs to remove address fields that can be retrieved from the datastore
  • Updated changeset implementations to use FindAndFormatRef utility for address resolution
  • Refactored tests to populate the datastore with required addresses before executing changesets

Reviewed changes

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

Show a summary per file
File Description
usdc_token_pool_deploy.go Removed CCTPMessageTransmitterProxy deployment logic; now expects it to be pre-deployed and stored in datastore
usdc_token_pool_proxy_deploy.go Retrieves Router, USDCToken, and pool addresses from datastore instead of input parameters
usdc_token_pool_cctp_v2_deploy.go Added datastore lookups for Router, RMN, and Token addresses with fallback to input parameter for Token
siloed_usdc_token_pool_deploy.go Removed Token, RMNProxy, Router, and LockBox from input struct; retrieves from datastore
erc20_lockbox_deploy.go Removed TokenAdminRegistry from input; retrieves from datastore
set_domains.go Removed single Address field; now uses per-chain address lookups from datastore
configure_allowed_callers.go Renamed Address to AddressesByChain map; retrieves ERC20LockBox addresses from datastore
update_lock_or_burn_mechanism.go Removed Address from input; retrieves USDCTokenPoolProxy address from datastore
update_lock_release_pool_addresses.go Removed Address from input; retrieves USDCTokenPoolProxy address from datastore
*_test.go files Updated tests to pre-populate datastore with required addresses and removed address fields from changeset inputs

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

for _, perChainInput := range input.ChainInputs {
addressByChain[perChainInput.ChainSelector] = perChainInput.Address

erc20_lock_box_address, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{
Copy link
Contributor

Choose a reason for hiding this comment

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

For this one, you need to allow for the ability to pass in a full ref. Or at least a qualifier string (qualifier is another address ref field). Only because there will be multiple lock boxes for different tokens in the datastore. Qualifier would typically be the token symbol, ultimately depends on what you save to the datastore post-deployment.

Copy link
Contributor Author

@jhweintraub jhweintraub Dec 1, 2025

Choose a reason for hiding this comment

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

Qualifier is a good idea. I think the better way would be to use "IOwnable" as the qualifier since the main identifying feature of the lockbox is that it uses Ownable token pools. That way in the future if we build a lockbox which works on RBAC-based token pools we can make the qualifier "IAccessControl". Good Call out. In terms of 1.6.4 there is only one version but forward thinking is also useful.

TokenAdminRegistry: perChainInput.TokenAdminRegistry,
TokenAdminRegistry: tokenAdminRegistryAddress,
}
report, err := cldf_ops.ExecuteSequence(e.OperationsBundle, sequences.ERC20LockboxDeploySequence, e.BlockChains, sequenceInput)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, make sure that when you deploy something like a lock box or a token pool, you add the entry to the datastore with the qualifier field populated (i.e. set to the token symbol). Ensures that you can differentiate between different token pools / lock boxes in the datastore and what their purposes are.

Copy link
Contributor Author

@jhweintraub jhweintraub Dec 1, 2025

Choose a reason for hiding this comment

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

so the lockbox is not one-token-one-lockbox, but multiple tokens to one lockbox so I don't think using the token in the qualifier is the best solution, but I do agree with better labeling practices. Also the token pools being deployed here do have "USDC" in the type which should solve the issue.

Copy link
Collaborator

@b-gopalswami b-gopalswami left a comment

Choose a reason for hiding this comment

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

LGTM! Just left one question.

Comment on lines 46 to 52
erc20LockBoxAddress, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{
Type: datastore.ContractType(erc20_lock_box.ContractType),
Version: erc20_lock_box.Version,
}, perChainInput.ChainSelector, evm_datastore_utils.ToEVMAddress)
if err != nil {
return cldf.ChangesetOutput{}, err
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

How do we ensure this is the right address to act on? Like, do we expect only one such contract to be available for the entire network?

Copy link
Contributor Author

@jhweintraub jhweintraub Dec 1, 2025

Choose a reason for hiding this comment

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

I've added a qualifier to the lookup to ensure there are no conflicts. Currently we don't expect there to be more than one LockBox per chain but that may change in the future so adding this qualifier helps with that. It is also possible that we could just do it based on versioning, as any future version of the lockbox will have a version >1.6.4 but the qualifier is a fine solution as well.

e13bde4#diff-e5ca08ab4642f513279363eb93ed645ab89ab91a2f85b047c3eaac5220fe78f4R52

b-gopalswami
b-gopalswami previously approved these changes Dec 1, 2025
AnieeG
AnieeG previously approved these changes Dec 1, 2025
Copy link
Contributor

@AnieeG AnieeG left a comment

Choose a reason for hiding this comment

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

Approved with 1 observation -
For all changesets I see only mcms input is verified and no other input is considered for verify function. If you want to come back to it later please add a ticket. Otherwise we are opening up ways for contract reverts and unintended input set-up through operations.

Comment on lines 38 to 39
Type: "TokenAdminRegistry",
Version: semver.MustParse("1.5.0"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 48 to 49
Type: "RBACTimelock",
Version: semver.MustParse("1.0.0"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

erc20LockboxAddress, err := datastore_utils.FindAndFormatRef(e.DataStore, datastore.AddressRef{
Type: datastore.ContractType(erc20_lock_box.ContractType),
Version: erc20_lock_box.Version,
Qualifier: "IOwnable",
Copy link
Contributor

Choose a reason for hiding this comment

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

let's have it as constant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Metric v1_6_4/changeset_addressRefs main
Coverage 70.3% 70.0%

@jhweintraub jhweintraub added this pull request to the merge queue Dec 1, 2025
Merged via the queue into main with commit e200e93 Dec 1, 2025
40 checks passed
@jhweintraub jhweintraub deleted the v1_6_4/changeset_addressRefs branch December 1, 2025 21:30
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.

5 participants