Commit Graph

3772 Commits (1884d17e9dcc09c49aed0ad68ca3f3c1a2d629be)

Author SHA1 Message Date
Jeff Becker a09bb89d15
dont put multiple outbound contexts 4 years ago
Jeff Becker d3f222ddcc
revert relay side dedup parameter 4 years ago
Stephen Shelton bbee45118e
Remove redundant lookup logic from relays 4 years ago
Jeff Becker 158a9018f3
rename variable 4 years ago
Jeff Becker 9ff31f6402
spelling is hard 4 years ago
Jeff Becker 8f4362f092
fix up introset lookups 4 years ago
Jason Rhinelander 806d43c34e
Merge pull request #1147 from notlesh/diagnose-pubintro-round2-2020-02-28
Diagnose pubintro round2
4 years ago
Jason Rhinelander d46a880150
Merge pull request #1145 from majestrate/remove-convotags-right-away-2020-02-27
Remove convotags right away when outbound context dies
4 years ago
Jason Rhinelander b60adc909d Make IntroSet publish confirmed less verbose
Essentially just rate limit the confirmation message to one message per
second.
4 years ago
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.
4 years ago
Jason Rhinelander c0eb0c4db4 Avoid unnecessary copy 4 years ago
Jeff Becker 45fa9bebbc
wrong txid 4 years ago
Jeff Becker e3b5fb4dd9
add local publish intro message to send reply down path 4 years ago
Jason Rhinelander 58fe7ac801 De-static constants
We don't need separate copies of these per compilation unit.
4 years ago
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.
4 years ago
Jeff Becker 5b075259e6
revert 4 years ago
Jeff Becker b4a59a0b1a
make format 4 years ago
Jeff Becker dd21cba1fe
dedup via txid not keyspace location 4 years ago
Jason Rhinelander 76608b6b90 Logic simplification 4 years ago
Jason Rhinelander 27b8743107 Add warns for introset publish failures 4 years ago
jeff f76b9f3042 make format 4 years ago
jeff 49e69d7087 remove uneeded code 4 years ago
Stephen Shelton 2ebd9bbd95
Implement PublishServiceJob::SendReply() 4 years ago
Stephen Shelton 638ea2e0fd
Make format 4 years ago
Stephen Shelton d09fd13dd6
Calculate 'candidateNumber' when we should store Introset 4 years ago
Stephen Shelton 37ca564005
Log when DHTSendTo fails @ Router::SendToOrQueue 4 years ago
Stephen Shelton 62014de91c
Handle PubIntro relayOrder logic on client-side 4 years ago
Stephen Shelton 61d19179f7
Remove dead code 4 years ago
Stephen Shelton a8623f09e9
Properly deserialize PubIntroMessages' relayed var 4 years ago
Stephen Shelton c0fbe06c0f
Require 'From' and 'relayed' in PublishIntroMessage ctor 4 years ago
Stephen Shelton f61cd1a7da
Add some notes/comments about DHT message handling 4 years ago
Stephen Shelton 6b906de00d
Judicious removal of dead code 4 years ago
Jeff Becker ce335dc47d
remove convotags on dead outbound context 4 years ago
Jeff Becker dea78d2326
change function signature for dht context to exclude time parameter 4 years ago
Jeff Becker 7a84bbe459
remove dht explore timer 4 years ago
Jason Rhinelander df7a173649 Shorten version and prefix with v
So we get `v0.7.0` instead of `lokinet-0.7.0-abcdef12`; the latter is
useful for devs, but not so much for random operators (and you can
always go get the full version from the binary).
4 years ago
Jason Rhinelander d5eed90a3c Fix systemd compilation & enable systemd on travis 4 years ago
Jason Rhinelander f1aa27e616 fix speeling mistack 4 years ago
Jeff a8ce76f6e4
Merge pull request #1094 from majestrate/upstream-cname-monkey-patch-dns-2020-02-12
monkey patch upstream dns to rewrite .loki cname answers
4 years ago
Jeff da780658e1
Merge pull request #1134 from majestrate/systemd-status-2020-02-25
remove uneeded members
4 years ago
Jeff Becker d50a0149f9
use std::chrono 4 years ago
Jeff Becker 9c30ff7a26
handle snode and clean up codepath for hooked dns 4 years ago
Jeff Becker 1d5c712adb
monkey patch upstream dns to rewrite .loki cname answers 4 years ago
Jeff Becker 9d5dbbc0ad
remove uneeded members 4 years ago
Jeff 9dc86372b5
Merge pull request #1131 from majestrate/systemd-status-2020-02-25
Systemd status reporting
4 years ago
Jeff Becker 66181d8a8f
systemd status 4 years ago
Linux User fd23fd6894
32-bit linux patches 4 years ago
Jeff 19a751c41b
Merge pull request #1127 from notlesh/spread-snapp-path-builds-evenly-2020-02-24
Spread snapp path builds evenly
4 years ago
Jeff 4f29405e9e
Merge pull request #1115 from majestrate/handle-multiple-responses-per-lookup-2020-02-20
handle multiple responses per hidden service lookup
4 years ago
Stephen Shelton abe4015986
Use constants for path build timing 4 years ago
Stephen Shelton 230037b9f3
Increase default path timeout from 10min to 20min 4 years ago
Stephen Shelton f0374eb2b7
Use existing 'lastBuild' var for spacing path builds 4 years ago
Stephen Shelton c2c010dbad
Make format 4 years ago
Stephen Shelton c1b5e453c7
Big I, little i, what begins with I? 4 years ago
Stephen Shelton 1db6c6ae3b
Make format 4 years ago
Stephen Shelton c2f719c996
Build endpoint paths at even[ish] intervals 4 years ago
Jeff a8a6c175fc
Merge pull request #1128 from majestrate/use-std-chrono-2020-02-24
make llarp_time_t use std::chrono::milliseconds
4 years ago
Jason Rhinelander 04c618ddae gcc 5 compatibility workaround 4 years ago
Jeff Becker 368acec485
fix last commit 4 years ago
Jeff Becker b2181f2449
reduce code use 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 ecdab10dac
explictly use std::chrono::milliseconds 4 years ago
Jeff Becker df427ffa0e
use llarp_time_t instead of auto 4 years ago
Jason Rhinelander 3bd400f6fe Fix string_view C++17 compatibility
string_view was implicitly convertible to std::string, but
std::string_view is only explicitly convertible.  This makes the
`operator std::string` explicit to be more compatible, and re-adds a
bunch of explicit string casts to the code where needed.

