CRE Don2Don accept OCR attestation of a response#21607
CRE Don2Don accept OCR attestation of a response#21607dhaidashenko wants to merge 1 commit intodevelopfrom
Conversation
CORA - Pending Reviewers
Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
4a361c5 to
8c09813
Compare
2bbab2b to
ec482f1
Compare
|
| return fmt.Errorf("invalid signer index: %d", sig.Signer) | ||
| } | ||
|
|
||
| if signed[sig.Signer] { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
We have two consumers of OCR reports:
- On-chain contracts (code reuse is not possible)
- 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}}) |
There was a problem hiding this comment.
could benefit from a library on the client side that crafts resp.Metadata.Metering[0] in the way we expect here
There was a problem hiding this comment.
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.
ec482f1 to
ffd661b
Compare
ffd661b to
0d17383
Compare




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