Commit Graph

519 Commits

Author SHA1 Message Date
Stephen Shelton
5e05defc76
Add API query for peer stats, other related fixes 2020-07-02 10:13:22 -06:00
Stephen Shelton
595288e046
Add PeerDb::handleGossipedRC 2020-07-02 10:13:22 -06:00
Stephen Shelton
7109ddc951
Add PeerDb::modifyPeerStats() 2020-07-02 10:13:21 -06:00
Stephen Shelton
cc6e9c882a
Use foo.snode as peerstats unique id, test file-backed db 2020-07-02 10:12:14 -06:00
Stephen Shelton
a30806b375
Some sqlite_orm related fixes 2020-07-02 10:12:14 -06:00
Stephen Shelton
8adb6295fc
Initialize sqlite_orm and start interacting with it 2020-07-02 10:12:13 -06:00
Stephen Shelton
73c9ddff52
Begin peer stats infrastructure 2020-07-02 10:12:11 -06:00
Jason Rhinelander
a7c42ab2bd
Use lokimq's hex/base32z encoding/decoding 2020-07-02 11:13:31 -04:00
Jason Rhinelander
271ded7a1f
Fix test variable scope
These variables need to persist past the end of the lambda and weren't;
release builds didn't seem to mind access the freed memory, but Debug
builds triggered failures.
2020-07-02 11:13:31 -04:00
Jeff Becker
8fc52fcbbe
increase test timeout 2020-07-02 11:13:31 -04:00
Jeff Becker
c9a2222d39
Revert "bump submodules"
This reverts commit 0de2b994fa3e3252eae46d39960dd17872184050.
2020-07-02 11:13:30 -04:00
Jeff Becker
0f21eeccb0
* rework exit codepath to allow multiple exits
* rework net code for ip ranges to be cleaner
* clean up endpoint auth code
* refactor config to validate network configs before setting up endpoints
* remove buildone from path/pathbuilder.cpp so we don't spam connection attempts
2020-07-02 11:13:30 -04:00
Jeff Becker
2ef2e6171a
bump submodules 2020-07-02 11:13:30 -04:00
Jeff Becker
3cdca30a74
more auth shit 2020-07-02 11:13:30 -04:00
Jeff Becker
0d6e3bcd89
fix crashing tests 2020-07-02 11:13:30 -04:00
Jeff Becker
0787b6e2fd
load config differently for unit tests because they run as root in CI for some reason 2020-07-02 11:13:29 -04:00
Jeff Becker
98a3b45f16
disable logging to see why ci tests die like a sucka 2020-07-02 11:12:50 -04:00
Jeff Becker
b6a7b5ccfb
only run catch2 tests in gdb and add assert to unit test 2020-07-02 11:12:05 -04:00
Jeff Becker
e13e886df9
fix up event loop crap so that unit tests pass 2020-07-02 11:10:06 -04:00
Jeff Becker
456f9d4ba1
remove GNU-ism 2020-07-02 11:10:06 -04:00
Jeff Becker
0a889d7042
fix up iwp unit test 2020-07-02 11:10:06 -04:00
Jeff Becker
e95b9d530e
fix unit tests, make them pass 2020-07-02 11:10:06 -04:00
Jeff Becker
f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 2020-07-02 11:07:34 -04:00
Stephen Shelton
11951510bf
Remove libabyss and rpc::Caller/rpc::Server 2020-07-02 11:07:30 -04:00
Stephen Shelton
0aa43c6b07
Pass RuntimeOptions instead of 'bool isRelay' 2020-07-01 08:38:56 -06:00
Stephen Shelton
b5d6a73ffd
Rip out most of C API 2020-06-29 13:55:59 -06:00
Jeff Becker
6984cda3a6
add pybind and router hive to ci 2020-06-08 15:50:12 -04:00
Jeff Becker
b8e1ffa83e
add comments and improve the regression test 2020-06-08 15:36:47 -04:00
Jeff Becker
3d2990f90d
use llarp::LogSilencer to shut up loging in unit tests 2020-06-08 09:26:53 -04:00
Jeff Becker
a73335579a
silence logging in regression test 2020-06-08 09:07:49 -04:00
Jeff Becker
800668348a
add regression test for key backup bug 2020-06-08 08:42:10 -04:00
Stephen Shelton
1497b829bd
Ignore our self.signed file if we're a client 2020-06-04 11:05:23 -06:00
Jeff Becker
328c7a398e
make sure event loop owns logic so that logic call does not use seperate thread 2020-05-23 16:07:20 -04:00
Jeff Becker
00143e63f4
put replay filters on transit hops to reduce retransmissions. 2020-05-23 16:07:20 -04:00
Jason Rhinelander
d05e6716cb Remove llarp::str(string_view)
It was a workaround for pre-C++17 std::string which didn't support
passing a string_view to various functions/operators.  There's only one
place left that needs an explicit conversion, and that's where it is
used as a map key; so just be explicit there and remove llarp::str()
everywhere else.
2020-05-21 17:05:30 -03:00
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().
2020-05-20 19:18:28 -03:00
Jason Rhinelander
bdc9c7bfa8 Move IPRange out of net.hpp; free up TruncateV6 etc.
- Move IPRange into its own net/ip_range.hpp

- Move the static net::IPPacket::TruncateV6, etc. functions to free
net::TruncateV6, etc. functions (now from net/ip.hpp instead of
net/ip_packet.hpp).

- Make net::TruncateV6 and net::ExpandV4 constexpr.

- Add IPRange::FromIPv4 factory function (to replace the iprange_ipv4
free function)
2020-05-20 19:18:27 -03:00
Stephen Shelton
807bfc5302
Initialize Config with LoadConfig in all key manager tests 2020-05-20 15:54:23 -06:00
Stephen Shelton
fa6845b206
Use global RC file paths instead of redefining them 2020-05-20 15:54:23 -06:00
Stephen Shelton
ac225eb65e
Testing: explicitly initialize variable 2020-05-20 15:54:22 -06:00
Stephen Shelton
7167b4ad02
Properly initialize config in unit test 2020-05-20 15:54:21 -06:00
Rick V
918a09c0cf fix sockaddr win32 and collapse headers on the unix side 2020-05-18 15:13:45 -05:00
Jason Rhinelander
c5faa86926 cmake refactor
Refactors many things in cmake to improve and simplify:

- don't use variable indirection for target names; target names are
*already* a variable of sorts.  (e.g. ${UTIL_LIB} is now just
lokinet-util).  cmake/basic_definitions.cmake is now gone.

- fix LTO enabling to use the standard cmake (3.9+) LTO mechanism rather
than shoving a bunch of flag hacks through link_libraries and
add_compile_options.  This also now enables LTO when building a shared
library (because previously the -flto hacks were only turned on in the
static code for some reason).

- build liblokinet as *either* shared library or static library, but not
both.  Building both makes things more complicated because they had
different names (lokinet-shared or lokinet-static) and seems pointless:
you generally want one or the other.  Now there is just the liblokinet
target, which will be shared or static depending on the value of
BUILD_SHARED_LIBS.

- Simplify lokinet-cryptography AVX2 code: just build *one* library, and
add in the additional AVX2 files when possible, rather than building two
and needing to merge them.

- Compress STATIC_LINK and STATIC_LINK_RUNTIME into just STATIC_LINK.
It makes no sense to use one of these (_RUNTIME) on Windows and the
other on non-Windows when they appear to try to do the same thing.

- remove a bunch of annotations from `endif(FOO)` -> `endif()`.

- move all the tuntap compilation code (including OS-specific source
file selection) into vendor/CMakeLists.txt and build tuntap as an
intermediate OBJECT library rather than keeping a global variable in 5
different files.

- move release motto define to root cmake; it made no sense being
duplicated in both unix.cmake and win32.cmake

- fix add_log_tag to not stomp on any existing source compile flags with
its definition.  Also use proper compile definition property instead of
cramming it into compile flags.

- make optimization/linker flags less hacky.  There's no reason for us
to force particular optimization flags because the cmake build type
already does that (e.g. -DCMAKE_BUILD_TYPE=Release does -O3).  Not doing
that also silences a bunch of cmake warnings because it thinks "-O0 -g3"
etc.  are link libraries (which is reasonable: that's what the code was
telling cmake they are).

- sets the default build type to RelWithDebInfo which gives us `-O2 -g`
if you don't specify a build type.

- Move PIC up (so that the things loaded in unix.cmake, notably libuv,
have it set).

- Add a custom `curl` interface library that carries the correct link
target and include paths for curl (system or bundled).
2020-05-17 23:31:23 -03:00
Jason Rhinelander
26ecf23ad8 Silence various warnings 2020-05-17 21:28:17 -03:00
Jason Rhinelander
bc4573c447 Disable empty string SockAddr throw test
The code intentionally no longer throws and handles this as a special
case (resulting in an empty SockAddr).
2020-05-17 17:08:11 -03:00
Jeff Becker
1780e86faa
fix up unit tests, make them all pass 2020-05-15 08:38:04 -04:00
Jeff
a5b09c47e1
Merge pull request #1262 from notlesh/bandaids-for-sockaddr-refactor-2020-05-11
Bandaids for sockaddr refactor 2020 05 11
2020-05-12 12:04:59 -04:00
Stephen Shelton
174c9ec740
log-- 2020-05-08 16:52:46 -06:00
Stephen Shelton
78d09f2ae5
Support SockAddr in from sockaddr and friends 2020-05-08 16:52:00 -06:00
Stephen Shelton
e944bcb28a
Unit tests and fixes for SockAddr::fromString() 2020-05-08 14:33:44 -06:00