diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-07-13 23:40:55 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-07-13 23:40:55 +0800 |
commit | d483da766f812ab171ad611e4c85bf5b936b5d94 (patch) | |
tree | 2696cef48cdbb736b8eaefd3fd477f856271c37c /swarm | |
parent | 7c9314f231a7ddffbbbc5fec16c65519a0121eeb (diff) | |
download | dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.tar dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.tar.gz dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.tar.bz2 dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.tar.lz dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.tar.xz dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.tar.zst dexon-d483da766f812ab171ad611e4c85bf5b936b5d94.zip |
swarm/network: bump up protocol versions due to wrapped message intro (#17170)
Diffstat (limited to 'swarm')
-rw-r--r-- | swarm/network/protocol.go | 4 | ||||
-rw-r--r-- | swarm/network/protocol_test.go | 8 | ||||
-rw-r--r-- | swarm/network/stream/stream.go | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/swarm/network/protocol.go b/swarm/network/protocol.go index 8bf81fde6..49ae5a15b 100644 --- a/swarm/network/protocol.go +++ b/swarm/network/protocol.go @@ -44,7 +44,7 @@ const ( // BzzSpec is the spec of the generic swarm handshake var BzzSpec = &protocols.Spec{ Name: "bzz", - Version: 4, + Version: 5, MaxMsgSize: 10 * 1024 * 1024, Messages: []interface{}{ HandshakeMsg{}, @@ -54,7 +54,7 @@ var BzzSpec = &protocols.Spec{ // DiscoverySpec is the spec for the bzz discovery subprotocols var DiscoverySpec = &protocols.Spec{ Name: "hive", - Version: 4, + Version: 5, MaxMsgSize: 10 * 1024 * 1024, Messages: []interface{}{ peersMsg{}, diff --git a/swarm/network/protocol_test.go b/swarm/network/protocol_test.go index c28bc863e..63faf3108 100644 --- a/swarm/network/protocol_test.go +++ b/swarm/network/protocol_test.go @@ -186,7 +186,7 @@ func (s *bzzTester) testHandshake(lhs, rhs *HandshakeMsg, disconnects ...*p2ptes func correctBzzHandshake(addr *BzzAddr) *HandshakeMsg { return &HandshakeMsg{ - Version: 4, + Version: 5, NetworkID: DefaultNetworkID, Addr: addr, } @@ -199,7 +199,7 @@ func TestBzzHandshakeNetworkIDMismatch(t *testing.T) { err := s.testHandshake( correctBzzHandshake(addr), - &HandshakeMsg{Version: 4, NetworkID: 321, Addr: NewAddrFromNodeID(id)}, + &HandshakeMsg{Version: 5, NetworkID: 321, Addr: NewAddrFromNodeID(id)}, &p2ptest.Disconnect{Peer: id, Error: fmt.Errorf("Handshake error: Message handler error: (msg code 0): network id mismatch 321 (!= 3)")}, ) @@ -216,7 +216,7 @@ func TestBzzHandshakeVersionMismatch(t *testing.T) { err := s.testHandshake( correctBzzHandshake(addr), &HandshakeMsg{Version: 0, NetworkID: 3, Addr: NewAddrFromNodeID(id)}, - &p2ptest.Disconnect{Peer: id, Error: fmt.Errorf("Handshake error: Message handler error: (msg code 0): version mismatch 0 (!= 4)")}, + &p2ptest.Disconnect{Peer: id, Error: fmt.Errorf("Handshake error: Message handler error: (msg code 0): version mismatch 0 (!= 5)")}, ) if err != nil { @@ -231,7 +231,7 @@ func TestBzzHandshakeSuccess(t *testing.T) { err := s.testHandshake( correctBzzHandshake(addr), - &HandshakeMsg{Version: 4, NetworkID: 3, Addr: NewAddrFromNodeID(id)}, + &HandshakeMsg{Version: 5, NetworkID: 3, Addr: NewAddrFromNodeID(id)}, ) if err != nil { diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go index 56f242e91..cd0580a0c 100644 --- a/swarm/network/stream/stream.go +++ b/swarm/network/stream/stream.go @@ -653,7 +653,7 @@ func (c *clientParams) clientCreated() { // Spec is the spec of the streamer protocol var Spec = &protocols.Spec{ Name: "stream", - Version: 4, + Version: 5, MaxMsgSize: 10 * 1024 * 1024, Messages: []interface{}{ UnsubscribeMsg{}, |