Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] - Contacts, etc. #2242

Open
wants to merge 378 commits into
base: dev
Choose a base branch
from
Open

[WIP] - Contacts, etc. #2242

wants to merge 378 commits into from

Conversation

dr7ana
Copy link
Contributor

@dr7ana dr7ana commented Oct 22, 2024

No description provided.

dr7ana and others added 30 commits January 31, 2024 07:54
- 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
- initial/subsequent fetching combined for RouterContacts and RouterIDs
- bootstraps fallback implemented and looped into fetch logic
- 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
- 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
- disable reachability testing with config option; required to be done on testnet
- reachability testing pipeline through link_manager executes pings similar to storage server. connection established hook reports successful reachability, while connection closed callback (with non-default error code) reports unsuccessful testing
- 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
- 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
- Up and running locally, no connections yet
- Next: flip testnet and do the gosh dang thing
- now pointing to jason/void-listen
- straightened out setting of public addr and public port in config vs listen ("bind") addr
- fixed small bug in router contact writing and saving
Some of these were wrong (trying to use formats that didn't work); this
updates them all to new-style logging.
This doesn't really have a purpose.
`deregister_peer` does the exact same thing as `close_connection` so
just remove it.

Also removes an unnecessary loop dispatch call (because we *have* to be
in the logic thread already to be able to touch the variables we are
touching before the dispatch).
- TODO: discuss authentication for nodes connecting to bootstrap seed
- crit log num connected/RC's, conn open/closed, etc
- nodes now send their RC to the bootstrap seed on making a request
- allows the bootstrap seed to distribute RCs
We are reinterpret_cast'ing the version to a string to send it as raw
bytes, but it was sending \x00\x00\x09 instead of \x00\x09\x0a because
the version constant was actually a uint16_t array.

This just makes the version constant a uint8_t array instead so that it
works (and I am not at all worried about any version component getting
larger than 255).
@dr7ana dr7ana force-pushed the contacts branch 3 times, most recently from 9a6445a to c8c54c4 Compare February 20, 2025 18:54
@dr7ana dr7ana changed the base branch from quic-wip to dev February 22, 2025 17:45
@dr7ana dr7ana marked this pull request as ready for review February 24, 2025 12:27
@dr7ana dr7ana force-pushed the contacts branch 2 times, most recently from 1e74439 to 9cc7efd Compare March 4, 2025 21:18
- unified under session_path_interface pure virtual class
@dr7ana dr7ana force-pushed the contacts branch 8 times, most recently from 0ec41c0 to efc30d1 Compare March 5, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants