Skip to content

Add EnclaveConfig to confidentialrelay request params (PRIV-458)#2063

Open
nadahalli wants to merge 1 commit into
mainfrom
tejaswi/priv-458-relay-enclave-config
Open

Add EnclaveConfig to confidentialrelay request params (PRIV-458)#2063
nadahalli wants to merge 1 commit into
mainfrom
tejaswi/priv-458-relay-enclave-config

Conversation

@nadahalli
Copy link
Copy Markdown
Contributor

SecretsRequestParams and CapabilityRequestParams now carry an
EnclaveConfig field describing the enclave's current Signers,
MasterPublicKey, T, and F. The relay-DON handler in chainlink/core
will use this to compare against onchain DON state before treating
an attested request as trusted.

Without this field, the request's Nitro attestation binds the request
hash but does not let the relay see the enclave's config. A malicious
host can produce a genuinely-attested request over a forged enclave
config and have it accepted. This closes the gap Sigma Prime CL112-01
identified, mirroring the pool.go-side hardening in
smartcontractkit/confidential-compute#329.

EnclaveConfig is a parallel struct in this package, not imported from
confidential-compute, to keep the dependency direction one-way. Fields
match types.EnclaveConfig there; the enclave will fill this struct
from its local instance before sending. Validate enforces non-empty
Signers, F > 0, non-empty MasterPublicKey. The relay-response hash
binds every field with Signers sorted so logically-equivalent configs
hash the same regardless of Signer ordering.

Rollout (Stage 2 of PRIV-458):

  1. (this PR) chainlink-common adds the field.
  2. confidential-compute bumps chainlink-common and fills EnclaveConfig
    on every outgoing relay request.
  3. chainlink/core bumps both deps and verifies EnclaveConfig against
    onchain DON state in handleSecretsGet and handleCapabilityExecute.

Existing callers that do not set EnclaveConfig will now fail
Validate. This is intentional: the field is required for the relay
to perform the audit-recommended check.

Jira: https://smartcontract-it.atlassian.net/browse/PRIV-458

SecretsRequestParams and CapabilityRequestParams now carry an
EnclaveConfig field describing the enclave's current Signers,
MasterPublicKey, T, and F. The relay-DON handler in chainlink/core
uses this to compare against onchain DON state before treating an
attested request as trusted.

Without this field, the request's Nitro attestation cryptographically
binds the request hash but does not let the relay see the enclave's
config. A malicious host can produce a genuinely-attested request
over a forged enclave config and have it accepted. This closes the
gap Sigma Prime CL112-01 identified, mirroring the pool.go-side
hardening in confidential-compute #329.

EnclaveConfig is defined as a parallel struct in this package rather
than imported from confidential-compute to keep the dependency
direction one-way. The fields match types.EnclaveConfig there and
the enclave fills this struct from its local instance before sending.

Validate enforces non-empty Signers, F > 0, and non-empty
MasterPublicKey. The canonical hash for relay-response signing now
binds every field with Signers sorted so that two logically-equivalent
configs hash the same regardless of Signer ordering.
Copilot AI review requested due to automatic review settings May 15, 2026 16:02
@nadahalli nadahalli requested a review from a team as a code owner May 15, 2026 16:02
@github-actions
Copy link
Copy Markdown

👋 nadahalli, 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
Copy link
Copy Markdown

⚠️ API Diff Results - github.com/smartcontractkit/chainlink-common

⚠️ Breaking Changes (1)

pkg/capabilities/v2/actions/confidentialrelay (1)
  • CapabilityRequestParams — Old is comparable, new is not

✅ Compatible Changes (3)

pkg/capabilities/v2/actions/confidentialrelay (1)
  • EnclaveConfig — ➕ Added
pkg/capabilities/v2/actions/confidentialrelay.CapabilityRequestParams (1)
  • EnclaveConfig — ➕ Added
pkg/capabilities/v2/actions/confidentialrelay.SecretsRequestParams (1)
  • EnclaveConfig — ➕ Added

📄 View full apidiff report

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

This PR hardens confidential relay requests by requiring callers to include an EnclaveConfig payload (signers, master public key, and threshold parameters) so downstream relay handlers can verify the enclave configuration against on-chain DON state after attestation validation (PRIV-458 / Sigma Prime CL112-01).

Changes:

  • Added EnclaveConfig to SecretsRequestParams and CapabilityRequestParams and made it required via Validate().
  • Included EnclaveConfig in the canonical response-hash input (with signer ordering canonicalized by sorting).
  • Added focused unit tests covering validation requirements and hash binding / stability under signer reordering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/capabilities/v2/actions/confidentialrelay/types.go Adds EnclaveConfig, validates it, and binds it into canonical hashing with order-independent signer handling.
pkg/capabilities/v2/actions/confidentialrelay/types_test.go Updates request param fixtures and adds tests for EnclaveConfig validation and hash binding/canonicalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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