-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Simplify new chain config #15478
Simplify new chain config #15478
Conversation
HomeChainSel uint64 | ||
FeedChainSel uint64 | ||
ChainsToDeploy []uint64 | ||
TokenConfig TokenConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the TokenConfig is also already part of the commit plugin config
) | ||
|
||
func Test_NewAcceptOwnershipChangeset(t *testing.T) { | ||
e := NewMemoryEnvironmentWithJobs(t, logger.TestLogger(t), 2, 4) | ||
e := NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), 2, 4, &TestConfigs{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drive by test simplification
if enabled, ok := c.USDCConfig.EnabledChainMap()[chainSel]; ok && enabled { | ||
ocrParams.ExecuteOffChainConfig.TokenDataObservers = c.USDCConfig.ToTokenDataObserverConfig() | ||
} | ||
ocrParams.CommitOffChainConfig.PriceFeedChainSelector = cciptypes.ChainSelector(c.FeedChainSel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think much better to just have the full configuration as input and not mutate the config inside here
AER Report: CI Core ran successfully ✅AER Report: Operator UI CI ran successfully ✅ |
// For setting OCR configuration | ||
OCRSecrets deployment.OCRSecrets | ||
OCRParams map[uint64]CCIPOCRParams | ||
// Common to all chains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the main change. We separate into global and per chain, and use the Exec/Commit plugin config directly to reduce some duplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -119,6 +120,8 @@ func AddDonAndSetCandidateChangeset( | |||
ccipOCRParams := DefaultOCRParams( | |||
feedChainSel, | |||
tokenConfig.GetTokenInfo(e.Logger, state.Chains[newChainSel].LinkToken, state.Chains[newChainSel].Weth9), | |||
// TODO: Need USDC support. | |||
nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a ticket for that?
69bc98b
3e1ef01
The USDC config is part of the execution plugin OCR configuration so here we just use that as the source of truth. Also combine into a single map of per chain configuration to avoid all the parallel map validation.