Commit Graph

142 Commits (b81f7025c9a619409bb1c3f39e0c56e2084fd7be)

Author SHA1 Message Date
Jason Rhinelander b81f7025c9
Replace logging with oxen-logger
Replaces custom logging system with spdlog-based oxen logging.  This
commit mainly replaces the backend logging with the spdlog-based system,
but doesn't (yet) convert all the existing LogWarn, etc. to use the new
format-based logging.

New logging statements will look like:

    llarp::log::warning(cat, "blah: {}", val);

where `cat` should be set up in each .cpp or cluster of .cpp files, as
described in the oxen-logging README.

As part of spdlog we get fmt, which gives us nice format strings, where
are applied generously in this commit.

Making types printable now requires two steps:
- add a ToString() method
- add this specialization:

      template <>
      constexpr inline bool llarp::IsToStringFormattable<llarp::Whatever> = true;

This will then allow the type to be printed as a "{}" value in a
fmt::format string.  This is applied to all our printable types here,
and all of the `operator<<` are removed.

This commit also:
- replaces various uses of `operator<<` to ToString()
- replaces various uses of std::stringstream with either fmt::format or
  plain std::string
- Rename some to_string and toString() methods to ToString() for
  consistency (and to work with fmt)
- Replace `stringify(...)` and `make_exception` usage with fmt::format
  (and remove stringify/make_exception from util/str.hpp).
2 years ago
Jeff 1eba0f836e
replace LLARP_PROTO_VERSION macro 2 years ago
Jason Rhinelander b09298e211
Replace llarp/util/endian.hpp with oxenc/endian.h 2 years ago
Jeff ffadcb2e93 clean up paths that are ignored and inactive 2 years ago
Jason Rhinelander 0fe7153f6e Fix client latency bug; De-shared_ptr IHopHandler queues
- Replace m_FlushWakeup with a call to the router's god mode pump
  method.  m_FlushWakeup apparently isn't enough to get things out, and
  we can end up with incoming packets that don't get properly handled
  right away without it.

- The shared_ptr around the ihophandler queues isn't needed and is just
  adding a layer of obfuscation; instead just exchange the list directly
  into the lambda.

- Use std::exchange rather than swap

- A couple other small code cleanups.
3 years ago
Jason Rhinelander 78cc466bf2 Rename PumpLL -> TriggerPump
And rename the actual pump implementation back to PumpLL.
3 years ago
Jason Rhinelander 031ea7aa37 Get rid of external event loop direct wakeups
If something needs to wake up the event loop it should be using an
async, as we are now with PumpLL(); but we had various code triggering a
wakeup, expecting that PumpLL gets called on every wakeup, which isn't
true anymore.
3 years ago
Jeff Becker 5cdb1afa0d
increase timer timeout interval because 1 seconds RTT can happen but 2 seconds is pretty bad 3 years ago
Jeff Becker 486cdc0949
correctly do latency test FEC
before this it would cause a posative feedback loop causing paths to fail for "no real reason"
3 years ago
Jeff Becker 1f9b8e5972
nuke invalid routers when we get a path build fail back to not resuse them in the future 3 years ago
Jeff Becker aa1c1bad0b
record reason for path fail and the full hops 3 years ago
Jeff Becker e4ed53224c
use weak_ptr on a path to reference its parent pathset instead of a bare pointer so crashes dont happen 3 years ago
Jeff Becker 2a76a3d081
treat ignored paths like established paths when dealing with expiration 3 years ago
Jeff Becker 23aa35b825
log when we ignore a path 3 years ago
Jeff Becker 23a82c493f
* don't include failed at when we are the pivot router as that case never happens.
* mark paths as ingored instead of expired when we stop a path builder
* only remove path builder when we have no established paths
3 years ago
Jeff Becker 174e1b247b
fix latency tests.
* do FEC for latency tests so if we fail one test it doesn't kill the entire path
* ignore FEC'd responses on latency tests
* track latency history and report the mean latency instead of just the last sample
3 years ago
Jeff Becker b1afe0f596
always do path tests
this reverts some stupid bullshit that broke 0.9.0
3 years ago
Jeff Becker f69ccb73a8
limit path reanimation
* wait for a limited time for dead paths to reanimate and then remove them after that forever
3 years ago
Jeff Becker 6b115913bc
lokinetmon updates
* add country flags to lokinetmon
* expose hop ip addresses via rpc introspection for geoip in lokinetmon
3 years ago
Jeff Becker 545021aa3d
temp commit 3 years ago
Jeff Becker 2e8f47a7fa
various cleanups 3 years ago
Jeff Becker 5b05d22bad
refactors
* add path sequence numbers on routing messages
* reduce log level in debug mode
* wire up loopback style sending to ourself
3 years ago
Jeff Becker 59c9e997f2
build paths faster and limit path builds at edge router instead of via a time counter for all edges 3 years ago
Jeff Becker 59891d5d5f
wire up snode traffic to quic 3 years ago
Jeff Becker 7a1ffc2df4
* lessen replay filter window
* dont have transit hops use a replay filter
* formatting
3 years ago
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
3 years ago
Jason Rhinelander 91d6698a9d Reformat with clang-format-11 3 years ago
Jason Rhinelander c4559d158e Make format 3 years ago
Jason Rhinelander ccc7b5c9e9 Merge Logic functions into EventLoop
loop->call(...) is similar to the old logic->Call(...), but is smart
about the current thread: if called from within the event loop it simply
runs the argument directly, otherwise it queues it.

