Commit Graph

338 Commits (dev)

Author SHA1 Message Date
Jeff d3091cf9fc
Merge pull request #1167 from tewinget/tooling
RouterHive initial PR
4 years ago
Stephen Shelton 4c6be3c8d1
Add PathBuildRejectedEvent to RouterHive 4 years ago
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.
4 years ago
Thomas Winget 84a1d7dbcc clang format....... 4 years ago
Thomas Winget c8c66f0a5f some refactoring of tooling code, added RCGossipReceivedEvent 4 years ago
Thomas Winget a9882ad475 PathRequestReceivedEvent implemented 4 years ago
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.
4 years ago
Thomas Winget 1e04decb66 can ping on lokinet running in python context! 4 years ago
Jeff Becker add305b9f4
use size / 2 as the number of transit paths 4 years ago
Jeff Becker 05082e2507
fix status line 4 years ago
Jason Rhinelander 76608b6b90 Logic simplification 4 years ago
Stephen Shelton f61cd1a7da
Add some notes/comments about DHT message handling 4 years ago
Jason Rhinelander f1aa27e616 fix speeling mistack 4 years ago
Jeff Becker 9d5dbbc0ad
remove uneeded members 4 years ago
Jeff Becker 66181d8a8f
systemd status 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
Jason Rhinelander f84ce61d66 Removed empty cpp files
These aren't needed: CMake already knows how to follow #includes and
rebuild when headers change as long as the headers are included
*somewhere*.  The extra .cpp files here just require building a bunch of
.cpp files with just header content that we just end up throw away
during linking (since the same things will also be compiled in whatever
other compilation units include the same headers).
4 years ago
Jason Rhinelander b4440094b0 De-abseil, part 2: mutex, locks, (most) time
- util::Mutex is now a std::shared_timed_mutex, which is capable of
  exclusive and shared locks.

- util::Lock is still present as a std::lock_guard<util::Mutex>.

- the locking annotations are preserved, but updated to the latest
  supported by clang rather than using abseil's older/deprecated ones.

- ACQUIRE_LOCK macro is gone since we don't pass mutexes by pointer into
  locks anymore (WTF abseil).

- ReleasableLock is gone.  Instead there are now some llarp::util helper
  methods to obtain unique and/or shared locks:
    - `auto lock = util::unique_lock(mutex);` gets an RAII-but-also
      unlockable object (std::unique_lock<T>, with T inferred from
      `mutex`).
    - `auto lock = util::shared_lock(mutex);` gets an RAII shared (i.e.
      "reader") lock of the mutex.
    - `auto lock = util::unique_locks(mutex1, mutex2, mutex3);` can be
      used to atomically lock multiple mutexes at once (returning a
      tuple of the locks).
  This are templated on the mutex which makes them a bit more flexible
  than using a concrete type: they can be used for any type of lockable
  mutex, not only util::Mutex.  (Some of the code here uses them for
  getting locks around a std::mutex).  Until C++17, using the RAII types
  is painfully verbose:

  ```C++
  // pre-C++17 - needing to figure out the mutex type here is annoying:
  std::unique_lock<util::Mutex> lock(mutex);
  // pre-C++17 and even more verbose (but at least the type isn't needed):
  std::unique_lock<decltype(mutex)> lock(mutex);
  // our compromise:
  auto lock = util::unique_lock(mutex);
  // C++17:
  std::unique_lock lock(mutex);
  ```

  All of these functions will also warn (under gcc or clang) if you
  discard the return value.  You can also do fancy things like
  `auto l = util::unique_lock(mutex, std::adopt_lock)` (which lets a
  lock take over an already-locked mutex).

- metrics code is gone, which also removes a big pile of code that was
  only used by metrics:
  - llarp::util::Scheduler
  - llarp:🧵:TimerQueue
  - llarp::util::Stopwatch
