Skip to content

[CRE] Support confidential workflow engine path#21444

Closed
nadahalli wants to merge 12 commits intotejaswi/cw-phase4from
tejaswi/cw-e2e-engine-path
Closed

[CRE] Support confidential workflow engine path#21444
nadahalli wants to merge 12 commits intotejaswi/cw-phase4from
tejaswi/cw-e2e-engine-path

Conversation

@nadahalli
Copy link
Contributor

@nadahalli nadahalli commented Mar 6, 2026

Confidential CRE Workflows (implementation plan | E2E test design)

Summary

Three changes needed for the confidential workflows engine-path E2E test (confidential-compute#260). The test validates the full flow: syncer detects confidential=true workflow, creates ConfidentialModule, cron trigger fires, module delegates to the confidential-workflows capability, enclave runs WASM, mock capability on relay DON receives the request.

Stacked on #21298 (ConfidentialModule + attributes plumbing).

Changes

1. Workflow attributes plumbing

RegisterWithContract and registerWorkflowV2 now accept an attributes []byte parameter, passed through to registry.UpsertWorkflow. Confidential workflows set {"confidential":true} so the syncer routes them to ConfidentialModule (see #21298). vault_don_secrets is removed; secrets are fetched dynamically by the enclave at runtime.

All existing callers pass nil (no behavior change). CompileAndDeployConfidentialWorkflow helper added to t_helpers.go for E2E tests that need attributes.

Files: system-tests/lib/cre/workflow/workflow.go, system-tests/tests/test-helpers/t_helpers.go, core/scripts/cre/environment/environment/workflow.go

2. File fetcher HTTP URL support

Confidential workflows have a dual-use binary URL: the on-chain URL must be HTTP (so the enclave can fetch the binary), but the syncer's file-based fetcher reads from the local container filesystem. The file fetcher now detects HTTP(S) URLs and extracts the filename via filepath.Base(u.Path), resolving it against the configured base path.

Without this, the file fetcher rejects the HTTP URL with "request URL is not within the basePath".

Files: core/services/workflows/syncer/fetcher.go, core/services/workflows/syncer/v2/fetcher.go

3. FeatureFlags in confidential engine creation

tryConfidentialEngineCreate in handler.go was missing FeatureFlags: h.featureFlags in the engine config, causing a nil pointer panic when the engine checked feature flags during trigger registration.

File: core/services/workflows/syncer/v2/handler.go

Related PRs

nadahalli added 12 commits March 3, 2026 14:39
…lows

- DB migration 0291: add attributes bytea column to workflow_specs_v2
- WorkflowSpec: add Attributes field, persist through ORM
- Handler: store payload.Attributes, route confidential workflows to
  dedicated engine creation path (tryConfidentialEngineCreate)
- ConfidentialModule: host.ModuleV2 impl that delegates execution to
  the confidential-workflows@1.0.0-alpha capability via CapabilitiesRegistry
- Plugin registration for confidential-workflows in plugins.private.yaml
- IsConfidential now returns (bool, error) instead of silently swallowing
  malformed attributes JSON
- Add info log when routing workflow to confidential execution
- Add unit tests for ParseWorkflowAttributes, IsConfidential,
  ComputeBinaryHash, ConfidentialModule.Execute (success, error paths,
  namespace defaulting, request field forwarding)
- Add handler-level tests verifying confidential routing: confidential
  attributes bypass engine factory, non-confidential uses it, malformed
  attributes return error
- Add comment documenting "main" as VaultDON default namespace
Replace the local ../chainlink-common replace directive with a proper
module reference to commit 177ddc60abbe on the
tejaswi/confidential-workflows-codegen branch. Also fix Namespace
field assignment (string, not *string) to match the published proto.
The tryConfidentialEngineCreate path was missing the WorkflowID
collision diagnostic that tryEngineCreate has. Also remove the #wip
changeset tag before merge.
Will add back when confidential workflows is ready for release.
- Bump chainlink-common to v0.10.1-0.20260303010151-2879e49d71bd (PR #1851)
- Fix Namespace field: proto optional field requires *string, not string
- Fix NewEventHandler call in handler_test.go: insert nil featureFlags arg to match updated signature
0291_change_chain_selector_and_block_height_to_numeric.sql landed on
develop via #21303, so our workflow_attributes migration must be 0292.
Points at ed10df3 which has replace directives removed, so
loopinstall can build from the module cache on a clean checkout.
0292_soft_drop_evm_heads_numeric_id.sql landed on develop, so bump
our migration from 292 to 293.
Plumb workflow attributes through RegisterWithContract so confidential
workflows can set confidential=true and vault_don_secrets on-chain.
Add HTTP URL support to file fetcher (extracts filename from URL path)
for workflows where the on-chain URL is HTTP but syncer reads locally.
Pass FeatureFlags to confidential engine creation.
@nadahalli nadahalli requested review from a team as code owners March 6, 2026 13:17
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

✅ No conflicts with other open PRs targeting tejaswi/cw-phase4

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

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.

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
80.0% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube

@trunk-io
Copy link

trunk-io bot commented Mar 6, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@nadahalli
Copy link
Contributor Author

Superseded by #21603

@nadahalli nadahalli closed this Mar 19, 2026
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