(This also fixes the build if changing the standard to c++17)
4 years ago
Jeff Becker 524726e4cc
cast interval to std::chrono::milliseconds before dividing by 4 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
Jeff Becker 39cdc9e6dd
shift intro on introset update 4 years ago
Jason Rhinelander f976ebbe49 make format 🤦 4 years ago
Jason Rhinelander 55acec80ec Disable thread annotation when not under libc++
They are fairly useless under stdlibc++ because it doesn't have the
required annotations on stl mutexes and locks, so we just get tons of
useless warnings.
4 years ago
Jason Rhinelander 27025030ce Renamed uint128.h -> uint128.hpp 4 years ago
Jason Rhinelander 3fedd5ba6b Avoid wrong-order initialization on big endian 4 years ago
Jason Rhinelander 2093f94244 Make uint128_t use big/little endian layout internally
Thus if someone wants to memcpy out of it it will have the expected
endianness of the internal data.
4 years ago
Jason Rhinelander 454abb4f9f Avoid copies in mutators
Reimplement operators in terms of mutators, rather than vice versa, so
that mutators don't have to make a copy.
4 years ago
Jason Rhinelander 4207a7cfa3 Rewrite In6ToHUInt to be endian agnostic 4 years ago
Jason Rhinelander dba3ff7fd3 gcc 5.x string_view workaround 4 years ago
Jason Rhinelander 0839c16f19 Final abseil purge
Bye-bye Google Boost.
4 years ago
Jason Rhinelander 5ce6c01476 Don't use double-underscores
double-underscore names are reserved for the compiler/STL.
4 years ago
Jason Rhinelander 5fcc11f2bf Fix format 4 years ago
Jason Rhinelander 5d1230d7c9 constexpr string_view fixes
Pre-C++17 char_traits::compare isn't constexpr so we can't constexpr the
find/rfind methods that use it.

begin() etc, however, can be constexpr (and need to be for some of the
other constexpr methods here that use them).
4 years ago
Jason Rhinelander 46242ba69b TrimWhiteSpace -> TrimWhitespace
Fix my dumb initial capitalization choice.
4 years ago
Jason Rhinelander 74d4afad51 Remove metric config parsing 4 years ago
Jason Rhinelander 54186c4a89 Replace absl string_view with string_view from lokimq
When we add loki-mq has a dependency we can just alias it, but for now
it's easier to copy the header than add the whole submodule library.
4 years ago
Jason Rhinelander 089056ca5b Remove all ABSL_ATTRIBUTE_UNUSED uses 4 years ago
Jason Rhinelander 5fd830bc36 Prettify uptime duration in log lines
Produces strings such as:

    [+1h09m12.475s]

instead of:

    [+4152475 ms]
4 years ago
Jason Rhinelander 2e9840ea39 Replace abseil date code with Hinnart's date.h
Howard Hinnart's date.h is the library that was accepted as C++20
date/calendar support, so this is essentially a backport of C++20 date
time support.

