Skip to content

Commit

Permalink
squash; kick le net
Browse files Browse the repository at this point in the history
  • Loading branch information
dr7ana committed Oct 24, 2024
1 parent d236b46 commit 1b14e79
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
8 changes: 2 additions & 6 deletions llarp/contact/client_contact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion llarp/dht/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
};
Expand Down
6 changes: 3 additions & 3 deletions llarp/handlers/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions llarp/link/link_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ namespace llarp

void LinkManager::handle_publish_cc(std::string_view body, std::function<void(std::string)> respond)
{
log::critical(logcat, "Received request to publish client contact!");

EncryptedClientContact enc;
bool is_relayed;
uint64_t relay_order;
Expand Down
4 changes: 2 additions & 2 deletions llarp/link/link_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ namespace llarp
void (LinkManager::*)(std::string_view body, std::function<void(std::string)> 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);
Expand Down

0 comments on commit 1b14e79

Please sign in to comment.