Similarly most of the other event loop calls are also now thread-aware:
for example, `call_later(...)` can queue the job directly when called if
in the event loop rather than having to double-queue through the even
loop (once to call, then inside the call to initiate the time).
3 years ago
Jeff Becker f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 4 years ago
Jeff Becker 25a4bbd5ca
use std::swap 4 years ago
Jeff Becker 382e4215a8
path testing interval increase to reduce bandwidth use 4 years ago
Jeff Becker 00143e63f4
put replay filters on transit hops to reduce retransmissions. 4 years ago
Jason Rhinelander 3bb24580a4 make format 4 years ago
Jason Rhinelander ebd2142114 Don't use std::optional::value() because f u macos
This replaces all use of std::optional's `opt.value()` with `*opt`
because macOS is great and the ghost of Steve Jobs says that actually
supporting std::optional's value() method is not for chumps before macOS
10.14.  So don't use it because Apple is great.

Pretty much all of our use of it actually is done better with operator*
anyway (since operator* doesn't do a check that the optional has a
value).

Also replaced *most* of the `has_value()` calls with direct bool
context, except for one in the config section which looked really
confusing at a glance without a has_value().
4 years ago
Jason Rhinelander 1697bf90fe C++17
Compiles with C++17, replaces ghc::filesystem with std::filesystem,
nonstd::optional with std::optional, and llarp::string_view with
std::string_view.
4 years ago
Stephen Shelton 273270916e
The Great Wall of Blame
This commit reflects changes to clang-format rules. Unfortunately,
these rule changes create a massive change to the codebase, which
causes an apparent rewrite of git history.

Git blame's --ignore-rev flag can be used to ignore this commit when
attempting to `git blame` some code.
4 years ago
Stephen Shelton 4c6be3c8d1
Add PathBuildRejectedEvent to RouterHive 4 years ago
Stephen Shelton f61cd1a7da
Add some notes/comments about DHT message handling 4 years ago
Jeff Becker fdcd19662f
remove trailing "ms" 4 years ago
Jeff Becker bf0416cab8
remove Time_t, add operator overload for printing llarp_time_t and add to_json function for serializing llarp_time_t to json 4 years ago
Jeff Becker d2d109e92c
llarp_time_t is now using std::chrono 4 years ago
Jeff Becker f4520ac920
make decaying hashset use llarp::Time_t and move unit tests to use catch2 4 years ago
Jason Rhinelander 089056ca5b Remove all ABSL_ATTRIBUTE_UNUSED uses 4 years ago
Stephen Shelton ea97a8f2ac
Make format 4 years ago
Thomas Winget 145efaf0bb should probably build before committing... 4 years ago
Thomas Winget ad3465ee66 std move better 4 years ago
Thomas Winget 893ef2b874 const-y-ness and move-y-ness 4 years ago
Thomas Winget fc56a018e5 path builder prints hops, rest print short name 4 years ago
Jason Rhinelander ac1486d0be Replace absl::optional with optional-lite
Step 1 of removing abseil from lokinet.

For the most part this is a drop-in replacement, but there are also a
few changes here to the JSONRPC layer that were needed to work around
current gcc 10 dev snapshot:

- JSONRPC returns a json now instead of an optional<json>.  It doesn't
  make any sense to have a json rpc call that just closes the connection
  with returning anything.  Invoked functions can return a null (default
  constructed) result now if they don't have anything to return (such a
  null value won't be added as "result").
4 years ago