Skip to content

CRE Don2Don accept OCR attestation of a response#21607

Draft
dhaidashenko wants to merge 1 commit intodevelopfrom
feature/PLEX-2611-cre-don2don-accept-ocr-attestatin
Draft

CRE Don2Don accept OCR attestation of a response#21607
dhaidashenko wants to merge 1 commit intodevelopfrom
feature/PLEX-2611-cre-don2don-accept-ocr-attestatin

Conversation

@dhaidashenko
Copy link
Collaborator

@dhaidashenko dhaidashenko commented Mar 19, 2026

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
/core/capabilities/ 7 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
go.mod 6 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 6 @smartcontractkit/core, @smartcontractkit/foundations
integration-tests/go.mod 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations
integration-tests/go.sum 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations

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

For more details, see the full review summary.

@github-actions
Copy link
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
Contributor

github-actions bot commented Mar 19, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link

trunk-io bot commented Mar 19, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

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
@cl-sonarqube-production
Copy link

return fmt.Errorf("invalid signer index: %d", sig.Signer)
}

if signed[sig.Signer] {
Copy link
Contributor

Choose a reason for hiding this comment

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

do all consumers of ocr signed reports have to do this validation? maybe there's a shared lib in chainlink-common or libocr we can use?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have two consumers of OCR reports:

  1. On-chain contracts (code reuse is not possible)
  2. Liboccr. Code reuse is also not possible as signatures are streamed from other nodes and in this case, we have all of them in one place.

Extracting this for loop into a dedicated function in common does not seem like a good idea at this stage, since it's not shared with any other caller right now.
And even if someone in the future needs to use something similar, I do not see any issues with duplicating the code or extracting it at that stage, as the logic is trivial and will always converge to the same code, except for some minor differences.

rpt := resp.Metadata.Metering[0]
rpt.Peer2PeerID = sender.String()
var payload []byte
payload, err = c.encodePayloadWithMetadata(msg, commoncap.ResponseMetadata{Metering: []commoncap.MeteringNodeDetail{rpt}})
Copy link
Contributor

Choose a reason for hiding this comment

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

could benefit from a library on the client side that crafts resp.Metadata.Metering[0] in the way we expect here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've consolidated logic for interacting with metering details in the client_request.
If you meant a method to craft resp.Metadata.Metering[0] on the capabilities side, I agree that it's beneficial. However, it's out of scope for this PR.

patrickhuie19
patrickhuie19 previously approved these changes Mar 19, 2026
@dhaidashenko dhaidashenko force-pushed the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch from ec482f1 to ffd661b Compare March 20, 2026 12:34
@dhaidashenko dhaidashenko force-pushed the feature/PLEX-2611-cre-don2don-accept-ocr-attestatin branch from ffd661b to 0d17383 Compare March 20, 2026 12:40
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.

2 participants