From 6fd5f4e86d295854c4b740cfc26830c635e5830a Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 4 Feb 2021 16:47:49 +0300 Subject: [PATCH 1/2] payload: extensible payload hashes are network-dependent Of course they are. Fixes 2021-02-04T13:39:02.351Z WARN peer disconnected {"addr": "172.29.0.4:20333", "reason": "handling CMDExtensible message: signature check failed: invalid signature", "peerCount": 3} 2021-02-04T13:39:02.352Z WARN peer disconnected {"addr": "172.29.0.3:20334", "reason": "handling CMDExtensible message: signature check failed: invalid signature", "peerCount": 2} in 2+2 setting. --- pkg/network/payload/extensible.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/network/payload/extensible.go b/pkg/network/payload/extensible.go index 7df9ffd33..838d519ac 100644 --- a/pkg/network/payload/extensible.go +++ b/pkg/network/payload/extensible.go @@ -121,6 +121,7 @@ func (e *Extensible) updateHashes(b []byte) { // updateSignedPart updates serialized message if needed. func (e *Extensible) updateSignedPart() { w := io.NewBufBinWriter() + w.WriteU32LE(uint32(e.Network)) e.encodeBinaryUnsigned(w.BinWriter) e.signedpart = w.Bytes() } From f081e63674a9641031c109ba71e625858132fdfa Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 4 Feb 2021 16:55:46 +0300 Subject: [PATCH 2/2] consensus: fix extensible message category name Fix this in 2+2 setup: 2021-02-04T13:50:23.923Z WARN peer disconnected {"addr": "172.30.0.5:20334", "reason": "handling CMDExtensible message: invalid category", "peerCount": 3} 2021-02-04T13:50:26.968Z WARN peer disconnected {"addr": "172.30.0.2:42586", "reason": "handling CMDExtensible message: invalid category", "peerCount": 2} --- pkg/consensus/consensus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/consensus/consensus.go b/pkg/consensus/consensus.go index 3e31d6ecf..1af47538d 100644 --- a/pkg/consensus/consensus.go +++ b/pkg/consensus/consensus.go @@ -41,7 +41,7 @@ const defaultTimePerBlock = 15 * time.Second const nsInMs = 1000000 // Category is message category for extensible payloads. -const Category = "Consensus" +const Category = "dBFT" // Service represents consensus instance. type Service interface {