Commit Graph

526 Commits

Author SHA1 Message Date
Audric Ackermann
ad6d206aa6
add version and uptime to summary status endpoint 2022-02-21 10:57:47 +11:00
Audric Ackermann
d9467f4dee fix numPaths value in Router::ExtractSummaryStatus 2022-02-16 13:07:55 +11:00
Jeff
fc444741f1 move constant to new header
create llarp/constants/time.hpp for time/duration constants
2022-01-27 11:11:57 -05:00
Jeff
5fac6c84d8 detect timeskip and thaw network when we think it happened. 2022-01-27 10:59:04 -05:00
Jeff
205584acdf redo systemd status line to include number of paths and endpoint count. optionally warn about low path success. 2022-01-14 11:18:07 -05:00
Jeff
388fc53380
match io loop event order on windows/apple to match linux.
on win32/apple reading packets from the interface does not count as an io operation.
manually trigger pump on win32/apple to pretend that it is an io event.
add platform quark function MaybeWakeUpperLayers on vpn::Interface to manaully wake up the other components on platforms that need that (ones on which packet io is not done via io events).
on non linux platforms, use uv_prepare_t instead of uv_check_t as the former triggers before blocking for io, instead of after. this better matches linux's order of operations in libuv.
2021-12-15 15:25:53 -05:00
Jason Rhinelander
09c2b31b25 Move paths pumping into PumpLL 2021-11-15 18:24:07 -04:00
Jason Rhinelander
b3a8160c89 Pump hidden context sooner
This has to happen before pumping links because it is putting things on
links.
2021-11-15 13:38:05 -04:00
Jason Rhinelander
9844d358e6 Fix packet delay creep
- Make the main PumpLL also pump hidden services, rather than using
  separate wakers in each TunEndpoint.  It seems there is some
  interactions that just one or the other is not enough.

- Eliminate TunEndpoint send queue -- it isn't needed as we can just
  send directly.
2021-11-15 13:37:57 -04:00
Jason Rhinelander
78cc466bf2 Rename PumpLL -> TriggerPump
And rename the actual pump implementation back to PumpLL.
2021-11-15 13:37:47 -04:00
Jason Rhinelander
031ea7aa37 Get rid of external event loop direct wakeups
If something needs to wake up the event loop it should be using an
async, as we are now with PumpLL(); but we had various code triggering a
wakeup, expecting that PumpLL gets called on every wakeup, which isn't
true anymore.
2021-11-15 13:36:44 -04:00
Jason Rhinelander
74215fc44c Fix link layer delivery race condition (fix random ping delays)
We trigger a pump immediately, but this is racey because we add to our
plaintext data in a worker thread; if the worker thread runs after the
pump then it ends up leaving plaintext to be handled, but there's no
wakeup until the next one.

This was the cause of seeing a random +1s and bunching added to ping
responses sometimes: it wasn't until the *next* ping goes through the
network that the plaintext queue gets processed, at which point it
flushes the old one and often the new one together.

