ZcashFoundation / dnsseeder

Configurable DNS seeder for Zcash based on CoreDNS
Apache License 2.0
4 stars 3 forks source link

Teach the seeder about network upgrades #3

Open gtank opened 4 years ago

gtank commented 4 years ago

Unlike the Bitcoin DNS seeder the original zcash-seeder was based on, this seeder has the need and capacity to serve different subsets of the network based on what NU the client is on.

This feature should be based on supported protocol version and supply subdomains that will seed only peers that are on the requested network epoch.

An example configuration might look like:

heartwood.seeder.example.com {
    dnsseed {
        network mainnet
        bootstrap_peers 127.0.13.37:8233
        crawl_interval 30m
        record_ttl 600
        protocol_versions 170011
    }
}

However, it should also be possible to automatically generate those subdomains with a map between name strings and protocol version ranges. In that case, each subdomain SHOULD share the same crawl process to the extent possible to avoid producing unnecessary network traffic.

teor2345 commented 3 years ago

Typically, we'll only have seeders for two network upgrades active at any one time - the current network upgrade, and the next network upgrade. (Or the previous one, if we've just passed an activation.)

At network upgrade activation, we should switch the default seeder from current to next.