Skip to content

CRE Don2Don accept OCR attestation of a response#21607

Merged
bolekk merged 16 commits intodevelopfrom
feature/PLEX-2611-cre-don2don-accept-ocr-attestatin
Apr 23, 2026
Merged

CRE Don2Don accept OCR attestation of a response#21607
bolekk merged 16 commits intodevelopfrom
feature/PLEX-2611-cre-don2don-accept-ocr-attestatin

Conversation

@dhaidashenko
Copy link
Copy Markdown
Collaborator

@dhaidashenko dhaidashenko commented Mar 19, 2026

Allow Capabilities Nodes to provide OCR attestation of the response.

Motivation

To reduce the bandwidth used by chain capabilities OCR, for some request types, nodes will exchange hashes of observed RPC responses instead of actual responses. While this greatly reduces the required bandwidth, there is now a high probability that only F+1 chain cap nodes will have the RPC response. Thus, to ensure reliability, we should allow capability nodes to provide OCR attestation so that receiving a response from a single node is sufficient.

All chain capability nodes will still attempt to send the response. If the node has only a report and no RPC payload, it will return a special error indicating that the node must wait for a response from another node.
Changes to Don2Don to ensure that only one capability node returns the report with the payload are out of scope for this PR. And the benefits of that approach are debatable.

Ticket: https://smartcontract-it.atlassian.net/browse/PLEX-2611
Depends on:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

CORA - Pending Reviewers

All codeowners have approved! ✅

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

For more details, see the full review summary.

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Mar 19, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CCIPTokenTransfer_EVM2Sui_ManagedTokenPool_NoRateLimit Logs ↗︎
Test_CCIPPureTokenTransfer_EVM2Sui_BurnMintTokenPool Logs ↗︎

View Full Report ↗︎Docs

@dhaidashenko dhaidashenko force-pushed the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch from 4a361c5 to 8c09813 Compare March 19, 2026 15:54
@dhaidashenko dhaidashenko force-pushed the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch 2 times, most recently from 2bbab2b to ec482f1 Compare March 19, 2026 17:50
Comment thread core/capabilities/remote/executable/request/client_request.go
Comment thread core/capabilities/remote/executable/request/client_request.go Outdated
patrickhuie19
patrickhuie19 previously approved these changes Mar 19, 2026
@dhaidashenko dhaidashenko force-pushed the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch 2 times, most recently from ffd661b to 0d17383 Compare March 20, 2026 12:40
patrickhuie19
patrickhuie19 previously approved these changes Mar 24, 2026
@dhaidashenko dhaidashenko requested a review from bolekk March 25, 2026 17:53
@dhaidashenko dhaidashenko marked this pull request as ready for review March 25, 2026 17:53
@dhaidashenko dhaidashenko requested review from a team as code owners March 25, 2026 17:53
Copilot AI review requested due to automatic review settings March 25, 2026 17:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: HIGH (changes remote executable request aggregation/validation logic and adds a new OCR-attestation fast-path)

This PR updates the remote executable capability client to accept and verify OCR-attested responses (rather than requiring a quorum of identical responses), and bumps chainlink-common / keystore dependencies across multiple modules to pick up the needed functionality.

Changes:

  • Add OCR attestation verification for capability responses in the remote executable client request path.
  • Plumb OCR3 configs through launcher → executable client → request validation.
  • Update tests to cover OCR-attested responses and bump chainlink-common / keystore versions across modules.

Reviewed changes

Copilot reviewed 14 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
core/capabilities/remote/executable/request/client_request.go Adds OCR-attestation verification path, metering extraction helper, and new error-handling behavior.
core/capabilities/remote/executable/request/client_request_test.go Extends request tests to cover OCR-attested responses and new constructor signature.
core/capabilities/remote/executable/request/client_request_internal_test.go Adds focused unit tests for attestation verification logic.
core/capabilities/remote/executable/client.go Extends dynamic config + SetConfig to carry OCR3 configs into requests.
core/capabilities/launcher.go Passes OCR3 configs into v2 remote executable client config.
core/capabilities/remote/executable/client_test.go Updates tests for SetConfig signature change.
core/capabilities/remote/executable/endtoend_test.go Updates workflow-node config call signature.
go.mod Bumps github.com/smartcontractkit/chainlink-common and .../keystore versions.
go.sum Checksum updates for bumped dependencies.
core/scripts/go.mod Bumps chainlink-common / keystore versions in scripts module.
core/scripts/go.sum Checksum updates for scripts module.
deployment/go.mod Bumps chainlink-common / keystore versions in deployment module.
deployment/go.sum Checksum updates for deployment module.
integration-tests/go.mod Bumps chainlink-common / keystore versions for integration tests.
integration-tests/go.sum Checksum updates for integration tests.
integration-tests/load/go.mod Bumps chainlink-common / keystore versions for load tests.
integration-tests/load/go.sum Checksum updates for load tests.
system-tests/lib/go.mod Bumps chainlink-common / keystore versions for system-test lib.
system-tests/lib/go.sum Checksum updates for system-test lib.
system-tests/tests/go.mod Bumps chainlink-common / keystore versions for system tests.
system-tests/tests/go.sum Checksum updates for system tests.