4 years ago
Stephen Shelton ea97a8f2ac
Make format 4 years ago
Thomas Winget fae86281e9 make path short name look nicer 4 years ago
Thomas Winget 145efaf0bb should probably build before committing... 4 years ago
Thomas Winget 74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 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
Jeff Becker e35d17764a * add path::Path::UniqueEndpointSet_t
* start using check2 for new unit tests
* unit test for path::Path::UniqueEndpointSet_t
4 years ago
Jeff Becker 7374f8f0fd
update lokinetmon 4 years ago
Jeff Becker e8b84fcfbd
add path speed metrics for lokinetmon 4 years ago
Jeff Becker 499e346da6
notify delivery of path builds 4 years ago
Jeff Becker 99eb7726ff
initial dht key blinding 4 years ago
Jeff Becker 9efd796145
initial wack at 0.7.0 dht fixes 4 years ago
Jeff Becker 495ad6d566
testnet patch 4 years ago
Jeff Becker 9214ecbc48
rename bloomfilter to replayfilter 5 years ago
Jeff Becker a7a101e33c
more intellegent path failure profiling using LRSM 5 years ago
Jeff Becker 1244ad83ad
fix include file use 5 years ago
Jeff Becker d391f70417
reduce cpu use 5 years ago
Jeff Becker 73e07ef2d0
client side replay filter 5 years ago
Jeff Becker 472cee2594
make static constant for decay interval 5 years ago
Jeff Becker da5af879e9
typofix 5 years ago
Jeff Becker f3e96e06b2
propagate error to client 5 years ago
Jeff Becker a9c9fe9c24
limit client side path builds per ip 5 years ago
Jeff Becker 8b8d636ded
make format 5 years ago
Thomas Winget 71bb0dd520 implement timers using libuv
So far only a bit of the code using timers has been modified to use
the new libuv-based timers.  Also only the non-Windows case has been
implemented.  Seems to be working though, so it's a good time to commit.
5 years ago
Jeff Becker 01b24c7090
limit connections 5 years ago
Jeff Becker 0f4c531d06
fix path resource leak 5 years ago
Jeff Becker 0828307906 fix address mapping bug 5 years ago
Jeff Becker 5188873288 batch and flush 5 years ago
Jeff Becker 2852601a28 flush in logic 5 years ago
Jeff Becker d823d6fa70 only flush when no other jobs are executing 5 years ago
Jeff Becker 9e305c5b30 use lockless queues to gather results of transit traffic work 5 years ago
Jeff Becker d591394ad2 dont process empty queues 5 years ago
Jeff Becker e2472d985d process transit hops on flush 5 years ago
Jeff Becker c3858a56df
make it compile 5 years ago
Jeff Becker 34bc3da069
flush quues of other paths 5 years ago
Jeff Becker 56dce90de9
add trace log level for tracking logic thread jobs 5 years ago
Jeff Becker 1a864832c8
make format 5 years ago
Thomas Winget 23a9773e1e
remove our paths from outbound queues 5 years ago
Thomas Winget ef1a5652ef
remove our paths from outbound queues 5 years ago
Thomas Winget 17de3f2478 do...while; make format; remove erroneous GUARDED_BY 5 years ago
Thomas Winget 75512b1b58 ban zero id for pathid; clarity and cleanup 5 years ago
Thomas Winget 9d3e7d349c Add per-path queues, prioritize control messages over traffic 5 years ago
Jeff Becker 7ee026fa50
make path builds work again 5 years ago
Jeff Becker 7c35b00f98
Revert "move calling of path build sccess hook to correct place"
This reverts commit 902cd86a3b.
5 years ago
Jeff Becker 902cd86a3b
move calling of path build sccess hook to correct place 5 years ago
Jeff Becker 9d266dbec7
meh 5 years ago
jeff 32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 5 years ago
jeff f9fb40f590 final touches 5 years ago
jeff 6c2ebbb925 try fixing handover and add snapp traffic to multithreaded crypto workers 5 years ago
Jeff Becker 5863e33825
move it arround 5 years ago
Jeff Becker 327c545530
finish multithread cryptography first pass 5 years ago
jeff 14c9ef15ed try calling stuff in logic thread from event loop 5 years ago
Jeff Becker bcf9135da6
testnet 5 years ago
Jeff Becker 3c0245f8b3
Merge remote-tracking branch 'github/master' into iwp-multi-ack 5 years ago
Jeff Becker 4bf6882c8a
more async cryptography 5 years ago
Jeff Becker 12314e8d00
ensure no crash on quit 5 years ago
Jeff Becker 5cdd92e2a3
remove more locking and make it safe 5 years ago
Jeff Becker 1adae338ce
Merge remote-tracking branch 'origin/master' 5 years ago
Michael edd0ec398f
Move thread stuff to subdirectory 5 years ago
Michael 4d8fe2a8a8
Move meta programming to subdirectory 5 years ago
Jeff Becker c01112e4b7
tracy lock contention testing and other fun things 5 years ago
Michael 094b697b01
Replace StatusObject with underlying JSON type 5 years ago
Michael 40aabd6d92
Use the right version of clang-tidy 5 years ago
Michael 0a1620aff2
make format 5 years ago
Michael 16cdfbd5f0
clang-tidy modernize pass 5 years ago
Michael 84601fa474
Make format 5 years ago
Michael d1990b5e93
Fix suspicious thread-unsafety 5 years ago
Jeff 10d7e7cb77
Merge branch 'master' into master 5 years ago
Michael c429f0cec9
Jeff's fixes 5 years ago
Michael a270fe5f33
fixup! Fix gcc trunk warnings 5 years ago
Michael f9e9227e19
Fix gcc trunk warnings 5 years ago
Michael 4763888d2c
Add fail-able docker build for gcc trunk 5 years ago
Rick V f6c97091fd
clang-format 5 years ago
Rick V 16096c6adb
add debug helper lib for core dump generation on all supported windows targets
had an epiphany earlier