(It does support timezone support, but requires more of the library and
that seems like overkill for what we need; this just prints UTC
timestamps instead, which need only a header-only include).
4 years ago
Jason Rhinelander ba1b20153e Miscellaneous small absl removals 4 years ago
Jason Rhinelander 870062e8cc Remove absl optimization
This was being used to get at gcc/clang's __builtin_expect, but we don't
really need that: we can just avoid the check entirely when not in debug
mode which should be even faster.
4 years ago
Jason Rhinelander 5efcd49a3b Deabseil: remove absl::StrCat, de-templatize fromEnv
fromEnv here wasn't usefully templatized (the base template basically
couldn't be used for anything except a string anyway), so just replaced
it with the overloads we need and moved the implementations out of the
header.
4 years ago
Jason Rhinelander 5c95971335 Make C++ literals available everywhere in `llarp` 4 years ago
Jason Rhinelander 98c34d995b De-abseil: Add our own llarp::TrimWhiteSpace
Adds a TrimWhiteSpace instead of using abseil's.

Adds Catch2 tests for it, and also converts the existing str tests to
catch (which look much, much nicer than the gtest ones).
4 years ago
Jason Rhinelander 00a624ab40 Fix and rename CaselessCmp -> CaselessLessThan
The comparison done here was really weird: by comparing lengths *before*
contents "zz" would sort before "aaa".  It wasn't invalid for the
specific purpose being used here (looking for true/false values), but
would be highly broken if someone tried to use it elsewhere.

