Conversation
|
✅ No conflicts with other open PRs targeting |
|
I see you updated files related to
|
|
CORA - Pending Reviewers
Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown For more details, see the full review summary. |
|
| # 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. |
There was a problem hiding this comment.
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.
|
|
||
| t.Setenv("REQUIRE_BFT_QUORUM", "true") |
There was a problem hiding this comment.
| 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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"
| 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, | ||
| } |
There was a problem hiding this comment.
| 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. |
There was a problem hiding this comment.
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.




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