From 1b14e7908aecb5b057878d4f87411ebb24e58638 Mon Sep 17 00:00:00 2001 From: dr7ana Date: Thu, 24 Oct 2024 06:35:42 -0700 Subject: [PATCH] squash; kick le net --- external/oxen-libquic | 2 +- llarp/contact/client_contact.hpp | 8 ++------ llarp/dht/node.hpp | 2 +- llarp/handlers/session.cpp | 6 +++--- llarp/link/link_manager.cpp | 2 ++ llarp/link/link_manager.hpp | 4 ++-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/external/oxen-libquic b/external/oxen-libquic index d837250265..f64ecf62f0 160000 --- a/external/oxen-libquic +++ b/external/oxen-libquic @@ -1 +1 @@ -Subproject commit d83725026529c259395d2abc2d3e91840d67cdc6 +Subproject commit f64ecf62f00534fb09ef371322d276bc58549b9e diff --git a/llarp/contact/client_contact.hpp b/llarp/contact/client_contact.hpp index 17d7143932..81c496443a 100644 --- a/llarp/contact/client_contact.hpp +++ b/llarp/contact/client_contact.hpp @@ -46,12 +46,8 @@ namespace llarp TCP2QUIC = 1 << 5, }; - /** TODO: - - LocalCC - - holds the derived Ed25519PrivateData - - RemoteCC: - - */ + // TESTNET: + inline static constexpr auto CC_PUBLISH_INTERVAL{5min}; /** ClientContact On the wire we encode the data as a dict containing: diff --git a/llarp/dht/node.hpp b/llarp/dht/node.hpp index 2326d15cff..4c9804c8b0 100644 --- a/llarp/dht/node.hpp +++ b/llarp/dht/node.hpp @@ -32,7 +32,7 @@ namespace llarp::dht CCNode(EncryptedClientContact other) : client_contact{std::move(other)}, ID{client_contact.blinded_pubkey} {} - nlohmann::json ExtractStatus() const { return nlohmann::json{{"key", client_contact.key()}}; } + nlohmann::json ExtractStatus() const { return nlohmann::json{{"key", client_contact.key().to_string()}}; } bool operator<(const CCNode& other) const { return client_contact.signed_at < other.client_contact.signed_at; } }; diff --git a/llarp/handlers/session.cpp b/llarp/handlers/session.cpp index d8a153e5cb..48bac59103 100644 --- a/llarp/handlers/session.cpp +++ b/llarp/handlers/session.cpp @@ -138,11 +138,11 @@ namespace llarp::handlers { if (should_publish_cc) { - log::debug(logcat, "Starting ClientContact publish ticker..."); + log::critical(logcat, "Starting ClientContact publish ticker..."); _cc_publisher = _router.loop()->call_every( - path::DEFAULT_LIFETIME, + CC_PUBLISH_INTERVAL, [this]() { - log::info(logcat, "Updating and publishing ClientContact..."); + log::critical(logcat, "Updating and publishing ClientContact..."); update_and_publish_localcc(get_current_client_intros()); }, true); diff --git a/llarp/link/link_manager.cpp b/llarp/link/link_manager.cpp index a70eb5fc1b..5c4316ea1a 100644 --- a/llarp/link/link_manager.cpp +++ b/llarp/link/link_manager.cpp @@ -1086,6 +1086,8 @@ namespace llarp void LinkManager::handle_publish_cc(std::string_view body, std::function respond) { + log::critical(logcat, "Received request to publish client contact!"); + EncryptedClientContact enc; bool is_relayed; uint64_t relay_order; diff --git a/llarp/link/link_manager.hpp b/llarp/link/link_manager.hpp index cb6c8be5d6..f48248b2d9 100644 --- a/llarp/link/link_manager.hpp +++ b/llarp/link/link_manager.hpp @@ -285,8 +285,8 @@ namespace llarp void (LinkManager::*)(std::string_view body, std::function respond)> path_requests = { {"resolve_ons"sv, &LinkManager::handle_resolve_ons}, - {"publish_intro"sv, &LinkManager::handle_publish_cc}, - {"find_intro"sv, &LinkManager::handle_find_cc}}; + {"publish_cc"sv, &LinkManager::handle_publish_cc}, + {"find_cc"sv, &LinkManager::handle_find_cc}}; // Path relaying void handle_path_control(oxen::quic::message, const RouterID& from);