Also renamed it because it really is just a `<` implementation, not a
full cmp implementation.
4 years ago
Jason Rhinelander 7d167d3fe4 Add return types to lambda
Without these the return type could be wrong (e.g. supposed to return a
reference but returns a value).
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 fe61367a87 Vastly simplified llarp::util::memFn
There is a huge pile of unnecessary machinery here that can be solved
with a few lambdas and some member function pointer type deduction.
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
Stephen Shelton 16be86a5c3
Merge pull request #1116 from tewinget/short-path-names
path builder prints hops, rest print short name
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
Jeff 7c5a721457
Merge pull request #1114 from notlesh/redundant-introset-lookup-improvements-2020-02-20
Redundant introset lookup improvements
4 years ago
Stephen Shelton 63c3106db2
Make format 4 years ago
Jeff Becker 748be8eec8
handle multiple responses per hidden service lookup 4 years ago
Stephen Shelton 0429bafbb3
Merge pull request #1111 from notlesh/redundant-introset-propagation-2020-02-19
Redundant introset propagation
4 years ago
Stephen Shelton 66cb30fa58
Refactor: remove recursionDepth from DHT lookups 4 years ago
Jeff 6ac5f19b3a
Merge pull request #1110 from jagerman/no-abseil-optional
De-abseil, part 1: remove absl::optional
4 years ago
Stephen Shelton 45a36fcfee
Rework FindIntro logic per redundant strategy 4 years ago
Jason Rhinelander 05a2e961e6 Add missing header 4 years ago
Stephen Shelton 4c499fb076
Make format 4 years ago
Stephen Shelton 6966168f5a
Minor improvements to DHT inroset propagation 4 years ago
Stephen Shelton dff9aeb250
Propagate Introset publishing redundantly 4 years ago
Jeff Becker dc7828941f
add log statement 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 9a6148c4c3
require router version in public routers 4 years ago
Jeff 20bc168d1c
Merge pull request #1093 from majestrate/toggle-publishing-introsets-2020-02-11
make publishing introsets optional
4 years ago
Jeff Becker 1874f439b7
add comment 4 years ago
Jeff Becker e907d2ae19
handover fixes 4 years ago
Jeff Becker f7f5d893a5
use endpoint path for lookup because outboundcontext does not implement pathset::HandleGotIntroMessage 4 years ago
Jeff Becker c9866b6a0b
simplify 4 years ago
Jeff Becker 9aeee37347
short circuit 4 years ago
Jeff Becker 6a495dd090
ammend outbound context logic 4 years ago
Jeff Becker 02228ded08
spread out path builds 4 years ago
Jason Rhinelander 9e096d1996 Reduce introset publishing interal to 2.5min instead of 1.25min
We want to have some redundancy, but having 8 active at once seems
extreme; reduce to 4.
4 years ago
Jason Rhinelander ce90b9dc7b clang format 4 years ago
Jason Rhinelander c3637c81fd Remove another unused randomize parameter 4 years ago
Jason Rhinelander 25a796d940 Rework partial sorting code: use pointers, add lock
Changes to code to sorts a set of pointers instead of full records, then
copy those out into the final results that we return.
4 years ago
Jason Rhinelander 24469daefb Remove unused parameter
We always randomize now.
4 years ago
Jeff Becker 83ee508fe1 comparison fix 4 years ago
Jeff Becker 763f61e454 dont collide variable names 4 years ago
Stephen Shelton 9dfcfbc3ac Bencode/decode relayOrder in lexigraphical order, make it uint64_t 4 years ago
Stephen Shelton 127e7ef31b Make format 4 years ago
Stephen Shelton adf8772f3c Remove relayOrder from MessageDecoder 4 years ago
Stephen Shelton 6ca2c11e59 Serialize / deserialize relayOrder @ FindIntroMessage 4 years ago
Stephen Shelton 906803e387 Refactor DHT introset lookups to use redundant lookup strategy 4 years ago
Stephen Shelton fa1df8db63 Big R, little r, what begins with R? 4 years ago
Jeff Becker 4d4b33607f dont use optional 4 years ago
Jeff Becker 23bcfa4abb revert change 4 years ago
Jeff Becker df8c56343d refactor GetManyPathsWithUniqueEndpoints to go into service/endpoint_util.hpp 4 years ago
Jeff Becker fc5e6b4d77 log location 4 years ago
Jeff Becker 3cc2adae31 paralell publish and lookups 4 years ago
Jeff Becker e30c720446 redundant publish for service endpoint 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 2b6f27d60d
remove connect back logic for dead inbound sessions 4 years ago
Jason Rhinelander c522bc0537 ghc::filesystem devendor to submodule
Also removed some unused/old options for conditionally not using
ghc::filesystem and a sodium option that wasn't used anywhere.
4 years ago
Jason Rhinelander 5a787de73b Switch abseil & nlohmann to submodules and update to latest stable
Our current abseil won't build with gcc 10 (its `optional`
implementation appears broken), and spews warnings under slightly older
compilers; updating to the latest stable 2019 branch fixes both issues.
4 years ago
Jeff 34cd64369b
Merge pull request #1095 from jagerman/warning-fix
Fix signed/unsigned comparison warning and make more std::chrono-y
4 years ago
Stephen Shelton 68d0cabcc5
Print an error when BDecodeReadFromFile() fails before calling DumpBuffer() 4 years ago
Jason Rhinelander 6a8d4aca38 Fix signed/unsigned comparison warning and make more std::chrono-y 4 years ago
Jeff Becker 837998eb88
rename variable 4 years ago
Jeff Becker f6c4181e14
remove include 4 years ago
Jeff Becker 28561cd654
use Time_t 4 years ago
Jeff Becker 96c5553e34
rename variables 4 years ago
Jeff Becker 434ce56553
* get rid of dht explore for service nodes
* add Time_t using std::chrono for future uses
* make decaying hashset constructor with llarp_time_t explicit
* add decaying hashset implicit constructor using Time_t
* add timeouts for gossiper replay
* allow regossip of our RC
4 years ago
Jeff Becker 154be464ea
rc gossiping 4 years ago
Jeff Becker 7ad47f2dba
* get rid of dht explore for service nodes
* add Time_t using std::chrono for future uses
* make decaying hashset constructor with llarp_time_t explicit
* add decaying hashset implicit constructor using Time_t
* add timeouts for gossiper replay
* allow regossip of our RC
4 years ago
Jeff Becker ea3851d15f
rc gossiping 4 years ago
Jeff 1403cff805
Merge pull request #1079 from majestrate/remove-dht-message-limit-2020-02-03
make message queue unbound for direct dht messages
4 years ago
Jeff 671c765161
Merge pull request #1085 from majestrate/check-for-initial-current-introset-2020-02-06
check for current introset being zero (initial state)
4 years ago
Jeff 4371ea469d
Merge pull request #1086 from majestrate/lokinetmon-update-2020-02-07
update lokinet monitor to work with iwp
4 years ago
Jeff Becker 792fd4132c
only make default endpoint non-reachable if no keyfile option presented 4 years ago
Jeff Becker 6c67cc1f01
make default endpoint non reachable by default 4 years ago
Jeff Becker 70eb353c42
make publishing introsets optional using reachable=false to disable 4 years ago
Jeff Becker 7374f8f0fd
update lokinetmon 4 years ago
Jeff 5901d0eb6b
Merge pull request #1092 from majestrate/reduce-iwp-multiack-frequency-2020-02-10
Reduce iwp multiack transmission frequency
4 years ago
Jeff 47db547378
Merge pull request #1088 from notlesh/add-iwp-stats-to-json-api-2020-02-07
Add IWP session stats to JSON API
4 years ago
Jeff Becker 8b77ec31ef
reduce number of multiack packets sent 4 years ago
Stephen Shelton 3d00feb08a
Make format 4 years ago
Stephen Shelton 7f0972d48e
Use name 'StateToString()' instead of ambiguous 'toString()' 4 years ago
Stephen Shelton 63ad7c8b91
Leave IWP session JSON stats 'tx' and 'rx' for compat 4 years ago
Jeff 8cad7fecbd
Merge pull request #1087 from majestrate/dont-flood-dht-2020-02-07
dont flood dht with requests, if we know of a router don't look it up
4 years ago
Jeff Becker e8b84fcfbd
add path speed metrics for lokinetmon 4 years ago
Jeff 80a7b788bc
Merge pull request #1089 from majestrate/dht-introset-lookup-relayed-try-closer-2020-02-07
try closer router if relayed
4 years ago
Jeff Becker 00260555bd
logic simplification 4 years ago
Jeff Becker e4a16dfdd5
fix comment 4 years ago
Jeff Becker b211450cc8
always recurse to second closest if we don't have it 4 years ago
Jeff Becker 5b87a9419e
default recursion depth to 2 not 12 4 years ago
Jeff Becker 19d91a440f
move declaration of peer 4 years ago
Jeff Becker 3bea7327cb
handle end case by telling requester that it's not there 4 years ago
Jeff Becker 7e1a6236be
if relayed try closer router if we don't have an intro 4 years ago
Jeff Becker a9331a1431
fix unit test 4 years ago
Stephen Shelton 2279ebeb40
Add IWP session stats to JSON API 4 years ago
Jeff Becker cd27b33849
dont flood dht with requests, if we know of a router don't look it up 4 years ago
Jeff 0271f178d2
Merge pull request #1078 from jagerman/travis-bionic-and-arm
New travis arches + required endian fixes, libsodium build replacement
4 years ago
Jason Rhinelander 3be7eb789b Endian defines fix for macOS
It seems `__BYTE_ORDER`/`__LITTLE_ENDIAN`/`__BIG_ENDIAN` aren't defined
on macOS, so `if __BYTE_ORDER == __BIG_ENDIAN` was true which made macOS
take the big endian path *twice* (which cancelled out the big endian
conversion).

