aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2019-05-16 23:29:12 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-05-16 23:29:12 +0800
commit60386b3545659d99c7488e456c780606db101936 (patch)
tree6fe471edaacf9813faf0a4382ade1287479672d6 /swarm/network
parent1e067202a2311e583238026da0c9032e28a3f0b2 (diff)
downloadgo-tangerine-60386b3545659d99c7488e456c780606db101936.tar.gz
go-tangerine-60386b3545659d99c7488e456c780606db101936.tar.zst
go-tangerine-60386b3545659d99c7488e456c780606db101936.zip
swarm/network: bump network id for 0.4 release (#19580)
* swarm/network: bump network id for 0.4 release * swarm/network: bump bzz protocol version * swarm/docs: migration document v0.3 to v0.4 * swarm/storage/feed: gofmt lookup_test.go
Diffstat (limited to 'swarm/network')
-rw-r--r--swarm/network/protocol.go4
-rw-r--r--swarm/network/protocol_test.go2
-rw-r--r--swarm/network/stream/syncer.go13
3 files changed, 10 insertions, 9 deletions
diff --git a/swarm/network/protocol.go b/swarm/network/protocol.go
index ad3f8df8f..dd8a86c0b 100644
--- a/swarm/network/protocol.go
+++ b/swarm/network/protocol.go
@@ -33,7 +33,7 @@ import (
)
const (
- DefaultNetworkID = 3
+ DefaultNetworkID = 4
// timeout for waiting
bzzHandshakeTimeout = 3000 * time.Millisecond
)
@@ -43,7 +43,7 @@ var DefaultTestNetworkID = rand.Uint64()
// BzzSpec is the spec of the generic swarm handshake
var BzzSpec = &protocols.Spec{
Name: "bzz",
- Version: 8,
+ Version: 9,
MaxMsgSize: 10 * 1024 * 1024,
Messages: []interface{}{
HandshakeMsg{},
diff --git a/swarm/network/protocol_test.go b/swarm/network/protocol_test.go
index 737ad0784..616abde9e 100644
--- a/swarm/network/protocol_test.go
+++ b/swarm/network/protocol_test.go
@@ -36,7 +36,7 @@ import (
)
const (
- TestProtocolVersion = 8
+ TestProtocolVersion = 9
)
var TestProtocolNetworkID = DefaultTestNetworkID
diff --git a/swarm/network/stream/syncer.go b/swarm/network/stream/syncer.go
index 9bde39550..7a61950ed 100644
--- a/swarm/network/stream/syncer.go
+++ b/swarm/network/stream/syncer.go
@@ -18,6 +18,7 @@ package stream
import (
"context"
+ "fmt"
"strconv"
"time"
@@ -58,7 +59,7 @@ func RegisterSwarmSyncerServer(streamer *Registry, netStore *storage.NetStore) {
if err != nil {
return nil, err
}
- return NewSwarmSyncerServer(po, netStore, p.ID().String()+"|"+string(po))
+ return NewSwarmSyncerServer(po, netStore, fmt.Sprintf("%s|%d", p.ID(), po))
})
// streamer.RegisterServerFunc(stream, func(p *Peer) (Server, error) {
// return NewOutgoingProvableSwarmSyncer(po, db)
@@ -146,16 +147,16 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6
if batchSize >= BatchSize {
iterate = false
metrics.GetOrRegisterCounter("syncer.set-next-batch.full-batch", nil).Inc(1)
- log.Debug("syncer pull subscription - batch size reached", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
+ log.Trace("syncer pull subscription - batch size reached", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
}
if timer == nil {
timer = time.NewTimer(batchTimeout)
} else {
- log.Debug("syncer pull subscription - stopping timer", "correlateId", s.correlateId)
+ log.Trace("syncer pull subscription - stopping timer", "correlateId", s.correlateId)
if !timer.Stop() {
<-timer.C
}
- log.Debug("syncer pull subscription - channel drained, resetting timer", "correlateId", s.correlateId)
+ log.Trace("syncer pull subscription - channel drained, resetting timer", "correlateId", s.correlateId)
timer.Reset(batchTimeout)
}
timerC = timer.C
@@ -164,10 +165,10 @@ func (s *SwarmSyncerServer) SetNextBatch(from, to uint64) ([]byte, uint64, uint6
// received after some time
iterate = false
metrics.GetOrRegisterCounter("syncer.set-next-batch.timer-expire", nil).Inc(1)
- log.Debug("syncer pull subscription timer expired", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
+ log.Trace("syncer pull subscription timer expired", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
case <-s.quit:
iterate = false
- log.Debug("syncer pull subscription - quit received", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
+ log.Trace("syncer pull subscription - quit received", "correlateId", s.correlateId, "batchSize", batchSize, "batchStartID", batchStartID, "batchEndID", batchEndID)
}
}
if batchStartID == nil {