Skip to content

Billing: meter confidential compute duration - #23961

Closed
DylanTinianov wants to merge 1 commit into
CRE-6779-compute-usage-recordsfrom
CRE-6920-confidential-compute-usage
Closed

DylanTinianov wants to merge 1 commit into
CRE-6779-compute-usage-recordsfrom
CRE-6920-confidential-compute-usage

Conversation

@DylanTinianov

@DylanTinianov DylanTinianov commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

CRE-6920 (parent CRE-6778). Stacked on #23858 (compute usage records). Depends on chainlink-common #2457 and the enclave side CRE-6919 (chainlink-confidential-compute).

What

#23858 skipped the compute record for executions delegated to the confidential module, because the engine's computeDuration for those is the enclave round trip. This PR bills them from the enclave's own measurement:

  • ConfidentialModule.Execute stores ConfidentialWorkflowResponse.execution_duration_ms (when present) for the execution.
  • ConfidentialExecutionTracker.TookExecution now returns a ConfidentialExecution{Measured, Duration} with the took flag.
  • baseEngine.emitComputeUsage uses that duration for confidential executions. If the enclave did not report one (older enclave), it logs a warning and emits nothing rather than billing the round trip.

Same record shape as ordinary compute: cre:workflow:compute, value in ms, EventId = execution id, log line Emitted capability usage meter record.

Tests

compute_usage_test.go: enclave-measured duration is billed (value 1234), unmeasured confidential execution emits nothing and warns.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting CRE-6779-compute-usage-records

@github-actions

github-actions Bot commented Oct 9, 2026

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.

@DylanTinianov DylanTinianov changed the title workflows/v2: meter confidential compute from the enclave-reported duration (CRE-6920) Billing: meter confidential compute duration Oct 9, 2026
@trunk-io

trunk-io Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@DylanTinianov
DylanTinianov force-pushed the CRE-6920-confidential-compute-usage branch from 4e22826 to 147f757 Compare October 9, 2026 19:14
…ration (CRE-6920)

ConfidentialModule records the enclave's execution_duration_ms for each
execution it handles. The engine's compute usage emission now bills that
value for confidential executions instead of skipping them: the engine's own
computeDuration is the enclave round trip, not the customer's compute. When
an older enclave reports no duration the record is skipped with a warning.

ConfidentialExecutionTracker.TookExecution returns the ConfidentialExecution
(Measured, Duration) alongside the took flag.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@DylanTinianov
DylanTinianov force-pushed the CRE-6920-confidential-compute-usage branch from 147f757 to 6dee883 Compare October 9, 2026 19:19
@cl-sonarqube-production

Copy link
Copy Markdown

@DylanTinianov
DylanTinianov deleted the CRE-6920-confidential-compute-usage branch October 15, 2026 15:37
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.

1 participant