This makes util/endian.hpp define __LITTLE_ENDIAN__ or __BIG_ENDIAN__
everywhere, and errors if it can't be set.
4 years ago
Jason Rhinelander 9283aac4b6 Big endian fixes 4 years ago
Jason Rhinelander 66ebe3995e Remove -Wshadow; it is far too aggressive under gcc 4 years ago
Jeff e44449b2d5
Merge pull request #1084 from notlesh/reduce-client-log-output-2020-02-06
s/LogInfo/LogDebug/ @ explore message
4 years ago
Jeff Becker 8c698a1cd1
* rename i to foundIntro
* check for zero timestamp
* use > not >=
4 years ago
Jeff Becker 41210a8ae1
check for current introset being zero (initial state) 4 years ago
Stephen Shelton 37e4f26be1
s/LogInfo/LogDebug @ 'signed/verify encrypted introset' 4 years ago
Stephen Shelton 2cade16c0e
s/LogInfo/LogDebug/ @ 'updating SN list' 4 years ago
Stephen Shelton bc3184a126
s/LogInfo/LogDebug/ @ explore message 4 years ago
Jeff Becker 499e346da6
notify delivery of path builds 4 years ago
Jeff 8230b1152e
Merge pull request #1072 from majestrate/2020-01-25-router-version
add router version
4 years ago
Jeff Becker e6174efa21
don't derive x25519 key from ed25519 key 4 years ago
Jeff c122b460e1
Merge pull request #1075 from jagerman/dht-blinding
Dht blinding
4 years ago
Jeff Becker 80f8363386
don't drop messages with pathid zero which belong to snode to snode dht and path build requests. 4 years ago
Jason Rhinelander 8cd95c01b3 Abstract signing hash data location
This makes the interface a little cleaner by not requiring the class
user to know how we laid out the data in the object.
4 years ago
Jason Rhinelander 739ce92aeb Remove unused ristretto includes 4 years ago
Jeff Becker ee752c00e6
make format 4 years ago
Jeff Becker c014d21f84
use std::shared_ptr not a bare pointer to prevent memleak 4 years ago
Stephen Shelton 5631983716
Make format 4 years ago
Stephen Shelton 8921125924
Fix buffer overflow when version encodes too many integers 4 years ago
Jason Rhinelander f1171ed7a2 make format 😠 🤮 4 years ago
Jason Rhinelander 46f3459b79 Fixed EncryptedIntroSet signing to use PrivateKey
We can generate both root and derived signatures from a PrivateKey, but
only root from a SecretKey, so just change it to use a PrivateKey.
4 years ago
Jason Rhinelander cd8f26deff Use hash instead of random for signing hash data
This makes PrivateKey store both the key followed by the hash.  For
PrivateKeys based on SecretKeys this just means the second half of the
SHA-512 of the seed, and makes a PrivateKey constructed from a SecretKey
give an identical signature to signing directly with sodium.

