Skip to content

feat(deployment): surface declared confidential compute config on the deployment view#3353

Merged
baktun14 merged 6 commits into
mainfrom
feat/deployment-surface-confidential-compute
Jun 24, 2026
Merged

feat(deployment): surface declared confidential compute config on the deployment view#3353
baktun14 merged 6 commits into
mainfrom
feat/deployment-surface-confidential-compute

Conversation

@baktun14

@baktun14 baktun14 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Why

Closes CON-451.

After deploying a Confidential Compute (TEE) workload, a tenant should be able to confirm from the deployment detail view that a TEE was actually requested, understand the resource slice the provider's attestation sidecar reserves, and not be confused by that sidecar. This is the deploy-web counterpart to the already-merged backend support (#3344 / CON-463).

The declared TEE type is recorded on-chain as a group placement requirement: group_spec.requirements.attributes carries a tee/type attribute (cpu | cpu-gpu) so only TEE-capable providers can bid and match. deploy-web already loads this for every deployment, so the surface reads it directly from the chain — it works for deployments created from any client (Console, CLI, SDK), not only those whose SDL manifest happens to be in this browser's localStorage.

What

For deployments whose groups declare an on-chain tee/type:

  • Indicator — a Confidential Compute (CPU) / (CPU + GPU) badge in the deployment sub-header, shown whenever any group declares tee/type (distinct types across groups listed in the tooltip for mixed deployments). The tooltip frames it as declared intent whose confidentiality depends on the provider honoring the request and passing attestation — not a verified runtime guarantee.
  • Resource carve-out — in the lease view, a per-pod breakdown of Requested → Attestation sidecar → Available to your container, one entry per group_spec.resources unit (the sidecar is injected into every pod of a CC group), replicating the provider's subtraction + floors (sidecar limits: 100m CPU, 64Mi/128Mi memory; floors 10m / 16Mi — matching feat: confidential compute provider#396). On-chain groups carry no service names, so each unit is labelled by its resource composition (e.g. 8 CPU · 32 GiB · 1 GPU) when a lease declares more than one, with the replica count noted. A note appears when the declared budget is at/below the sidecar footprint (so the floored values aren't misread as broken arithmetic). Billing is unchanged — the slice comes out of the container, not the bill.
  • Defensive sidecar filter — a single select: omitAttestationSidecar chokepoint on useLeaseStatus. The sidecar is a pod container today (never a leaseStatus.services key), so this is a documented passthrough that guards the pre-GA provider contract for the status/logs/shell selectors.

Notes for reviewers:

  • No dedicated feature flag (deliberate deviation from the AC, agreed with product): every path self-gates on a declared on-chain tee/type, so non-CC deployments are completely unaffected. Trivially reversible by wrapping the new UI in useFlag("ui_confidential_compute").
  • All new logic is pure/unit-tested (utils, badge, carve-out, and a hook-level filter regression test). A live CC provider now exists on mainnet (snp-gpu), so the badge can be verified end-to-end against a real cpu-gpu deployment — this supersedes the earlier CON-459 "no CC provider yet" assumption.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added a Confidential Compute badge in deployment headers, driven by declared TEE types.
    • Added a “Confidential compute resources” section on lease rows showing Requested, Attestation sidecar reservation, and Available container CPU/Memory, with formatted units.
  • Bug Fixes

    • Lease status shaping now hides attestation sidecar details while still honoring any custom data selection logic.
  • Tests

    • Added unit tests for the badge, resources display, TEE utilities, and new TEE-related hooks.
  • Chores

    • Expanded provider JWT generation to include the attestation scope.

… deployment view

For deployments declaring a TEE type (services.<name>.params.tee in the stored SDL manifest):

- show a Confidential Compute badge in the deployment sub-header (presence-driven, friendly
  CPU / CPU + GPU labels, declared-intent framing)
- render the attestation sidecar's per-service resource carve-out (requested / sidecar /
  available) in the lease view, with a note when the declared budget is below the footprint
