Commit Graph

8174 Commits

Author SHA1 Message Date
Jason Rhinelander
c3a515da49
Config setting documentation edits
Rewords/reformats the documentation of various configuration options.
2022-10-18 12:05:13 -03:00
jeff
011bd2e84f format 2022-10-17 19:05:30 -04:00
Jeff Becker
e5b7ea5f2d
dont do queries while down 2022-10-17 09:38:19 -04:00
Jeff Becker
082756c64c
cancel pending queries on down.
after calling Down() any pending queries will not be properly
canceled and results in a crash when we destruct the queries on our side.
2022-10-17 09:10:34 -04:00
Jeff Becker
306d54e285
when running as a client squelch warnings about snode status and make sure we connect out 2022-10-17 08:33:50 -04:00
majestrate
8f532dec89
Merge pull request #2015 from jagerman/oxend-rpc-updates
Oxend RPC updates
2022-10-16 19:11:11 -04:00
jeff
6813dd659c lint 2022-10-16 14:53:23 -04:00
majestrate
9176ab1157
Merge pull request #2014 from jagerman/fix-sockaddr-ordering
Fix multi-field ordering
2022-10-15 10:54:07 -04:00
majestrate
666642f906
Merge pull request #2016 from jagerman/zlib-bump
zlib version bump
2022-10-15 10:53:52 -04:00
Jason Rhinelander
e143bd13cd
zlib version bump 2022-10-14 22:29:58 -03:00
Jason Rhinelander
c5e787b8cb Oxend error ping + unfunded tracking
Currently (from a recent PR) we aren't pinging oxend if not active, but
that behaviour ended up being quite wrong because lokinet needs to ping
even when decommissioned or deregistered (when decommissioned we need
the ping to get commissioned again, and if not registered we need the
ping to get past the "lokinet isn't pinging" nag screen to prepare a
registration).

This considerably revises the pinging behaviour:

