Commit Graph

113 Commits (0fe8c6f0a6bab7fb346fc2b0e75927d3494d9236)

Author SHA1 Message Date
dr7ana 5f8e1ada15 formatting 8 months ago
dr7ana c0b6277496 HAPPY NEW YEAR 8 months ago
dr7ana 38c1008b59 gossip new RC's on bfetch 8 months ago
dr7ana 61718464ae 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
8 months ago
dr7ana 9cc053608a 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
8 months ago
dr7ana 3e9d5a97a8 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
8 months ago
dr7ana ae38dc7110 gossip storage, logs 8 months ago
Jason Rhinelander 687d6556d5 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.
8 months ago
dr7ana 961763d1bb lets see which gets rejected 8 months ago
Jason Rhinelander 86f2906ec3 Get rid of IterDir
It's a gross implementation, and even if it wasn't, using it takes more
code than not using it.
8 months ago
dr7ana 75e31279be btreq destructor
- try closing the connection via link::Endpoint like we probably should be doing..
- testing out dropping stream constructor, godspeed
8 months ago
dr7ana 22879b64ed 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
8 months ago
dr7ana 7f143bb52f full mesh proto implementation 8 months ago
dr7ana 89975a0b01 gossip fetch and response handling implemented 8 months ago
dr7ana cc97fe1f5f Added connection keepalive
- implemented ngtcp2 ping to keep connections alive
- fixed weird lambda captures
- fetch logic
- lets see what happens
8 months ago
dr7ana 42da1b0e68 bootstrap tweaking 8 months ago
dr7ana 9f0766f203 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!
8 months ago
dr7ana 30ea6799db better! 8 months ago
dr7ana 90a530a114 whatever 8 months ago
dr7ana 1e1f4dd40b come on already work already 8 months ago
dr7ana 0e888395d6 who cares 8 months ago
dr7ana 384cb7a8bd dont bomb with bootstrap reqs 8 months ago
dr7ana 03976d8731 Squashed misc testnet fixes 8 months ago
dr7ana 6a32148402 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
8 months ago
dr7ana 66ad28a2f1 Local router mode
- Up and running locally, no connections yet
- Next: flip testnet and do the gosh dang thing
8 months ago
dr7ana 32e55b0f17 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
8 months ago
dr7ana 44696b1ba3 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
8 months ago
dr7ana 63a57d5ae4 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
8 months ago
dr7ana e02ddd61d0 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
8 months ago
dr7ana 483b79aca7 pull yourself up by your bootstraps sonny
- initial/subsequent fetching combined for RouterContacts and RouterIDs
- bootstraps fallback implemented and looped into fetch logic
8 months ago
dr7ana e1a5d935a6 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
8 months ago
dr7ana 9bb85582a4 housekeeping pre-trust model 8 months ago
dr7ana baabfabedc fetch RID result handler logic 8 months ago
dr7ana d6b8b55727 less synchronous for the subsequent fetches 8 months ago
dr7ana ab24f4bc1a RC/RID fetching logic implemented 8 months ago
dr7ana 07fc0246ed housekeeping and groundwork, initial commit 8 months ago
Thomas Winget 040fc86703 minor fixups 8 months ago
Thomas Winget af424cda9c (client) periodically fetch RouterIDs from peers 8 months ago
Thomas Winget 52cd9e1794 Minor RC load/store/prune fixups 8 months ago
Thomas Winget a42d1c1d9f 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.
8 months ago
Thomas Winget e37ef7808d 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.
8 months ago
Thomas Winget 74e7f14db9 minor style/naming changes 8 months ago
Thomas Winget 10984b2fa5 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).
8 months ago
Thomas Winget e29e23bf81 implement and use "gossip_rc" command
TODO: refactor or remove RCGossiper and revisit RC regen and
when-to-gossip logic.
8 months ago
Thomas Winget 611d277d28 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.
8 months ago
dr7ana 68e67c881b {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)
8 months ago
dr7ana 632f4ee70b RC refactor layout
- Local and Remote RC's now implemented with discrete functionalities and uses
8 months ago
dr7ana 5596ffd9d7 CI Fixes, squash 8 months ago
dr7ana f574cd798f 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 b597ae5a94 "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