Expand ocr3 config in add_capabilities changeset#22015
Expand ocr3 config in add_capabilities changeset#22015yashnevatia wants to merge 6 commits intodevelopfrom
Conversation
|
👋 yashnevatia, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
Risk Rating: HIGH — changes modify deployment-time config generation for OCR3 and add new on-chain reads; current implementation can produce incorrect OCR3 config counts and can panic if Env.Offchain is missing.
This PR adds OCR3 config expansion to the AddCapabilities changeset so that capability configs containing ocr3Configs with an offchainConfig map are expanded into full OCR3 configs before being written on-chain.
Changes:
- Expand OCR3 configs (inject signers/transmitters + base64 offchain config) during
AddCapabilities.Apply. - Add an integration test verifying OCR3 config expansion is present in the DON’s stored capability configuration.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
deployment/cre/capabilities_registry/v2/changeset/add_capabilities.go |
Adds pre-processing to expand OCR3 configs by reading DON nodes and mutating the input configs before executing the add-capabilities sequence. |
deployment/cre/capabilities_registry/v2/changeset/add_capabilities_test.go |
Adds a test that applies AddCapabilities with an OCR3 config map and asserts the stored config is expanded (signers/transmitters present, offchainConfig becomes base64 string). |
deployment/cre/capabilities_registry/v2/changeset/add_capabilities.go
Outdated
Show resolved
Hide resolved
| if expandErr := expandOCR3Configs(e, config.RegistryChainSel, nodes, ocr3CapConfigs, firstConfigCount); expandErr != nil { | ||
| return cldf.ChangesetOutput{}, fmt.Errorf("DON %q: failed to expand OCR3 configs: %w", donName, expandErr) | ||
| } |
There was a problem hiding this comment.
expandOCR3Configs will call into ocr3.ComputeOCR3Config, which calls deployment.NodeInfo(..., env.Offchain) and will panic if e.Offchain is nil when an ocr3Configs[*].offchainConfig map needs expansion. AddCapabilities should fail gracefully instead of panicking (e.g., detect whether any entry requires expansion and return a clear error if e.Offchain/e.OCRSecrets are missing).
| for donName, donCapConfigs := range config.DonCapabilityConfigs { | ||
| _, nodes, donErr := sequences.GetDonNodes(donName, capReg) | ||
| if donErr != nil { | ||
| return cldf.ChangesetOutput{}, fmt.Errorf("DON %q: failed to get nodes: %w", donName, donErr) | ||
| } |
There was a problem hiding this comment.
This pre-processing loop fetches DON + node info from the registry (GetDonNodes) for every DON, but the sequences.AddCapabilities sequence also calls GetDonNodes again. This doubles the on-chain read calls and adds latency even when there are no OCR3 configs to expand. Consider either (a) scanning the input configs first and only fetching nodes for DONs that actually need OCR3 expansion, or (b) moving OCR3 expansion into the AddCapabilities sequence after it already has don/nodes available.
|
deployment/cre/capabilities_registry/v2/changeset/add_capabilities.go
Outdated
Show resolved
Hide resolved
|


This pull request enhances the
AddCapabilitieschangeset logic for the Capabilities Registry v2 by integrating OCR3 configuration expansion.OCR3 Configuration Support and Expansion:
Applymethod inAddCapabilitiesnow retrieves the registry contract, fetches DON nodes, and expands OCR3 capability configurations using the newexpandOCR3Configslogic, which incorporates the current OCR3 config count and ensures proper config structure for each DON.UpdateDonandConfigureCapabilityRegistrychangesets