diff --git a/node/config/config.go b/node/config/config.go index f27056b..e4cfe73 100644 --- a/node/config/config.go +++ b/node/config/config.go @@ -73,6 +73,9 @@ func LoadConfig(configPath string, proverKey string) (*Config, error) { bootstrapPeers := []string{ "/dns/bootstrap.quilibrium.com/udp/8336/quic/p2p/QmUhm9iZVruSxyavjoPLCfuoRG94SGQEkfxEEoukEZmD5B", + "/dns/quaalude.quilibrium.com/udp/8336/quic/p2p/QmcKQjpQmLpbDsiif2MuakhHFyxWvqYauPsJDaXnLav7PJ", + "/dns/quecifer.quilibrium.com/udp/8336/quic/p2p/QmQkyqziNCycUDdeBypkikMZWH2bBmmxfK7cbJFJmyyQdQ", + "/dns/quantum.quilibrium.com/udp/8336/quic/p2p/QmXaSyf9Gaq5ddcHysefDpuE7SJqzdg1surQ5wac55ysJV", "/ip4/204.186.74.47/udp/8317/quic/p2p/Qmd233pLUDvcDW3ama27usfbG1HxKNh1V9dmWVW1SXp1pd", "/ip4/204.186.74.46/udp/8316/quic/p2p/QmeqBjm3iX7sdTieyto1gys5ruQrQNPKfaTGcVQQWJPYDV", "/ip4/186.233.184.181/udp/8336/quic/p2p/QmW6QDvKuYqJYYMP5tMZSp12X3nexywK28tZNgqtqNpEDL", @@ -198,7 +201,11 @@ func LoadConfig(configPath string, proverKey string) (*Config, error) { config.Engine.GenesisSeed = genesisSeed } - if len(config.P2P.BootstrapPeers) == 0 { + // Slight trick here to get people on the latest bootstrap list – + // if it's empty, always use latest, if it has the Q bootstrap node, always + // use latest. + if len(config.P2P.BootstrapPeers) == 0 || + config.P2P.BootstrapPeers[0] == bootstrapPeers[0] { config.P2P.BootstrapPeers = bootstrapPeers } diff --git a/node/consensus/ceremony/consensus_frames.go b/node/consensus/ceremony/consensus_frames.go index eab23f1..3e86f35 100644 --- a/node/consensus/ceremony/consensus_frames.go +++ b/node/consensus/ceremony/consensus_frames.go @@ -1,6 +1,7 @@ package ceremony import ( + "bytes" "context" "io" "time" @@ -155,7 +156,8 @@ func (e *CeremonyDataClockConsensusEngine) GetMostAheadPeer() ( for _, v := range e.peerMap { _, ok := e.uncooperativePeersMap[string(v.peerId)] if v.maxFrame > max && - v.timestamp > consensus.GetMinimumVersionCutoff().UnixMilli() && !ok { + v.timestamp > consensus.GetMinimumVersionCutoff().UnixMilli() && + bytes.Compare(v.version, consensus.GetMinimumVersion()) >= 0 && !ok { peer = v.peerId max = v.maxFrame } @@ -330,14 +332,8 @@ func (e *CeremonyDataClockConsensusEngine) collect( e.syncingStatus = SyncStatusNotSyncing } - // With large networks and slow syncing machines, this can lead to an - // infinite loop if the list is refreshing fast enough, so make the size - // of the map the maximum loop case: - e.peerMapMx.Lock() - size := len(e.peerMap) - e.peerMapMx.Unlock() - - for i := 0; i < size; i++ { + // With the increase of network size, constrain down to top thirty + for i := 0; i < 30; i++ { peerId, maxFrame, err := e.GetMostAheadPeer() if err != nil { e.logger.Warn("no peers available, skipping sync") diff --git a/node/p2p/blossomsub.go b/node/p2p/blossomsub.go index 294ccf0..2d24572 100644 --- a/node/p2p/blossomsub.go +++ b/node/p2p/blossomsub.go @@ -344,7 +344,9 @@ func initDHT( go func() { for { time.Sleep(30 * time.Second) - if len(h.Network().Peers()) == 0 { + // try to assert some stability, never go below min peers for data + // consensus: + if len(h.Network().Peers()) < 3 { logger.Info("reconnecting to peers") reconnect() }