-
Notifications
You must be signed in to change notification settings - Fork 475
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
p2p: Capabilities Advertisement for Archival/Catchpoints #5702
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5702 +/- ##
==========================================
+ Coverage 55.54% 55.62% +0.08%
==========================================
Files 476 478 +2
Lines 66853 66980 +127
==========================================
+ Hits 37131 37256 +125
+ Misses 27193 27184 -9
- Partials 2529 2540 +11
... and 12 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Still need to add testing, merge from master, add some docs, etc. But feel free to give early feedback at this point if anyone has some. |
@@ -581,6 +581,9 @@ type Local struct { | |||
|
|||
// DisableAPIAuth turns off authentication for public (non-admin) API endpoints. | |||
DisableAPIAuth bool `version[30]:"false"` | |||
|
|||
// EnableDHT will turn on the hash table for use with capabilities advertisement | |||
EnableDHTProviders bool `version[30]:"false"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v31
@@ -41,6 +41,7 @@ | |||
"EnableBlockService": false, | |||
"EnableBlockServiceFallbackToArchiver": true, | |||
"EnableCatchupFromArchiveServers": false, | |||
"EnableDHTProviders": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v30 should not be modified
@@ -152,6 +156,8 @@ type AlgorandFullNode struct { | |||
tracer messagetracer.MessageTracer | |||
|
|||
stateProofWorker *stateproof.Worker | |||
|
|||
capabilitiesDiscovery *p2p.CapabilitiesDiscovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have node free of p2p dependency/implementation detail?
…creation (algorand#5672) goal network pregen [-p] [-t]: Generates genesis.json, root and part keys based on the template file [-t]. [-p] (pregendir) is where the genesis files are saved (since this is an inherited required flag), and it must be empty or command will error. goal network create [-r] [-t] [-p]: Imports files from pregendir to networkDir. Importing keys was already possible, but this explicitly copies over the keys from another directory, because network directories are wiped if there is an error during creation.
Summary
PR is currently WIP. There are a few bits which are still being implemented.
This adds libp2p-kad-dht to go-algorand. In this PR it is wrapped in a cache and has some backoff logic included.
At a high level it is using the Content Provider interfaces in the DHT spec in a basic way. It sets up common namespaces for 2 basic capabilities (archival and catchpoints), and advertises those capabilities to bootstrap peers on node startup.
Next Steps (Not in this PR)
Integrate the peer store and provider stores with the catchup and fast catchup services in order to use them as the source of peer info (with SRV entries as a fallback).
In order for non-relay nodes to be able to use the DHT for capabilities advertisement, we'll need the relays to enable it--since the relays in the SRV list will be used as initial peers.
Test Plan
More testing to be added as the PR progresses. I'll update here.