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
Algod: Leverage 2 SRV record providers for resolving relay addresses w/ de-duplication. #5087
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5087 +/- ##
==========================================
+ Coverage 55.46% 55.54% +0.07%
==========================================
Files 447 448 +1
Lines 63290 63360 +70
==========================================
+ Hits 35103 35191 +88
+ Misses 25807 25787 -20
- Partials 2380 2382 +2
... and 10 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
7d97b1e
to
a3a90bd
Compare
a3a90bd
to
7d03ca3
Compare
afc46c7
to
6150990
Compare
This feature allows for user friendly way of booting off off two separate lists - not only primary/secondary. It would be even better to treat 3rd and following boostrapid entries as secondary to allow the merger of even more relay sets. |
network/wsNetwork_test.go
Outdated
dedupedRelayDomains = removeDuplicateStr(relayDomains) | ||
|
||
relayPeers = netA.GetPeers(PeersPhonebookRelays) | ||
assert.Equal(t, len(dedupedRelayDomains), len(relayPeers)) | ||
|
||
relayAddrs = make([]string, len(relayPeers)) | ||
for pi, peer := range relayPeers { | ||
relayAddrs[pi] = peer.(HTTPPeer).GetAddress() | ||
} | ||
sort.Strings(relayAddrs) | ||
sort.Strings(dedupedRelayDomains) | ||
assert.Equal(t, dedupedRelayDomains, relayAddrs) | ||
|
||
archivePeers = netA.GetPeers(PeersPhonebookArchivers) | ||
assert.Equal(t, len(dedupedArchiveDomains), len(archivePeers)) | ||
|
||
archiveAddrs = make([]string, len(archivePeers)) | ||
for pi, peer := range archivePeers { | ||
archiveAddrs[pi] = peer.(HTTPPeer).GetAddress() | ||
} | ||
sort.Strings(archiveAddrs) | ||
sort.Strings(dedupedArchiveDomains) | ||
assert.Equal(t, dedupedArchiveDomains, archiveAddrs) |
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.
I'd wrap this whole check in an inline function. It was not clear to me at first that half of this test was the assertion logic and this could help.
4bde105
to
1bcbd48
Compare
4806884
to
d3760a8
Compare
5961d55
to
fc99282
Compare
b1517fe
to
1c19e28
Compare
….net as backup, with dedup pattern between resolved addresses from the two.
… in-depth description of how ParseDNSBootstrap behaves.
…a the appropriate builder function.
…wsNetwork_test.go Co-authored-by: Will Winder <wwinder.unh@gmail.com>
Co-authored-by: Will Winder <wwinder.unh@gmail.com>
Co-authored-by: Will Winder <wwinder.unh@gmail.com>
…t had been hidden as a result.
Co-authored-by: cce <51567+cce@users.noreply.github.com>
… validate and just parse flavors. The Validate function is now called during bootstrapping in both the algod and algoh main functions (where errors stop start up).
…Template. In practice, there is no reason to vary whether or not we stop in validate vs 'just read' modes.
26afede
to
06a432d
Compare
GenesisID: genesisID, | ||
NetworkID: networkID, | ||
nodeInfo: nodeInfo, | ||
resolveSRVRecords: tools_network.ReadFromSRV, |
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.
👍 nice
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.
+1
@@ -23,13 +23,16 @@ import ( | |||
"encoding/binary" | |||
"encoding/json" | |||
"fmt" | |||
"github.com/algorand/go-algorand/internal/rapidgen" |
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.
when I resurrect #3734 the gci tool can auto-organize all the imports across the codebase, there used to be a preferred structure for import sections but we have drifted a lot
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.
LGTM
Summary
Introduces support for having two sets of SRV records intended to resolve to the same relay hosts. This allows for resiliency against a single DNS provider failing.
As a part of this, we are introducing the concept of primary and backup SRV bootstrap entries. For these, one can provide a deduplication pattern for merging between them:
<network>.algorand0.network?backup=<network>.algorand.network&dedup=<name>.(algorand-<network>|n-<network>.algorand0).network
Today, we support providing multiple independent bootstrap entries such as
<network>.algorand.network;<network>.myawesomebootstraponalgorand.com
In these cases, no deduplication is attempted unless resolved relay names are identical. The equivalent of that with our new backup support looks like:
<network>.algorand0.network?backup=<network>.algorand.network&dedup=<name>.(algorand-<network>|n-<network>.algorand0).network;<network>.myawesomebootstraponalgorand.com
Test Plan