- We ping oxend *unless* there is a specific error with our connections
  (i.e. we *should* be establishing peer connections but don't have any)
- If we do have such an error, we send a new oxend "error" ping to
  report the error to oxend and get oxend to hold off on sending uptime
  proofs.

Along the way this also changes how we handle the current node state:
instead of just tracking deregistered/decommissioned, we now track three
states:

- LooksRegistered -- which means the SN is known to the network (but not
  necessarily active or fully staked)
- LooksFunded -- which means it is known *and* is fully funded, but not
  necessarily active
- LooksDecommissioned -- which means it is known, funded, and not
  currently active (which implies decommissioned).

The funded (or more precisely, unfunded) state is now tracked in
rc_lookup_handler in a "greenlist" -- i.e. new SNs that are so new (i.e.
"green") that they aren't even fully staked or active yet.
2022-10-14 20:55:21 -03:00
Jason Rhinelander
bd869b3b07 Log demotion
Demote a couple spammy messages to trace level.
2022-10-14 20:37:19 -03:00
Jason Rhinelander
0e576ff59e Clean up oxend service node list handling
This aligns service node updating logic a bit closer to what happens in
storage server, and should make it a bit more resilient, hopefully
tracking down the (off-Github) reported issue where lokinet sometimes
doesn't see itself as active.

- Initiate a service node list update in the 30s timer lokinet ping
  timer (in case we miss a block notify for some reason); although this
  is expensive, the next point mitigates it:

- Retrieve the block hash with the SN state update, and feed it back
  into the next get_service_nodes call (as "poll_block_hash") so that
  oxend just sends back a mostly-empty response when the block hasn't
  changed, allowing both oxend and lokinet to skip nearly all of the
  work of a service node list update when the block hasn't changed since
  the last poll.  (This was already partially implemenated--we were
  already looking for "unchanged"--but without a block hash to get from
  and pass back to oxend we'd never actually get an "unchanged" result).

- Tighten up the service node list handling by moving the "unchanged"
  handling into the get_service_nodes response handler: this way the
  HandleNewServiceNodeList function is only handling the list but not
  the logic as to whether there actually is a new list or not.
2022-10-14 18:02:53 -03:00
Jason Rhinelander
36792d4337
Fix multi-field < ordering
Lots and lots of places in the code had broken < operators because they
are returning something like:

    foo < other.foo or bar < other.bar;

but this breaks both the strict weak ordering requirements that are
required for the "Compare" requirement for things like
std::map/set/priority_queue.

For example:

    a = {.foo=1, .bar=3}
    b = {.foo=3, .bar=1}

does not have an ordering over a and b (both `a < b` and `b < a` are
satisfied at the same time).

This needs to be instead something like:

    foo < other.foo or (foo == other.foo and bar < other.bar)

but that's a bit clunkier, and it is easier to use std::tie for tuple's
built-in < comparison which does the right thing:

    std::tie(foo, bar) < std::tie(other.foo, other.bar)

(Initially I noticed this in SockAddr/sockaddr_in6, but upon further
investigation this extends to the major of multi-field `operator<`'s.)

This fixes it by using std::tie (or something similar) everywhere we are
doing multi-field inequalities.
2022-10-13 16:29:13 -03:00
majestrate
54fba30516
Merge pull request #2008 from jagerman/win32-routepoker-logging
Add more logging around route poking conditions
2022-10-07 09:33:13 -04:00
Jason Rhinelander
bc071231c8
Add a net::ToString() to help stringify ipaddr_t
Android, in particular, has problems with fmt's built-in variant
handling for this type for some reason.
2022-10-06 22:21:41 -03:00
Jason Rhinelander
25d73d627a
Remake non-mac icon; regenerate during build for windows
The non-mac icon was an old version with white foreground and a
completely transparent background, but this looks bad (or invisible)
depending on where you view it.  This updates it based on the macos
icon, but with a round white circle background instead of the macos
"squircle" background.

This also replaces the .ico file for the installer with one that we
build during the win32 build rather than a pregenerated one.

Bumps the gui as well to a version with the new icons in place.
2022-10-06 21:32:58 -03:00
Jason Rhinelander
768e953522
De-prioritize some windivert logging
We don't really need to log at info level for every
windivert-intercepted incoming and outgoing packet.
2022-10-06 21:32:58 -03:00
Jason Rhinelander
6f31d5108b
Windows fix: iterate over IPv4/IPv6 interfaces separately
If we get back an IPv6 address as the first gateway then we won't have
the expected IPv4 gateway that the route poker needs to operate.

This iterates through them separately so that we treat the IPv4 and IPv6
sides of an address as separate interfaces which should allow the route
poker to find the one it wants (and just skip the IPv6 one).
2022-10-06 21:32:58 -03:00
Jason Rhinelander
e398b5bff8
Fix interface enumeration on posix
The last interface wouldn't be considered.
2022-10-06 21:32:57 -03:00
Jason Rhinelander
fe0f916a09
DRY private range selection; add missing ranges
DRY a chunk of repeated code for finding a free private range.

Also fix it so that it will consider 10.255.0.1/16 and 192.168.255.1/24
(previously it would only check up to octet 254).
2022-10-06 21:32:57 -03:00
Jason Rhinelander
d10c4b9d17
Add more logging around route poking conditions
Log why we aren't doing anything if we aren't going to do anything.
2022-10-06 21:32:57 -03:00
Jason Rhinelander
4bf80833f4
Add InterfaceInfo formatter 2022-10-06 21:32:57 -03:00
Jason Rhinelander
bd8dffc730
Merge pull request #1991 from jagerman/lokinet-vpn-cleanups
Lokinet vpn cleanups
2022-10-06 16:09:56 -03:00
Jason Rhinelander
ba6a3f0e80
Merge pull request #1996 from tewinget/fallback-bootstrap
Fallback bootstrap router build parameter, ignore obsolete bootstrap routers
2022-10-06 16:09:29 -03:00
Jason Rhinelander
9a2cd19eb8
Fix obsolete oxenmq/hex.h usage 2022-10-06 14:29:50 -03:00
Jason Rhinelander
6ee7306217
oxen-mq update to tagged stable release 2022-10-06 14:01:09 -03:00
Jason Rhinelander
82e2e6fb10
bake in bootstrap fallbacks at build time
also change the defailt/fallback bootstrap file for testnet to be a list
of RCs (albeit of size 1) rather than just an RC dict.
2022-10-06 13:59:49 -03:00
Thomas Winget
82c95a2486
don't ping core if active with too few peers
If running as a service node, we ping core on a regular interval to
inform it we're running and in a good state.  If we're an active
(not decommissioned or deregistered) service node and have too few
peers and thus we're not actually connected to lokinet, we should skip
that ping so core doesn't think we're ok.
2022-10-06 13:59:49 -03:00
Thomas Winget
cc1bcf86fa
Fallback bootstrap router build parameter
Adds a fallback bootstrap file path parameter to CMake, specify
-DBOOTSTRAP_SYSTEM_PATH="/path/to/file" to use.

Adds a list of (currently 1) obsolete bootstrap RouterIDs to check
bootstrap RCs against.  Will not use bootstrap RCs if they're on that
list.

Log an error periodically if we appear to be an active service node but
have fewer than a set number (5) known peers.

Bumps oxen-logging version for literal _format.
2022-10-06 13:59:47 -03:00
Jason Rhinelander
20281ccc60
Clean up/simplify SN list handling 2022-10-06 13:58:33 -03:00
Jason Rhinelander
ebdb37ac77
Significantly decrease decomm warning frequency
30s is insanely fast for a error level log statement and spams logs
incessantly; reduce it to repeating once every 5 minutes.
2022-10-06 13:58:26 -03:00
Jason Rhinelander
d944b6542c
Merge pull request #1997 from tewinget/omq-rpc-logs
omq rpc log subscription
2022-10-06 13:56:07 -03:00
Jason Rhinelander
3276ed1d71
Bump lokinet-gui to latest
For log support, and other various changes/improvements.
2022-10-06 11:56:07 -03:00
Jason Rhinelander
bac3f9dca1
fix macos assemble_gui dependency
The `sign` target on macos was not working properly -- the signing
script would run before the build is finished.  This was caused by
cmake/macos.cmake having an `if(BUILD_GUI)`, but BUILD_GUI isn't defined
as an option until cmake/gui.cmake, which hadn't been included yet where
macos.cmake was included.

This extracts just the `option(BUIL_GUI)` from gui.cmake into a separate
gui-option.cmake file that we can load earlier to fix it.

While here I also noticed the GUI_EXE setting was defined as an option,
but isn't actually a boolean value, as an option, but isn't actually a
boolean value, so fixed it by making it a `set(... CACHE FILEPATH ...)`.
2022-10-06 11:56:07 -03:00
Jason Rhinelander
9f258700b7
Lower log level for renewals to debug
Otherwise you see a lot of unnecessary subscription renewals every 30s
in the logs.
2022-10-06 11:56:07 -03:00
Jason Rhinelander
dc358a6eda
macos: Fix hanging --start when Lokinet already running
If you stop/start the GUI but it doesn't exit on start, the second
--start (when lokinet is already running) waits for a state change that
doesn't come (because lokinet is already running).  This add a check for
already-running so that we exit right away in such a case.
2022-10-06 11:56:07 -03:00
Jason Rhinelander
307ae40e00
Apple: fix build failure when file already exists
The tools to create a dmg on Apple are flakey, of course, and fail in
cryptic ways if the file already exists, so purge it in the
contrib/mac.sh script.
2022-10-06 11:56:07 -03:00
Jason Rhinelander
c4c5d128c3
Add ring buffer sink to macos build 2022-10-06 11:56:06 -03:00
Thomas Winget
eaf30de1fd
omq rpc log subscription
respects whether RPC is enabled, removes the log sink otherwise

bumps oxen-mq and oxen-logging
2022-10-06 11:56:04 -03:00
Jason Rhinelander
fc07b8a10e
Merge pull request #2005 from jagerman/profiling-bencode-refactor
file slurp/dump and profiling refactor
2022-10-06 11:55:19 -03:00
Jason Rhinelander
006394315d
Add local mirror to most jobs; build script cleanups 2022-10-05 19:29:47 -03:00
Jason Rhinelander
fae527517d
Try to appease android's crappy toolchain 2022-10-05 17:34:55 -03:00
Jason Rhinelander
75e382604b
Bump required oxenc version 2022-10-05 16:48:59 -03:00
Jason Rhinelander
f641c08e80
llarp/profiling: refactor to use oxenc producer/consumer
No more llarp_buffer_t here!

(I was tracking down a segfault which led me in here and it was easier
to rewrite this to use bt_dict_{consumer,producer} than to decipher all
the cursed llarp_buffer_t and bencode callback nest).
2022-10-05 16:35:16 -03:00
Jason Rhinelander
d335527a70
Add binary file slurp/dump utility functions
We have basically this same bit of code in tons of places; consolidate
it into llarp::util::slurp_file/llarp::util::dump_file.

Also renames all the extra junk that crept into llarp/util/fs.hpp out of
there into llarp/util/file.hpp instead.
2022-10-05 16:34:32 -03:00
Jason Rhinelander
3891141755
Merge pull request #2004 from jagerman/mac-icon-rework
Rewrite and tweak the macos icon
2022-10-05 12:53:38 -03:00
Jason Rhinelander
ca26b20b2f
Scale down the inner part of the logo a bit 2022-10-04 20:51:29 -03:00
Jason Rhinelander
6b352c7fd8
Rewrite and tweak the macos icon
The old one was way too big on mac relative to other icons.  This scales
the background down, while keeping the black logo parts the same, and
changes the rounding of the corners to match native macos apps.

This also rewrites it from scratch to use a useful coordinate system
which allows drawing all the fundamentals in much more useful units.
2022-10-04 13:57:59 -03:00
Jason Rhinelander
66c79b232a
Fix log warning 2022-09-22 13:22:43 -03:00