From 1a4ed4adfe79a9cc99efb97334efe91fca6aad35 Mon Sep 17 00:00:00 2001 From: 0xAustinWang Date: Thu, 13 Feb 2025 23:21:54 +0800 Subject: [PATCH 1/3] parallelize operations in the deployer group --- deployment/ccip/changeset/deployer_group.go | 1 + 1 file changed, 1 insertion(+) diff --git a/deployment/ccip/changeset/deployer_group.go b/deployment/ccip/changeset/deployer_group.go index 6f3732a760b..53427ad65a2 100644 --- a/deployment/ccip/changeset/deployer_group.go +++ b/deployment/ccip/changeset/deployer_group.go @@ -3,6 +3,7 @@ package changeset import ( "context" "fmt" + "golang.org/x/sync/errgroup" "math/big" "slices" "time" From 51b5a83fbce2dc2f88a9186f3903acb2960395dd Mon Sep 17 00:00:00 2001 From: 0xAustinWang Date: Wed, 19 Feb 2025 14:52:08 +0800 Subject: [PATCH 2/3] enable replacing ocr only --- deployment/ccip/changeset/deployer_group.go | 1 - deployment/environment/crib/ccip_deployer.go | 40 +++++++++++++++----- integration-tests/testconfig/ccip/ccip.toml | 7 ++-- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/deployment/ccip/changeset/deployer_group.go b/deployment/ccip/changeset/deployer_group.go index 53427ad65a2..6f3732a760b 100644 --- a/deployment/ccip/changeset/deployer_group.go +++ b/deployment/ccip/changeset/deployer_group.go @@ -3,7 +3,6 @@ package changeset import ( "context" "fmt" - "golang.org/x/sync/errgroup" "math/big" "slices" "time" diff --git a/deployment/environment/crib/ccip_deployer.go b/deployment/environment/crib/ccip_deployer.go index ee3e5fe6dd1..e2c432bddd1 100644 --- a/deployment/environment/crib/ccip_deployer.go +++ b/deployment/environment/crib/ccip_deployer.go @@ -124,7 +124,7 @@ func DeployCCIPAndAddLanes(ctx context.Context, lggr logger.Logger, envConfig de // ----- Part 2 ----- lggr.Infow("setting up ocr...") - *e, err = setupOCR(e, homeChainSel, feedChainSel) + *e, err = mustOCR(e, homeChainSel, feedChainSel, true) if err != nil { return DeployCCIPOutput{}, fmt.Errorf("failed to apply changesets for setting up OCR: %w", err) } @@ -204,8 +204,7 @@ func ConnectCCIPLanes(ctx context.Context, lggr logger.Logger, envConfig devenv. }, nil } -// ConfigureCCIPOCR is a group of changesets used from CRIB to configure OCR on a new setup -// This sets up OCR on all chains in the envConfig by configuring the CCIP home chain +// ConfigureCCIPOCR is a group of changesets used from CRIB to redeploy the chainlink don on an existing setup func ConfigureCCIPOCR(ctx context.Context, lggr logger.Logger, envConfig devenv.EnvironmentConfig, homeChainSel, feedChainSel uint64, ab deployment.AddressBook) (DeployCCIPOutput, error) { e, _, err := devenv.NewEnvironment(func() context.Context { return ctx }, lggr, envConfig) if err != nil { @@ -213,8 +212,8 @@ func ConfigureCCIPOCR(ctx context.Context, lggr logger.Logger, envConfig devenv. } e.ExistingAddresses = ab - lggr.Infow("setting up ocr...") - *e, err = setupOCR(e, homeChainSel, feedChainSel) + lggr.Infow("resetting ocr...") + *e, err = mustOCR(e, homeChainSel, feedChainSel, false) if err != nil { return DeployCCIPOutput{}, fmt.Errorf("failed to apply changesets for setting up OCR: %w", err) } @@ -503,7 +502,7 @@ func setupLanes(e *deployment.Environment, state changeset.CCIPOnChainState) (de ) } -func setupOCR(e *deployment.Environment, homeChainSel uint64, feedChainSel uint64) (deployment.Environment, error) { +func mustOCR(e *deployment.Environment, homeChainSel uint64, feedChainSel uint64, newDons bool) (deployment.Environment, error) { chainSelectors := e.AllChainSelectors() var ocrConfigPerSelector = make(map[uint64]changeset.CCIPOCRParams) for selector := range e.Chains { @@ -511,8 +510,10 @@ func setupOCR(e *deployment.Environment, homeChainSel uint64, feedChainSel uint6 changeset.WithDefaultExecuteOffChainConfig(nil), ) } - return commonchangeset.Apply(nil, *e, nil, - commonchangeset.Configure( + + var commitChangeset commonchangeset.ConfiguredChangeSet + if newDons { + commitChangeset = commonchangeset.Configure( // Add the DONs and candidate commit OCR instances for the chain deployment.CreateLegacyChangeSet(changeset.AddDonAndSetCandidateChangeset), changeset.AddDonAndSetCandidateChangesetConfig{ @@ -525,7 +526,28 @@ func setupOCR(e *deployment.Environment, homeChainSel uint64, feedChainSel uint6 PluginType: types.PluginTypeCCIPCommit, }, }, - ), + ) + } else { + commitChangeset = commonchangeset.Configure( + // Add the exec OCR instances for the new chains + deployment.CreateLegacyChangeSet(changeset.SetCandidateChangeset), + changeset.SetCandidateChangesetConfig{ + SetCandidateConfigBase: changeset.SetCandidateConfigBase{ + HomeChainSelector: homeChainSel, + FeedChainSelector: feedChainSel, + }, + PluginInfo: []changeset.SetCandidatePluginInfo{ + { + OCRConfigPerRemoteChainSelector: ocrConfigPerSelector, + PluginType: types.PluginTypeCCIPCommit, + }, + }, + }, + ) + } + + return commonchangeset.Apply(nil, *e, nil, + commitChangeset, commonchangeset.Configure( // Add the exec OCR instances for the new chains deployment.CreateLegacyChangeSet(changeset.SetCandidateChangeset), diff --git a/integration-tests/testconfig/ccip/ccip.toml b/integration-tests/testconfig/ccip/ccip.toml index e8ca343bbab..9d98f796900 100644 --- a/integration-tests/testconfig/ccip/ccip.toml +++ b/integration-tests/testconfig/ccip/ccip.toml @@ -243,13 +243,12 @@ ephemeral_addresses_number = 0 [Load.CCIP.Load] # MessageTypeWeights corresponds with [data only, token only, message with token] -#MessageTypeWeights = [100,0,0] MessageTypeWeights = [100,0,0] # each destination chain will receive 1 incoming request per RequestFrequency for the duration of LoadDuration RequestFrequency = "5s" -LoadDuration = "1h" +LoadDuration = "10m" # destination chain selectors to send messages to -NumDestinationChains = 30 +NumDestinationChains = 8 # Directory where we receive environment configuration from crib CribEnvDirectory = "../../../../crib/deployments/ccip-v2/.tmp" -TimeoutDuration = "1h" \ No newline at end of file +TimeoutDuration = "20m" \ No newline at end of file From a1cb941f5fbc2f8ad7b2560b833b0bdb07d879c3 Mon Sep 17 00:00:00 2001 From: Austin <107539019+0xAustinWang@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:30:23 +0800 Subject: [PATCH 3/3] Update deployment/environment/crib/ccip_deployer.go Co-authored-by: Abdelrahman Soliman (Boda) <2677789+asoliman92@users.noreply.github.com> --- deployment/environment/crib/ccip_deployer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/environment/crib/ccip_deployer.go b/deployment/environment/crib/ccip_deployer.go index e2c432bddd1..7e1c7070313 100644 --- a/deployment/environment/crib/ccip_deployer.go +++ b/deployment/environment/crib/ccip_deployer.go @@ -529,7 +529,7 @@ func mustOCR(e *deployment.Environment, homeChainSel uint64, feedChainSel uint64 ) } else { commitChangeset = commonchangeset.Configure( - // Add the exec OCR instances for the new chains + // Update commit OCR instances for existing chains deployment.CreateLegacyChangeSet(changeset.SetCandidateChangeset), changeset.SetCandidateChangesetConfig{ SetCandidateConfigBase: changeset.SetCandidateConfigBase{