Skip to content

Unify operator and node startup configuration - #8309

Open
Amaury Chamayou (achamayou) with Copilot wants to merge 11 commits into
mainfrom
copilot/remove-distinct-in-memory-config-type-again
Open

Amaury Chamayou (achamayou) with Copilot wants to merge 11 commits into
mainfrom
copilot/remove-distinct-in-memory-config-type-again

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Startup converted the operator configuration into a near-identical in-memory type, preserving an obsolete host/enclave split and eagerly loading file inputs. This PR removes that split while preserving the operator JSON schema and node-to-node genesis format.

What changed

  • Single configuration type

    • Replace host::HostConfig and ccf::StartupConfig with public ccf::CCFConfig; remove the host-side conversion.
    • Keep StartType public and node-owned in ccf/node/start_type.h.
    • Preserve command settings under command.start, command.join, and command.recover.
  • Node-owned input loading

    • Resolve file-backed inputs in node code where needed.
    • Retain runtime node data and pin service certificates across join retries, snapshot fetching, and recovery.
    • Move environment expansion beside its production consumer under src/node/, avoiding a new node -> host back-edge.
  • Public API and serialization

    • Expose configuration through ccf/node/configuration.h and resolved node data separately on NodeConfigurationState.
    • Keep JSON declarations with their public configuration types, including consensus and service configuration, without introducing private includes from public headers.
    • Preserve JSON defaults and round-trip behavior, including pending_node_timeout and current main's additional-worker behavior.
    const auto& state = node_configuration->get();
    const auto& join = state.node_config.command.join;
    const auto& node_data = state.node_data;
  • Source dependency boundary

    • Remove all four production includes of common/configuration.h from src/node.
    • Enforce the measured common allowlist: crypto, ds, node, and service.
    • Make the service configuration table dependency in node/internal_tables_access.h explicit rather than relying on a transitive include.
    • Make enclave/entry_points.h include the owning common/configuration.h declaration for EnclaveConfig directly.

Measured dependency graph

Measured on bbe4941d1 with the production-source projection used by scripts/check-source-dependencies.py:

Metric Result
Source components 25
Direct internal edges 88
Cyclic components 6
Acyclic components 19
Total SCCs 20
Cyclic SCCs 1
Largest SCC 6

The remaining cyclic SCC is consensus, endpoints, js, kv, node, and service. common is a singleton SCC, and node -> common is absent. Relative to the documented current-main baseline in #3517, this removes three displayed source-folder edges and reduces the cyclic core from seven components to six.

Compatibility and safety

  • Operator configuration keys, defaults, and serialization remain compatible.
  • Existing genesis request serialization remains unchanged.
  • Public headers include only public headers.
  • File loading remains at the node-side point of use, preserving the PR's TOCTOU improvement.

Validation

  • cmake -S . -B build -GNinja
  • cmake --build build --target ccf ccf_kv ccf_launcher env_test node_frontend_test frontend_test open_service_test
  • ctest --test-dir build -R env_test --no-tests=error --output-on-failure
  • ctest --test-dir build -R frontend_test --no-tests=error --output-on-failure
  • ctest --test-dir build -R open_service_test --no-tests=error --output-on-failure
  • scripts/includes-checks.sh
  • scripts/ascii-checks.sh
  • ClangFormat 18 check on changed C/C++ files
  • Gersemi 0.27.0 check on CMakeLists.txt
  • Prettier check on scripts/source-dependencies.json

Closes #7565

Part of #3517

Copilot AI and others added 3 commits September 8, 2026 08:40
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove distinct in-memory config type Unify operator and node startup configuration Sep 8, 2026

Copilot AI left a comment

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.

🔵 Needs a closer look

It changes startup, recovery, attestation, and join trust-anchor handling across core host and node boundaries.

Pull request overview

Unifies operator and node startup configuration under the public ccf::CCFConfig API.

Changes:

  • Removes duplicate host/startup configuration types and migrates consumers.
  • Moves file-backed input loading into node startup paths.
  • Preserves genesis serialization and adds configuration/data retention tests.

Custom instructions used

  • .github/copilot-instructions.md
  • .github/instructions/changelog.instructions.md
  • .github/instructions/reviewing.instructions.md
File summaries
File Description
CHANGELOG.md Documents the public API migration.
CMakeLists.txt Moves environment utilities into the CCF implementation.
include/ccf/node/configuration.h Defines the unified configuration type.
include/ccf/node/node_configuration_interface.h Exposes resolved node data separately.
include/ccf/node/start_type.h Adds the public startup-mode enum.
python/pyproject.toml Updates the package version.
samples/apps/logging/logging.cpp Migrates node-data access.
src/common/configuration.h Updates JSON serialization declarations.
src/common/enclave_interface_types.h Uses the public startup-mode definition.
src/enclave/enclave.h Accepts unified configuration.
src/enclave/entry_points.h Updates enclave entry-point signature.
src/enclave/main.cpp Passes unified startup settings.
src/host/configuration.h Removes the redundant host configuration.
src/host/run.cpp Removes host-side conversion and input loading.
src/kv/kv_types.h Updates configuration include.
src/node/node_configuration_subsystem.h Publishes configuration and resolved node data.
src/node/node_state.h Loads and retains startup inputs in node state.
src/node/recovery_decision_protocol.h Updates configuration include.
src/node/recovery_snapshot_ledger.h Updates configuration include.
src/node/rpc/network_identity_subsystem.h Updates configuration include.
src/node/rpc/node_call_types.h Preserves the genesis wire model.
src/node/rpc/node_frontend.h Reads resolved node data.
src/node/rpc/node_interface.h Exposes unified configuration and node data.
src/node/rpc/test/frontend_test.cpp Updates the test configuration fixture.
src/node/rpc/test/node_frontend_test.cpp Tests configuration and genesis serialization.
tests/governance.py Tests file-backed startup data retention.
Review details
  • Files reviewed: 26/26 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Main moved the curl client to src/http_client (#8285) and reworked SNP
attestation parsing and COSE signature storage in node_state.h (#8083,
#8334). Keep this PR's config.command.join path in the join callback with
the ccf::http_client rename, drop the stale http/curl.h include, and move
the changelog entry into the unreleased 7.0.16 section, keeping the
Python SDK version at 7.0.16.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@achamayou
Amaury Chamayou (achamayou) marked this pull request as ready for review September 21, 2026 17:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The join-retry check added for node-owned node_data loading queried GET /node/network/nodes/self on a pending node, but a pending node's KV is not ready and its frontend only serves Command endpoints, so it always answered 503 FrontendNotOpen and governance_test failed in bucket_c on every CI run of this branch. Observe the property through the primary instead: after the input file is deleted, accepted join retries keep rewriting the pending entry (last_written advances) and the recorded node_data is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

Remove distinct in-memory config type

3 participants