Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changesets for self-serve token pool deployments #15877

Merged
merged 51 commits into from
Jan 24, 2025
Merged

Conversation

kylesmartin
Copy link
Contributor

@kylesmartin kylesmartin commented Jan 9, 2025

Copy link
Contributor

github-actions bot commented Jan 9, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@kylesmartin kylesmartin marked this pull request as ready for review January 13, 2025 19:29
@kylesmartin kylesmartin requested review from a team as code owners January 13, 2025 19:29
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.

This is a partial review.
I think we should create sep changeset for new token pool addition and Updating existing pool config otherwise it is cluttering the changeset. Also DeployTokenPoolContractsConfig name does not convey that it can be used for ExistingPoolUpdates.

deployment/ccip/changeset/state.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/state.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/state.go Show resolved Hide resolved
deployment/ccip/changeset/state.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
Copy link
Contributor

Flakeguard Summary

Ran new or updated tests between develop and b203501 (CCIP-4508).

View Flaky Detector Details | Compare Changes

Found Flaky Tests ❌

Name Pass Ratio Panicked? Timed Out? Race? Runs Successes Failures Skips Package Package Panicked? Avg Duration Code Owners
TestRMNCurseIdempotent 0.00% true true false 3 0 3 0 github.com/smartcontractkit/chainlink/deployment/ccip/changeset true 0s @smartcontractkit/ccip, @smartcontractkit/core, @smartcontractkit/deployment-automation

Artifacts

For detailed logs of the failed tests, please refer to the artifact failed-test-results-with-logs.json.

@kylesmartin kylesmartin requested a review from a team as a code owner January 17, 2025 02:45
@kylesmartin kylesmartin requested a review from winder January 17, 2025 02:45
@kylesmartin kylesmartin requested a review from carte7000 January 22, 2025 21:19
@@ -74,32 +105,10 @@ func (d *DeployerGroup) GetDeployer(chain uint64) (*bind.TransactOpts, error) {
Context: txOpts.Context,
AccessList: txOpts.AccessList,
NoSend: true,
// Set the gas limit to avoid simulating the call before appending to transactions.
// Some calls depend on each other, so we don't want to simulate until we actually start executing.
GasLimit: 1_000_000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a thought, would it make sense to allow simulating the changeset before executing on the enact part? Maybe not something for this PR but that could add value overall. I am also a bit sad that we have to remove the simulation from here, that was a nice feature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've adjusted it a bit to address your concerns: ed01ffe

If deployer key is used, simulations now happen when transactions are appended. I've split my token admin registry changeset into 3 different proposals to pass simulations. The deployer group now takes opCount offsets into account to enable enacting multiple proposals.

I was wondering though, do you think simulations should happen if MCMS key is used? Right now they are not because gasLimit is hard-set in SimTransactOpts.

Copy link
Contributor Author

@kylesmartin kylesmartin Jan 23, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is value of having simulation even with MCMS, but that could be something we work out after if for now it's blocking this PR


// To perform these actions, we have to be the admin of the token. There are three ways this can happen:
// 1. We are already the admin of the token (no action)
// 2. We are the proposed admin of the token (just have to accept)
Copy link
Contributor

Choose a reason for hiding this comment

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

We fine with doing this "compound" operation (i.e the accept adminship not being a separate CS)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on feedback from you and Ani & recent findings with the deployer group, I decided to split it out: 488554c

In doing so we can leave the deployer group untouched for now

cc @AnieeG

deployment/ccip/changeset/cs_configure_token_pools.go Outdated Show resolved Hide resolved
deployment/ccip/changeset/cs_deploy_token_pools.go Outdated Show resolved Hide resolved
deployment/common/proposalutils/propose.go Outdated Show resolved Hide resolved
Comment on lines 115 to 116
defer d.reset()

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this make sense even when mcms is not enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this object is becoming pretty complex and a critical component since its used by a bunch of changesets, can we have some coverage of this multi-Enact logic?

Or enforce a single-Enact behavior if thats safer / makes more sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if a pattern like this would be more obvious/safe for multi proposal. Move the reason and mcmsOpCount to a DeployerGroupContext object.

Then we call it like that

d := NewDeployerGroup(...., DeployerGroupContext("proposal description"))
d.DoSomethingOnChain()
// Next Proposal
d = d.WithNewContext("proposal2 description") // Internally clone the DeployerGroupContext and increment the offsets
d.DoSomethingElseOnChain()

d.Enact() // Create the 2 proposals

deployment/common/proposalutils/propose.go Outdated Show resolved Hide resolved
Comment on lines 220 to 233
if c.MCMS != nil {
// Pre-allocate the proposal slice with the correct capacity
totalProposals := len(proposeAdminOutput.Proposals) +
len(acceptAdminOutput.Proposals) +
len(configurationOutput.Proposals)
proposals := make([]timelock.MCMSWithTimelockProposal, 0, totalProposals)
proposals = append(proposals, proposeAdminOutput.Proposals...)
proposals = append(proposals, acceptAdminOutput.Proposals...)
proposals = append(proposals, configurationOutput.Proposals...)

return deployment.ChangesetOutput{
Proposals: proposals,
}, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing I have been thinking is that since the deployerGroup was initially made to abstract MCMS vs deployer key. Would it make sense to also move this logic into the deployerGroup?

Perhaps we could have a function called .NewProposal(reason) instead of using Enact in multi proposal scenario. Not sure if this is needed for this PR but interested in your opinion if that would be a good next step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think revising the API so that we return a single Enact at the end of the changeset makes the most sense.

}

// DeployTokenPoolContractsChangeset deploys new pools for a given token across multiple chains.
func DeployTokenPoolContractsChangeset(env deployment.Environment, c DeployTokenPoolContractsConfig) (deployment.ChangesetOutput, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to support MCMS for this changeset? Also would be benefit from simulation in the DeployerGroup even if we don't use MCMS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MCMS doesn't apply to this one, since it just involves deploying contracts

@kylesmartin kylesmartin added this pull request to the merge queue Jan 24, 2025
Merged via the queue into develop with commit de9e993 Jan 24, 2025
195 checks passed
@kylesmartin kylesmartin deleted the CCIP-4508 branch January 24, 2025 19:33
@kylesmartin kylesmartin restored the CCIP-4508 branch January 24, 2025 21:14
@kylesmartin kylesmartin deleted the CCIP-4508 branch January 24, 2025 21:14
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.

4 participants