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.
a bunch of routers logging to stdout at the same time is a complete
charlie foxtrot. until we take the time to make logger not a singleton
(and probably make each router able to log to its own file rather than stdout)
just make it not log.
Note: this is very temporary, as the logs will be annoying for testing the
pybind stuff and shouldn't be necessary for debugging it
Router now has a hive pointer if LOKINET_HIVE is set.
llarp::Context has a method InjectHive to give Router the pointer.
Router has a method NotifyRouterEvent which does:
- when LOKINET_HIVE is set, passes the event to RouterHive
- else when LOKINET_DEBUG is set, prints the event at a low log level
- else NOP
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.
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.