Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

StartupConfig was a near-identical copy of CCHostConfig that existed as a holdover from SGX/ringbuffer days. It added complexity by requiring conversion between types and duplicated field definitions. This consolidates them by making StartupConfig an alias for CCFConfig.

Changes

  • Merged StartupConfig fields into CCFConfig: Runtime fields (startup_host_time, node_data, service_data, sealed_ledger_secret_location) and nested types (Start, Join, Recover) now live directly in CCFConfig
  • Type alias for backward compatibility: using StartupConfig = CCFConfig;
  • Updated all references: Enclave, node, and host code now use CCFConfig directly
  • Removed redundant snapshot_tx_interval: Was duplicate of snapshots.tx_count

Before/After

// Before: Two separate types with conversion
ccf::StartupConfig startup_config(config);  // Sliced from CCHostConfig

// After: Single type, explicit base copy
ccf::CCFConfig startup_config = static_cast<const ccf::CCFConfig&>(config);

Files

  • include/ccf/node/startup_config.h - Consolidated types
  • src/common/configuration.h - Updated JSON serialization
  • src/host/run.cpp - Updated function signatures
  • src/enclave/*.{h,cpp}, src/node/*.h - Use CCFConfig
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove distinct in-memory config type</issue_title>
<issue_description>Another awkward hold-over from the SGX/ringbuffer days. We have a host::CCHostConfig type, that is directly JSON-serialisable - this is what the operators give us. We convert that to a near-identical-bar-some-naming-and-instantiation type called ccf::StartupConfig. One thing that used to do was strip out the host-only bits so the enclave didn't worry about them, but we want to push much of that reasoning into the "enclave" code. It also did some early validation/reification, but we think that can all be pushed to time-of-use, removing some TOCTOU concerns.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Remove distinct in-memory config type Remove distinct in-memory config type Jan 12, 2026
Copilot AI requested a review from achamayou January 12, 2026 16:26
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

2 participants