diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-11 12:14:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 17a969ad66402ed9af16c166fbc7a8080274e44b (patch) | |
tree | 5d0c0fc5d09799862572fb362223af80edecd5e0 | |
parent | bc5c31fdd6869f277cca69d873befef76e4cb354 (diff) | |
download | dexon-17a969ad66402ed9af16c166fbc7a8080274e44b.tar.gz dexon-17a969ad66402ed9af16c166fbc7a8080274e44b.tar.zst dexon-17a969ad66402ed9af16c166fbc7a8080274e44b.zip |
dex: fetcher: modify parameters to speedup syncing (#239)
-rw-r--r-- | dex/fetcher/fetcher.go | 6 | ||||
-rw-r--r-- | dex/peer.go | 5 | ||||
-rw-r--r-- | p2p/dial.go | 1 |
3 files changed, 7 insertions, 5 deletions
diff --git a/dex/fetcher/fetcher.go b/dex/fetcher/fetcher.go index f6807b5a5..64e576bd8 100644 --- a/dex/fetcher/fetcher.go +++ b/dex/fetcher/fetcher.go @@ -34,9 +34,9 @@ const ( gatherSlack = 100 * time.Millisecond // Interval used to collate almost-expired announces with fetches fetchTimeout = 5 * time.Second // Maximum allotted time to return an explicitly requested block maxUncleDist = 7 // Maximum allowed backward distance from the chain head - maxQueueDist = 32 // Maximum allowed distance from the chain head to queue - hashLimit = 256 // Maximum number of unique blocks a peer may have announced - blockLimit = 64 // Maximum number of unique blocks a peer may have delivered + maxQueueDist = 320 // Maximum allowed distance from the chain head to queue + hashLimit = 1024 // Maximum number of unique blocks a peer may have announced + blockLimit = 512 // Maximum number of unique blocks a peer may have delivered ) var ( diff --git a/dex/peer.go b/dex/peer.go index 8ade9f152..64798aaaf 100644 --- a/dex/peer.go +++ b/dex/peer.go @@ -944,6 +944,8 @@ func (ps *peerSet) BuildConnection(round uint64) { ps.lock.Lock() defer ps.lock.Unlock() + log.Info("Build connection", "round", round) + dkgLabel := peerLabel{set: dkgset, round: round} if _, ok := ps.label2Nodes[dkgLabel]; !ok { dkgPKs, err := ps.gov.DKGSet(round) @@ -965,8 +967,7 @@ func (ps *peerSet) BuildConnection(round uint64) { if _, ok := ps.label2Nodes[notaryLabel]; !ok { notaryPKs, err := ps.gov.NotarySet(round) if err != nil { - log.Error("get notary set fail", - "round", round, "err", err) + log.Error("get notary set fail", "round", round, "err", err) return } diff --git a/p2p/dial.go b/p2p/dial.go index b323bdac1..cd226c53a 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -223,6 +223,7 @@ func (s *dialstate) newTasks(nRunning int, peers map[enode.ID]*Peer, now time.Ti log.Warn("Removing direct dial candidate", "id", t.dest.ID(), "addr", &net.TCPAddr{IP: t.dest.IP(), Port: t.dest.TCP()}, "err", err) delete(s.direct, t.dest.ID()) case nil: + log.Debug("Direct peer connected", "id", id) s.dialing[id] = t.flags newtasks = append(newtasks, t) } |