Commit Graph

8150 Commits

Author SHA1 Message Date
Thomas Winget
6b728a0512 implement new rc gossip logic
Relays will now re-sign and gossip their RCs every 6 hours (minus a
couple random minutes) using the new gossip_rc message.

Removes the old RCGossiper concept
2024-01-31 07:54:12 -08:00
Thomas Winget
10984b2fa5 NodeDB RCs don't need insertion time
We will want some notion of "when did we receive it" for RCs (or
RouterIDs, details tbd), but that will be per-source as a means to form
some metric of consensus/trust on which relays are *actually* on the
network.  Clients don't have a blockchain daemon to pull this from, so
they have to ask many relays for the full list of relays and form a
trust model on that (bootstrapping problem notwithstanding).
2024-01-31 07:54:12 -08:00
Thomas Winget
e29e23bf81 implement and use "gossip_rc" command
TODO: refactor or remove RCGossiper and revisit RC regen and
when-to-gossip logic.
2024-01-31 07:54:12 -08:00
Thomas Winget
f6594a33bc Remove find/lookup router
We're removing the notion of find/lookup a singular RC, so this gets rid
of all functions which did that and replaces their usages with something
sensible.
2024-01-31 07:54:12 -08:00
Thomas Winget
611d277d28 remove rc_lookup_handler, relocating useful parts
RC "lookup" is being replaced with "gimme all recently updated RCs".  As
such, doing a lookup on a specific RC is going away, as is network
exploration, so a lot of what RCLookupHandler was doing will no longer
be relevant.  Functionality from it which was kept has moved to NodeDB,
as it makes sense for that functionality to live where the RCs live.
2024-01-31 07:54:12 -08:00
Thomas Winget
cd27121890 fix some copy/paste derping
also deserialize to unsigned string where possible/useful so to not have
unnecessary reinterpret_casts all over the place.
2024-01-31 07:54:12 -08:00
Thomas Winget
00f30f2c24 onion encrypt path build frames
path build frames should be onioned at each hop to avoid a bad actor
controlling two nodes in a path being able to know (with certainty,
temporal correlation is hard to avoid) that they're hops on the same
path.  This is desirable as in the worst case someone could be your edge
hop and terminal hop on a path, and now the terminal hop knows your IP
making the path basically pointless.
2024-01-31 07:54:12 -08:00
Thomas Winget
7fdecef9b3 messages::status -> messages 2024-01-31 07:54:12 -08:00
Thomas Winget
0000c6b392 remove some unused "path build"-related functions 2024-01-31 07:54:12 -08:00
Thomas Winget
f995b30348 preconstructed dicts for error/timeout/ok
also move messages' statuses into their own namespace
2024-01-31 07:54:12 -08:00
Jason Rhinelander
957280e628 Delete llarp::util::memFn
It's unnecessary abstraction that barely simplifies anything, and is now
only used in one single place anyway, which is easily replaced with a
(unabstracted) lambda.
2024-01-31 07:54:12 -08:00
Thomas Winget
04e9fd559c build fixes, clang-format, minor touch-ups 2024-01-31 07:54:12 -08:00
Thomas Winget
657214992b chahca nonce size is 24 bytes
Lots of code was using 32-byte nonces for xchacha20 symmetric
encryption, but this just means 8 extra bytes per packet wasted as
chacha is only using the first 24 bytes of that nonce anyway.

Changing this resulted in a lot of dead/dying code breaking, so this
commit also removes a lot of that (and comments a couple places with
TODO instead)

Also nounce -> nonce where it came up.
2024-01-31 07:54:12 -08:00
Thomas Winget
2bea5e7823 path control message response status changes
change path control message inner message response to take just a
string, which will be a bt-encoded response with an early key for
status.  If there is a timeout we pass a bt dict that only has that as
the status, else the response we de-onioned should have either an OK
status or some other error.

change messages to use new status key

correctly call Path::EnterState on path build response
2024-01-31 07:54:12 -08:00
Thomas Winget
62a88b3cea omit breaking RC stuff pending refactor
It seems RC refactor will obviate the need for a "get individual RC"
method, so this comments out some usage of that to sidestep build
errors, rather than correcting them in a way that will just be wasted.
2024-01-31 07:54:12 -08:00
Thomas Winget
bf2665bbe7 path control messages and onioning fleshed out
- control messages can be sent along a path
- the path owner onion-encrypts the "inner" message for each hop in the
  path
- relays on the path will onion the payload in both directions, such
  that the terminal relay will get the plaintext "inner" message and the
  client will get the plaintext "response" to that.
- control messages have (mostly, see below) been changed to be invokable
  either over a path or directly to a relay, as appropriate.

TODO:
  - exit messages need looked at, so they have not yet been changed for
    this
  - path transfer messages (traffic from client to client over 2 paths
    with a shared "pivot") are not yet implemented