i kept having problems with static linking because
i merged the GNU C runtime with the SEH library
instead of merging the latter with pthread
5 years ago
Jeff Becker aa0a795689
call path build fail stuff in logic thread 5 years ago
Jeff Becker 60fbeca9d4
const correctness 5 years ago
Jeff Becker db2206664a
fix crashes in testnet 5 years ago
Thomas Winget 697ece64cc make TransitHop self-destruct if path is invalidated 5 years ago
Thomas Winget 38fd0552d3 Adds Link-Relay Status Messages
Success case:
  - the path endpoint creates and sends a LR_StatusMessage upon
    successful path creation

Failure case:
  - an intermediate hop creates and sends a LR_StatusMessage upon
    failure to forward the path to the next hop for any reason

Both cases:
  - transit hops receive LR_StatusMessages and add a frame
    to them reflecting their "status" with respect to that path
  - the path creator receives LR_StatusMessages and decrypts/parses
    the LR_StatusRecord frames from the path hops.  If all is good,
    the Path does as it would when receiving a PathConfirmMessage.
    If not, the Path marks the new path as failed.

LR_StatusMessage is now used/sent in place of PathConfirmMessage
5 years ago
Thomas Winget bbb5339b33 add debug-level log message on path build success 5 years ago
Jeff Becker 7a3c8e5ca0
set limits correctly 5 years ago
Jeff Becker f48754c45d
make hop count and length configurable 5 years ago
Michael e52492911d
Refactor endpoint state management to a new class 5 years ago
Jeff Becker 1fd6b5ae74
Merge remote-tracking branch 'origin/master' into ipv6-tun 5 years ago
Michael be997020dd
Fixup two minor warnings 5 years ago
Michael 488695047f
Remove redundant else blocks 5 years ago
Jeff Becker b9bcc2b775
make threadpool consice 5 years ago
Jeff Becker d6ec528a72
start work on seperating ips out of endpoint 5 years ago
Jeff Becker 64e9622270
start seperating tun and endpoint 5 years ago
Michael b6b400baef
Tidy up pathbuilder code 5 years ago
Michael 08609f9e5a
Rename message files 5 years ago
Michael 8a058fcb34
Move other messages 5 years ago
Michael 83bd9227a7
Move exit messages 5 years ago
Michael d6751e3eeb
Move subset of messages to right directory 5 years ago
Michael b89689fec3
Refactor path build code 5 years ago
Rick V c6c31efec9
make format 5 years ago
Jeff Becker 9ea13a9ee3
ingore paths that drop exit traffic 5 years ago
Jeff Becker 762a0c534f
Merge remote-tracking branch 'origin/master' 5 years ago
Michael 491fee206b
Port code to use CryptoManager over passing Crypto pointers 5 years ago
Jeff Becker 068fec82fb
set lifetime of paths 5 years ago
Jeff Becker 2897141036
make format and introduce new function EnsureRouter on router to check nodedb or do dht lookup 5 years ago
Jeff Becker a375f1103f
explicitly lookup router if not connected to it on LRCM forward. 5 years ago
Jeff Becker c77e0aff8a
only check for ready paths when counting in future 5 years ago
Jeff Becker 13190284f7
double path build timeout 5 years ago
Jeff Becker 64c7ed42fc
make format 5 years ago
Jeff Becker 9c96aecf3f
move llarp::Logic to std::shared_ptr
add sequence numbers to HSD messages

begin work on network isolation code

add more docs
5 years ago
Michael dd8a93a400
Apply rule of zero to code base 5 years ago
Jeff Becker a4e90ee769
hax to make it work. 5 years ago
Jeff Becker d3a98db267
don't resize frames 5 years ago
Jeff Becker f832c9a593
use shared_ptr 5 years ago
Jeff 06f8bb2f42 add blacklist-snode option 5 years ago
Jeff Becker ad019cab71
add changes for review 5 years ago
Jeff Becker 486042511c
log hops 5 years ago
Jeff Becker 540c2e1666
fix previous commit 5 years ago
Jeff Becker df322e1149
don't include duplicate hops in paths 5 years ago
Jeff Becker 9d466cd09d
pump only on send queue full and clear exit roles when closing exit 5 years ago
Jeff Becker b68f539de6
limit outbound connections 5 years ago
Jeff Becker 1d852a1e83
send exit close ack 5 years ago
Jeff Becker 7b03b63d13
more sighup code 5 years ago
Jeff Becker a53da68700
start work on sighup 5 years ago
Jeff Becker 744ebac579
only use ready paths 5 years ago
Jeff Becker 61d42811be
prevent crash 5 years ago
Jeff Becker 34533db620
add urgent build that builds over an existing path for an endpoint 5 years ago
Jeff Becker b9adf90fb9
remove random timer fuzz 5 years ago
Jeff Becker 6c17bf35b3
decrease minimum path build interval 5 years ago
Jeff Becker 5fa85acaf7
rebuild exit paths if they die 5 years ago