Commit Graph

556 Commits

Author SHA1 Message Date
Stephen Shelton
9be8050854
Make format 2020-03-02 09:57:37 -07:00
Stephen Shelton
886a981997
Consolidate introset publishing constants 2020-03-02 09:57:37 -07:00
Jeff Becker
a09bb89d15
dont put multiple outbound contexts 2020-03-02 11:56:47 -05:00
Jeff Becker
158a9018f3
rename variable 2020-03-02 11:18:26 -05:00
Jeff Becker
9ff31f6402
spelling is hard 2020-03-02 11:17:50 -05:00
Jeff Becker
8f4362f092
fix up introset lookups 2020-03-02 11:12:29 -05:00
Jason Rhinelander
806d43c34e
Merge pull request #1147 from notlesh/diagnose-pubintro-round2-2020-02-28
Diagnose pubintro round2
2020-03-01 20:26:41 -04:00
Jason Rhinelander
b60adc909d Make IntroSet publish confirmed less verbose
Essentially just rate limit the confirmation message to one message per
second.
2020-03-01 14:04:37 -04:00
Jason Rhinelander
cfee824a79 Don't republish when we have extra paths
This caused some unwanted behaviour:

- on initial startup we often get two publishes in quick succession
because we're publishing and building paths at the same time

- at the 10m mark we enter a publish loop every 5 seconds because we
have paths with lifetimes < 10min that was triggering this condition,
and yet those paths will never actually be included in the introset
because they are expiring in <10m.
2020-03-01 13:56:04 -04:00
Jason Rhinelander
823c17206f Add min intro set paths, slightly increase spread speed
This should ensure that we have enough shortly after startup for initial
path builds.

The spread speed here gets slightly increased to lifetime/5 (=4min)
instead of lifetime/4 (=5min) so that our "normal" number of paths is 5
with occassional momentary drops to 4, but should always keep us >= the
new minimum of 4.