- defensively keep the sidecar out of the lease-status service lists via one useLeaseStatus
  select chokepoint

The feature self-gates on a declared params.tee, so non-CC deployments are unaffected.
@baktun14 baktun14 requested a review from a team as a code owner June 23, 2026 15:47
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds TEE helpers and hooks, renders confidential-compute UI in deployment views, filters attestation sidecar data in lease queries, and expands the provider JWT scope.

Changes

Confidential compute display and attestation flow

Layer / File(s) Summary
TEE helpers and hooks
apps/deploy-web/src/utils/confidentialCompute.ts, apps/deploy-web/src/utils/confidentialCompute.spec.ts, apps/deploy-web/src/hooks/useDeclaredTeeTypes.ts, apps/deploy-web/src/hooks/useDeclaredTeeTypes.spec.ts, apps/deploy-web/src/hooks/useTeeResourceCarveouts.ts, apps/deploy-web/src/hooks/useTeeResourceCarveouts.spec.ts
Defines TEE type constants and parsing helpers, derives declared TEE types from deployment groups, computes sidecar carveouts and per-resource carveouts, strips the attestation sidecar from lease status, formats TEE labels, and adds hooks that memoize declared types and carveouts. Tests cover group parsing, carveout math, resource carveouts, sidecar omission, and hook behavior.
Confidential compute badge
apps/deploy-web/src/components/shared/ConfidentialComputeBadge.tsx, apps/deploy-web/src/components/shared/ConfidentialComputeBadge.spec.tsx, apps/deploy-web/src/components/deployments/DeploymentDetail.tsx, apps/deploy-web/src/components/deployments/DeploymentSubHeader.tsx
Introduces the confidential compute badge component with injected UI dependencies, renders a type-specific or generic label from declared TEE types, and returns null when no types are provided. The deployment detail view computes declared TEE types and passes them into the subheader, which renders the badge in its status section.
Confidential compute resources
apps/deploy-web/src/components/deployments/ConfidentialComputeResources.tsx, apps/deploy-web/src/components/deployments/ConfidentialComputeResources.spec.tsx, apps/deploy-web/src/components/deployments/LeaseRow.tsx
Introduces the confidential compute resources component with formatted requested, attestation-sidecar, and available rows, constrained-resource messaging, unit labels, and optional tooltip injection. Tests cover empty state, value formatting, minimum warnings, replica labeling, GPU labeling, and tooltip text. Lease rows compute carveouts and render the resources summary.
Lease query filtering and JWT scope
apps/deploy-web/src/queries/useLeaseQuery.ts, apps/deploy-web/src/queries/useLeaseQuery.spec.tsx, apps/deploy-web/src/hooks/useProviderJwt/useProviderJwt.ts, apps/deploy-web/src/hooks/useProviderJwt/useProviderJwt.spec.tsx
Lease status queries filter the attestation sidecar before caller selection, with tests covering the filtered services map and composed selector behavior. Provider JWT requests add the attestation scope, and the matching test updates the expected request payload.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Suggested reviewers

  • ygrishajev
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/deployment-surface-confidential-compute

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.10%. Comparing base (7f7ec7d) to head (cf02451).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3353      +/-   ##
==========================================
- Coverage   69.63%   69.10%   -0.54%     
==========================================
  Files        1087     1048      -39     
  Lines       26672    25664    -1008     
  Branches     6415     6249     -166     
==========================================
- Hits        18574    17736     -838     
+ Misses       7111     6953     -158     
+ Partials      987      975      -12     
Flag Coverage Δ *Carryforward flag
api 84.98% <ø> (ø) Carriedforward from 5f6a333
deploy-web 55.24% <ø> (-0.01%) ⬇️ Carriedforward from 5f6a333
log-collector ?
notifications 91.44% <ø> (ø) Carriedforward from 5f6a333
provider-console 81.38% <ø> (ø) Carriedforward from 5f6a333
provider-inventory 85.08% <ø> (-0.27%) ⬇️
provider-proxy 86.26% <ø> (ø) Carriedforward from 5f6a333
tx-signer ?

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...eb/src/components/deployments/DeploymentDetail.tsx 0.00% <ø> (ø)
...src/components/deployments/DeploymentSubHeader.tsx 0.00% <ø> (ø)
...deploy-web/src/components/deployments/LeaseRow.tsx 0.00% <ø> (ø)
...loy-web/src/hooks/useProviderJwt/useProviderJwt.ts 94.87% <ø> (ø)
apps/deploy-web/src/queries/useLeaseQuery.ts 95.34% <ø> (-0.21%) ⬇️