For derived keys we use a ShortHash of the root key's signing hash
concatenated with the publicly known hash value, so that our derived key
signing hash will be different from the root signing hash and also
different for different derivation parameters.

This also changed one of the asserts in crypto_noop, but upon closer
inspection the copying of the secret key into the signature seems really
wrong, so just changed them to fill with 0s.
4 years ago
Jason Rhinelander fe8a72750a Silence unused parameter warning 4 years ago
Stephen Shelton cfabe72587
Fix RouterVersion::IsEmpty() and RouterVersion::Clear() 4 years ago
Stephen Shelton f0571a9f2c
Fix IsCompatableWith() logic WRT emptyRouterVersion, add unit tests 4 years ago
Thomas Winget afd87eedb4 NO CLAMPS YOU IDIOT!!! 4 years ago
Thomas Winget a487982c49 initial implementation of blinded sign -- not working yet 4 years ago
Jason Rhinelander f7cd10a82e Fix Recalculate()
Recalculate did what should have been the right thing but wasn't because
of libsodium's mislabelling the "seed" as the secret key.
4 years ago
Jason Rhinelander 860c5efd47 Derived key fixes
The reason things weren't working here is because libsodium does
something completely unintuitive and called the seed the "secret key"
when it isn't, it's the seed.

This adds a new PrivateKey class (alongside the existing SecretKey and
PubKey) that holds just a private key value but no seed -- which we need
to do because there is no way we can get a seed after calculating a
derived keypair.

With these changes, we now generate exactly the same keys and subkeys as
Tor (and a new test case uses values generated in Tor to verify this).

