Skip to content

[CRE] (feat): validate OCR key bundles against expected signers in ProposeJobSpec - #24164

Open
justinkaseman wants to merge 4 commits into
developfrom
CRE-7279
Open

justinkaseman wants to merge 4 commits into
developfrom
CRE-7279

Conversation

@justinkaseman

@justinkaseman justinkaseman commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What

ProposeJobSpec.VerifyPreconditions now checks that each target node’s OCR2 key bundle in JD matches an expected onchain signer, before a spec is proposed.

How

  • New optional inputs: expectedSigners (CSA key → signer) and skipKeyringCheck.
  • EVM bundle: the ID must be non-empty and its signer must match.
  • Non-EVM bundles: present, non-empty ID, not shared between nodes.
  • Applies to OCR3, Ring, Consensus, Aptos, Solana and Stellar.
  • Skipped when expectedSigners is empty, so existing callers are unaffected.
  • Skipped for minimalOracleFactory or an explicit oracleFactory, since the spec then takes no bundle IDs from JD.
  • Not applicable to the EVM template: its spec takes oracleFactory from the inputs, not from JD.
  • Node selection uses new shared filter builders (StandardCapabilityNodeFilter, PluginDONNodeFilter) that the proposing operations also call, so the check and the proposal target the same nodes.
  • NewNodeFromJD and ChainConfigsToOCRConfig now return an error or skip a config when OCR2 metadata is missing, instead of panicking.

Why

A stale JD chain config, for example after a key rotation, would otherwise bake the wrong bundle ID into the spec.

Follow-up

A chainlink-deployments PR will be needed to make the resolver fill expectedSigners from nodes.json.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

👋 justinkaseman, 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!

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

EVM proposals bypass keyring validation and can retain stale bundle IDs, while missing OCR metadata can cause precondition checks to panic instead of returning validation errors.

2 open issues
What changed in this PR

Adds optional OCR key-bundle validation to job proposal preconditions, helping prevent stale Job Distributor configuration from supplying incorrect bundle IDs.

Changes:

  • Adds expected signers keyed by node CSA key and an emergency bypass flag.
  • Checks EVM signer matches and non-EVM bundle presence and uniqueness for supported templates.
  • Adds unit and integration coverage for validation, node selection, and bypass behavior.
File Description
deployment/​cre/​jobs/​propose_job_spec.go Adds validation inputs and invokes the keyring check.
deployment/​cre/​jobs/​propose_job_spec_keyring_e2e_test.go Exercises precondition checks through the test harness.
deployment/​cre/​jobs/​propose_job_spec_keyring_check.go Implements node selection, signer matching, and bundle validation.
deployment/​cre/​jobs/​propose_job_spec_keyring_check_test.go Tests validation helpers, selectors, filters, and bypasses.

Review effort: Balanced

Comment on lines +24 to +25
job_types.OCR3, job_types.Consensus, job_types.Ring,
job_types.Aptos, job_types.Solana, job_types.Stellar,
for i, n := range jdNodes {
ids[i] = n.Id
}
infos, err := deployment.NodeInfo(ids, e.Offchain)

@russell-stern russell-stern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like there's a flaky e2e test


// targetNodeFilter reproduces the JD node selection of the operation that proposes the template, so
// the check validates the same nodes the proposal targets.
func targetNodeFilter(config ProposeJobSpecInput) *nodev1.ListNodesRequest_Filter {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this desyncs from the JD node selection will it fail silently? Can we extract the function into a shared lib so they both use the same logic or have a follow up to do it?

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
/deployment/ ❌ 2 @smartcontractkit/ccip-tooling, @smartcontractkit/ccip-offchain, @smartcontractkit/keystone, @smartcontractkit/operations-platform, @smartcontractkit/core
/deployment/cre/ ❌ 8 @smartcontractkit/keystone, @smartcontractkit/operations-platform

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical issue remains: missing OCR2 or P2P metadata causes NewNodeFromJD to panic instead of returning a precondition error, requiring explicit error handling and a VerifyPreconditions regression test.

3 open issues

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the optional pre-proposal OCR key-bundle validation change.

2 open issues
1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
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.

3 participants