Scrupulous human review focus:

  • ClientRequest.verifyAttestation (signature bounds checks, config-digest checks, and overall correctness of the “1 response with F+1 sigs” acceptance criteria).
  • ClientRequest.OnMessage error-handling path for ErrResponsePayloadNotAvailable and the interaction with response quorum/timeout behavior.
  • Operational/logging impact of adding ocr3Configs to SetConfig logs.

Suggested reviewers (per CODEOWNERS):

  • For /core/capabilities/**: @smartcontractkit/keystone, @smartcontractkit/capabilities-team
  • For root go.mod/go.sum: @smartcontractkit/core, @smartcontractkit/foundations
  • For /integration-tests/**: @smartcontractkit/devex-tooling, @smartcontractkit/core
  • For /deployment/**: @smartcontractkit/ccip-tooling, @smartcontractkit/operations-platform, @smartcontractkit/keystone, @smartcontractkit/core
Comments suppressed due to low confidence (1)

core/capabilities/remote/executable/request/client_request.go:350

  • OnMessage unmarshals the capability response (pb.UnmarshalCapabilityResponse) to check for OCR attestation, and then for the non-attestation path calls getMessageHashAndMetadata, which unmarshals the same payload again. Consider refactoring to unmarshal once and reuse the parsed response/metadata when computing the response hash to avoid redundant work on the hot path.
		resp, err := pb.UnmarshalCapabilityResponse(msg.Payload)
		if err != nil {
			return fmt.Errorf("failed to unmarshal capability response: %w", err)
		}

		if resp.Metadata.OCRAttestation != nil {
			rpt, err := extractMeteringFromMetadata(sender, resp.Metadata)
			if err != nil {
				return fmt.Errorf("failed to extract metering detail from metadata: %w", err)
			}
			// Since signatures are provided switch to OCR based validation. It's enough to get 1 response with F+1 signatures
			// to be confident that the response is honest.
			err = c.verifyAttestation(resp, rpt)
			if err != nil {
				c.lggr.Errorw("failed to verify capability response OCR attestation", "peer", sender, "err", err, "requestID", c.id, "msgPayload", hex.EncodeToString(msg.Payload))
				return fmt.Errorf("failed to verify capability response OCR attestation: %w", err)
			}

			var payload []byte
			payload, err = c.encodePayloadWithMetadata(msg, commoncap.ResponseMetadata{Metering: []commoncap.MeteringNodeDetail{rpt}})
			if err != nil {
				return fmt.Errorf("failed to encode payload with metadata: %w", err)
			}

			c.sendResponse(clientResponse{Result: payload})
			return nil
		}

		// metering reports per node are aggregated into a single array of values. for any single node message, the
		// metering values are extracted from the CapabilityResponse, added to an array, and the CapabilityResponse
		// is marshalled without the metering value to get the hash. each node could have a different metering value
		// which would result in different hashes. removing the metering detail allows for direct comparison of results.
		responseID, metadata, err := c.getMessageHashAndMetadata(msg)
		if err != nil {
			return fmt.Errorf("failed to get message hash: %w", err)
		}

Comment thread core/capabilities/remote/executable/request/client_request.go
Comment thread core/capabilities/remote/executable/request/client_request.go Outdated
Comment thread core/capabilities/remote/executable/request/client_request.go Outdated
Comment thread core/capabilities/remote/executable/client.go Outdated
@dhaidashenko dhaidashenko force-pushed the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch from b62fc5a to 9f8971a Compare March 25, 2026 17:58
bolekk
bolekk previously approved these changes Apr 22, 2026
@bolekk bolekk enabled auto-merge April 22, 2026 17:41
patrickhuie19
patrickhuie19 previously approved these changes Apr 22, 2026
…attestatin

# Conflicts:
#	deployment/go.mod
#	integration-tests/go.mod
#	integration-tests/load/go.mod
#	system-tests/lib/go.mod
@dhaidashenko dhaidashenko dismissed stale reviews from patrickhuie19 and bolekk via 7f032af April 23, 2026 15:08
bolekk
bolekk previously approved these changes Apr 23, 2026
@bolekk bolekk added this pull request to the merge queue Apr 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Apr 23, 2026
@bolekk bolekk enabled auto-merge April 23, 2026 18:06
…attestatin

# Conflicts:
#	core/scripts/go.sum
#	deployment/go.sum
#	go.mod
#	go.sum
#	integration-tests/go.sum
#	integration-tests/load/go.mod
#	integration-tests/load/go.sum
#	system-tests/lib/go.sum
#	system-tests/tests/go.sum
ilija42
ilija42 previously approved these changes Apr 23, 2026
@dhaidashenko dhaidashenko dismissed stale reviews from ilija42 and bolekk via 571050d April 23, 2026 18:10
@cl-sonarqube-production
Copy link
Copy Markdown

@dhaidashenko dhaidashenko requested review from bolekk and ilija42 April 23, 2026 18:41
@bolekk bolekk added this pull request to the merge queue Apr 23, 2026
Merged via the queue into develop with commit c0f5a3c Apr 23, 2026
230 of 236 checks passed
@bolekk bolekk deleted the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch April 23, 2026 19:10
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