This is incomplete -- the subkey signing code is still not implemented;
it has to be adapted to create a signature from a PrivateKey rather than
a SecretKey which will probably requiring working around/reimplementing
some of what libsodium does for creating a signature since it expects
"secret keys" i.e. the seed.
4 years ago
Jeff Becker 0f13591802
does not work 4 years ago
Jeff Becker 99eb7726ff
initial dht key blinding 4 years ago
Jeff Becker 1543284f6b
make it compile 4 years ago
Jeff Becker 4f81b913ef
make router version member optional on serialization 4 years ago
Jeff Becker 9efd796145
initial wack at 0.7.0 dht fixes 4 years ago
jeff f6813717b5 Merge branch '2020-01-25-router-version' of ssh://github.com/majestrate/loki-network into 2020-01-25-router-version 5 years ago
jeff 898c98b170 use double braces 5 years ago
Jeff Becker bb6dce486f
don't use a pointer 5 years ago
Jeff Becker 8c82bfe5bf
operator != 5 years ago
Jeff Becker 03c13f4261
make it compile 5 years ago
jeff 816070be62 dont inherit std::array 5 years ago
jeff fa30a6f9b2 router version 5 years ago
jeff f728e6016b router version 5 years ago
Jeff Becker b280bac141
don't always use bootstrap when exploring 5 years ago
Jeff Becker 7146857df6
use static initialization for started times 5 years ago
Jeff Becker 7aa1b2c27c
monotonic time and run testnet at 20% realtime 5 years ago
Jeff Becker 626b2a6196
return true 5 years ago
Jeff Becker e87b754906
fix recursion depth on introset lookup 5 years ago
Jeff Becker 2c0dc12f39
refactor single char variables in DHT (mostly) 5 years ago
Jeff Becker ae8bb3751b
connect to closest for RC lookups too 5 years ago
Jeff Becker 49f696de9c
connect to closer nodes for introset lookups 5 years ago
Jeff Becker 3b66cf6e75
dht fixes, disable iterative lookups on clients, revert "fixes" from 0.6.3, pass in recursion depth from introset lookup 5 years ago
Stephen Shelton fba12093ac
Remove dead code (AbstractRouter::EnsureRouter()) 5 years ago
Jeff 51e4b47cf8
Merge pull request #1061 from majestrate/fix-log-level-2020-01-20
configurable log level
5 years ago
Jeff Becker 1165466d56
don't deadlock when we want to remove lots of paths, flush queue instead when full 5 years ago
Jeff Becker 2f02073cac
unsigned char 5 years ago
Jeff Becker c69eb2c970
off -> none 5 years ago
Jeff Becker ef0595602b
reduce number of values for LogLevelFromString 5 years ago
Jeff Becker 40876a6e3f
configurable log level 5 years ago
Jason Rhinelander 95b0eeda29 Add support for lokid's "unchanged" response
If we pass the last block hash to lokid it can give us an "unchanged"
response instead of the service node states to tell us that there is no
updated needed.
5 years ago
Jason Rhinelander 1ba1e04390 Separate json SN parsing definition/declaration
No changes to code here (committing this separately to make the changes
in the following commit easier to follow).
5 years ago
Jeff Becker c86fb19187
bump version for 0.6.4 5 years ago
Jeff Becker 12899701c5
inform congestion on tail drop 5 years ago
Jeff Becker 860891b6a6
tail drop 5 years ago
Jeff Becker 4185d47d4b
link layer message priority 5 years ago
Jeff a681c28e5f
Merge pull request #1050 from majestrate/tweak-limits-2020-01-16
Tweak limits
5 years ago
Jeff Becker c3f99e1b5c
make format 5 years ago
Stephen Shelton f01392cc49
Start stale router lookup 5 minutes before its expiration 5 years ago
Stephen Shelton 9b00e6fa8d
Bump RC expiration constants significantly 5 years ago
jeff 79fd08e559
fix typo 5 years ago
jeff 4a761be52d
use std::chrono 5 years ago
Jeff Becker fe148f7823
merge conflict fix 5 years ago
Jeff 493213717f
Merge pull request #1054 from notlesh/message-queue-stats-2020-01-17
Include outbound message queue stats in dumpState API response
5 years ago
Stephen Shelton 3cf4bd8f97
Lookup routers at maximum frequency of 10 minutes 5 years ago
Stephen Shelton 698dddc151
Use std::max() and make format 5 years ago
Stephen Shelton 5c518d6586
Include outbound message queue stats in dumpState API response 5 years ago
Stephen Shelton 169ece08e8
Fix HaveReceivedWhitelist() typo 5 years ago
Jason Rhinelander a1333c901c
Merge pull request #1044 from notlesh/bump-version-0.6.3-2019-01-15
Bump version (0.6.3)
5 years ago
Jason Rhinelander acd53f08b1
Merge pull request #1042 from jagerman/fix-jsonapi-bind-ip
Fix json api bind IP
5 years ago
Jason Rhinelander ba89df40c8
Merge pull request #1041 from notlesh/dht-fixes-cleanup
Dht fixes cleanup
5 years ago
Stephen Shelton 2607bdbee6
Bump version (0.6.3) 5 years ago
Stephen Shelton 702c130020
Remove dead code in llarp_nodedb::Insert() 5 years ago
Jason Rhinelander eadfeefafc
Merge pull request #1038 from majestrate/dht-disable-iterative-lookup-2020-01-14
disable iterative behavior in DHT
5 years ago
Jason Rhinelander 416c71e554 Fix json api bind IP
Only the port was being used, the IP was being ignored and it was always
binding to localhost.
5 years ago
Stephen Shelton fbb274a724
Make format (mutter mutter) 5 years ago
Stephen Shelton 8206557ac7
Don't respect whitelist when we haven't received it yet 5 years ago
Stephen Shelton c92e7ae5c7
Add warning when we found a null RC for a DHT lookup 5 years ago
Stephen Shelton 08149112b2
Randomize routers to explore in ExploreNetwork() 5 years ago
Jeff Becker a17b5f25b5
check for zero'd rc 5 years ago
Jeff Becker d9297a4907
log invalid signatures 5 years ago
Jeff Becker 4cb6301e28
use copy not move 5 years ago
Jeff Becker c5feb07fb9
address feedback from tom 5 years ago
Jeff Becker 6fd714d193
contrib/testnet: fix up testnet config generator to make super centralized topology
llarp/context.cpp, llarp/nodedb.{h,c}pp: load netdb AFTER whitelist
llarp/router/router.cpp: explore always
llarp/router/{i,}rc_lookup_handler.{h,c}pp explore with whitelist, update routers with lookup before stale
5 years ago
Jeff Becker 9322df013b
check with rc handler before insert 5 years ago
Jeff Becker 2af64671bf
make it compile 5 years ago
Jeff Becker 0526fef37b
store RCs if valid 5 years ago
Jeff Becker b56a3528db
periodic nodedb flush 5 years ago
Jeff Becker 495ad6d566
testnet patch 5 years ago
Jeff Becker 09f5f6dfa7
disable iterative lookup 5 years ago
Jeff Becker c7b94f32be
reduce disk io 5 years ago
Jeff 0e2c5736a8
Merge pull request #1034 from majestrate/dht-timeout-fixes-2020-01-10
dht timeout tweak
5 years ago
Jeff 0ad2809ac7
Merge pull request #1033 from majestrate/prevent-segfault-2020-01-10
prevent segfault
5 years ago
Jeff Becker 78cdf8f96b
variable lookup timeout on participants 5 years ago
Jeff Becker 8bb492da6e
dht timeout tweak 5 years ago
Jeff Becker 77f0944d6d
use shared_from_this 5 years ago
Jeff Becker 78e325c4c5
always lookup introset from nearest router 5 years ago
Jeff Becker 2d82e931da
try doing lookup from close router, randomize when above lookup threshold 5 years ago
Jeff Becker b2784dd5ec
explore faster 5 years ago
Jeff ac46d99107
Merge pull request #1029 from majestrate/expire-snode-sessions-based-off-activity-2020-01-08
Expire snode sessions based off activity
5 years ago
Jeff Becker eb174923ad
m_LastUse shouldn't be 0 ever now 5 years ago
Jeff Becker 1a80153352
mark used on costructed so it doesn't go away 5 years ago
Jeff Becker 9e50920dad
dont update timestamp of last use using when we get exit only when we use it 5 years ago
Jeff Becker a96fd645c5
remove side effect from address detection assert 5 years ago
Jeff Becker fde0ca374f
i hate curl 5 years ago
Jeff Becker 336a748695
make it build in normal mode too 5 years ago
Jeff Becker 80cbddde7b
fixups for review 5 years ago
Jeff Becker 2ce592e4af
static link with docs 5 years ago
Jeff cceb531e58
version bump 5 years ago
Jeff a5f8568c9c
Merge pull request #1020 from majestrate/dev
recent fixes
5 years ago
Jeff Becker 37b11614d0
if select_random_hop_excluding returns false we should probably break anyways so do that 5 years ago
Jeff Becker c6d77e72f2
fix up tcp connection logic 5 years ago
Jeff Becker 989146f63a
handle write failure 5 years ago
Jeff Becker c38c055488
return result 5 years ago
Jeff Becker 42f721d691
don't queue on full write queue 5 years ago
Jeff Becker 6d42b5f997
reduce logic calls 5 years ago
Jeff Becker 8a5365d9a6
diversify endpoints 5 years ago
Jeff Becker 9f153f12e0
actually connect to random routers 5 years ago
Jeff Becker a3e7324e9a
make it compile 5 years ago
Jeff Becker c3b14b32b4
relays do profiling and not hand out "shit" routers in explore 5 years ago
Jeff Becker c1ad5f955a
remove mutex 5 years ago
Jeff Becker 64b5537fe0
rpc clean up logic, dont fetch list as client AND dont ping lokid as client 5 years ago
Jeff Becker e5f92eaa79
only ping lokid if a service node 5 years ago
Jeff da8ec60922
Merge pull request #1023 from notlesh/iwp-bw-stats-2019-12-17
add bw stats to iwp sessions
5 years ago
Jeff Becker 9214ecbc48
rename bloomfilter to replayfilter 5 years ago
Rick V 636957f3f9
happy new year 5 years ago
Jeff Becker 3147e2d357
shuffle intros when more than 1 exists 5 years ago
Jeff Becker a7a101e33c
more intellegent path failure profiling using LRSM 5 years ago
Jeff Becker 52b13b9f1e
typo fix 5 years ago
Jeff Becker 1244ad83ad
fix include file use 5 years ago
Jeff Becker 55e27d36e5
* only profile as client
* only explore churn as relay
5 years ago
Jeff Becker d391f70417
reduce cpu use 5 years ago
Jeff Becker 73e07ef2d0
client side replay filter 5 years ago
Jeff Becker b3ad65f470
randomize intro order on shift 5 years ago
Jeff Becker 79badd6714
* clients expore dht faster
* use random path when doing dht lookups for .loki
5 years ago
Jeff Becker a8e6069a93
enable profiling by default 5 years ago
Jeff f5338512b3
Merge pull request #1014 from majestrate/limit-client-path-builds-at-edges-2019-12-30
Limit client path builds at edges
5 years ago
Jeff Becker 472cee2594
make static constant for decay interval 5 years ago
Jeff Becker 7c92805bb4
fix typo 5 years ago
Jeff Becker ecf2685aa3
use optional 5 years ago
Jeff Becker da5af879e9
typofix 5 years ago
Jeff Becker d7c78b0c71
comments 5 years ago
Jeff Becker f3e96e06b2
propagate error to client 5 years ago
Jeff Becker 562f3f07ab
add unit test for decaying hash set 5 years ago
Jeff Becker a9c9fe9c24
limit client side path builds per ip 5 years ago
Jeff Becker 5ae428a114
Revert "remove call to link manager"
This reverts commit 3dd36fa11a.
5 years ago
Jeff Becker a5121c346c
remove call to link manager 5 years ago
Jeff Becker d1a29884df
client side perf improvement 5 years ago
Jeff Becker 79c3c748e4
limit number of snode sessions client side 5 years ago
Jeff Becker 4126d307b3
dont close timers on closeall 5 years ago
Jeff Becker 59257815d5
version bump with intentional grammar troll motto for science related ventures. 5 years ago
Jeff Becker 8b8d636ded
make format 5 years ago
Rick V b9c02d999f
why was this there
we do not support MSVC
5 years ago