From 094ae51ae54b12a15d353fc81edce613c7196bfa Mon Sep 17 00:00:00 2001 From: Amaury Chamayou Date: Fri, 7 Mar 2025 14:59:03 +0000 Subject: [PATCH] Pass through OE logging, 5.0.14 release notes (#6888) Co-authored-by: Max --- CHANGELOG.md | 3 +++ edl/ccf.edl | 1 + include/ccf/pal/enclave.h | 37 ------------------------------------- src/enclave/main.cpp | 2 -- src/host/enclave.h | 19 ------------------- tests/infra/remote.py | 4 +--- 6 files changed, 5 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e66a5dd3212..3cadd511c658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - `ccf.ledger`/`read_ledger.py` previously enforced too strict a condition on node membership when validating ledger files (#6849). +- Removed default value for redirection-kind parameter to start_network script (#6887). +- Don't throw error if the ledger directory exists but is empty on node start (#6885). +- Open Enclave logs directly to standard output, without restriction (#6888) ## [5.0.13] diff --git a/edl/ccf.edl b/edl/ccf.edl index c1d65e04fac0..4017327a026a 100644 --- a/edl/ccf.edl +++ b/edl/ccf.edl @@ -2,6 +2,7 @@ // Licensed under the Apache 2.0 License. enclave { + from "openenclave/edl/logging.edl" import *; from "openenclave/edl/sgx/platform.edl" import *; from "openenclave/edl/time.edl" import *; diff --git a/include/ccf/pal/enclave.h b/include/ccf/pal/enclave.h index 45fea0c95abc..a244652af96c 100644 --- a/include/ccf/pal/enclave.h +++ b/include/ccf/pal/enclave.h @@ -16,8 +16,6 @@ namespace ccf::pal { #if !defined(INSIDE_ENCLAVE) || defined(VIRTUAL_ENCLAVE) - static inline void redirect_platform_logging() {} - static inline void initialize_enclave() {} static inline void shutdown_enclave() {} @@ -29,41 +27,6 @@ namespace ccf::pal #else - static void open_enclave_logging_callback( - void* context, - oe_log_level_t level, - uint64_t thread_id, - const char* message) - { - switch (level) - { - case OE_LOG_LEVEL_FATAL: - CCF_LOG_FMT(FATAL, "")("OE: {}", message); - break; - case OE_LOG_LEVEL_ERROR: - CCF_LOG_FMT(FAIL, "")("OE: {}", message); - break; - case OE_LOG_LEVEL_WARNING: - CCF_LOG_FMT(FAIL, "")("OE: {}", message); - break; - case OE_LOG_LEVEL_INFO: - CCF_LOG_FMT(INFO, "")("OE: {}", message); - break; - case OE_LOG_LEVEL_VERBOSE: - CCF_LOG_FMT(DEBUG, "")("OE: {}", message); - break; - case OE_LOG_LEVEL_MAX: - case OE_LOG_LEVEL_NONE: - CCF_LOG_FMT(TRACE, "")("OE: {}", message); - break; - } - } - - static inline void redirect_platform_logging() - { - oe_enclave_log_set_callback(nullptr, &open_enclave_logging_callback); - } - static inline void initialize_enclave() { auto rc = oe_attester_initialize(); diff --git a/src/enclave/main.cpp b/src/enclave/main.cpp index 04944823b967..8ea24487c0d9 100644 --- a/src/enclave/main.cpp +++ b/src/enclave/main.cpp @@ -134,8 +134,6 @@ extern "C" auto ringbuffer_logger = new_logger.get(); ccf::logger::config::loggers().push_back(std::move(new_logger)); - ccf::pal::redirect_platform_logging(); - enclave_sanity_checks(); { diff --git a/src/host/enclave.h b/src/host/enclave.h index 6a243c1745af..2d8bdde1fe07 100644 --- a/src/host/enclave.h +++ b/src/host/enclave.h @@ -22,21 +22,6 @@ # include "enclave/virtual_enclave.h" #endif -extern "C" -{ -#ifdef PLATFORM_SGX - void nop_oe_logger( - void* context, - bool is_enclave, - const struct tm* t, - long int usecs, - oe_log_level_t level, - uint64_t host_thread_id, - const char* message) - {} -#endif -} - namespace host { void expect_enclave_file_suffix( @@ -128,10 +113,6 @@ namespace host expect_enclave_file_suffix(path, ".enclave.so.signed", type); } -# ifdef CCF_DISABLE_VERBOSE_LOGGING - oe_log_set_callback(nullptr, nop_oe_logger); -# endif - auto err = oe_create_ccf_enclave( path.c_str(), OE_ENCLAVE_TYPE_SGX, diff --git a/tests/infra/remote.py b/tests/infra/remote.py index 14aad26f109e..207305faf3c8 100644 --- a/tests/infra/remote.py +++ b/tests/infra/remote.py @@ -666,9 +666,7 @@ def __init__( snp_uvm_security_context_dir ) - oe_log_level = CCF_TO_OE_LOG_LEVEL.get(kwargs.get("host_log_level")) - if oe_log_level: - env["OE_LOG_LEVEL"] = oe_log_level + env["OE_LOG_LEVEL"] = "INFO" self.name = f"{label}_{local_node_id}" self.start_type = start_type