... and 51 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

baktun14 added 2 commits June 23, 2026 16:20
…in group attribute

Confidential Compute is declared on-chain as a group placement requirement
(group_spec.requirements.attributes "tee/type" = cpu | cpu-gpu) so only
TEE-capable providers can bid and match — it is not a localStorage-only value
as the initial implementation assumed. Reading the stored SDL manifest's
params.tee meant the badge and carve-out would never render for a real CC
deployment (e.g. one created from the CLI).

Re-base on data deploy-web already loads: badge = distinct tee/type across
deployment.groups; per-pod carve-out = one entry per lease.group
group_spec.resources unit (the attestation sidecar is injected into every pod
of a CC group), labelled by resource composition since on-chain groups carry
no service names, with the replica count noted.

Drop the js-yaml/params.tee manifest path (getDeclaredTeeTypesFromYaml,
getServiceTeeType, getServiceComputeResources, getTeeServiceCarveouts). Keep
the sidecar carve-out math and constants, omitAttestationSidecar, the badge,
labels/tooltip and the no-feature-flag behaviour.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/deploy-web/src/utils/confidentialCompute.ts`:
- Around line 41-47: `parseIntegerVal` currently uses `parseInt`, which accepts
numeric prefixes and lets malformed values like suffixed strings slip through as
valid counts. Update `parseIntegerVal` in `confidentialCompute.ts` to only
accept exact integer strings by validating the whole string before converting,
while keeping the existing `number` and non-string handling unchanged. Use the
`parseIntegerVal` helper itself as the place to enforce this stricter parsing so
invalid on-chain resource values are returned as undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c5c2fb43-4c79-4cbf-9086-70013dae76c1

📥 Commits

Reviewing files that changed from the base of the PR and between 45d55f2 and 8336fbb.

📒 Files selected for processing (6)
  • apps/deploy-web/src/components/deployments/ConfidentialComputeResources.spec.tsx
  • apps/deploy-web/src/components/deployments/ConfidentialComputeResources.tsx
  • apps/deploy-web/src/components/deployments/DeploymentDetail.tsx
  • apps/deploy-web/src/components/deployments/LeaseRow.tsx
  • apps/deploy-web/src/utils/confidentialCompute.spec.ts
  • apps/deploy-web/src/utils/confidentialCompute.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/deploy-web/src/components/deployments/ConfidentialComputeResources.spec.tsx
  • apps/deploy-web/src/components/deployments/DeploymentDetail.tsx
  • apps/deploy-web/src/components/deployments/ConfidentialComputeResources.tsx

Comment thread apps/deploy-web/src/utils/confidentialCompute.ts
baktun14 added 2 commits June 24, 2026 10:45
Wrap the root-level getDeclaredTeeTypes / getTeeResourceCarveouts calls in
useDeclaredTeeTypes / useTeeResourceCarveouts hooks so DeploymentDetail and
LeaseRow call a hook at the render root rather than a bare memoized util,
following the established pattern (cf. useTrialDeploymentTimeRemaining). The
pure functions stay in confidentialCompute.ts with their unit tests; the hooks
own the useMemo. No behaviour change.
@baktun14 baktun14 added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 0da5034 Jun 24, 2026
57 checks passed
@baktun14 baktun14 deleted the feat/deployment-surface-confidential-compute branch June 24, 2026 16:27
baktun14 added a commit to akash-network/console-air that referenced this pull request Jun 25, 2026
… view (#37)

Port akash-network/console#3353 (upstream CON-451) into the self-custody fork. Read the
on-chain `tee/type` group placement attribute and surface Confidential Compute on the
deployment detail view, sourced from chain so it works for any client (Console/CLI/SDK).

- Confidential Compute badge in the deployment sub-header, per declared TEE type
- per-pod Requested -> attestation sidecar -> available carve-out in the lease row,
  mirroring the provider sidecar footprint (akash-network/provider#396)
- defensive omitAttestationSidecar chokepoint on useLeaseStatus (passthrough today)

No managed-wallet/JWT coupling: the upstream global-scope `attestation` change and its
#3360 revert are a no-op here (console-air's JWT is a blockchain-down fallback). Data-gated;
no feature flag, matching the upstream merged behavior.
domhhv pushed a commit to domhhv/akash-network-console that referenced this pull request Jun 27, 2026
…kash-network#3360)

PR akash-network#3353 added "attestation" to the global managed-wallet provider JWT
scope unconditionally. Field and non-TEE providers validate the scope
against an enum that does not include "attestation" and reject the entire
JWT with "JWT has invalid claims", so manifest sends fail for every managed
deployment and the deployment never goes active.

Revert the global scope back to the base set. The attestation scope is only
needed to call the provider attestationQuote endpoint, which has no consumer
on this token; it moves to a per-provider granular token for confidential
compute attestation-evidence downloads (akash-network#3359).
domhhv pushed a commit to domhhv/akash-network-console that referenced this pull request Jun 27, 2026
…ute leases (akash-network#3359)

* fix(jwt): remove attestation from global managed-wallet token scope

PR akash-network#3353 added "attestation" to the global managed-wallet provider JWT
scope unconditionally. Field and non-TEE providers validate the scope
against an enum that does not include "attestation" and reject the entire
JWT with "JWT has invalid claims", so manifest sends fail for every managed
deployment and the deployment never goes active.

Revert the global scope back to the base set. The attestation scope is only
needed to call the provider attestationQuote endpoint, which has no consumer
on this token; it moves to a per-provider granular token for confidential
compute attestation-evidence downloads (akash-network#3359).

* feat(deployment): download attestation evidence for confidential compute leases

Surface a download for a running Confidential Compute lease's hardware-signed
attestation evidence (AEP-83 §5). A fresh 64-byte nonce is sent per request so
the returned evidence is bound to that request; the preview distinguishes the
single CPU report from per-GPU reports and saves the full bundle as JSON.

Fetched over the existing JWT provider-proxy path (the managed-wallet token
carries the `attestation` scope) — front-end only, no backend change. Gated
behind the new `ui_confidential_compute` flag and only shown for running
deployments whose on-chain group declares a tee/type.

Part of CON-540

* refactor(deployment): guard attestation download on resolved provider and extract report label

* feat(deployment): mint per-provider token for attestation evidence download

The provider attestationQuote endpoint requires the `attestation` JWT scope.
akash-network#3360 removed that scope from the shared global managed-wallet token because
non-TEE providers reject it. Add useProviderJwt.generateScopedProviderToken to
mint an ephemeral, single-provider granular token carrying only `attestation`,
and use it from useAttestationQuoteMutation instead of the global token.

Only TEE-capable providers accept the scope, and the download trigger already
renders solely for confidential-compute leases, so the scoped token is
requested only where the provider accepts it.

Ref CON-575

* fix(deployment): bind attestation evidence to its nonce and time-bound the fetch

Return the per-request nonce alongside the quote and include it in the
downloaded bundle so the evidence can be verified for freshness against the
hardware-signed report_data. Give the attestation quote fetch a finite 60s
timeout so a stalled provider surfaces the modal's error/retry UI instead of
hanging in a pending state.

Addresses CodeRabbit review feedback on PR akash-network#3359.

* refactor(deployment): drop ui_confidential_compute flag from attestation download

The download already only renders for live leases whose on-chain group
declares a TEE type, so it never surfaces for non-Confidential-Compute
deployments. The feature flag was redundant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants