1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00
Commit graph

60 commits

Author SHA1 Message Date
jeff b0bb0b7609
initial route poking 2020-08-24 20:21:55 -04:00
jeff 75f9643776
attempt to fix snode traffic ip rewrite bug 2020-08-24 20:19:52 -04:00
Stephen Shelton 607d04a314
Use str instead of lokimq::ConnectionID in pybind 2020-07-23 10:52:53 -06:00
Stephen Shelton 56e2bc2c47
Acquire python's Global Interpreter Lock in callbacks 2020-07-06 17:40:42 -06:00
Stephen Shelton a88dc9f026
Prevent pybind from deleting HiveRouter pointers 2020-07-06 17:39:22 -06:00
Stephen Shelton 305795315b
Specify disabling RC gossiping (testing only) properly 2020-07-06 17:38:41 -06:00
Stephen Shelton 0e99f5bc86
Configure HiveContext it pybind correctly 2020-07-06 16:10:42 -06:00
Stephen Shelton 343252c48d
Use HiveContext and HiveRouter properly 2020-07-02 10:26:53 -06:00
Stephen Shelton 552dcce5fd
Use inheritance to handle Hive injection 2020-07-02 10:25:10 -06:00
Stephen Shelton b0d8568452
Remove llarp C API usage from RouterHive 2020-07-02 10:24:19 -06:00
Stephen Shelton 84c83a2400
Add specialized subclass of Router for Hive 2020-07-02 10:22:57 -06:00
Stephen Shelton aeb0c2be3a
Remove ability to stop routers from gossiping for now 2020-07-02 10:22:03 -06:00
Stephen Shelton bdac43e19f
Peer stats test which artificially stops a router from gossiping its RC 2020-07-02 10:22:03 -06:00
Stephen Shelton 3b6f84c68c
Peek at peer stats db in test_peer_stats 2020-07-02 10:22:02 -06:00
Stephen Shelton d1b629f494
RouterHive ConnectionAttemptEvent 2020-07-02 10:22:02 -06:00
Stephen Shelton d69d538f1a
Add missing files 2020-07-02 10:16:19 -06:00
Stephen Shelton b2a72dd46a
Initial test_peer_stats hive test 2020-07-02 10:16:19 -06:00
Jeff Becker 26f62bc260
make pybind compile 2020-07-02 11:13:32 -04:00
Jason Rhinelander a7c42ab2bd
Use lokimq's hex/base32z encoding/decoding 2020-07-02 11:13:31 -04:00
Jeff Becker 6984cda3a6
add pybind and router hive to ci 2020-06-08 15:50:12 -04: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
Jeff Becker 01cc2c86bf
format 2020-05-06 11:37:15 -04:00
Jeff Becker 635dc4fe13
unbreak router hive
llarp/config/config.cpp:
respect [network]:type option

llarp/handlers/exit.cpp:
when [network]:type is null dont init tun interface

llarp/service/context.cpp:
respect [network]:type option
change endpoint name back to "default"

llarp/tooling/router_hive.cpp:
dont use LogicCall for obtaining RCs from underlying relays, it crashes the mainloop and it's probably safe to readonly access RCs.

pybind/common.hpp:
remove typecasters as we use C++17 now

pybind/llarp/config.cpp:
remove SnappConfig
wire up NetworkConfig

pybind/llarp/handlers/pyhandler.hpp:
remove SnappConfig from constructor

pybind/llarp/handlers/pyhandler.cpp:
update constructor implementation to match header

test/hive/hive.py:
remove broke endpoint related code
wire up null endpoint option using NetworkConfig
use index at 0 for relays and clients instead of 1
dont add a python endpoint to all clients
2020-05-06 10:45:30 -04:00
Stephen Shelton 93b35c92a7
Eradicate service::Config 2020-05-04 11:05:51 -04:00
Stephen Shelton 526b1320b7
Some maybe-fixes for RouterHive post config cleanup 2020-04-24 11:18:25 -06:00
Stephen Shelton dfcf8fb62e
Update RouterHive to reflect config changes 2020-04-07 17:50:50 -06:00
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.
2020-04-07 12:38:56 -06:00
Stephen Shelton 8a12da8bd5
Remove some .cpp files related to RouterEvents
The motivation is to reduce the raw amount of code required to create
and maintain events.
2020-03-12 13:51:57 -06:00
Stephen Shelton ea835405c5
Refactor NotifyRouterEvent() to forward args, event code cleanup
This template-ifies Router::NotifyRouterEvent() up so that it accepts
the arguments to instantiate the specified event type, forwarding them
to std::make_unique. This would allow (in the future) the function to
no-op the call and avoid memory allocation. It also slightly reduces
the amount of code required to fire an event.

This commit also simplifies some of the RouterEvent code to reduce
redundancy.
2020-03-12 11:50:46 -06:00
Stephen Shelton 6664202868
Add FindRouterSentEvent and FindRouterReceivedEvent to RouterHive 2020-03-10 12:12:11 -06:00
Thomas Winget 84a1d7dbcc clang format....... 2020-03-06 20:20:11 -05:00
Thomas Winget 695784b2b6 more hive things
DHT PubIntroSentEvent
some helper functions added to RouterHive (C++ class) as well as RouterHive(Python class)
hive.py main() continues to be a testbed for new event types
some more internal classes in pybind
2020-03-04 00:57:26 -05:00
Thomas Winget 6fc05ca1ff RCGossipSentEvent 2020-03-03 19:57:09 -05:00
Thomas Winget c8c66f0a5f some refactoring of tooling code, added RCGossipReceivedEvent 2020-03-03 19:57:09 -05:00
Thomas Winget df0380e746 LRSM RouterEvent, added to hive test and test passes. 2020-03-03 19:57:09 -05:00
Thomas Winget 138a0b33fb jason's computer can't python3 2020-03-03 19:57:09 -05:00
Thomas Winget 771d0b4489 hive pytest framework in place (and path build test works)! 2020-03-03 19:57:09 -05:00
Thomas Winget 04c1f67f78 more structure to python hive code 2020-03-03 19:57:09 -05:00
Thomas Winget ee7b7e917d hive can now instantiate and start relays/clients separately 2020-03-03 19:57:09 -05:00
Stephen Shelton 4741d81051 Add GotIntro event to RouterHive 2020-03-03 19:57:09 -05:00
Jeff Becker e7689b40a7 dht pub intro message router event thiny doo 2020-03-03 19:57:09 -05:00
Jeff Becker 22ed47ca12 better tostring 2020-03-03 19:57:09 -05:00
Thomas Winget 309569628e change some to_string functions 2020-03-03 19:57:09 -05:00
Thomas Winget db2a0ef7f7 git add because I'm dumb 2020-03-03 19:57:09 -05:00
Thomas Winget a9882ad475 PathRequestReceivedEvent implemented 2020-03-03 19:57:09 -05:00
Thomas Winget c9a278c0de some more changes to pybind/hive code, read below
hive.py is currently largely for testing the pybind stuff, so changes to it will likely
be frequent and arbitrary for now.

Added pybind for llarp::path::PathHopConfig, but not every member -- just rc and upstream routerID

Hive now uses std::queue with mutex instead of our lockless queue.

Removed some functions from Hive that will not be necessary as things are being handled from python.
2020-03-03 19:57:09 -05:00
Thomas Winget 5cf35769b4 don't have python try to intercept stdout/stderr 2020-03-03 19:57:09 -05:00
Jeff Becker 32dbe6b1ad more shiz 2020-03-03 19:57:09 -05:00
Jeff Becker 877443d95c more introspection code 2020-03-03 19:57:09 -05:00
Thomas Winget 931ff521d1 working toward full testnet of routers (not clients yet) in hive/pybind setup
Not working yet -- some sort of RC issue.  Checkout the commit prior to this if you want something that 'works' that you can play with.
2020-03-03 19:57:09 -05:00