Skip to content

feat(confidentialrelay): gateway forwards relay responses as a bundle; enclave verifies#22807

Open
nadahalli wants to merge 4 commits into
developfrom
tejaswi/relay-gateway-dumb-bundle
Open

feat(confidentialrelay): gateway forwards relay responses as a bundle; enclave verifies#22807
nadahalli wants to merge 4 commits into
developfrom
tejaswi/relay-gateway-dumb-bundle

Conversation

@nadahalli

Copy link
Copy Markdown
Contributor

Makes the gateway a dumb fan-in for confidential-relay responses and moves all signature verification to the enclave, closing a liveness gap where the gateway counted unverified, attacker-supplied signer identities toward quorum (one compromised relay node could forge quorum and starve the enclave of the real result).

  • Gateway: replaces the signature-counting aggregator (aggregator.go) with bundler.go, a keyless fan-in that forwards every collected per-node response in one SignedXResponseBundle without merging, trusting, or counting signatures. Forwards at the 2F+1 response threshold (so >=F+1 honest responses are guaranteed present), and forwards a partial bundle on timeout instead of erroring.
  • Relay node: emits a single Signature per response; keeps populating the deprecated Signatures array during the migration window.

Depends on chainlink-common #2109 (bundle types). Draft until that merges and common is released; go.mod is temporarily pinned to the #2109 branch.

Make the gateway a keyless dumb fan-in for confidential-relay responses
and move all signature verification to the enclave. Previously the gateway
counted unverified, attacker-supplied signer identities toward quorum, so a
single compromised relay node could forge quorum and starve the enclave of
the real result (a liveness break).

Gateway: replace the signature-counting aggregator with a bundler that
forwards every collected per-node response in one bundle, without merging,
trusting, or counting signatures. Forward at the 2F+1 response threshold
(so >=F+1 honest responses are guaranteed present) and forward a partial
bundle on timeout instead of erroring.

Relay node: emit a single Signature per response; keep populating the
deprecated Signatures array during the migration window.

Bumps chainlink-common to the bundle-types commit, pinned to the #2109
branch until it merges (PR is draft until then).
@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

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@trunk-io

trunk-io Bot commented Jun 11, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Re-point from the temporary #2109 branch pin to the merged main commit
(87b1e75d), now that chainlink-common#2109 has landed.
@nadahalli nadahalli marked this pull request as ready for review June 12, 2026 12:24
@nadahalli nadahalli requested review from a team as code owners June 12, 2026 12:24
Resolve the aggregator_test.go modify/delete conflict by keeping #22807's
deletion: #22516 (now on develop) added validEnclaveConfig to that file,
but the dumb-bundler replaces the aggregator entirely and that helper is
unused elsewhere. Relay packages build and tests pass with #22516's
config-verify changes merged in.
… lint

- Bump chainlink-common to 87b1e75d in the 6 sibling modules (core/scripts,
  deployment, integration-tests{,/load}, system-tests/{lib,tests}) so the
  module graph is consistent (fixes Clean Go Tidy + deployment test builds).
- Lint: fmt.Errorf -> errors.New (perfsprint); []byte(fmt.Sprintf) -> fmt.Appendf
  and drop the generic ptr() wrapper (modernize); use assert instead of require
  inside test goroutines (testifylint).
@nadahalli nadahalli requested a review from a team as a code owner June 12, 2026 12:46
@cl-sonarqube-production

Copy link
Copy Markdown

Comment on lines +688 to +689
// Deprecated: kept populated during the migration window so any reader still
// on the array field continues to work; remove once nothing reads Signatures.

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.

why are we "migrating" with no customers?

Comment on lines +52 to +54
sort.Slice(out, func(i, j int) bool {
return bytes.Compare(out[i].Signature.Signer, out[j].Signature.Signer) < 0
})

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.

why are we sorting by signer?

Comment on lines +252 to +254
// valid signatures (e.g. faulty nodes stayed silent). The gateway does not
// decide that; it forwards whatever it collected and lets the enclave, the
// trust anchor, accept or reject.

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.

Is this for censorship resistance? The gateway can always censor things.

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