les, les/lespay: implement new server pool (#20758)
This PR reimplements the light client server pool. It is also a first step to move certain logic into a new lespay package. This package will contain the implementation of the lespay token sale functions, the token buying and selling logic and other components related to peer selection/prioritization and service quality evaluation. Over the long term this package will be reusable for incentivizing future protocols. Since the LES peer logic is now based on enode.Iterator, it can now use DNS-based fallback discovery to find servers. This document describes the function of the new components: https://gist.github.com/zsfelfoldi/3c7ace895234b7b345ab4f71dab102d4
This commit is contained in:
@ -65,11 +65,22 @@ var GoerliBootnodes = []string{
|
||||
|
||||
const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"
|
||||
|
||||
// These DNS names provide bootstrap connectivity for public testnets and the mainnet.
|
||||
// See https://github.com/ethereum/discv4-dns-lists for more information.
|
||||
var KnownDNSNetworks = map[common.Hash]string{
|
||||
MainnetGenesisHash: dnsPrefix + "all.mainnet.ethdisco.net",
|
||||
RopstenGenesisHash: dnsPrefix + "all.ropsten.ethdisco.net",
|
||||
RinkebyGenesisHash: dnsPrefix + "all.rinkeby.ethdisco.net",
|
||||
GoerliGenesisHash: dnsPrefix + "all.goerli.ethdisco.net",
|
||||
// KnownDNSNetwork returns the address of a public DNS-based node list for the given
|
||||
// genesis hash and protocol. See https://github.com/ethereum/discv4-dns-lists for more
|
||||
// information.
|
||||
func KnownDNSNetwork(genesis common.Hash, protocol string) string {
|
||||
var net string
|
||||
switch genesis {
|
||||
case MainnetGenesisHash:
|
||||
net = "mainnet"
|
||||
case RopstenGenesisHash:
|
||||
net = "ropsten"
|
||||
case RinkebyGenesisHash:
|
||||
net = "rinkeby"
|
||||
case GoerliGenesisHash:
|
||||
net = "goerli"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
return dnsPrefix + protocol + "." + net + ".ethdisco.net"
|
||||
}
|
||||
|
Reference in New Issue
Block a user