The fix here gets rid of the map of sessions needing wakeups and instead
adds an atomic flag to all of them to let us figure out which ones
need to be flushed.
2021-11-15 13:36:28 -04:00
Jason Rhinelander
9113a6b36b Triggered pumping
This redoes how/when we pump so that we should only be calling the
idempotent PumpLL() when we actually have (or may have) something to
pump.
2021-11-15 13:35:57 -04:00
Jason Rhinelander
633431be66 Make outbound message queue PumpLL again if it doesn't send all 2021-11-14 10:10:19 -04:00
Jeff Becker
8a9025e234 only pump path context in idempotent pumpll 2021-11-14 10:07:31 -04:00
Jeff Becker
bb86996acf make event loop pump function non idempotent 2021-11-14 10:07:31 -04:00
Jeff Becker
8744c93944 prevent 100% cpu usage on service nodes
call_soon wakes up the mainloop and is often reentrant, we dont want to
ever way up the event loop but we also want to always defer the call so
we always use the workers
2021-11-14 10:07:11 -04:00
Jeff Becker
22d4b88edc
make PumpLL idempotent to reduce cpu use a bit 2021-11-09 11:59:57 -05:00
Sean
e11a94c95c
RPC call for summary get_status (#1742)
* RPC call for summary get_status

* lint

* update with review notes

* further review points

* uint64_t
2021-10-13 07:20:36 -04:00
Jeff Becker
5c457ff486
refactor logging to use std::source_location
* use std::source_location instead of godawful macros in logging
* remove unused/absolutely haram af json logstream
* fix bug in android logger where it doesn't respect eLogNone
2021-10-06 11:10:48 -04:00
Jeff Becker
64cd2990bc
remove old routing table maniuplation code 2021-08-27 11:07:54 -04:00
Jeff Becker
e3281cd026
add string representation to SessionResult 2021-07-05 09:09:20 -04:00
Jeff Becker
1d1d97b0ef
disable peer status entirely 2021-07-05 09:09:20 -04:00
Jeff Becker
2578983a09
dont give peer stats in rpc 2021-07-05 09:09:20 -04:00
Jeff Becker
5074dd5f2b
re-enable multithreading on clients but not on service nodes 2021-06-08 14:36:30 -04:00
Jeff Becker
d7a51e88f5
make router tick 250ms instead of 100ms to prevent excessive log spam
limit calls to decommissioned warning to every 30s to prevent excessive log spam
2021-06-08 14:36:30 -04:00
Jeff Becker
f3deabdb96
* get_failing does not need abstract router as paramter so we remove it
* add remove_node_from_failing to remove a node by pubkey from the failing set
* if a router is deregistered we remove it from the failing set so we don't retest it
* remove a router from the failing set if we get a test success
2021-06-08 10:47:27 -04:00
Jeff Becker
d88ed4eee0
make windows happy by making some constexprs non static and such as windows does not LTO 2021-06-08 05:46:05 -04:00
Jeff Becker
37ab78b654
dont run router testing if we are decommissioned.
properly name function to be called LooksDecommissioned because that is different than deregistered
2021-06-07 16:35:06 -04:00
Jeff Becker
07d18b30c0
typofix 2021-06-07 16:18:52 -04:00
Jason Rhinelander
7c964800ba
Fix unintentional whitelist/greylist copying 2021-06-07 16:16:18 -04:00
Jeff Becker
ef924aea39
gossip RC when we are not deregistered so we can come back when we are decommissioned 2021-06-07 16:15:17 -04:00
Jeff Becker
95537804cd
separate white/grey list for active/decommissioned nodes.
allow sessions to decommissioned nodes but not paths.
2021-06-07 10:57:33 -04:00
Jason Rhinelander
28ba0b7533
Add logging about testing success/fail 2021-06-07 10:00:36 -04:00
Jeff Becker
c23e121139
capture by value to appease clang 11 2021-06-07 08:44:47 -04:00
Jeff Becker
9ad90d029d
* use weak_ptr on core rpc
* use reachability testing code lifted storage server's code
2021-06-07 08:41:35 -04:00
Jeff Becker
b830eeb535
initial lokinet router testing:
* report via rpc to oxen core connection stats on success and failure
* connect to random service node by pubkey every 5 seconds for testing
2021-06-04 16:52:41 -04:00
Jeff Becker
51b7566a46
if we look deregistered we will now:
* not gossip our rc
* not explore the network to prevent outbound session attempts
* not establish sessions to other service nodes
* close all open sessions we have to tell clients we don't want them
* catch exceptions flushing peerdb in disk thread
* don't connect out to non allowed routers
* simplify logic in RCLookupHandler::RemoteIsAllowed()
* add HaveReceivedWhitelist to I_RCLookupHandler base type
* add LooksDeregistered to Router type that tells us if we think we are deregistered
* don't allow building paths over us if we are deregistered
2021-05-12 07:17:40 -04:00
Jeff Becker
ec62228149
limit path builds across all builders 2021-05-05 08:21:39 -04:00
Jeff Becker
554a44c8bf
report block height reported by oxend in systemd status 2021-05-03 16:53:00 -04:00
Jeff Becker
545021aa3d
temp commit 2021-04-19 07:02:46 -04:00
Jeff Becker
25e338d621
srv records
* add srv records in RCs if we have any
* add mechanism to add SRV records for plainquic exposed ports
* resign and republish rc or introset on srv record changes
2021-04-19 07:02:43 -04:00
Jeff Becker
a2285730b8
reduce log level 2021-04-19 07:00:27 -04:00
Jeff Becker
48ce77ed1f
XXX: single threaded mode 2021-04-19 06:59:07 -04:00
Jeff Becker
2188b443e9
more liblokinet api stuff
* add lokinet_wait_for_ready to wait until we have published introsets and such
* optionally expose ports in lnproxy
* dont save profiles by default
2021-04-19 06:59:07 -04:00
Jeff Becker
95cd275cdd
liblokinet additions:
* add lokinet_add_bootstrap_rc function for adding an rc from memory
* prevent stack overflow on error closing connection in quic
* add in memory nodedb
* refactor how convotags are set as active
* add initial stubs for endpoint statistics
* refactor time stuff to be a bit cleaner
* update lnproxy script with more arguments
2021-04-19 06:59:07 -04:00
Jeff Becker
59c9e997f2
build paths faster and limit path builds at edge router instead of via a time counter for all edges 2021-04-19 06:59:05 -04:00
Jeff Becker
7098f46d60
rpc endpoint for triggering quic tunnel 2021-04-19 06:58:37 -04:00
Jason Rhinelander
2ca7ef7f5f
Rename isRouter -> isSNode
The isRouter wording was quite confusing, especially in a call such as:

    router->Configure(config, opts.isRouter, nodedb)
2021-04-19 06:58:36 -04:00
Jason Rhinelander
181953b4a6 Replace ::Hash nested structs with std::hash specializations 2021-03-10 11:19:52 -04:00