Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] liblokinet changes #2141

Draft
wants to merge 65 commits into
base: dev
Choose a base branch
from
Draft

Conversation

majestrate
Copy link
Contributor

placeholder for dan's branch for liblokinet used for code review.

llarp/quic/connection.cpp Outdated Show resolved Hide resolved
tewinget and others added 5 commits March 1, 2023 07:05
- add new format with category
- add set_data_dir method to liblokinet
bump ngtcp2 dep to the latest tagged version.  The changes to get
liblokinet/quic back to "working" (insofar as it was before) are
complete in this commit, but there appear to be further changes in
ngtcp2 apart from simple API changes which could merit reworking how we
use it somewhat.
- fix some ngtcp2 usage and conn issue detection
- clients now get an ERR_PROTO packet when something goes wrong and the
server is unhappy.
- ngtcp2_accept changed between our last update of it and current, this
fixes its usage.
- with a minor change to the C API, liblokinet userland will now be able
to receive notification when a connection is (un)successfully opened,
and when it closes.  TODO: supply a reason for the close, if we decide
it should
- pkt tx timer update + max pkt count
- added pkt tx time updates to message handling logic
- setting destlen param to at least max_tx_UDP_Payload size
@majestrate majestrate changed the title [draft] dan's liblokinet changes [WIP] liblokinet changes Mar 1, 2023
- removed fprintf debug statements used for xcode debugging that were failing CI
- removed unused variables also failing CI
- deb stable i386 (and others) broke with logging of variants
- handshake timeouts was incorrect: must call ngtcp2_write_connection_close if NGTCP2_ERR_HANDSHAKE_TIMEOUT is returned
- packet handling fix: do not close stream on congestion
- bumped clang-format version to latest (16)
- format-version.sh checks for version 14 or greater now, removed old comment block
@@ -122,7 +122,7 @@ namespace llarp
virtual bool
EnsurePathTo(
AddressVariant_t addr,
std::function<void(std::optional<service::ConvoTag>)> hook,
std::function<void(std::optional<std::variant<service::Address, RouterID>>)> hook,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::function<void(bool)>

@@ -24,7 +24,7 @@ namespace llarp
/// Empty constructor.
IpAddress() = default;
/// move construtor
IpAddress(IpAddress &&) = default;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bin this entire file if you can

dr7ana and others added 9 commits April 20, 2023 07:18
We changed the quic code to refer to its remote endpoint using an Address Variant
and this resulted in a crash when sending a connection close packet.  This code was
incorrectly supplying an uninitialized value for ConvoTag before but this was silently
ignored; after switching to a variant it became a crash.
this still feels incorrect, but more correct than before
locking in lokinet_shared needs revisited in general.  In addition, user-supplied
callbacks we call from the main thread currently should be called on a separate
thread instead, both to keep the main loop fast and to avoid complex locking issues.
dr7ana and others added 6 commits April 25, 2023 16:11
In commit a76acd4 we attempted to fix
issues on service nodes that related to spamming service nodes with
traffc, but this caused a regression where clients could not connect
to the network.

However, we also did something idiotic with the protocol handshake.
The handshake logic was modified and caused client connections to
fail. This was due to a change in how we decided what a timed out
session is. We redo the close bug and revert the change to the
protocol handshake.

(cherry picked from commit b0b6e2b)
when we queue cpu heavy work in lokinet to worker threads we make 1
job per function call. we call a lot of jobs so this coleases the jobs
into 1 job that we push off at the end of the event loop cycle,
reducing the number of jobs going across the omq proxy thread, in
theory reducing cpu usage.

(cherry picked from commit bbbb07d)
Merging cherry-picks back to testnet branch:
-  oxen-io#2164
-  oxen-io#2134
@majestrate majestrate added this to Backlog in 2023 roadmap via automation May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2023 roadmap
  
Backlog
Development

Successfully merging this pull request may close these issues.

None yet

4 participants