Commit Graph

112 Commits (a4bd7806b3ee51b64315287da60b235a83decbf0)

Author SHA1 Message Date
dr7ana 5469c9beb0 HAPPY NEW YEAR 6 months ago
dr7ana 3fb9ba57e5 gossip new RC's on bfetch 6 months ago
dr7ana 30f62d2689 zero cost exception handling my ass
- rework bootstrap loading to move all logic into BootstrapList object
- ability to parse lists and dicts of bootstraps implemented
- netid parsing refers to the correct fallback
- cross your fingers boys here we go
6 months ago
dr7ana 4437d0b373 re-abstraction for client connections
- pending_conns removed in favor of direct creation of link::Connection objects in link::Endpoint::{service,client}_conn containers
- conn lookup maps removed, they were pointless
6 months ago
dr7ana 3451a30d0e ALPN verification
- laying the groundwork for functional client->service node connections. this requires ALPNs verification as a secondary method of identification to the remote key
- refactored btreq stream creation to use improved stream creation logic in libquic
6 months ago
dr7ana 9e31300d0f gossip storage, logs 6 months ago
Jason Rhinelander 6fdfb4cef6
Add `exact` argument to get_n_random_rcs
If given and true then return nullopt if we don't find the requested
number; otherwise return them even if there aren't as many as we
requested.
6 months ago
dr7ana 47be3cefe1 lets see which gets rejected 6 months ago
Jason Rhinelander 7417c59286
Get rid of IterDir
It's a gross implementation, and even if it wasn't, using it takes more
code than not using it.
6 months ago
dr7ana 2a090b6e42 btreq destructor
- try closing the connection via link::Endpoint like we probably should be doing..
- testing out dropping stream constructor, godspeed
6 months ago
dr7ana 87ae0686d0 rc parsing
- new btdc method used to ensure no junk at the end of our bt data
- DRYed out the RC code
- check inbound bootstraps against all registered routers, not just whitelist
- libquic vbump
6 months ago
dr7ana c71e767511 full mesh proto implementation 6 months ago
dr7ana 42aa92ab95 gossip fetch and response handling implemented 6 months ago
dr7ana ef1897c25a Added connection keepalive
- implemented ngtcp2 ping to keep connections alive
- fixed weird lambda captures
- fetch logic
- lets see what happens
6 months ago
dr7ana 08c2c26c29 bootstrap tweaking 6 months ago
dr7ana fd21eb3a00 Big fix!
- pending conns container stops them from being counted towards active conns in the interim
- un-abstracted pendingmessages vs pendingdatamessages vs pendingcontrolmessages (gross)
- fixed bootstrap fetching and storage!
6 months ago
dr7ana ea614ed141 better! 6 months ago
dr7ana 6cb2f57abd whatever 6 months ago
dr7ana b69f754599 come on already work already 6 months ago
dr7ana 7544436f6a who cares 6 months ago
dr7ana f725c07f2d dont bomb with bootstrap reqs 6 months ago
dr7ana 9084d39e5a Squashed misc testnet fixes 6 months ago
dr7ana d00257b9f0 address parsing
- straightened out setting of public addr and public port in config vs listen ("bind") addr
- fixed small bug in router contact writing and saving
6 months ago
dr7ana cef2ff7782 Local router mode
- Up and running locally, no connections yet
- Next: flip testnet and do the gosh dang thing
6 months ago
dr7ana ed6bd28a35 testnet prep
- redoing link_manager functions again to implement previously ignored review comments on several PRs
- conceptually merging "whitelist_routers" and new "known_{rids,rcs}", s.t. we can completely eliminate white/red/gray/green/etc lists in favor of something that isn't dumb
6 months ago
dr7ana c9268dceba trust model edge case handling
- Once we have our set of returned rc's and accepted rid's (ones that were found locally), the remainder are placed in an "unconfirmed" state
- Once there, they have five subsequent successful fetches to be found in request response, at which point their verification counter is incremented and their attempt counter is reset
- If they appear three times, they are "promoted" and moved to our "known_{rid,rc}" list
6 months ago
dr7ana 70e9c1ae25 trust model fetch fails
- bootstrap cooldown implemented with 1min timer in case all bootstraps fail
- set comparison implemented in non-initial and non-bootstrap rc fetching; set comparison in rid fetching is done every fetch
- nodedb get_random functions refactored into conditional/non-conditional methods. Conditional search implements reservoir sampling for one-pass accumulation of n random rcs
6 months ago
dr7ana 3508dee8d8 trust model
- greedy evaluation of returned rid's, simplifying post-processing logic to simple frequency comparison per rid against a constant threshold
- tidied up link_manager request/response handling
- TODO:
  - review and decide thresholds
  - evaluate necessity and potential implementation of rc comparison
