Skip to content

Commit 961ccab

Browse files
committed
[FAB-4557] gossip: Do not sign block messages
In gossip we currently sign every message in the following way: - Message sent by the Gossip() API call - uses the peer's signing identity to sign the message. - Message sent via Send() is signed in a NOOP manner (the signature is empty) Since blocks are already signed by the ordering service there is no point in signing them with the peer's signing identity. This commit makes such message be NOOP-signed. Change-Id: I0e5dca73e2ba3e711955829435172ed7f0365b61 Signed-off-by: Yacov Manevich <[email protected]>
1 parent 076fb52 commit 961ccab

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

gossip/gossip/gossip_impl.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,15 @@ func (g *gossipServiceImpl) Gossip(msg *proto.GossipMessage) {
629629
GossipMessage: msg,
630630
}
631631

632-
_, err := sMsg.Sign(func(msg []byte) ([]byte, error) {
633-
return g.mcs.Sign(msg)
634-
})
632+
var err error
633+
if sMsg.IsDataMsg() {
634+
sMsg, err = sMsg.NoopSign()
635+
} else {
636+
_, err = sMsg.Sign(func(msg []byte) ([]byte, error) {
637+
return g.mcs.Sign(msg)
638+
})
639+
}
640+
635641
if err != nil {
636642
g.logger.Warning("Failed signing message:", err)
637643
return

0 commit comments

Comments
 (0)