Skip to content

cre/sdk: add compute_duration_ms to ExecutionResult - #472

Merged
DylanTinianov merged 1 commit into
capabilities-developmentfrom
CRE-6779-compute-duration-ms
Oct 13, 2026
Merged

DylanTinianov merged 1 commit into
capabilities-developmentfrom
CRE-6779-compute-duration-ms

Conversation

@DylanTinianov

@DylanTinianov DylanTinianov commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds optional int64 compute_duration_ms = 5 to sdk.v1alpha.ExecutionResult, plus the regenerated cre/go/sdk/sdk.pb.go and embedded proto sources.

Why

Compute metering (CRE-6779) needs one duration per execution that is right for both ordinary and confidential runs. The module that executes the workflow sets it on the result it already returns: the WASM host times the guest run; the confidential module carries over the enclave-reported execution_duration_ms (#469). The engine meters what is reported and no longer needs to know which module ran, or to time the run itself.

Optional field: presence distinguishes an unavailable measurement from a measured zero. Backward compatible for SDKs that build ExecutionResult.

Consumers

  • chainlink-common #2464 (WASM host sets it)
  • chainlink #23858 (engine meters it; confidential module sets it)

Same change targeting main as a cherry-pick per the CRE branch policy: see the companion PR.

Testing

cd cre/go && go generate ./... && go build ./... && go test ./...; cd cre/verify && go run .. Regenerated with the pinned protoc 29.3 / protoc-gen-go 1.36.6, so only the three touched files change.

🤖 Generated with Claude Code

The module that executes a workflow reports the run's wall-clock duration
on the result it returns: the WASM host times the guest run, and the
confidential module carries over the enclave-reported duration. The
workflow engine meters whatever is reported as cre:workflow:compute, so it
no longer needs to know which module executed, or time the run itself.

Presence distinguishes an unavailable measurement from a measured zero.
Regenerated sdk.pb.go and the embedded proto sources with the pinned
generator versions (protoc 29.3, protoc-gen-go 1.36.6).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1860207

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Regenerate Protobuf Files / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedOct 13, 2026, 9:14 PM

@DylanTinianov
DylanTinianov merged commit e622e8b into capabilities-development Oct 13, 2026
11 checks passed
@DylanTinianov
DylanTinianov deleted the CRE-6779-compute-duration-ms branch October 13, 2026 21:20
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