6 months ago
dr7ana 91121ea22b pull yourself up by your bootstraps sonny
- initial/subsequent fetching combined for RouterContacts and RouterIDs
- bootstraps fallback implemented and looped into fetch logic
6 months ago
dr7ana f6e651caea move from vectors to unordered_sets
- When receiving a request to fetch RouterID's, the remote endpoint fulfilling the request stores them in an unordered set. When the request caller receives that payload, it is loaded into a vector in the same order. However, we should just load it directly into an unordered set to enforce both the order and that none appear twice
- The trust model will have to operate on multiple large lists of RouterID's and RC's efficiently, and maintaining a sort order ensures the values are workable immediately after deserialization
6 months ago
dr7ana ba3fffb765 housekeeping pre-trust model 6 months ago
dr7ana b6cc86e25b fetch RID result handler logic 6 months ago
dr7ana 3fc7980691 less synchronous for the subsequent fetches 6 months ago
dr7ana 6559617816 RC/RID fetching logic implemented 6 months ago
dr7ana 5fa3c2be87 housekeeping and groundwork, initial commit 6 months ago
Thomas Winget 70d2052cd4 minor fixups 6 months ago
Thomas Winget 14b9aa20ee (client) periodically fetch RouterIDs from peers 6 months ago
Thomas Winget b353fd4095 Minor RC load/store/prune fixups 6 months ago
Thomas Winget c30a4dd44a Implement fetch RouterIDs method and usage
Periodically clients will fetch the set of RouterIDs for all relays on
the network.  It will request this list from a number (12, currently) of
relays, but as we are likely to be requesting from more relays than we
want to have edge connections, this request will itself be relayed to
the target source via one of our edges.  As we can't trust our edge to
do this honestly, the responses are signed by the source relay.

TODO: the responses from all (12) relays are collected, then processed
together.  The reconciliation of their responses is not yet implemented.

TODO: the source selection for this method obviously requires sources to
begin with, but this is the method by which we learn of
those...bootstrapping is still a bit in-progress, and will need to be
finished for this.

TODO: make Router call this periodically, as with RC fetching.
6 months ago
Thomas Winget 6952e8f705 Add command to fetch RCs from remote node
This command will be called periodically by clients to maintain a list
of RCs of active relay nodes.  It will require another command (future
commit) to fetch the RouterIDs from many nodes and reconcile those so we
have some notion of good-ness of the RCs we're getting; if we get what
seems to be a bad set of RCs (this concept not yet implemented), we will
choose a different relay to fetch RCs from.  These are left as TODOs for
now.
6 months ago
Thomas Winget 5bf520d0f1 minor style/naming changes 6 months ago
Thomas Winget 2425652696 NodeDB RCs don't need insertion time
We will want some notion of "when did we receive it" for RCs (or
RouterIDs, details tbd), but that will be per-source as a means to form
some metric of consensus/trust on which relays are *actually* on the
network.  Clients don't have a blockchain daemon to pull this from, so
they have to ask many relays for the full list of relays and form a
trust model on that (bootstrapping problem notwithstanding).
6 months ago
Thomas Winget 29ec72f0da implement and use "gossip_rc" command
TODO: refactor or remove RCGossiper and revisit RC regen and
when-to-gossip logic.
6 months ago
Thomas Winget ad9d0b19c1 remove rc_lookup_handler, relocating useful parts
RC "lookup" is being replaced with "gimme all recently updated RCs".  As
such, doing a lookup on a specific RC is going away, as is network
exploration, so a lot of what RCLookupHandler was doing will no longer
be relevant.  Functionality from it which was kept has moved to NodeDB,
as it makes sense for that functionality to live where the RCs live.
6 months ago
dr7ana fa4471f566 {Remote,Local}RC's
- RemoteRC supplants most of the functionality throughout the code of RouterContact
- Next step will be to sort out CI issues, then see if we can get rid of either LocalRC (and therefore RouterContact entirely)
7 months ago
dr7ana 07271f9ae7 RC refactor layout
- Local and Remote RC's now implemented with discrete functionalities and uses
7 months ago
dr7ana 7314c2a22a CI Fixes, squash 8 months ago
dr7ana 46ad8d4058 Clang format include sorting + CMake
- includes are now sorted in consistent, logical order; first step in an attempt to fix the tomfoolery (no relation to Tom) brought in by include-what-you-use
- shuffled around some cmake linking to simplify dependency graph
- superfluous files removed
8 months ago
Jason Rhinelander f4f5ab0109 "Refactor" aka delete Crypto/CryptoManager
- Get rid of CryptoManager.
- Get rid of Crypto.
- Move all the Crypto instance methods to llarp::crypto functions.
  (None of them needed to be methods at all, so this is simple).
- Move sodium/ntru initialization into static initialization.
- Add llarp::csrng, which is an available llarp::CSRNG instance which is
  a bit easier than needing to construct a `CSRNG rng{};` in various
  places.
- Various related small simplifications/cleanups.
8 months ago
dr7ana e710cfea47 Review commit 8 months ago