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

Simplify new chain config #15478

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Simplify new chain config #15478

merged 5 commits into from
Dec 3, 2024

Conversation

connorwstein
Copy link
Contributor

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.

HomeChainSel uint64
FeedChainSel uint64
ChainsToDeploy []uint64
TokenConfig TokenConfig
Copy link
Contributor Author

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{})
Copy link
Contributor Author

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)
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 much better to just have the full configuration as input and not mutate the config inside here

@connorwstein connorwstein marked this pull request as ready for review December 2, 2024 20:58
@connorwstein connorwstein requested review from a team as code owners December 2, 2024 20:58
Copy link
Contributor

github-actions bot commented Dec 2, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

// For setting OCR configuration
OCRSecrets deployment.OCRSecrets
OCRParams map[uint64]CCIPOCRParams
// Common to all chains
Copy link
Contributor Author

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

b-gopalswami
b-gopalswami previously approved these changes Dec 2, 2024
Copy link
Contributor

@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

mateusz-sekara
mateusz-sekara previously approved these changes Dec 3, 2024
@@ -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,
Copy link
Collaborator

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?

b-gopalswami
b-gopalswami previously approved these changes Dec 3, 2024
mateusz-sekara
mateusz-sekara previously approved these changes Dec 3, 2024
@connorwstein connorwstein added this pull request to the merge queue Dec 3, 2024
Merged via the queue into develop with commit 88a6c75 Dec 3, 2024
182 of 183 checks passed
@chainchad chainchad deleted the simplify-new-chain-config branch December 3, 2024 20:09
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.

6 participants