Commit Graph

155 Commits

Author SHA1 Message Date
Jeff Becker
3425069b41
feedback from jason
* use emplace in PeerSectionConfig::Acceptable use insert everywhere else
* use const l-value references
* fix typos and spelling mistakes
2021-03-02 07:20:29 -05:00
Jeff Becker
9457da27d9
add option to enforce unique netblocks per path. 2021-03-02 07:20:28 -05:00
Jeff Becker
1f1db29816
GetIf -> GetRandom 2021-02-03 16:38:31 -05:00
Jeff Becker
f24cdb305b
clean up calls to NodeDB::GetIf to be cleaner and more concise 2021-02-03 14:49:33 -05:00
Jeff Becker
d55705362a
use good routers 2021-02-03 13:50:12 -05:00
Jeff Becker
b6dbbb4bef
consolidate pathbuilder logic
* deduplicate code for path hops selection
2021-02-03 13:44:43 -05:00
Jeff Becker
df4ea34a56
nodedb refactor
* bump zmq static dep
* lokimq -> oxenmq
* llarp_nodedb -> llarp::NodeDB
* remove all crufty api parts of NodeDB
* make NodeDB rc selection api not suck
* make path builder api not suck
* propagate all above changes so that unit tests work and it all compiles
2021-02-02 09:35:40 -05:00
Jeff
e66522b9dd
fix path reference leak (#1451) 2020-11-04 11:08:29 -05:00
Jeff
8be7c46531
try fixing memory leak in path builder (#1442) 2020-11-02 08:06:46 -05:00
Jeff
dcb48db5fe
enable profiling on clients by default (#1421)
* enable client relay profiling by default

* macos dns fixes

* improve peer profiling algorithm to track timeouts vs failures

* remove debug ioctl call in tuntap code

* use ub_wait instead of ub_process as that was what was there before

* const correctness

* DRY out checking for SIIT

* typofix

* correct name
2020-10-27 17:34:09 -04:00
Jeff
4c7d52ac20
more aggressive path building. (#1423)
* more aggressive path building.

* do more than one in parallel path builds at a time

* correct last commit's logic

* rename numPaths -> numDesiredPaths to clarify intent

* revert string change as it will break a lot

* don't prematurly short circuit on snode builds

Co-authored-by: Thomas Winget <tewinget@gmail.com>
2020-10-27 16:27:14 -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
f4971a88fd
use lokimq workers instead of llarp:🧵:ThreadPool 2020-07-02 11:07:34 -04: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
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
Thomas Winget
84a1d7dbcc clang format....... 2020-03-06 20:20:11 -05:00
Thomas Winget
c8c66f0a5f some refactoring of tooling code, added RCGossipReceivedEvent 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
1e04decb66 can ping on lokinet running in python context! 2020-03-03 19:57:09 -05:00
Jason Rhinelander
76608b6b90 Logic simplification 2020-03-01 11:58:08 -04:00
Jason Rhinelander
f1aa27e616 fix speeling mistack 2020-02-25 22:27:34 -04:00
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 2020-02-25 12:05:13 -05:00
Jeff Becker
d2d109e92c
llarp_time_t is now using std::chrono 2020-02-24 15:25:03 -05:00
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
2020-02-21 23:22:47 -04:00
Stephen Shelton
ea97a8f2ac
Make format 2020-02-21 10:16:45 -07:00
Thomas Winget
fae86281e9 make path short name look nicer 2020-02-20 17:20:17 -05:00
Thomas Winget
74d421ac2d PathBuildNumber -> NextPathBuildNumber because increment side-effect 2020-02-20 16:57:48 -05:00
Thomas Winget
893ef2b874 const-y-ness and move-y-ness 2020-02-20 16:46:07 -05:00
Thomas Winget
fc56a018e5 path builder prints hops, rest print short name 2020-02-20 16:37:39 -05:00
Jeff Becker
499e346da6
notify delivery of path builds 2020-02-06 12:12:39 -05:00
Jeff Becker
56dce90de9
add trace log level for tracking logic thread jobs 2019-11-22 16:23:19 -05:00
Thomas Winget
ef1a5652ef
remove our paths from outbound queues 2019-11-07 13:23:06 -05:00
Jeff Becker
7ee026fa50
make path builds work again 2019-11-05 11:58:53 -05:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -04:00
Jeff Becker
bcf9135da6
testnet 2019-09-05 16:20:55 -04:00
Jeff Becker
1adae338ce
Merge remote-tracking branch 'origin/master' 2019-09-04 07:58:02 -04:00
Michael
edd0ec398f
Move thread stuff to subdirectory 2019-09-03 20:52:28 +01:00
Michael
4d8fe2a8a8
Move meta programming to subdirectory 2019-09-03 20:52:28 +01:00
Jeff Becker
c01112e4b7
tracy lock contention testing and other fun things 2019-09-03 11:56:56 -04:00
Michael
094b697b01
Replace StatusObject with underlying JSON type 2019-08-19 10:33:26 +01:00
Michael
a270fe5f33
fixup! Fix gcc trunk warnings 2019-08-02 10:34:56 +01:00
Michael
f9e9227e19
Fix gcc trunk warnings 2019-08-02 10:29:08 +01:00
Jeff Becker
aa0a795689
call path build fail stuff in logic thread 2019-07-31 08:51:24 -04:00
Jeff Becker
60fbeca9d4
const correctness 2019-07-29 12:43:24 -04:00
Jeff Becker
db2206664a
fix crashes in testnet 2019-07-29 11:10:20 -04:00
Jeff Becker
f48754c45d
make hop count and length configurable 2019-07-18 12:28:17 -04:00
Jeff Becker
b9bcc2b775
make threadpool consice 2019-07-09 09:47:24 -04:00
Jeff Becker
d6ec528a72
start work on seperating ips out of endpoint 2019-07-01 10:56:56 -04:00
Jeff Becker
64e9622270
start seperating tun and endpoint 2019-07-01 09:44:25 -04:00
Michael
b6b400baef
Tidy up pathbuilder code 2019-06-20 17:35:40 +01:00
Michael
b89689fec3
Refactor path build code 2019-06-18 22:51:41 +01:00
Jeff
674f272a46
Merge pull request #630 from majestrate/master
recent stability stuff
2019-05-29 08:20:25 -04:00
Michael
491fee206b
Port code to use CryptoManager over passing Crypto pointers 2019-05-28 20:45:08 +01:00
Jeff Becker
068fec82fb
set lifetime of paths 2019-05-28 10:06:01 -04:00
Jeff Becker
64c7ed42fc
make format 2019-05-22 12:20:50 -04:00
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
2019-05-22 12:20:03 -04:00
Michael
dd8a93a400
Apply rule of zero to code base 2019-05-19 23:11:07 +01:00
Jeff Becker
a4e90ee769
hax to make it work. 2019-05-16 14:55:12 -04:00
Jeff Becker
d3a98db267
don't resize frames 2019-05-15 10:55:01 -04:00
Jeff Becker
486042511c
log hops 2019-05-08 10:30:55 -04:00
Jeff Becker
540c2e1666
fix previous commit 2019-05-08 10:18:04 -04:00
Jeff Becker
df322e1149
don't include duplicate hops in paths 2019-05-08 10:01:31 -04:00
Jeff Becker
b68f539de6
limit outbound connections 2019-05-08 08:17:48 -04:00
Jeff Becker
7b03b63d13
more sighup code 2019-05-07 14:15:22 -04:00
Jeff Becker
a53da68700
start work on sighup 2019-05-07 13:46:38 -04:00
Jeff Becker
61d42811be
prevent crash 2019-05-07 09:04:43 -04:00
Jeff Becker
34533db620
add urgent build that builds over an existing path for an endpoint 2019-05-07 08:31:34 -04:00
Jeff Becker
b9adf90fb9
remove random timer fuzz 2019-05-06 12:13:41 -04:00
Jeff Becker
6c17bf35b3
decrease minimum path build interval 2019-05-06 12:00:10 -04:00
Jeff
01906c5d94 Merge remote-tracking branch 'origin/master' 2019-04-28 13:33:27 -04:00
Michael
9ee525a006
Fix shadowing warnings 2019-04-26 00:21:19 +01:00
Jeff Becker
6711296b26
finish converting to shared_ptr 2019-04-23 12:13:22 -04:00
Jeff Becker
99c29cf05a
prepare for ios/android jazz
move to use std::shared_ptr instead of bare pointers so we can
multithread everything.
2019-04-23 10:28:59 -04:00
Jeff Becker
57dc6cc965
make bundling rc in path builds configurable on runtime 2019-04-18 07:49:54 -04:00
Jeff Becker
94eb37d490
bundle RC in build record to improve build success rates. 2019-04-17 15:05:54 -04:00
Jeff Becker
87ff9268da
if a router is connected it's fine given it's a boostrap 2019-04-16 10:43:12 -04:00
Jeff Becker
a45d6db0e0
better profiling 2019-04-16 07:44:55 -04:00
Jeff Becker
6220fef2dc
select good first hops 2019-04-09 12:27:47 -04:00
Jeff Becker
c910a2a2fb
more 2019-04-05 10:58:22 -04:00
Jeff
97b9c679b0 don't use bootstrap nodes for first hops in paths 2019-04-03 15:05:44 -04:00
Jeff Becker
965b0957ee
tweaks 2019-03-31 11:09:59 -04:00
Jeff Becker
c23498925c
disable profiling on path fail 2019-03-31 10:41:36 -04:00
Jeff Becker
91298c4819
re-enable profiling 2019-03-25 10:17:02 -04:00
Jeff Becker
8a63533d1a
have service nodes maintain min connections
path building more robust selection
2019-03-25 08:52:32 -04:00
Jeff Becker
db17b0fad5
disable profiling 2019-03-22 13:41:04 -04:00
Jeff Becker
c63beae1c6
use std::min not std::max for linear backoff
ayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyylmao
this was fucking dumb as shit
2019-03-22 10:18:57 -04:00
Jeff Becker
ce126166af
more logging info 2019-03-22 10:10:30 -04:00
Jeff Becker
0369e42d5e
try harder to select hops 2019-03-22 08:44:15 -04:00
Jeff Becker
5d3833ef1a
fix dumb as shit path building that causes premature termiantion because of duplicate hops 2019-03-11 09:58:31 -04:00
Jeff Becker
6a09348c47
today's work 2019-03-07 17:53:36 -05:00
Jeff Becker
8331449ab9
update profiles on path build 2019-03-04 12:03:18 -05:00
Jeff Becker
591f3c92a9
make build records smaller 2019-02-19 10:06:39 -05:00
Michael
887fb4ac62
Replace insert(make_pair()) with emplace() 2019-02-18 10:35:23 +00:00
Michael
048fa83c39
Finish replacement of Router with AbstractRouter 2019-02-14 22:31:31 +00:00
Jeff Becker
46222df421
refactor 2019-02-11 12:14:43 -05:00
Jeff Becker
66753430ad
fix it 2019-02-08 16:29:56 -05:00
Jeff Becker
e1522faeaa
add introspection rpc endpoint 2019-02-08 14:43:25 -05:00
Michael
729cd045f1
Convert llarp::Router into an abstract base class 2019-02-06 09:59:47 +00:00
Jeff Becker
a953b34a45
fix crash 2019-02-05 10:06:53 -05:00