2024-01-31 07:54:12 -08:00
Thomas Winget
3bc8c30b22 path build message handling mostly finished
there are a few TODOs which merit further discussion
2024-01-31 07:54:12 -08:00
dr7ana
d35073cc58 libquic bump 2024-01-31 07:54:12 -08:00
dr7ana
472fcc7d1a review fixes 2024-01-31 07:54:12 -08:00
dr7ana
5c6c6bcfee config addr change
- the one addr to rule them all, and its name was oxen::quic::Address
- no more vectors of inbound/outbound junk
2024-01-31 07:54:12 -08:00
dr7ana
c149651d64 A soothing re-nomenclatura 2024-01-31 07:54:12 -08:00
dr7ana
47bedfd8da Review fixes + misc fixes 2024-01-31 07:54:12 -08:00
Jason Rhinelander
0de50b176b Untangle Endpoint::LookupServiceAsync
- .snodes don't need to support SRV records, so remove that
- untangle the mess of captured lambdas capturing other lambdas
  capturing other lambdas; we still need a chain of nested lambdas
  because we have a chain of callbacked events, but hiding the nesting
  by capturing them in other lambdas didn't improve anything.
2024-01-31 07:54:12 -08:00
dr7ana
68e67c881b {Remote,Local}RC's
- RemoteRC supplants most of the functionality throughout the code of RouterContact
- Next step will be to sort out CI issues, then see if we can get rid of either LocalRC (and therefore RouterContact entirely)
2024-01-31 07:54:12 -08:00
dr7ana
632f4ee70b RC refactor layout
- Local and Remote RC's now implemented with discrete functionalities and uses
2024-01-31 07:54:12 -08:00
Jason Rhinelander
431490fb8b Give up for now 2024-01-31 07:54:12 -08:00
Jason Rhinelander
ca5ed01b2c Bump libquic to latest for static build fixes 2024-01-31 07:54:12 -08:00
Jason Rhinelander
c3641ab22c Turn off terrible new cmake 3.24+ default 2024-01-31 07:54:12 -08:00
Jason Rhinelander
46482c03a6 Remove unused file 2024-01-31 07:54:12 -08:00
Jason Rhinelander
b3c3dcf33a Bump armhf static build to bullseye
Use backports for cmake because ngtcp2 needs 3.20+.
2024-01-31 07:54:12 -08:00
Jason Rhinelander
63b8fd49cc Don't export CC
This was causing cmake to double-invoke ccache for compilation units,
and broke oxen-mq's local zmq build for the same reason.
2024-01-31 07:54:12 -08:00
dr7ana
cb2a2cf6e3 Weird clang unused variable CI fix 2024-01-31 07:54:12 -08:00
Jason Rhinelander
eb37796b65 Bump oxen-mq for libzmq llvm static build fix 2024-01-31 07:54:12 -08:00
dr7ana
98583b8f58 Windows CI fixes
- some weird function call business
- string formatting
- etc
2024-01-31 07:54:12 -08:00
dr7ana
c46c18ea30 Bump libzmq static; remove patches 2024-01-31 07:54:12 -08:00
Jason Rhinelander
57c471e7a2 Bump WinDivert to latest
There are some bugfix releases, but also the upstream hash was wrong for
the current release anyway (upstream changed it?).
2024-01-31 07:54:12 -08:00
Jason Rhinelander
b909f537fe Default libcrypt to whether or not we find it
Also deliberately don't provide the function at all if we aren't
compiled with libcrypt so that we can't link if we try to call it when
not available.
2024-01-31 07:54:12 -08:00
Jason Rhinelander
6d6301daee Disable Router Hive & DEB builds
They aren't useful right now.
2024-01-31 07:54:12 -08:00
dr7ana
acf494098a squash 2024-01-31 07:54:12 -08:00
dr7ana
127ac2c9aa windows fixes 2024-01-31 07:54:12 -08:00
dr7ana
5596ffd9d7 CI Fixes, squash 2024-01-31 07:54:12 -08:00
Jason Rhinelander
19f9a8f122 Temporarily disable building/running test suite 2024-01-31 07:54:12 -08:00
dr7ana
57393ea740 Review fixes
- cleaned up include-what-you-use errors (mostly quoted includes)
- misc fixes
2024-01-31 07:54:12 -08:00
Jason Rhinelander
3d44e58e34 Fix systemd linkage 2024-01-31 07:54:12 -08:00
Jason Rhinelander
52b175772f Bring oxen-encoding back in as a submodule
As long as it's loaded before oxen-mq or libquic, this should end up
being the one that gets used in oxen-mq/libquic, and so we don't have to
update those when we want something in a newer oxen-encoding.
2024-01-31 07:54:12 -08:00
Jason Rhinelander
f21facfd39 Add format.sh detection of include problems 2024-01-31 07:54:12 -08:00
dr7ana
f574cd798f Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
2024-01-31 07:54:12 -08:00
dr7ana
12a89328fe Cmake restructuring 2024-01-31 07:54:12 -08:00
Jason Rhinelander
b597ae5a94 "Refactor" aka delete Crypto/CryptoManager
- Get rid of CryptoManager.
- Get rid of Crypto.
- Move all the Crypto instance methods to llarp::crypto functions.
  (None of them needed to be methods at all, so this is simple).
- Move sodium/ntru initialization into static initialization.
- Add llarp::csrng, which is an available llarp::CSRNG instance which is
  a bit easier than needing to construct a `CSRNG rng{};` in various
  places.
- Various related small simplifications/cleanups.
2024-01-31 07:54:12 -08:00
dr7ana
c0b19de963 Review commit 2024-01-31 07:54:12 -08:00