Files
aevolution/cmake/Network.cmake
T
dingoandClaude Opus 5.5 0ce51077b1
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (client) (push) Successful in 12m40s
Foundation / checks (postgres) (push) Canceled after 4s
Foundation / checks (network) (push) Successful in 12m53s
Foundation / checks (tsan) (push) Successful in 7m55s
Foundation / checks (checks) (push) Successful in 31m47s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
Add M10.8b signed handoff tickets and ticket admission
ADR-0096. A source region's handoff key signs a 160-byte ticket for one probe
transfer, account and destination; it rides the Hello grant slot and is
verified against neighbour keys bound to their regions. SessionControl
admits a ticket once per region, superseding like a grant, with the session
ending at the client's original grant expiry. RegionSessions makes the
destination's durable step first: PostgresHandoffLedger stages and commits
the transfer and moves the account's control, idempotently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 18:32:14 -04:00

87 lines
5.2 KiB
CMake

# M9.6 dev session protocol and TLS adapter (ADR-0082). Opt-in; never part of the
# headless simulation. Mbed TLS comes only from the explicitly prepared, pinned source.
include("${PROJECT_SOURCE_DIR}/tools/mbedtls-pin.cmake")
set(mbedtls_source "${PROJECT_SOURCE_DIR}/build/external/mbedtls/mbedtls-${EVO_MBEDTLS_VERSION}")
if(NOT EXISTS "${mbedtls_source}/evo-verified.sha256")
message(FATAL_ERROR "Prepare Mbed TLS explicitly: cmake -P tools/prepare-mbedtls.cmake")
endif()
file(STRINGS "${mbedtls_source}/evo-verified.sha256" verified)
if(NOT verified STREQUAL EVO_MBEDTLS_SHA256)
message(FATAL_ERROR "Prepared Mbed TLS does not match the reviewed source pin")
endif()
enable_language(C)
set(ENABLE_PROGRAMS OFF CACHE BOOL "" FORCE)
set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(GEN_FILES OFF CACHE BOOL "" FORCE)
set(USE_STATIC_MBEDTLS_LIBRARY ON CACHE BOOL "" FORCE)
set(USE_SHARED_MBEDTLS_LIBRARY OFF CACHE BOOL "" FORCE)
set(USE_STATIC_TF_PSA_CRYPTO_LIBRARY ON CACHE BOOL "" FORCE)
set(USE_SHARED_TF_PSA_CRYPTO_LIBRARY OFF CACHE BOOL "" FORCE)
set(DISABLE_PACKAGE_CONFIG_AND_INSTALL ON CACHE BOOL "" FORCE)
# Warnings-as-errors is policy for owned code. Upstream's own -Werror turns
# compiler-version-specific diagnostics (GCC 13 -O3 maybe-uninitialized in
# ssl_tls.c) into build failures of unmodified upstream sources.
set(MBEDTLS_FATAL_WARNINGS OFF CACHE BOOL "" FORCE)
set(TF_PSA_CRYPTO_FATAL_WARNINGS OFF CACHE BOOL "" FORCE)
set(MBEDTLS_USER_CONFIG_FILE "${PROJECT_SOURCE_DIR}/third_party/mbedtls/evo_mbedtls_config.h"
CACHE FILEPATH "Owned TLS 1.3-only restriction (ADR-0082)" FORCE)
# Upstream code is not compiled with project warning policy or our sanitizer
# instrumentation guarantees; only owned targets use evo_owned_target.
add_subdirectory("${mbedtls_source}" "${PROJECT_BINARY_DIR}/mbedtls" EXCLUDE_FROM_ALL SYSTEM)
# Dependency-free protocol: framing, envelopes, admission. No Mbed TLS types.
add_library(evo_network_protocol STATIC src/network/protocol/codec.cpp
src/network/protocol/admission.cpp src/network/protocol/session_control.cpp
src/network/protocol/session_protocol.cpp src/network/protocol/intent_admission.cpp
src/network/protocol/replication.cpp src/network/protocol/probe_motion.cpp)
target_link_libraries(evo_network_protocol PUBLIC evo_client_views evo_client_controls)
evo_owned_target(evo_network_protocol)
# M10.6 client prediction and reconciliation of the probe marker (ADR-0094).
add_library(evo_client_prediction STATIC src/client/prediction/motion_prediction.cpp
src/client/prediction/interpolation.cpp)
target_link_libraries(evo_client_prediction PUBLIC evo_network_protocol)
evo_owned_target(evo_client_prediction)
# Mbed TLS adapters: dev grants (HMAC-SHA256 via PSA) and the TLS 1.3 channel.
# M10.3 session grants (ECDSA P-256 via PSA) share the adapter (ADR-0091).
add_library(evo_network_tls STATIC src/network/tls/dev_grant.cpp src/network/tls/channel.cpp
src/network/tls/dev_credentials.cpp src/network/tls/session_grant.cpp
src/network/tls/handoff_ticket.cpp)
target_link_libraries(evo_network_tls PUBLIC evo_network_protocol PRIVATE mbedtls)
evo_owned_target(evo_network_tls)
# M10.3 backend identity adapter: providers, account directory, grant issuer (library only).
add_library(evo_identity STATIC src/identity/identity.cpp)
target_link_libraries(evo_identity PUBLIC evo_network_tls)
evo_owned_target(evo_identity)
# M9.7 sessions: non-blocking TCP, the host-agnostic session server and the client.
add_library(evo_network_session STATIC src/network/socket/tcp.cpp src/network/session/server.cpp
src/network/session/client.cpp src/network/session/grant_ledger.cpp)
target_link_libraries(evo_network_session PUBLIC evo_network_tls)
if(WIN32)
target_link_libraries(evo_network_session PRIVATE ws2_32)
endif()
evo_owned_target(evo_network_session)
# Dev credential and grant tool (ADR-0083); generates throwaway-scale dev secrets only.
add_executable(evo-dev-session apps/evo-dev-session/main.cpp)
target_link_libraries(evo-dev-session PRIVATE evo_network_session)
evo_owned_target(evo-dev-session)
if(BUILD_TESTING)
add_executable(evo-network-tests tests/network_protocol.cpp tests/network_tls.cpp
tests/network_session.cpp tests/network_control.cpp tests/network_replication.cpp
tests/network_motion.cpp tests/network_interpolation.cpp tests/network_main.cpp)
# The TLS tests generate throwaway dev certificates with Mbed TLS directly.
target_link_libraries(evo-network-tests PRIVATE evo_network_session evo_identity
evo_client_prediction mbedtls)
evo_owned_target(evo-network-tests)
add_test(NAME network COMMAND evo-network-tests)
set_tests_properties(network PROPERTIES TIMEOUT 120 LABELS "network")
endif()
if(EVO_BUILD_FUZZER)
# Coverage-guided codec fuzzing (Linux Clang; see the EVO_BUILD_FUZZER guard).
add_executable(evo-dev-session-fuzz tests/fuzz/dev_session_fuzz.cpp
src/network/protocol/codec.cpp)
target_link_libraries(evo-dev-session-fuzz PRIVATE evo_client_views evo_client_controls)
evo_owned_target(evo-dev-session-fuzz)
target_compile_options(evo-dev-session-fuzz PRIVATE -fsanitize=fuzzer,address,undefined -fno-omit-frame-pointer)
target_link_options(evo-dev-session-fuzz PRIVATE -fsanitize=fuzzer,address,undefined)
endif()