You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zebra has custom code that connects to all its initial seed peers on startup.
But we could use the AddressBook and CandidateSet to connect to these peers.
This would make the code simpler and more reliable. But we would need to maintain some existing security and reliability features of Zebra.
Specifications
When started for the first time, programs don’t know the IP addresses of any active full nodes. In order to discover some IP addresses, they query one or more DNS names (called DNS seeds) hardcoded into Bitcoin
Add MetaAddrChange::NewSeed and PeerAddrState::NeverAttemptedSeed variants
these variants only have a SocketAddr
security: these variants must not be assigned the current time - having a None time makes sure Zebra checks their addresses before gossiping them (existing behaviour)
Function Refactor
In add_initial_peers, send the peers to the AddressBook
Make sure that the first connected peer gets an immediate Addrs request
reliability: on small networks and with small seed sets, Zebra must get more addresses from this peer to reliably connect to other nodes (existing behaviour)
Testing
Test Zebra with a single seed peer
add an acceptance test that launches a Zebra node with the default initial peers config
also launch a Zebra node with only that peer's inbound listener in its initial peers config
check they both sync genesis and connect to multiple other peers
Test Zebra launch reliability using the existing acceptance tests
Alternatives
We could implement the initial peers rate-limit by waiting for a short time between each initial peer connection, see #2326.
But the rest of this change is a refactor and cleanup.
The text was updated successfully, but these errors were encountered:
Motivation
Zebra has custom code that connects to all its initial seed peers on startup.
But we could use the
AddressBook
andCandidateSet
to connect to these peers.This would make the code simpler and more reliable. But we would need to maintain some existing security and reliability features of Zebra.
Specifications
https://developer.bitcoin.org/devguide/p2p_network.html#peer-discovery
Solution
Type Refactor
MetaAddrChange::NewSeed
andPeerAddrState::NeverAttemptedSeed
variantsSocketAddr
None
time makes sure Zebra checks their addresses before gossiping them (existing behaviour)Function Refactor
add_initial_peers
, send the peers to theAddressBook
CandidateSet
will make sure that initial peer connections are rate-limited (originally fixed by Security: Rate-limit initial seed peer connections #2326)Addrs
requestTesting
Alternatives
We could implement the initial peers rate-limit by waiting for a short time between each initial peer connection, see #2326.
But the rest of this change is a refactor and cleanup.
The text was updated successfully, but these errors were encountered: