Skip to content

confidential workflows e2e tests - #23397

Open
vreff wants to merge 19 commits into
developfrom
conf-e2e
Open

confidential workflows e2e tests#23397
vreff wants to merge 19 commits into
developfrom
conf-e2e

Conversation

@vreff

@vreff vreff commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Adds an end-to-end test for confidential workflows, using the enclave test harness from chainlink-confidential-compute.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@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.

@trunk-io

trunk-io Bot commented Aug 12, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestScripts/nodes/evm/list The test failed without providing specific error details, indicating a possible test setup or environment issue. Logs ↗︎
TestScripts/nodes/evm/list/list The test failed because the server could not connect to localhost on the specified port, indicating the server was not running or accessible. Logs ↗︎

View Full Report ↗︎Docs

@vreff
vreff requested a review from a team as a code owner August 12, 2026 20:34
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
* 11 @smartcontractkit/foundations, @smartcontractkit/core
/system-tests/lib/cre/features/confidentialrelay/ 1 @smartcontractkit/privacy
/.github/** 1 @smartcontractkit/devex-cicd, @smartcontractkit/devex-tooling, @smartcontractkit/core
go.md 1 @smartcontractkit/core, @smartcontractkit/foundations
go.mod 3 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 3 @smartcontractkit/core, @smartcontractkit/foundations

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

@cl-sonarqube-production

Copy link
Copy Markdown

Comment on lines +334 to +335
# to that repo's fake-enclave runner. Check it out at the same revision the
# plugin is built from so the capability and the enclave app always match.

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.

Would it be worth making sure that the two revisions never diverge? Could read it from system-tests/tests/go.mod instead of what is listed as the public plugin.

Comment on lines +92 to +93

t.Setenv("REQUIRE_BFT_QUORUM", "true")

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.

Suggested change
t.Setenv("REQUIRE_BFT_QUORUM", "true")
// Both env vars below configure the enclave *host servers*, not this repo:
// the harness launches them with this process's environment inherited
// (testhelpers.MustSetupEnclaveWithEnv appends to os.Environ())
// REQUIRE_BFT_QUORUM makes each host demand a 2f+1 BFT supermajority of node
// signatures instead of f+1 (enclave/nitro/host), matching the relay's
// requireBFTQuorum = true in the topology TOML.
t.Setenv("REQUIRE_BFT_QUORUM", "true")

t.Helper()

root := os.Getenv("CONFIDENTIAL_COMPUTE_ROOT")
require.NotEmpty(t, root,

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.

Maybe make this a t.Skip instead so it doesn't fail locally for people?

return fmt.Sprintf("%s://%s:%d%s", incoming.Protocol, host, incoming.ExternalPort, incoming.Path)
}

// injectVaultPublicKey writes the vault DON's DKG public key and threshold into

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.

Comment looks out of place. Move it to above injectVaultPublicKey.


// DefaultGatewayWhitelistConfig builds the Gateway Connector's outbound allowlist:
// the caller's extra ports plus the fake service ports the config declares. Shared
// by `cre env start` and by tests that call StartCLIEnvironment directly, so both

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.

Seems no one one outside this file calls this on this branch, so we could make it private and update the comment to remove saying it is shared "and by tests"

Comment on lines +306 to +327
workers, err := testEnv.Dons.MustWorkflowDON().Workers()
require.NoError(t, err, "failed to get worker nodes from topology")
require.NotEmpty(t, workers, "workflow DON has no worker nodes")

signers := make([][]byte, 0, len(workers))
for _, node := range workers {
signers = append(signers, node.Keys.P2PKey.PeerID[:])
}

masterPublicKey, err := hex.DecodeString(vaultPublicKey)
require.NoError(t, err, "failed to hex-decode vault public key")

// don.F for an N-node DON is N/3; the enclave's own F/T is 2*don.F + 1.
donF := uint32(len(workers) / 3) //nolint:gosec // G115: the worker count comes from the topology
quorum := 2*donF + 1

config := cctypes.EnclaveConfig{
Signers: signers,
MasterPublicKey: masterPublicKey,
T: quorum,
F: quorum,
}

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.

Suggested change
workers, err := testEnv.Dons.MustWorkflowDON().Workers()
require.NoError(t, err, "failed to get worker nodes from topology")
require.NotEmpty(t, workers, "workflow DON has no worker nodes")
signers := make([][]byte, 0, len(workers))
for _, node := range workers {
signers = append(signers, node.Keys.P2PKey.PeerID[:])
}
masterPublicKey, err := hex.DecodeString(vaultPublicKey)
require.NoError(t, err, "failed to hex-decode vault public key")
// don.F for an N-node DON is N/3; the enclave's own F/T is 2*don.F + 1.
donF := uint32(len(workers) / 3) //nolint:gosec // G115: the worker count comes from the topology
quorum := 2*donF + 1
config := cctypes.EnclaveConfig{
Signers: signers,
MasterPublicKey: masterPublicKey,
T: quorum,
F: quorum,
}
don := testEnv.Dons.MustWorkflowDON()
workers, err := don.Workers()
require.NoError(t, err, "failed to get worker nodes from topology")
require.NotEmpty(t, workers, "workflow DON has no worker nodes")
signers := make([][]byte, 0, len(workers))
for _, node := range workers {
signers = append(signers, node.Keys.P2PKey.PeerID[:])
}
masterPublicKey, err := hex.DecodeString(vaultPublicKey)
require.NoError(t, err, "failed to hex-decode vault public key")
// Quorum tracks the DON's registered fault tolerance (Don.F, computed as
// (workers-1)/3 in NewDON), not a re-derivation from the worker count: the
// two diverge for e.g. 6-node DONs, and the enclave would then demand more
// signatures than the DON can produce.
quorum := 2*uint32(don.F) + 1
config := cctypes.EnclaveConfig{
Signers: signers,
MasterPublicKey: masterPublicKey,
T: quorum,
F: quorum,
}

Dynamically determine F instead of assuming it's always 1.

}
}

// UseFakeEnclaveForTest reports whether the harness selected fake enclaves.

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.

Nit: Necessity of this one line function is questionable:
UseFakeEnclaveForTest() (helpers.go:360) is a pure one-line wrapper over testhelpers.UseFakeEnclave(), and the test file already calls testhelpers.UseFakeEnclave() directly (test.go:79). Drop the wrapper, call the source in both places.

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