From ee57b70b84dbd0442a5437500e366ff99f686cad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 15:58:45 +0000 Subject: [PATCH 01/12] Remove stale cchost mentions from tests, samples, schema and host config Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/490c0f29-f328-442f-b280-591c6a302c40 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- CMakeLists.txt | 4 +- doc/conf.py | 2 +- .../{cchost_config.json => host_config.json} | 0 ...virtual_js.json => config_virtual_js.json} | 0 samples/minimal_ccf/ccf_runtime/Dockerfile | 3 +- samples/minimal_ccf/run_app.sh | 2 +- src/host/configuration.h | 50 +++++++++---------- src/host/run.cpp | 20 ++++---- tests/historical_query_cache.py | 2 +- tests/historical_query_perf.py | 2 +- tests/infra/e2e_args.py | 2 +- tests/infra/piccolo_driver.py | 2 +- tests/infra/remote.py | 3 ++ tests/infra/runner.py | 4 +- tests/lts_compatibility.py | 2 +- 15 files changed, 50 insertions(+), 48 deletions(-) rename doc/host_config_schema/{cchost_config.json => host_config.json} (100%) rename samples/minimal_ccf/app/{cchost_config_virtual_js.json => config_virtual_js.json} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 187cf45bcad1..805a0d9b4a12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,14 +355,14 @@ configure_file( install(FILES ${CCF_DIR}/include/ccf/version.h DESTINATION include/ccf) file( - READ ${CCF_DIR}/doc/host_config_schema/cchost_config.json + READ ${CCF_DIR}/doc/host_config_schema/host_config.json HOST_CONFIG_SCHEMA ) set_property( DIRECTORY APPEND PROPERTY - CMAKE_CONFIGURE_DEPENDS ${CCF_DIR}/doc/host_config_schema/cchost_config.json + CMAKE_CONFIGURE_DEPENDS ${CCF_DIR}/doc/host_config_schema/host_config.json ) configure_file( ${CCF_DIR}/src/host/config_schema.h.in diff --git a/doc/conf.py b/doc/conf.py index e4ced9c89c01..269d8059c828 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -484,7 +484,7 @@ def setup(app): ) # configuration generator - input_file_path = doc_dir / "host_config_schema/cchost_config.json" + input_file_path = doc_dir / "host_config_schema/host_config.json" output_file_path = doc_dir / "operations/generated_config.rst" if os.path.exists(input_file_path): diff --git a/doc/host_config_schema/cchost_config.json b/doc/host_config_schema/host_config.json similarity index 100% rename from doc/host_config_schema/cchost_config.json rename to doc/host_config_schema/host_config.json diff --git a/samples/minimal_ccf/app/cchost_config_virtual_js.json b/samples/minimal_ccf/app/config_virtual_js.json similarity index 100% rename from samples/minimal_ccf/app/cchost_config_virtual_js.json rename to samples/minimal_ccf/app/config_virtual_js.json diff --git a/samples/minimal_ccf/ccf_runtime/Dockerfile b/samples/minimal_ccf/ccf_runtime/Dockerfile index ac7d91bf617e..9e03b4f3032b 100644 --- a/samples/minimal_ccf/ccf_runtime/Dockerfile +++ b/samples/minimal_ccf/ccf_runtime/Dockerfile @@ -16,8 +16,7 @@ RUN mkdir /staging \ && rm -rf /staging/etc/tdnf \ && rm -rf /staging/run/* \ && rm -rf /staging/var/cache/tdnf \ - && find /staging/var/log -type f -size +0 -delete \ - && mv /staging/opt/ccf_${PLATFORM}/bin/cchost /staging/usr/bin/cchost + && find /staging/var/log -type f -size +0 -delete FROM mcr.microsoft.com/azurelinux/distroless/minimal:3.0 diff --git a/samples/minimal_ccf/run_app.sh b/samples/minimal_ccf/run_app.sh index 87f8d9081d8c..4aba7cbe4a2c 100755 --- a/samples/minimal_ccf/run_app.sh +++ b/samples/minimal_ccf/run_app.sh @@ -10,6 +10,6 @@ docker run \ --name ccf \ --rm -v "$(pwd)/app:/app" \ -p 8080:8080 \ - ${my_app_target} cchost --config /app/cchost_config_${PLATFORM}_js.json & + ${my_app_target} js_generic --config /app/config_${PLATFORM}_js.json & sleep 3 && docker rm -f ccf diff --git a/src/host/configuration.h b/src/host/configuration.h index 88940b09a123..e19e5bcdfad8 100644 --- a/src/host/configuration.h +++ b/src/host/configuration.h @@ -38,7 +38,7 @@ namespace host data_json_file, recovery_role); - struct CCHostConfig : public ccf::CCFConfig + struct HostConfig : public ccf::CCFConfig { ccf::ds::TimeString tick_interval = {"10ms"}; ccf::ds::TimeString slow_io_logging_threshold = {"10ms"}; @@ -127,38 +127,38 @@ namespace host Command command = {}; }; - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::OutputFiles); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::OutputFiles); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::OutputFiles); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig::OutputFiles); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig::OutputFiles, + HostConfig::OutputFiles, node_certificate_file, pid_file, node_to_node_address_file, rpc_addresses_file); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Logging); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Logging); - DECLARE_JSON_OPTIONAL_FIELDS(CCHostConfig::Logging, format); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Logging); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Logging); + DECLARE_JSON_OPTIONAL_FIELDS(HostConfig::Logging, format); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Memory); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Memory); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Memory); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Memory); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig::Memory, circuit_size, max_msg_size, max_fragment_size); + HostConfig::Memory, circuit_size, max_msg_size, max_fragment_size); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Start); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Start); DECLARE_JSON_REQUIRED_FIELDS( - CCHostConfig::Command::Start, members, constitution_files); + HostConfig::Command::Start, members, constitution_files); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig::Command::Start, + HostConfig::Command::Start, service_configuration, initial_service_certificate_validity_days, service_subject_name, cose_signatures); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Join); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command::Join, target_rpc_address); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Join); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command::Join, target_rpc_address); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig::Command::Join, + HostConfig::Command::Join, retry_timeout, follow_redirect, fetch_recent_snapshot, @@ -167,22 +167,22 @@ namespace host fetch_snapshot_max_size, host_data_transparent_statement_path); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Recover); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command::Recover); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Recover); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command::Recover); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig::Command::Recover, + HostConfig::Command::Recover, initial_service_certificate_validity_days, previous_service_identity_file); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command, type); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command, type); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig::Command, service_certificate_file, start, join, recover); + HostConfig::Command, service_certificate_file, start, join, recover); - DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(CCHostConfig, ccf::CCFConfig); - DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig, command); + DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(HostConfig, ccf::CCFConfig); + DECLARE_JSON_REQUIRED_FIELDS(HostConfig, command); DECLARE_JSON_OPTIONAL_FIELDS( - CCHostConfig, + HostConfig, tick_interval, slow_io_logging_threshold, node_client_interface, diff --git a/src/host/run.cpp b/src/host/run.cpp index 0c8fad325114..c9a046e5a383 100644 --- a/src/host/run.cpp +++ b/src/host/run.cpp @@ -96,7 +96,7 @@ static constexpr size_t retry_interval_ms = 100; namespace ccf { - void validate_and_adjust_recovery_threshold(host::CCHostConfig& config) + void validate_and_adjust_recovery_threshold(host::HostConfig& config) { if (config.command.type != StartType::Start) { @@ -191,7 +191,7 @@ namespace ccf }; void setup_rpc_interfaces( - host::CCHostConfig& config, + host::HostConfig& config, asynchost::RPCConnections& rpc, asynchost::RPCConnections& rpc_udp) { @@ -341,7 +341,7 @@ namespace ccf } void populate_config_for_start( - const host::CCHostConfig& config, ccf::StartupConfig& startup_config) + const host::HostConfig& config, ccf::StartupConfig& startup_config) { for (auto const& member : config.command.start.members) { @@ -404,7 +404,7 @@ namespace ccf } void populate_config_for_join( - const host::CCHostConfig& config, ccf::StartupConfig& startup_config) + const host::HostConfig& config, ccf::StartupConfig& startup_config) { LOG_INFO_FMT( "Creating new node - join existing network at {}", @@ -428,7 +428,7 @@ namespace ccf } void populate_config_for_recover( - const host::CCHostConfig& config, ccf::StartupConfig& startup_config) + const host::HostConfig& config, ccf::StartupConfig& startup_config) { LOG_INFO_FMT("Creating new node - recover"); startup_config.initial_service_certificate_validity_days = @@ -446,7 +446,7 @@ namespace ccf } std::optional create_enclave_node( - const host::CCHostConfig& config, + const host::HostConfig& config, messaging::BufferProcessor& buffer_processor, ringbuffer::Circuit& circuit, EnclaveConfig& enclave_config, @@ -508,7 +508,7 @@ namespace ccf } void write_certificates_to_disk( - const host::CCHostConfig& config, + const host::HostConfig& config, const std::vector& node_cert, const std::vector& service_cert) { @@ -529,7 +529,7 @@ namespace ccf } } - void run_enclave_threads(const host::CCHostConfig& config) + void run_enclave_threads(const host::HostConfig& config) { auto enclave_thread_start = [&](threading::ThreadID thread_id) { threading::set_current_thread_id(thread_id); @@ -573,7 +573,7 @@ namespace ccf } std::optional run_main_loop( - host::CCHostConfig& config, + host::HostConfig& config, messaging::BufferProcessor& buffer_processor, ringbuffer::Circuit& circuit, EnclaveConfig& enclave_config, @@ -954,7 +954,7 @@ namespace ccf schema_error_msg.value())); } - host::CCHostConfig config = config_json; + host::HostConfig config = config_json; if (config.logging.format == host::LogFormat::JSON) { diff --git a/tests/historical_query_cache.py b/tests/historical_query_cache.py index 542c1ac39afe..4e3646d3d45a 100644 --- a/tests/historical_query_cache.py +++ b/tests/historical_query_cache.py @@ -246,7 +246,7 @@ def run(args): args.package = "samples/apps/logging/logging" args.nodes = infra.e2e_args.min_nodes(args, f=1) args.initial_member_count = 1 - args.sig_ms_interval = 1000 # Set to cchost default value + args.sig_ms_interval = 1000 # Set to node default value args.historical_cache_soft_limit = "20KB" run(args) diff --git a/tests/historical_query_perf.py b/tests/historical_query_perf.py index 21c594ebfa5a..0257d028fbb0 100644 --- a/tests/historical_query_perf.py +++ b/tests/historical_query_perf.py @@ -219,5 +219,5 @@ def add(parser): args.package = "samples/apps/logging/logging" args.nodes = infra.e2e_args.max_nodes(args, f=0) args.initial_member_count = 1 - args.sig_ms_interval = 1000 # Set to cchost default value + args.sig_ms_interval = 1000 # Set to node default value run(args) diff --git a/tests/infra/e2e_args.py b/tests/infra/e2e_args.py index 78b353500d09..9a135f836fe2 100644 --- a/tests/infra/e2e_args.py +++ b/tests/infra/e2e_args.py @@ -65,7 +65,7 @@ def cli_args( parser.add_argument( "-b", "--binary-dir", - help="Path to CCF binaries (cchost, scurl, keygenerator)", + help="Path to CCF binaries (node executable, scurl, keygenerator)", default=".", ) parser.add_argument( diff --git a/tests/infra/piccolo_driver.py b/tests/infra/piccolo_driver.py index e7150307876d..4efd893bd321 100644 --- a/tests/infra/piccolo_driver.py +++ b/tests/infra/piccolo_driver.py @@ -81,7 +81,7 @@ def run(get_command, args): args.initial_user_count = 3 args.sig_ms_interval = 100 - args.ledger_chunk_bytes = "5MB" # Set to cchost default value + args.ledger_chunk_bytes = "5MB" # Set to node default value LOG.info("Starting nodes on {}".format(hosts)) diff --git a/tests/infra/remote.py b/tests/infra/remote.py index b8a7acaa5faa..6a5eaf022a2f 100644 --- a/tests/infra/remote.py +++ b/tests/infra/remote.py @@ -284,6 +284,9 @@ def get_result(self, line_count): class CCFRemote(object): + # Default binary name for older (pre-7.x) releases which still shipped a + # separate "cchost" entry-point. For 7.x and later this is overridden with + # the application enclave binary path below. BIN = "cchost" TEMPLATE_CONFIGURATION_FILE = "config.jinja" DEPS = [] diff --git a/tests/infra/runner.py b/tests/infra/runner.py index 601893a4ea52..88110424cf61 100644 --- a/tests/infra/runner.py +++ b/tests/infra/runner.py @@ -74,8 +74,8 @@ def run(get_command, args): hosts = infra.e2e_args.nodes(args, minimum_number_of_local_nodes(args)) args.initial_user_count = 3 - args.sig_ms_interval = 1000 # Set to cchost default value - args.ledger_chunk_bytes = "5MB" # Set to cchost default value + args.sig_ms_interval = 1000 # Set to node default value + args.ledger_chunk_bytes = "5MB" # Set to node default value LOG.info("Starting nodes on {}".format(hosts)) diff --git a/tests/lts_compatibility.py b/tests/lts_compatibility.py index 48b6e19c4070..52bb367ce14c 100644 --- a/tests/lts_compatibility.py +++ b/tests/lts_compatibility.py @@ -821,7 +821,7 @@ def add(parser): args.package = "js_generic" args.nodes = infra.e2e_args.max_nodes(args, f=0) args.jwt_key_refresh_interval_s = 3 - args.sig_ms_interval = 1000 # Set to cchost default value + args.sig_ms_interval = 1000 # Set to node default value # Hardcoded because host only accepts info log on release builds args.log_level = "info" From e32429d74cd35224b2bc32c1e5268b2ab0891fb8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 16:28:35 +0000 Subject: [PATCH 02/12] Make CCFRemote.BIN empty with comment that it must be set Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/16102018-130f-491a-87f7-26ad84e003bf Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- tests/infra/remote.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/infra/remote.py b/tests/infra/remote.py index 6a5eaf022a2f..17a4a379cea3 100644 --- a/tests/infra/remote.py +++ b/tests/infra/remote.py @@ -284,10 +284,8 @@ def get_result(self, line_count): class CCFRemote(object): - # Default binary name for older (pre-7.x) releases which still shipped a - # separate "cchost" entry-point. For 7.x and later this is overridden with - # the application enclave binary path below. - BIN = "cchost" + # Must be set by the caller (e.g. to the path of the node executable). + BIN = "" TEMPLATE_CONFIGURATION_FILE = "config.jinja" DEPS = [] @@ -386,7 +384,7 @@ def __init__( self.rpc_addresses_file = f"{local_node_id}.rpc_addresses" self.BIN = infra.path.build_bin_path(self.BIN, binary_dir=binary_dir) - # 7.x releases combined binaries and removed the separate cchost entry-point + # 7.x and later releases use the application binary directly if major_version is None or major_version >= 7: self.BIN = enclave_file From c10ab58c2d7dc88da3ca7a5a28eb41a49fb4463a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 18:03:06 +0000 Subject: [PATCH 03/12] Revert comment change in CCFRemote.__init__ Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/944eaa0f-7d80-4808-b871-e5a88fd00c0e Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- tests/infra/remote.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/infra/remote.py b/tests/infra/remote.py index 17a4a379cea3..34d9bbdf5a16 100644 --- a/tests/infra/remote.py +++ b/tests/infra/remote.py @@ -384,7 +384,7 @@ def __init__( self.rpc_addresses_file = f"{local_node_id}.rpc_addresses" self.BIN = infra.path.build_bin_path(self.BIN, binary_dir=binary_dir) - # 7.x and later releases use the application binary directly + # 7.x releases combined binaries and removed the separate cchost entry-point if major_version is None or major_version >= 7: self.BIN = enclave_file From 9a8164801ab666a8587a3f3ecb3e03c4fd75d438 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 19:29:44 +0000 Subject: [PATCH 04/12] Stage js_generic on PATH in minimal_ccf runtime Dockerfile Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/0a183e74-f64f-4978-9771-7977aa95667e Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com> --- samples/minimal_ccf/ccf_runtime/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/minimal_ccf/ccf_runtime/Dockerfile b/samples/minimal_ccf/ccf_runtime/Dockerfile index 9e03b4f3032b..c8f1b36ea646 100644 --- a/samples/minimal_ccf/ccf_runtime/Dockerfile +++ b/samples/minimal_ccf/ccf_runtime/Dockerfile @@ -16,7 +16,10 @@ RUN mkdir /staging \ && rm -rf /staging/etc/tdnf \ && rm -rf /staging/run/* \ && rm -rf /staging/var/cache/tdnf \ - && find /staging/var/log -type f -size +0 -delete + && find /staging/var/log -type f -size +0 -delete \ + # Stage js_generic on PATH as a sample application binary. Replace this + # with the actual intended application binary when adapting this image. + && mv /staging/opt/ccf_${PLATFORM}/bin/js_generic /staging/usr/bin/js_generic FROM mcr.microsoft.com/azurelinux/distroless/minimal:3.0 From 9972214007eecc259f95ef8683cbdc524679a773 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 10:26:11 +0000 Subject: [PATCH 05/12] Make CCFRemote binary_name an explicit constructor argument Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/b59a5b76-ce53-4ca6-a87f-bbd792a86407 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- tests/infra/node.py | 5 +++++ tests/infra/remote.py | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/infra/node.py b/tests/infra/node.py index 13608c87f2ac..cdbe9f16e5af 100644 --- a/tests/infra/node.py +++ b/tests/infra/node.py @@ -330,6 +330,11 @@ def _setup( lib_path, workspace, common_dir, + binary_name=( + "cchost" + if self.major_version is not None and self.major_version < 7 + else None + ), binary_dir=self.binary_dir, label=label, local_node_id=self.local_node_id, diff --git a/tests/infra/remote.py b/tests/infra/remote.py index 34d9bbdf5a16..e130fc122dab 100644 --- a/tests/infra/remote.py +++ b/tests/infra/remote.py @@ -284,8 +284,6 @@ def get_result(self, line_count): class CCFRemote(object): - # Must be set by the caller (e.g. to the path of the node executable). - BIN = "" TEMPLATE_CONFIGURATION_FILE = "config.jinja" DEPS = [] @@ -295,6 +293,7 @@ def __init__( enclave_file, workspace, common_dir, + binary_name=None, label="", binary_dir=".", local_node_id=None, @@ -383,10 +382,12 @@ def __init__( self.node_address_file = f"{local_node_id}.node_address" self.rpc_addresses_file = f"{local_node_id}.rpc_addresses" - self.BIN = infra.path.build_bin_path(self.BIN, binary_dir=binary_dir) # 7.x releases combined binaries and removed the separate cchost entry-point if major_version is None or major_version >= 7: self.BIN = enclave_file + else: + assert binary_name, "binary_name must be provided when major_version < 7" + self.BIN = infra.path.build_bin_path(binary_name, binary_dir=binary_dir) self.common_dir = common_dir self.pub_host = host.get_primary_interface().public_host From b5da74e493411dc90c83b65204ea19e543dfda5a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 12:58:19 +0000 Subject: [PATCH 06/12] Initial plan From 7215a36552058fccc76180942d4888c788646840 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 12:59:15 +0000 Subject: [PATCH 07/12] Initial plan From f1025bb83bae0ea7a374bc1cceee49ff073791da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 13:00:53 +0000 Subject: [PATCH 08/12] Fix CMake formatting using CI formatting script Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/fb2c3354-e196-424f-8e7a-9d52825c3668 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 805a0d9b4a12..4bb473609b36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,10 +354,7 @@ configure_file( ) install(FILES ${CCF_DIR}/include/ccf/version.h DESTINATION include/ccf) -file( - READ ${CCF_DIR}/doc/host_config_schema/host_config.json - HOST_CONFIG_SCHEMA -) +file(READ ${CCF_DIR}/doc/host_config_schema/host_config.json HOST_CONFIG_SCHEMA) set_property( DIRECTORY APPEND From 32fb0c5c7624c7bf630be7846a2f082cda70a875 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 13:08:48 +0000 Subject: [PATCH 09/12] Add Copilot instruction to run CI checks and CMake format fix flow Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/700d0514-2e53-4921-8c30-587a02f8f30e Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- .github/copilot-instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9b3fe8b4d299..6af4329e587a 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -61,6 +61,7 @@ sphinx-build --fail-on-warning -b html doc doc/html ## Code changes - `ci-checks.sh` must run successfully before any commit is pushed. +- Always run `./scripts/ci-checks.sh` in the same way as CI before pushing. If it reports `CMake format` failures, run `./scripts/cmake-format-checks.sh -f` and re-run `./scripts/ci-checks.sh` before committing. - All tests in `ci.yml` must pass before a PR can be merged. Consider which are likely to be affected by your changes and run those locally before pushing. - Take particular care with any changes that may affect compatibility with older releases, and ensure these are tested, via the `lts_compatibility` test with `LONG_TESTS=1` enabled. - Take particular care with changes to the consensus and crypto code, as these are critical for security and correctness. Ensure you have a thorough understanding of the existing code and the implications of your changes before proceeding. From 8fdeb8efbfe64776c43b00e7a3ff0389e767aa44 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 12:58:56 +0000 Subject: [PATCH 10/12] Remove duplicated formatting steps from Copilot instructions Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/3b14b77e-eab5-4c47-b1de-fe03cc145749 Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- .github/copilot-instructions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 6af4329e587a..9b3fe8b4d299 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -61,7 +61,6 @@ sphinx-build --fail-on-warning -b html doc doc/html ## Code changes - `ci-checks.sh` must run successfully before any commit is pushed. -- Always run `./scripts/ci-checks.sh` in the same way as CI before pushing. If it reports `CMake format` failures, run `./scripts/cmake-format-checks.sh -f` and re-run `./scripts/ci-checks.sh` before committing. - All tests in `ci.yml` must pass before a PR can be merged. Consider which are likely to be affected by your changes and run those locally before pushing. - Take particular care with any changes that may affect compatibility with older releases, and ensure these are tested, via the `lts_compatibility` test with `LONG_TESTS=1` enabled. - Take particular care with changes to the consensus and crypto code, as these are critical for security and correctness. Ensure you have a thorough understanding of the existing code and the implications of your changes before proceeding. From a27580298770d85a6f0c7a1717546b279a46a578 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 13:03:31 +0000 Subject: [PATCH 11/12] Revert cchost-removal changes from this formatting-only PR Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/78b42f5d-4459-4ddc-9130-509c14885e9e Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- CMakeLists.txt | 7 ++- doc/conf.py | 2 +- .../{host_config.json => cchost_config.json} | 0 ..._js.json => cchost_config_virtual_js.json} | 0 samples/minimal_ccf/ccf_runtime/Dockerfile | 4 +- samples/minimal_ccf/run_app.sh | 2 +- src/host/configuration.h | 50 +++++++++---------- src/host/run.cpp | 20 ++++---- tests/historical_query_cache.py | 2 +- tests/historical_query_perf.py | 2 +- tests/infra/e2e_args.py | 2 +- tests/infra/node.py | 5 -- tests/infra/piccolo_driver.py | 2 +- tests/infra/remote.py | 6 +-- tests/infra/runner.py | 4 +- tests/lts_compatibility.py | 2 +- 16 files changed, 52 insertions(+), 58 deletions(-) rename doc/host_config_schema/{host_config.json => cchost_config.json} (100%) rename samples/minimal_ccf/app/{config_virtual_js.json => cchost_config_virtual_js.json} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bb473609b36..187cf45bcad1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,12 +354,15 @@ configure_file( ) install(FILES ${CCF_DIR}/include/ccf/version.h DESTINATION include/ccf) -file(READ ${CCF_DIR}/doc/host_config_schema/host_config.json HOST_CONFIG_SCHEMA) +file( + READ ${CCF_DIR}/doc/host_config_schema/cchost_config.json + HOST_CONFIG_SCHEMA +) set_property( DIRECTORY APPEND PROPERTY - CMAKE_CONFIGURE_DEPENDS ${CCF_DIR}/doc/host_config_schema/host_config.json + CMAKE_CONFIGURE_DEPENDS ${CCF_DIR}/doc/host_config_schema/cchost_config.json ) configure_file( ${CCF_DIR}/src/host/config_schema.h.in diff --git a/doc/conf.py b/doc/conf.py index 269d8059c828..e4ced9c89c01 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -484,7 +484,7 @@ def setup(app): ) # configuration generator - input_file_path = doc_dir / "host_config_schema/host_config.json" + input_file_path = doc_dir / "host_config_schema/cchost_config.json" output_file_path = doc_dir / "operations/generated_config.rst" if os.path.exists(input_file_path): diff --git a/doc/host_config_schema/host_config.json b/doc/host_config_schema/cchost_config.json similarity index 100% rename from doc/host_config_schema/host_config.json rename to doc/host_config_schema/cchost_config.json diff --git a/samples/minimal_ccf/app/config_virtual_js.json b/samples/minimal_ccf/app/cchost_config_virtual_js.json similarity index 100% rename from samples/minimal_ccf/app/config_virtual_js.json rename to samples/minimal_ccf/app/cchost_config_virtual_js.json diff --git a/samples/minimal_ccf/ccf_runtime/Dockerfile b/samples/minimal_ccf/ccf_runtime/Dockerfile index c8f1b36ea646..ac7d91bf617e 100644 --- a/samples/minimal_ccf/ccf_runtime/Dockerfile +++ b/samples/minimal_ccf/ccf_runtime/Dockerfile @@ -17,9 +17,7 @@ RUN mkdir /staging \ && rm -rf /staging/run/* \ && rm -rf /staging/var/cache/tdnf \ && find /staging/var/log -type f -size +0 -delete \ - # Stage js_generic on PATH as a sample application binary. Replace this - # with the actual intended application binary when adapting this image. - && mv /staging/opt/ccf_${PLATFORM}/bin/js_generic /staging/usr/bin/js_generic + && mv /staging/opt/ccf_${PLATFORM}/bin/cchost /staging/usr/bin/cchost FROM mcr.microsoft.com/azurelinux/distroless/minimal:3.0 diff --git a/samples/minimal_ccf/run_app.sh b/samples/minimal_ccf/run_app.sh index 4aba7cbe4a2c..87f8d9081d8c 100755 --- a/samples/minimal_ccf/run_app.sh +++ b/samples/minimal_ccf/run_app.sh @@ -10,6 +10,6 @@ docker run \ --name ccf \ --rm -v "$(pwd)/app:/app" \ -p 8080:8080 \ - ${my_app_target} js_generic --config /app/config_${PLATFORM}_js.json & + ${my_app_target} cchost --config /app/cchost_config_${PLATFORM}_js.json & sleep 3 && docker rm -f ccf diff --git a/src/host/configuration.h b/src/host/configuration.h index e19e5bcdfad8..88940b09a123 100644 --- a/src/host/configuration.h +++ b/src/host/configuration.h @@ -38,7 +38,7 @@ namespace host data_json_file, recovery_role); - struct HostConfig : public ccf::CCFConfig + struct CCHostConfig : public ccf::CCFConfig { ccf::ds::TimeString tick_interval = {"10ms"}; ccf::ds::TimeString slow_io_logging_threshold = {"10ms"}; @@ -127,38 +127,38 @@ namespace host Command command = {}; }; - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::OutputFiles); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig::OutputFiles); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::OutputFiles); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::OutputFiles); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig::OutputFiles, + CCHostConfig::OutputFiles, node_certificate_file, pid_file, node_to_node_address_file, rpc_addresses_file); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Logging); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Logging); - DECLARE_JSON_OPTIONAL_FIELDS(HostConfig::Logging, format); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Logging); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Logging); + DECLARE_JSON_OPTIONAL_FIELDS(CCHostConfig::Logging, format); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Memory); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Memory); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Memory); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Memory); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig::Memory, circuit_size, max_msg_size, max_fragment_size); + CCHostConfig::Memory, circuit_size, max_msg_size, max_fragment_size); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Start); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Start); DECLARE_JSON_REQUIRED_FIELDS( - HostConfig::Command::Start, members, constitution_files); + CCHostConfig::Command::Start, members, constitution_files); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig::Command::Start, + CCHostConfig::Command::Start, service_configuration, initial_service_certificate_validity_days, service_subject_name, cose_signatures); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Join); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command::Join, target_rpc_address); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Join); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command::Join, target_rpc_address); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig::Command::Join, + CCHostConfig::Command::Join, retry_timeout, follow_redirect, fetch_recent_snapshot, @@ -167,22 +167,22 @@ namespace host fetch_snapshot_max_size, host_data_transparent_statement_path); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command::Recover); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command::Recover); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command::Recover); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command::Recover); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig::Command::Recover, + CCHostConfig::Command::Recover, initial_service_certificate_validity_days, previous_service_identity_file); - DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(HostConfig::Command); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig::Command, type); + DECLARE_JSON_TYPE_WITH_OPTIONAL_FIELDS(CCHostConfig::Command); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig::Command, type); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig::Command, service_certificate_file, start, join, recover); + CCHostConfig::Command, service_certificate_file, start, join, recover); - DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(HostConfig, ccf::CCFConfig); - DECLARE_JSON_REQUIRED_FIELDS(HostConfig, command); + DECLARE_JSON_TYPE_WITH_BASE_AND_OPTIONAL_FIELDS(CCHostConfig, ccf::CCFConfig); + DECLARE_JSON_REQUIRED_FIELDS(CCHostConfig, command); DECLARE_JSON_OPTIONAL_FIELDS( - HostConfig, + CCHostConfig, tick_interval, slow_io_logging_threshold, node_client_interface, diff --git a/src/host/run.cpp b/src/host/run.cpp index c9a046e5a383..0c8fad325114 100644 --- a/src/host/run.cpp +++ b/src/host/run.cpp @@ -96,7 +96,7 @@ static constexpr size_t retry_interval_ms = 100; namespace ccf { - void validate_and_adjust_recovery_threshold(host::HostConfig& config) + void validate_and_adjust_recovery_threshold(host::CCHostConfig& config) { if (config.command.type != StartType::Start) { @@ -191,7 +191,7 @@ namespace ccf }; void setup_rpc_interfaces( - host::HostConfig& config, + host::CCHostConfig& config, asynchost::RPCConnections& rpc, asynchost::RPCConnections& rpc_udp) { @@ -341,7 +341,7 @@ namespace ccf } void populate_config_for_start( - const host::HostConfig& config, ccf::StartupConfig& startup_config) + const host::CCHostConfig& config, ccf::StartupConfig& startup_config) { for (auto const& member : config.command.start.members) { @@ -404,7 +404,7 @@ namespace ccf } void populate_config_for_join( - const host::HostConfig& config, ccf::StartupConfig& startup_config) + const host::CCHostConfig& config, ccf::StartupConfig& startup_config) { LOG_INFO_FMT( "Creating new node - join existing network at {}", @@ -428,7 +428,7 @@ namespace ccf } void populate_config_for_recover( - const host::HostConfig& config, ccf::StartupConfig& startup_config) + const host::CCHostConfig& config, ccf::StartupConfig& startup_config) { LOG_INFO_FMT("Creating new node - recover"); startup_config.initial_service_certificate_validity_days = @@ -446,7 +446,7 @@ namespace ccf } std::optional create_enclave_node( - const host::HostConfig& config, + const host::CCHostConfig& config, messaging::BufferProcessor& buffer_processor, ringbuffer::Circuit& circuit, EnclaveConfig& enclave_config, @@ -508,7 +508,7 @@ namespace ccf } void write_certificates_to_disk( - const host::HostConfig& config, + const host::CCHostConfig& config, const std::vector& node_cert, const std::vector& service_cert) { @@ -529,7 +529,7 @@ namespace ccf } } - void run_enclave_threads(const host::HostConfig& config) + void run_enclave_threads(const host::CCHostConfig& config) { auto enclave_thread_start = [&](threading::ThreadID thread_id) { threading::set_current_thread_id(thread_id); @@ -573,7 +573,7 @@ namespace ccf } std::optional run_main_loop( - host::HostConfig& config, + host::CCHostConfig& config, messaging::BufferProcessor& buffer_processor, ringbuffer::Circuit& circuit, EnclaveConfig& enclave_config, @@ -954,7 +954,7 @@ namespace ccf schema_error_msg.value())); } - host::HostConfig config = config_json; + host::CCHostConfig config = config_json; if (config.logging.format == host::LogFormat::JSON) { diff --git a/tests/historical_query_cache.py b/tests/historical_query_cache.py index 4e3646d3d45a..542c1ac39afe 100644 --- a/tests/historical_query_cache.py +++ b/tests/historical_query_cache.py @@ -246,7 +246,7 @@ def run(args): args.package = "samples/apps/logging/logging" args.nodes = infra.e2e_args.min_nodes(args, f=1) args.initial_member_count = 1 - args.sig_ms_interval = 1000 # Set to node default value + args.sig_ms_interval = 1000 # Set to cchost default value args.historical_cache_soft_limit = "20KB" run(args) diff --git a/tests/historical_query_perf.py b/tests/historical_query_perf.py index 0257d028fbb0..21c594ebfa5a 100644 --- a/tests/historical_query_perf.py +++ b/tests/historical_query_perf.py @@ -219,5 +219,5 @@ def add(parser): args.package = "samples/apps/logging/logging" args.nodes = infra.e2e_args.max_nodes(args, f=0) args.initial_member_count = 1 - args.sig_ms_interval = 1000 # Set to node default value + args.sig_ms_interval = 1000 # Set to cchost default value run(args) diff --git a/tests/infra/e2e_args.py b/tests/infra/e2e_args.py index 9a135f836fe2..78b353500d09 100644 --- a/tests/infra/e2e_args.py +++ b/tests/infra/e2e_args.py @@ -65,7 +65,7 @@ def cli_args( parser.add_argument( "-b", "--binary-dir", - help="Path to CCF binaries (node executable, scurl, keygenerator)", + help="Path to CCF binaries (cchost, scurl, keygenerator)", default=".", ) parser.add_argument( diff --git a/tests/infra/node.py b/tests/infra/node.py index cdbe9f16e5af..13608c87f2ac 100644 --- a/tests/infra/node.py +++ b/tests/infra/node.py @@ -330,11 +330,6 @@ def _setup( lib_path, workspace, common_dir, - binary_name=( - "cchost" - if self.major_version is not None and self.major_version < 7 - else None - ), binary_dir=self.binary_dir, label=label, local_node_id=self.local_node_id, diff --git a/tests/infra/piccolo_driver.py b/tests/infra/piccolo_driver.py index 4efd893bd321..e7150307876d 100644 --- a/tests/infra/piccolo_driver.py +++ b/tests/infra/piccolo_driver.py @@ -81,7 +81,7 @@ def run(get_command, args): args.initial_user_count = 3 args.sig_ms_interval = 100 - args.ledger_chunk_bytes = "5MB" # Set to node default value + args.ledger_chunk_bytes = "5MB" # Set to cchost default value LOG.info("Starting nodes on {}".format(hosts)) diff --git a/tests/infra/remote.py b/tests/infra/remote.py index e130fc122dab..b8a7acaa5faa 100644 --- a/tests/infra/remote.py +++ b/tests/infra/remote.py @@ -284,6 +284,7 @@ def get_result(self, line_count): class CCFRemote(object): + BIN = "cchost" TEMPLATE_CONFIGURATION_FILE = "config.jinja" DEPS = [] @@ -293,7 +294,6 @@ def __init__( enclave_file, workspace, common_dir, - binary_name=None, label="", binary_dir=".", local_node_id=None, @@ -382,12 +382,10 @@ def __init__( self.node_address_file = f"{local_node_id}.node_address" self.rpc_addresses_file = f"{local_node_id}.rpc_addresses" + self.BIN = infra.path.build_bin_path(self.BIN, binary_dir=binary_dir) # 7.x releases combined binaries and removed the separate cchost entry-point if major_version is None or major_version >= 7: self.BIN = enclave_file - else: - assert binary_name, "binary_name must be provided when major_version < 7" - self.BIN = infra.path.build_bin_path(binary_name, binary_dir=binary_dir) self.common_dir = common_dir self.pub_host = host.get_primary_interface().public_host diff --git a/tests/infra/runner.py b/tests/infra/runner.py index 88110424cf61..601893a4ea52 100644 --- a/tests/infra/runner.py +++ b/tests/infra/runner.py @@ -74,8 +74,8 @@ def run(get_command, args): hosts = infra.e2e_args.nodes(args, minimum_number_of_local_nodes(args)) args.initial_user_count = 3 - args.sig_ms_interval = 1000 # Set to node default value - args.ledger_chunk_bytes = "5MB" # Set to node default value + args.sig_ms_interval = 1000 # Set to cchost default value + args.ledger_chunk_bytes = "5MB" # Set to cchost default value LOG.info("Starting nodes on {}".format(hosts)) diff --git a/tests/lts_compatibility.py b/tests/lts_compatibility.py index 1d418ecf74e8..59c2c109f925 100644 --- a/tests/lts_compatibility.py +++ b/tests/lts_compatibility.py @@ -825,7 +825,7 @@ def add(parser): args.package = "js_generic" args.nodes = infra.e2e_args.max_nodes(args, f=0) args.jwt_key_refresh_interval_s = 3 - args.sig_ms_interval = 1000 # Set to node default value + args.sig_ms_interval = 1000 # Set to cchost default value # Hardcoded because host only accepts info log on release builds args.log_level = "info" From 86826bbbe0e1314cd4a5573c5dbc2a24945b9ee3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 13:04:54 +0000 Subject: [PATCH 12/12] Fix trailing whitespace in reverted Dockerfile Agent-Logs-Url: https://github.com/microsoft/CCF/sessions/78b42f5d-4459-4ddc-9130-509c14885e9e Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com> --- samples/minimal_ccf/ccf_runtime/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/minimal_ccf/ccf_runtime/Dockerfile b/samples/minimal_ccf/ccf_runtime/Dockerfile index ac7d91bf617e..7f07d125a24e 100644 --- a/samples/minimal_ccf/ccf_runtime/Dockerfile +++ b/samples/minimal_ccf/ccf_runtime/Dockerfile @@ -17,7 +17,7 @@ RUN mkdir /staging \ && rm -rf /staging/run/* \ && rm -rf /staging/var/cache/tdnf \ && find /staging/var/log -type f -size +0 -delete \ - && mv /staging/opt/ccf_${PLATFORM}/bin/cchost /staging/usr/bin/cchost + && mv /staging/opt/ccf_${PLATFORM}/bin/cchost /staging/usr/bin/cchost FROM mcr.microsoft.com/azurelinux/distroless/minimal:3.0