Because the path spread happens over time, this shouldn't result in a
rebuild of several paths: we'll build 4 quickly, then another at +4m,
another at +8m, etc.  When the initial 4 expire, we'll be dropping from
9 to 5 established but that's still above the minimum (4) so we won't
need to reconnect to several at once, and the spread builds should keep
us at 5 all the time.
2020-03-01 12:37:43 -04:00
Jason Rhinelander
27b8743107 Add warns for introset publish failures 2020-03-01 11:48:43 -04:00
Stephen Shelton
62014de91c
Handle PubIntro relayOrder logic on client-side 2020-02-28 16:45:04 -07:00
Stephen Shelton
61d19179f7
Remove dead code 2020-02-28 16:32:00 -07:00
Jeff Becker
ce335dc47d
remove convotags on dead outbound context 2020-02-27 11:54:54 -05:00
Jeff
19a751c41b
Merge pull request #1127 from notlesh/spread-snapp-path-builds-evenly-2020-02-24
Spread snapp path builds evenly
2020-02-25 16:25:47 -05:00
Jeff
4f29405e9e
Merge pull request #1115 from majestrate/handle-multiple-responses-per-lookup-2020-02-20
handle multiple responses per hidden service lookup
2020-02-25 16:25:19 -05:00
Stephen Shelton
abe4015986
Use constants for path build timing 2020-02-25 13:52:59 -07:00
Stephen Shelton
230037b9f3
Increase default path timeout from 10min to 20min 2020-02-25 13:42:14 -07:00
Stephen Shelton
f0374eb2b7
Use existing 'lastBuild' var for spacing path builds 2020-02-25 13:39:28 -07:00
Stephen Shelton
c2c010dbad
Make format 2020-02-25 13:39:28 -07:00
Stephen Shelton
c1b5e453c7
Big I, little i, what begins with I? 2020-02-25 13:39:27 -07:00
Stephen Shelton
1db6c6ae3b
Make format 2020-02-25 13:39:27 -07:00
Stephen Shelton
c2f719c996
Build endpoint paths at even[ish] intervals 2020-02-25 13:39:25 -07:00
Jeff Becker
d2d109e92c
llarp_time_t is now using std::chrono 2020-02-24 15:25:03 -05:00
Jason Rhinelander
089056ca5b Remove all ABSL_ATTRIBUTE_UNUSED uses 2020-02-24 14:27:44 -04: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
Jeff Becker
748be8eec8
handle multiple responses per hidden service lookup 2020-02-20 14:33:54 -05:00
Stephen Shelton
0429bafbb3
Merge pull request #1111 from notlesh/redundant-introset-propagation-2020-02-19
Redundant introset propagation
2020-02-20 10:50:06 -08:00
Jeff
6ac5f19b3a
Merge pull request #1110 from jagerman/no-abseil-optional
De-abseil, part 1: remove absl::optional
2020-02-20 12:38:16 -05:00
Stephen Shelton
4c499fb076
Make format 2020-02-20 08:36:29 -07:00
Stephen Shelton
dff9aeb250
Propagate Introset publishing redundantly 2020-02-19 17:07:46 -07:00
Jeff Becker
dc7828941f
add log statement 2020-02-19 17:06:13 -07:00
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").
2020-02-19 18:21:25 -04:00
Jeff
20bc168d1c
Merge pull request #1093 from majestrate/toggle-publishing-introsets-2020-02-11
make publishing introsets optional
2020-02-19 11:50:41 -05:00
Jeff Becker
e907d2ae19
handover fixes 2020-02-18 12:15:14 -05:00
Jeff Becker
02228ded08
spread out path builds 2020-02-17 15:24:18 -05:00
Jason Rhinelander
c3637c81fd Remove another unused randomize parameter 2020-02-14 17:45:22 -04:00
Jason Rhinelander
24469daefb Remove unused parameter
We always randomize now.
2020-02-14 17:45:18 -04:00
Stephen Shelton
906803e387 Refactor DHT introset lookups to use redundant lookup strategy 2020-02-14 17:43:13 -04:00
Jeff Becker
4d4b33607f dont use optional 2020-02-14 17:43:13 -04:00
Jeff Becker
23bcfa4abb revert change 2020-02-14 17:43:13 -04:00
Jeff Becker
df8c56343d refactor GetManyPathsWithUniqueEndpoints to go into service/endpoint_util.hpp 2020-02-14 17:43:13 -04:00
Jeff Becker
fc5e6b4d77 log location 2020-02-14 17:43:13 -04:00
Jeff Becker
3cc2adae31 paralell publish and lookups 2020-02-14 17:43:13 -04:00
Jeff Becker
e30c720446 redundant publish for service endpoint 2020-02-14 17:43:11 -04:00
Jeff Becker
2b6f27d60d
remove connect back logic for dead inbound sessions 2020-02-14 13:12:45 -05:00
Jeff Becker
70eb353c42
make publishing introsets optional using reachable=false to disable 2020-02-11 16:48:36 -05:00
Jeff Becker
99eb7726ff
initial dht key blinding 2020-01-27 16:30:41 -05:00
Jeff Becker
2c0dc12f39
refactor single char variables in DHT (mostly) 2020-01-23 12:10:58 -05:00
Jeff Becker
a17b5f25b5
check for zero'd rc 2020-01-15 10:43:21 -05:00
Jeff Becker
2d82e931da
try doing lookup from close router, randomize when above lookup threshold 2020-01-09 06:26:41 -05:00
Jeff Becker
8a5365d9a6
diversify endpoints 2020-01-07 13:00:15 -05:00
Jeff Becker
5ae428a114
Revert "remove call to link manager"
This reverts commit 3dd36fa11a.
2019-12-30 11:13:17 -05:00
Jeff Becker
a5121c346c
remove call to link manager 2019-12-30 11:13:17 -05:00
Jeff Becker
d1a29884df
client side perf improvement 2019-12-30 11:13:17 -05:00
Jeff Becker
79c3c748e4
limit number of snode sessions client side 2019-12-30 05:19:03 -05:00
Stephen Shelton
2c6226f54a Backup SNApp keys when migrating to new ed25519 crypto 2019-12-06 11:21:14 -07:00
Jeff Becker
0828307906 fix address mapping bug 2019-11-29 19:11:14 -04:00
Jeff Becker
8849173112 try async decrypt then verify 2019-11-29 19:11:14 -04:00
Jeff Becker
ba0fd223d9 reduce number of jobs we put onto the logic thread 2019-11-29 18:45:06 -04:00
Jeff Becker
56dce90de9
add trace log level for tracking logic thread jobs 2019-11-22 16:23:19 -05:00
Jeff Becker
2c5561fc3c
make format 2019-11-05 12:01:34 -05:00
Jeff Becker
7ee026fa50
make path builds work again 2019-11-05 11:58:53 -05:00
jeff
32ed821763 Merge remote-tracking branch 'upstream/dev' into multithreaded-cryptography 2019-10-01 10:51:28 -04:00
jeff
7c691cf334 handover should be fixed now 2019-09-19 16:28:12 -04:00
jeff
6c2ebbb925 try fixing handover and add snapp traffic to multithreaded crypto workers 2019-09-19 10:41:31 -04:00
Jeff Becker
327c545530
finish multithread cryptography first pass 2019-09-16 12:12:05 -04:00
jeff
14c9ef15ed try calling stuff in logic thread from event loop 2019-09-16 06:21:12 -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
Jeff Becker
eabbb83149
use estimated build time instead of expiration time for delta when determining when to space out builds 2019-08-27 16:07:09 -04:00
Jeff Becker
e0424a91a7
bump path build handover window, check cooldown on build. 2019-08-27 16:00:00 -04:00
Jeff Becker
3c3338e801
Merge remote-tracking branch 'origin/master' into memlink 2019-08-21 10:53:25 -04:00
Michael
094b697b01
Replace StatusObject with underlying JSON type 2019-08-19 10:33:26 +01:00
Michael
16cdfbd5f0
clang-tidy modernize pass 2019-08-12 16:52:58 +01:00
Jeff Becker
c1f33bb1ac
initial mempipe implementation 2019-08-07 12:33:29 -04:00
Michael
f9e9227e19
Fix gcc trunk warnings 2019-08-02 10:29:08 +01: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
Michael
e52492911d
Refactor endpoint state management to a new class 2019-07-15 10:15:51 +01:00
Jeff Becker
1fd6b5ae74
Merge remote-tracking branch 'origin/master' into ipv6-tun 2019-07-12 09:53:52 -04:00
Michael
488695047f
Remove redundant else blocks 2019-07-09 22:54:46 +01:00
Jeff Becker
b9bcc2b775
make threadpool consice 2019-07-09 09:47:24 -04:00
Jeff Becker
fd911d0c52
make format 2019-07-08 10:22:47 -04:00
Jeff Becker
6467d21ba0
* fix testnet codepath
* add packet info for osx
2019-07-05 10:13:58 -04:00
Jeff Becker
81cab62bb9
* fix testnet codepath
* add packet info for osx
2019-07-05 08:07:06 -04:00
Jeff Becker
5874c38b38
swap path on inbound convo if expires soon 2019-07-01 17:35:49 -04:00
Jeff Becker
f211ff182a
pick ready paths for reply 2019-07-01 16:45:00 -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
Jeff Becker
0146a967d0
fix convotag inbound state setting 2019-06-28 11:49:29 -04:00
Jeff Becker
6bca652182
choose first timestamp 2019-06-28 10:48:00 -04:00
Jeff Becker
0b90acff75
handle reply intro 2019-06-28 10:12:20 -04:00
Jeff Becker
b0612e2ee1
Merge remote-tracking branch 'origin/master' into ipv6-tun 2019-06-21 11:23:53 -04:00
Michael
b6b400baef
Tidy up pathbuilder code 2019-06-20 17:35:40 +01:00
Jeff Becker
5c61df08b5
Merge remote-tracking branch 'origin/master' into ipv6-tun 2019-06-20 10:35:51 -04:00
Michael
08609f9e5a
Rename message files 2019-06-19 23:30:07 +01:00
Michael
8a058fcb34
Move other messages 2019-06-19 21:35:57 +01:00
Michael
d6751e3eeb
Move subset of messages to right directory 2019-06-19 21:35:26 +01:00
Jeff Becker
cd05fa6150
Merge remote-tracking branch 'origin/master' into ipv6-tun 2019-06-18 08:46:35 -04:00
Rick V
c6c31efec9
make format 2019-06-17 23:29:54 -05:00
Jeff Becker
30f6a8ccd2
make format 2019-06-17 09:05:37 -04:00
Jeff Becker
9c24fc15a8
try not spamming network with builds 2019-06-17 08:43:16 -04:00
Jeff Becker
5853e5e3f4
pass in path 2019-06-14 09:13:06 -04:00
Jeff Becker
a323003824
differentiate between inbound and outbound convos 2019-06-14 08:49:45 -04:00
Jeff Becker
2403ab8f86
ipv6 2019-06-11 12:44:05 -04:00
Jeff Becker
9ec41b8831
update RC expiration logic, lookup more often and remove stale entries 2019-06-10 08:47:21 -04:00
Jeff Becker
73c1538518
fix 2019-06-06 07:16:03 -04:00
Jeff Becker
f7ccbf0c78
eh 2019-06-06 07:10:18 -04:00
Jeff Becker
f8e2edae28
fix 2019-06-06 07:06:34 -04:00
Jeff Becker
223f2702d3
Merge branch 'fix-big-ooooofff' 2019-06-06 06:53:54 -04:00
Jeff Becker
a33dbce680
try switching logic 2019-06-06 06:52:27 -04:00
Jeff Becker
f8026b8a2d
use latest tag not oldest tag in inbound convos 2019-06-04 09:53:50 -04:00
Jeff Becker
39b1f104a8
revert 2019-06-04 09:43:49 -04:00
Jeff Becker
471a4bf6dd
use reply intro for inbound sessions 2019-06-04 09:34:24 -04:00
Michael
75430a234c
Convert to use memFn 2019-06-02 22:19:10 +01:00
Michael
491fee206b
Port code to use CryptoManager over passing Crypto pointers 2019-05-28 20:45:08 +01:00
Michael
d49e57aa8d
Fix thread safety issue in service::Endpoint::ProcessDataMessage 2019-05-22 21:28:17 +01:00
Jeff Becker
e85cc1bc8a
fix 2019-05-22 13:47:33 -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
a83be769e2
More explicit error when keyfile is not a valid file 2019-05-18 18:34:25 +01:00
Jeff Becker
8da3b51589
more hax 2019-05-17 07:18:42 -04:00
Jeff Becker
f832c9a593
use shared_ptr 2019-05-11 10:13:35 -04:00
Jeff
e21f1020ee don't std::move 2019-05-11 08:48:54 -04:00
Jeff
06f8bb2f42 add blacklist-snode option 2019-05-10 12:19:33 -04:00
Jeff Becker
018dd008ec
add custom single threaded allocator for utp buffers
fix up test net stuff
2019-05-09 16:28:56 -04:00
Jeff Becker
85fcb4bd84
fix it up 2019-05-09 11:54:22 -04:00
Jeff Becker
1d74585637
don't crash when we get no routers from lookup 2019-05-09 11:51:21 -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
Michael
1744ae7686
Tidy up service endpoint a bit more 2019-05-07 09:29:47 +01:00
Jeff Becker
d423ee02d2
use shared_ptr 2019-05-03 09:15:03 -04:00
Jeff Becker
986e831579
make bundle-rc option configurable on snode tld 2019-05-02 14:11:44 -04:00
Jeff Becker
e0892f7d23
gfdi 2019-05-02 12:33:53 -04:00
Jeff Becker
407f895c86
ooff 2019-05-02 12:31:08 -04:00
Jeff Becker
5b49008bca
more 2019-05-02 12:23:31 -04:00
Jeff Becker
a97e1e37a7
dont filter intros they are already good 2019-05-02 09:47:22 -04:00
Jeff Becker
e060082441
hook every dns for .loki and .snode when applicable
make {n,h}uint{32,16}_t templated type.
2019-05-01 09:40:10 -04:00
Jeff
59e6a4bc3d make snode work again probably 2019-04-30 17:36:27 -04:00
Jeff Becker
20ba2c7b8c
try not to die 2019-04-30 12:57:59 -04:00
Jeff Becker
cde4fcc00a
queue pending traffic 2019-04-30 12:49:34 -04:00
Jeff Becker
bb47d612b3
more 2019-04-30 12:07:17 -04:00
Jeff Becker
0b68d3db5d
move stuff arround so that flushing queues are done in the correct event loops
TODO: locking
2019-04-30 11:09:42 -04:00
Jeff Becker
2a7ebce8f4
Merge remote-tracking branch 'origin/master' 2019-04-30 11:01:13 -04:00
Jeff Becker
5e0acc1197
separate upstream/downstream flush 2019-04-30 09:56:39 -04:00
Jeff Becker
d50b18d7b0
try fixing leak also make format 2019-04-30 08:22:15 -04:00
Michael
725ee293c1
Refactor well named functionality in service::Endpoint into new struct 2019-04-30 02:06:31 +01:00