diff --git a/gossip/comm/ack.go b/gossip/comm/ack.go new file mode 100644 index 00000000000..62c1febf5ce --- /dev/null +++ b/gossip/comm/ack.go @@ -0,0 +1,73 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package comm + +import ( + "github.com/hyperledger/fabric/gossip/common" + "github.com/hyperledger/fabric/gossip/util" + proto "github.com/hyperledger/fabric/protos/gossip" +) + +type sendFunc func(peer *RemotePeer, msg *proto.SignedGossipMessage) +type waitFunc func(*RemotePeer) error + +type ackSendOperation struct { + snd sendFunc + waitForAck waitFunc +} + +func newAckSendOperation(snd sendFunc, waitForAck waitFunc) *ackSendOperation { + return &ackSendOperation{ + snd: snd, + waitForAck: waitForAck, + } +} + +func (aso *ackSendOperation) send(msg *proto.SignedGossipMessage, minAckNum int, peers ...*RemotePeer) []SendResult { + successAcks := 0 + results := []SendResult{} + + acks := make(chan SendResult, len(peers)) + // Send to all peers the message + for _, p := range peers { + go func(p *RemotePeer) { + // Send the message to 'p' + aso.snd(p, msg) + // Wait for an ack from 'p', or get an error if timed out + err := aso.waitForAck(p) + acks <- SendResult{ + RemotePeer: *p, + error: err, + } + }(p) + } + for { + ack := <-acks + results = append(results, SendResult{ + error: ack.error, + RemotePeer: ack.RemotePeer, + }) + if ack.error == nil { + successAcks++ + } + if successAcks == minAckNum || len(results) == len(peers) { + break + } + } + return results +} + +func interceptAcks(nextHandler handler, remotePeerID common.PKIidType, pubSub *util.PubSub) func(*proto.SignedGossipMessage) { + return func(m *proto.SignedGossipMessage) { + if m.IsAck() { + topic := topicForAck(m.Nonce, remotePeerID) + pubSub.Publish(topic, m.GetAck()) + return + } + nextHandler(m) + } +} diff --git a/gossip/comm/ack_test.go b/gossip/comm/ack_test.go new file mode 100644 index 00000000000..707e914ad94 --- /dev/null +++ b/gossip/comm/ack_test.go @@ -0,0 +1,153 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package comm + +import ( + "errors" + "testing" + "time" + + "github.com/hyperledger/fabric/gossip/common" + "github.com/hyperledger/fabric/gossip/util" + proto "github.com/hyperledger/fabric/protos/gossip" + "github.com/stretchr/testify/assert" +) + +func TestInterceptAcks(t *testing.T) { + pubsub := util.NewPubSub() + pkiID := common.PKIidType("pkiID") + msgs := make(chan *proto.SignedGossipMessage, 1) + handlerFunc := func(message *proto.SignedGossipMessage) { + msgs <- message + } + wrappedHandler := interceptAcks(handlerFunc, pkiID, pubsub) + ack := &proto.SignedGossipMessage{ + GossipMessage: &proto.GossipMessage{ + Nonce: 1, + Content: &proto.GossipMessage_Ack{ + Ack: &proto.Acknowledgement{}, + }, + }, + } + sub := pubsub.Subscribe(topicForAck(1, pkiID), time.Second) + wrappedHandler(ack) + // Ensure ack was consumed and not passed onwards to the wrapped hander + assert.Len(t, msgs, 0) + _, err := sub.Listen() + // Ensure ack was published + assert.NoError(t, err) + + // Test none acks are just forwarded + notAck := &proto.SignedGossipMessage{ + GossipMessage: &proto.GossipMessage{ + Nonce: 2, + Content: &proto.GossipMessage_DataMsg{ + DataMsg: &proto.DataMessage{}, + }, + }, + } + sub = pubsub.Subscribe(topicForAck(2, pkiID), time.Second) + wrappedHandler(notAck) + // Ensure message was passed to the wrapped handler + assert.Len(t, msgs, 1) + _, err = sub.Listen() + // Ensure ack was not published + assert.Error(t, err) +} + +func TestAck(t *testing.T) { + t.Parallel() + + comm1, _ := newCommInstance(14000, naiveSec) + comm2, _ := newCommInstance(14001, naiveSec) + defer comm2.Stop() + comm3, _ := newCommInstance(14002, naiveSec) + defer comm3.Stop() + comm4, _ := newCommInstance(14003, naiveSec) + defer comm4.Stop() + + acceptData := func(o interface{}) bool { + return o.(proto.ReceivedMessage).GetGossipMessage().IsDataMsg() + } + + ack := func(c <-chan proto.ReceivedMessage) { + msg := <-c + msg.Ack(nil) + } + + nack := func(c <-chan proto.ReceivedMessage) { + msg := <-c + msg.Ack(errors.New("Failed processing message because reasons")) + } + + // Have instances 2 and 3 subscribe to data messages, and ack them + inc2 := comm2.Accept(acceptData) + inc3 := comm3.Accept(acceptData) + + // Collect 2 out of 2 acks - should succeed + go ack(inc2) + go ack(inc3) + res := comm1.SendWithAck(createGossipMsg(), time.Second*3, 2, remotePeer(14001), remotePeer(14002)) + assert.Len(t, res, 2) + assert.Empty(t, res[0].Error()) + assert.Empty(t, res[1].Error()) + + // Collect 2 out of 3 acks - should succeed + t1 := time.Now() + go ack(inc2) + go ack(inc3) + res = comm1.SendWithAck(createGossipMsg(), time.Second*10, 2, remotePeer(14001), remotePeer(14002), remotePeer(14003)) + elapsed := time.Since(t1) + assert.Len(t, res, 2) + assert.Empty(t, res[0].Error()) + assert.Empty(t, res[1].Error()) + // Collection of 2 out of 3 acks should have taken much less than the timeout (10 seconds) + assert.True(t, elapsed < time.Second*5) + + // Collect 2 out of 3 acks - should fail, because peer3 now have sent an error along with the ack + go ack(inc2) + go nack(inc3) + res = comm1.SendWithAck(createGossipMsg(), time.Second*10, 2, remotePeer(14001), remotePeer(14002), remotePeer(14003)) + assert.Len(t, res, 3) + assert.Contains(t, []string{res[0].Error(), res[1].Error(), res[2].Error()}, "Failed processing message because reasons") + assert.Contains(t, []string{res[0].Error(), res[1].Error(), res[2].Error()}, "timed out") + + // Collect 2 out of 2 acks - should fail because comm2 and comm3 now don't acknowledge messages + res = comm1.SendWithAck(createGossipMsg(), time.Second*3, 2, remotePeer(14001), remotePeer(14002)) + assert.Len(t, res, 2) + assert.Contains(t, res[0].Error(), "timed out") + assert.Contains(t, res[1].Error(), "timed out") + // Drain ack messages to prepare for next salvo + <-inc2 + <-inc3 + + // Collect 2 out of 3 acks - should fail + go ack(inc2) + go nack(inc3) + res = comm1.SendWithAck(createGossipMsg(), time.Second*3, 2, remotePeer(14001), remotePeer(14002), remotePeer(14003)) + assert.Len(t, res, 3) + assert.Contains(t, []string{res[0].Error(), res[1].Error(), res[2].Error()}, "") // This is the "successful ack" + assert.Contains(t, []string{res[0].Error(), res[1].Error(), res[2].Error()}, "Failed processing message because reasons") + assert.Contains(t, []string{res[0].Error(), res[1].Error(), res[2].Error()}, "timed out") + assert.Contains(t, res.String(), "\"Failed processing message because reasons\":1") + assert.Contains(t, res.String(), "\"timed out\":1") + assert.Contains(t, res.String(), "\"successes\":1") + assert.Equal(t, 2, res.NackCount()) + assert.Equal(t, 1, res.AckCount()) + + // Send a message to no one + res = comm1.SendWithAck(createGossipMsg(), time.Second*3, 1) + assert.Len(t, res, 0) + + // Send a message while stopping + comm1.Stop() + res = comm1.SendWithAck(createGossipMsg(), time.Second*3, 1, remotePeer(14001), remotePeer(14002), remotePeer(14003)) + assert.Len(t, res, 3) + assert.Contains(t, res[0].Error(), "comm is stopping") + assert.Contains(t, res[1].Error(), "comm is stopping") + assert.Contains(t, res[2].Error(), "comm is stopping") +} diff --git a/gossip/comm/comm.go b/gossip/comm/comm.go index cdced1bd89d..f231622be3a 100644 --- a/gossip/comm/comm.go +++ b/gossip/comm/comm.go @@ -7,7 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package comm import ( + "encoding/json" "fmt" + "time" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" @@ -24,6 +26,9 @@ type Comm interface { // Send sends a message to remote peers Send(msg *proto.SignedGossipMessage, peers ...*RemotePeer) + // SendWithAck sends a message to remote peers, waiting for acknowledgement from minAck of them, or until a certain timeout expires + SendWithAck(msg *proto.SignedGossipMessage, timeout time.Duration, minAck int, peers ...*RemotePeer) AggregatedSendResult + // Probe probes a remote node and returns nil if its responsive, // and an error if it's not. Probe(peer *RemotePeer) error @@ -52,6 +57,63 @@ type RemotePeer struct { PKIID common.PKIidType } +// SendResult defines a result of a send to a remote peer +type SendResult struct { + error + RemotePeer +} + +// Error returns the error of the SendResult, or an empty string +// if an error hasn't occurred +func (sr SendResult) Error() string { + if sr.error != nil { + return sr.error.Error() + } + return "" +} + +// AggregatedSendResult represents a slice of SendResults +type AggregatedSendResult []SendResult + +// AckCount returns the number of successful acknowledgements +func (ar AggregatedSendResult) AckCount() int { + c := 0 + for _, ack := range ar { + if ack.error == nil { + c++ + } + } + return c +} + +// NackCount returns the number of unsuccessful acknowledgements +func (ar AggregatedSendResult) NackCount() int { + return len(ar) - ar.AckCount() +} + +// String returns a JSONed string representation +// of the AggregatedSendResult +func (ar AggregatedSendResult) String() string { + errMap := map[string]int{} + for _, ack := range ar { + if ack.error == nil { + continue + } + errMap[ack.Error()]++ + } + + ackCount := ar.AckCount() + output := map[string]interface{}{} + if ackCount > 0 { + output["successes"] = ackCount + } + if ackCount < len(ar) { + output["failures"] = errMap + } + b, _ := json.Marshal(output) + return string(b) +} + // String converts a RemotePeer to a string func (p *RemotePeer) String() string { return fmt.Sprintf("%s, PKIid:%v", p.Endpoint, p.PKIID) diff --git a/gossip/comm/comm_impl.go b/gossip/comm/comm_impl.go index 97a081be174..86d7bcad1f9 100644 --- a/gossip/comm/comm_impl.go +++ b/gossip/comm/comm_impl.go @@ -9,6 +9,7 @@ package comm import ( "bytes" "crypto/tls" + "encoding/hex" "fmt" "net" "reflect" @@ -67,6 +68,7 @@ func NewCommInstanceWithServer(port int, idMapper identity.Mapper, peerIdentity } commInst := &commImpl{ + pubSub: util.NewPubSub(), selfCertHash: certHash, PKIID: idMapper.GetPKIidOfCert(peerIdentity), idMapper: idMapper, @@ -124,6 +126,7 @@ func NewCommInstance(s *grpc.Server, cert *tls.Certificate, idStore identity.Map } type commImpl struct { + pubSub *util.PubSub selfCertHash []byte peerIdentity api.PeerIdentityType idMapper identity.Mapper @@ -201,7 +204,7 @@ func (c *commImpl) createConnection(endpoint string, expectedPKIID common.PKIidT connInfo: connInfo, }) } - conn.handler = h + conn.handler = interceptAcks(h, connInfo.ID, c.pubSub) return conn, nil } c.logger.Warningf("Authentication failed: %+v", err) @@ -214,17 +217,16 @@ func (c *commImpl) Send(msg *proto.SignedGossipMessage, peers ...*RemotePeer) { if c.isStopping() || len(peers) == 0 { return } - c.logger.Debug("Entering, sending", msg, "to ", len(peers), "peers") for _, peer := range peers { go func(peer *RemotePeer, msg *proto.SignedGossipMessage) { - c.sendToEndpoint(peer, msg) + c.sendToEndpoint(peer, msg, nonBlockingSend) }(peer, msg) } } -func (c *commImpl) sendToEndpoint(peer *RemotePeer, msg *proto.SignedGossipMessage) { +func (c *commImpl) sendToEndpoint(peer *RemotePeer, msg *proto.SignedGossipMessage, shouldBlock blockingBehavior) { if c.isStopping() { return } @@ -238,7 +240,7 @@ func (c *commImpl) sendToEndpoint(peer *RemotePeer, msg *proto.SignedGossipMessa c.logger.Warningf("%v isn't responsive: %v", peer, err) c.disconnect(peer.PKIID) } - conn.send(msg, disConnectOnErr) + conn.send(msg, disConnectOnErr, shouldBlock) return } c.logger.Warningf("Failed obtaining connection for %v reason: %v", peer, err) @@ -481,6 +483,63 @@ func (c *commImpl) authenticateRemotePeer(stream stream) (*proto.ConnectionInfo, return connInfo, nil } +// SendWithAck sends a message to remote peers, waiting for acknowledgement from minAck of them, or until a certain timeout expires +func (c *commImpl) SendWithAck(msg *proto.SignedGossipMessage, timeout time.Duration, minAck int, peers ...*RemotePeer) AggregatedSendResult { + if len(peers) == 0 { + return nil + } + var err error + + // Roll a random NONCE to be used as a send ID to differentiate + // between different invocations + msg.Nonce = util.RandomUInt64() + // Replace the envelope in the message to update the NONCE + msg, err = msg.NoopSign() + + if c.isStopping() || err != nil { + if err == nil { + err = errors.New("comm is stopping") + } + results := []SendResult{} + for _, p := range peers { + results = append(results, SendResult{ + error: err, + RemotePeer: *p, + }) + } + return results + } + c.logger.Debug("Entering, sending", msg, "to ", len(peers), "peers") + sndFunc := func(peer *RemotePeer, msg *proto.SignedGossipMessage) { + c.sendToEndpoint(peer, msg, blockingSend) + } + // Subscribe to acks + subscriptions := make(map[string]func() error) + for _, p := range peers { + topic := topicForAck(msg.Nonce, p.PKIID) + sub := c.pubSub.Subscribe(topic, timeout) + subscriptions[string(p.PKIID)] = func() error { + msg, err := sub.Listen() + if err != nil { + return err + } + if msg, isAck := msg.(*proto.Acknowledgement); !isAck { + return fmt.Errorf("Received a message of type %s, expected *proto.Acknowledgement", reflect.TypeOf(msg)) + } else { + if msg.Error != "" { + return errors.New(msg.Error) + } + } + return nil + } + } + waitForAck := func(p *RemotePeer) error { + return subscriptions[string(p.PKIID)]() + } + ackOperation := newAckSendOperation(sndFunc, waitForAck) + return ackOperation.send(msg, minAck, peers...) +} + func (c *commImpl) GossipStream(stream proto.Gossip_GossipStreamServer) error { if c.isStopping() { return fmt.Errorf("Shutting down") @@ -509,7 +568,7 @@ func (c *commImpl) GossipStream(stream proto.Gossip_GossipStreamServer) error { }) } - conn.handler = h + conn.handler = interceptAcks(h, connInfo.ID, c.pubSub) defer func() { c.logger.Debug("Client", extractRemoteAddress(stream), " disconnected") @@ -627,3 +686,7 @@ func createGRPCLayer(port int) (*grpc.Server, net.Listener, api.PeerSecureDialOp s = grpc.NewServer(serverOpts...) return s, ll, secureDialOpts, returnedCertHash } + +func topicForAck(nonce uint64, pkiID common.PKIidType) string { + return fmt.Sprintf("%d %s", nonce, hex.EncodeToString(pkiID)) +} diff --git a/gossip/comm/conn.go b/gossip/comm/conn.go index eb82e96813a..a0bc3e27c96 100644 --- a/gossip/comm/conn.go +++ b/gossip/comm/conn.go @@ -22,6 +22,13 @@ import ( type handler func(message *proto.SignedGossipMessage) +type blockingBehavior bool + +const ( + blockingSend = blockingBehavior(true) + nonBlockingSend = blockingBehavior(false) +) + type connFactory interface { createConnection(endpoint string, pkiID common.PKIidType) (*connection, error) } @@ -193,7 +200,6 @@ func newConnection(cl proto.GossipClient, c *grpc.ClientConn, cs proto.Gossip_Go stopFlag: int32(0), stopChan: make(chan struct{}, 1), } - return connection } @@ -225,7 +231,9 @@ func (conn *connection) close() { conn.stopChan <- struct{}{} + conn.drainOutputBuffer() conn.Lock() + defer conn.Unlock() if conn.clientStream != nil { conn.clientStream.CloseSend() @@ -237,31 +245,33 @@ func (conn *connection) close() { if conn.cancel != nil { conn.cancel() } - - conn.Unlock() - } func (conn *connection) toDie() bool { return atomic.LoadInt32(&(conn.stopFlag)) == int32(1) } -func (conn *connection) send(msg *proto.SignedGossipMessage, onErr func(error)) { - conn.Lock() - defer conn.Unlock() - - if len(conn.outBuff) == util.GetIntOrDefault("peer.gossip.sendBuffSize", defSendBuffSize) { - if conn.logger.IsEnabledFor(logging.DEBUG) { - conn.logger.Debug("Buffer to", conn.info.Endpoint, "overflowed, dropping message", msg.String()) - } +func (conn *connection) send(msg *proto.SignedGossipMessage, onErr func(error), shouldBlock blockingBehavior) { + if conn.toDie() { + conn.logger.Debug("Aborting send() to ", conn.info.Endpoint, "because connection is closing") return } + conn.Lock() + defer conn.Unlock() m := &msgSending{ envelope: msg.Envelope, onErr: onErr, } + if len(conn.outBuff) == util.GetIntOrDefault("peer.gossip.sendBuffSize", defSendBuffSize) { + if conn.logger.IsEnabledFor(logging.DEBUG) { + conn.logger.Debug("Buffer to", conn.info.Endpoint, "overflowed, dropping message", msg.String()) + } + if !shouldBlock { + return + } + } conn.outBuff <- m } @@ -316,6 +326,13 @@ func (conn *connection) writeToStream() { } } +func (conn *connection) drainOutputBuffer() { + // Drain the output buffer + for len(conn.outBuff) > 0 { + <-conn.outBuff + } +} + func (conn *connection) readFromStream(errChan chan error, msgChan chan *proto.SignedGossipMessage) { defer func() { recover() diff --git a/gossip/comm/mock/mock_comm.go b/gossip/comm/mock/mock_comm.go index 60d0be1bc21..61ac76ca48c 100644 --- a/gossip/comm/mock/mock_comm.go +++ b/gossip/comm/mock/mock_comm.go @@ -7,6 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package mock import ( + "time" + "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" @@ -83,6 +85,11 @@ func (packet *packetMock) Respond(msg *proto.GossipMessage) { } } +// Ack returns to the sender an acknowledgement for the message +func (packet *packetMock) Ack(err error) { + +} + // GetSourceEnvelope Returns the Envelope the ReceivedMessage was // constructed with func (packet *packetMock) GetSourceEnvelope() *proto.Envelope { @@ -144,6 +151,10 @@ func (mock *commMock) Send(msg *proto.SignedGossipMessage, peers ...*comm.Remote } } +func (mock *commMock) SendWithAck(_ *proto.SignedGossipMessage, _ time.Duration, _ int, _ ...*comm.RemotePeer) comm.AggregatedSendResult { + panic("not implemented") +} + // Probe probes a remote node and returns nil if its responsive, // and an error if it's not. func (mock *commMock) Probe(peer *comm.RemotePeer) error { diff --git a/gossip/comm/msg.go b/gossip/comm/msg.go index 0dc208307bb..283a528b1ce 100644 --- a/gossip/comm/msg.go +++ b/gossip/comm/msg.go @@ -35,7 +35,7 @@ func (m *ReceivedMessageImpl) Respond(msg *proto.GossipMessage) { m.conn.logger.Errorf("Failed creating SignedGossipMessage: %+v", err) return } - m.conn.send(sMsg, func(e error) {}) + m.conn.send(sMsg, func(e error) {}, blockingSend) } // GetGossipMessage returns the inner GossipMessage @@ -48,3 +48,17 @@ func (m *ReceivedMessageImpl) GetGossipMessage() *proto.SignedGossipMessage { func (m *ReceivedMessageImpl) GetConnectionInfo() *proto.ConnectionInfo { return m.connInfo } + +// Ack returns to the sender an acknowledgement for the message +func (m *ReceivedMessageImpl) Ack(err error) { + ackMsg := &proto.GossipMessage{ + Nonce: m.GetGossipMessage().Nonce, + Content: &proto.GossipMessage_Ack{ + Ack: &proto.Acknowledgement{}, + }, + } + if err != nil { + ackMsg.GetAck().Error = err.Error() + } + m.Respond(ackMsg) +} diff --git a/gossip/gossip/certstore_test.go b/gossip/gossip/certstore_test.go index 3d5b95c516d..0ca7c930535 100644 --- a/gossip/gossip/certstore_test.go +++ b/gossip/gossip/certstore_test.go @@ -54,6 +54,11 @@ func (s *sentMsg) GetSourceEnvelope() *proto.Envelope { return nil } +// Ack returns to the sender an acknowledgement for the message +func (s *sentMsg) Ack(err error) { + +} + func (s *sentMsg) Respond(msg *proto.GossipMessage) { s.Called(msg) } diff --git a/gossip/gossip/channel/channel_test.go b/gossip/gossip/channel/channel_test.go index eecc312a782..1cecee871ac 100644 --- a/gossip/gossip/channel/channel_test.go +++ b/gossip/gossip/channel/channel_test.go @@ -158,6 +158,11 @@ func (m *receivedMsg) Respond(msg *proto.GossipMessage) { m.Called(msg) } +// Ack returns to the sender an acknowledgement for the message +func (m *receivedMsg) Ack(err error) { + +} + func (m *receivedMsg) GetConnectionInfo() *proto.ConnectionInfo { return &proto.ConnectionInfo{ ID: m.PKIID, diff --git a/gossip/gossip/pull/pullstore_test.go b/gossip/gossip/pull/pullstore_test.go index 0eae4ccd326..668337f86c5 100644 --- a/gossip/gossip/pull/pullstore_test.go +++ b/gossip/gossip/pull/pullstore_test.go @@ -59,6 +59,11 @@ func (pm *pullMsg) GetConnectionInfo() *proto.ConnectionInfo { return nil } +// Ack returns to the sender an acknowledgement for the message +func (pm *pullMsg) Ack(err error) { + +} + type pullInstance struct { self discovery.NetworkMember mediator Mediator diff --git a/gossip/state/state_test.go b/gossip/state/state_test.go index c5e1e628966..f365ff2f03e 100644 --- a/gossip/state/state_test.go +++ b/gossip/state/state_test.go @@ -997,6 +997,11 @@ type receivedMessageMock struct { mock.Mock } +// Ack returns to the sender an acknowledgement for the message +func (mock *receivedMessageMock) Ack(err error) { + +} + func (mock *receivedMessageMock) Respond(msg *proto.GossipMessage) { mock.Called(msg) } diff --git a/gossip/util/pubsub.go b/gossip/util/pubsub.go index 04decc228a6..afae7c9d049 100644 --- a/gossip/util/pubsub.go +++ b/gossip/util/pubsub.go @@ -14,7 +14,7 @@ import ( ) const ( - subscriptionBuffSize = 5 + subscriptionBuffSize = 50 ) // PubSub defines a struct that one can use to: diff --git a/protos/gossip/extensions.go b/protos/gossip/extensions.go index 41a03b21a48..afc1a2262f8 100644 --- a/protos/gossip/extensions.go +++ b/protos/gossip/extensions.go @@ -212,6 +212,11 @@ func (m *GossipMessage) IsDataReq() bool { return m.GetDataReq() != nil } +// IsAck returns whether this GossipMessage is an acknowledgement +func (m *GossipMessage) IsAck() bool { + return m.GetAck() != nil +} + // IsDataUpdate returns whether this GossipMessage is a data update message func (m *GossipMessage) IsDataUpdate() bool { return m.GetDataUpdate() != nil @@ -329,6 +334,11 @@ type ReceivedMessage interface { // GetConnectionInfo returns information about the remote peer // that sent the message GetConnectionInfo() *ConnectionInfo + + // Ack returns to the sender an acknowledgement for the message + // An ack can receive an error that indicates that the operation related + // to the message has failed + Ack(err error) } // ConnectionInfo represents information about diff --git a/protos/gossip/message.pb.go b/protos/gossip/message.pb.go index c40e025b75c..8bed4faf24a 100644 --- a/protos/gossip/message.pb.go +++ b/protos/gossip/message.pb.go @@ -36,6 +36,7 @@ It has these top-level messages: RemotePvtDataRequest RemotePvtDataResponse PvtDataPayload + Acknowledgement */ package gossip @@ -300,6 +301,7 @@ type GossipMessage struct { // *GossipMessage_StateResponse // *GossipMessage_LeadershipMsg // *GossipMessage_PeerIdentity + // *GossipMessage_Ack Content isGossipMessage_Content `protobuf_oneof:"content"` } @@ -363,6 +365,9 @@ type GossipMessage_LeadershipMsg struct { type GossipMessage_PeerIdentity struct { PeerIdentity *PeerIdentity `protobuf:"bytes,21,opt,name=peer_identity,json=peerIdentity,oneof"` } +type GossipMessage_Ack struct { + Ack *Acknowledgement `protobuf:"bytes,22,opt,name=ack,oneof"` +} func (*GossipMessage_AliveMsg) isGossipMessage_Content() {} func (*GossipMessage_MemReq) isGossipMessage_Content() {} @@ -381,6 +386,7 @@ func (*GossipMessage_StateRequest) isGossipMessage_Content() {} func (*GossipMessage_StateResponse) isGossipMessage_Content() {} func (*GossipMessage_LeadershipMsg) isGossipMessage_Content() {} func (*GossipMessage_PeerIdentity) isGossipMessage_Content() {} +func (*GossipMessage_Ack) isGossipMessage_Content() {} func (m *GossipMessage) GetContent() isGossipMessage_Content { if m != nil { @@ -529,6 +535,13 @@ func (m *GossipMessage) GetPeerIdentity() *PeerIdentity { return nil } +func (m *GossipMessage) GetAck() *Acknowledgement { + if x, ok := m.GetContent().(*GossipMessage_Ack); ok { + return x.Ack + } + return nil +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*GossipMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _GossipMessage_OneofMarshaler, _GossipMessage_OneofUnmarshaler, _GossipMessage_OneofSizer, []interface{}{ @@ -549,6 +562,7 @@ func (*GossipMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) (*GossipMessage_StateResponse)(nil), (*GossipMessage_LeadershipMsg)(nil), (*GossipMessage_PeerIdentity)(nil), + (*GossipMessage_Ack)(nil), } } @@ -641,6 +655,11 @@ func _GossipMessage_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { if err := b.EncodeMessage(x.PeerIdentity); err != nil { return err } + case *GossipMessage_Ack: + b.EncodeVarint(22<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Ack); err != nil { + return err + } case nil: default: return fmt.Errorf("GossipMessage.Content has unexpected type %T", x) @@ -787,6 +806,14 @@ func _GossipMessage_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto. err := b.DecodeMessage(msg) m.Content = &GossipMessage_PeerIdentity{msg} return true, err + case 22: // content.ack + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Acknowledgement) + err := b.DecodeMessage(msg) + m.Content = &GossipMessage_Ack{msg} + return true, err default: return false, nil } @@ -881,6 +908,11 @@ func _GossipMessage_OneofSizer(msg proto.Message) (n int) { n += proto.SizeVarint(21<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s + case *GossipMessage_Ack: + s := proto.Size(x.Ack) + n += proto.SizeVarint(22<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -1549,6 +1581,22 @@ func (m *PvtDataPayload) GetPayload() []byte { return nil } +type Acknowledgement struct { + Error string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` +} + +func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } +func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } +func (*Acknowledgement) ProtoMessage() {} +func (*Acknowledgement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } + +func (m *Acknowledgement) GetError() string { + if m != nil { + return m.Error + } + return "" +} + func init() { proto.RegisterType((*Envelope)(nil), "gossip.Envelope") proto.RegisterType((*SecretEnvelope)(nil), "gossip.SecretEnvelope") @@ -1578,6 +1626,7 @@ func init() { proto.RegisterType((*RemotePvtDataRequest)(nil), "gossip.RemotePvtDataRequest") proto.RegisterType((*RemotePvtDataResponse)(nil), "gossip.RemotePvtDataResponse") proto.RegisterType((*PvtDataPayload)(nil), "gossip.PvtDataPayload") + proto.RegisterType((*Acknowledgement)(nil), "gossip.Acknowledgement") proto.RegisterEnum("gossip.PullMsgType", PullMsgType_name, PullMsgType_value) proto.RegisterEnum("gossip.GossipMessage_Tag", GossipMessage_Tag_name, GossipMessage_Tag_value) } @@ -1727,98 +1776,101 @@ var _Gossip_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("gossip/message.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1488 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x17, 0xdd, 0x6f, 0xdb, 0x40, - 0x3d, 0xdf, 0x89, 0x7f, 0xf9, 0x68, 0x7a, 0x6d, 0x87, 0x29, 0x13, 0x14, 0x8b, 0x8d, 0x42, 0x47, - 0x3a, 0x75, 0x20, 0x26, 0x0d, 0x84, 0xd2, 0x26, 0x34, 0xd1, 0x96, 0xb4, 0xb8, 0x9d, 0xa0, 0x08, - 0xc9, 0xba, 0xc6, 0x57, 0xc7, 0xd4, 0x3e, 0xbb, 0xbe, 0x4b, 0x59, 0x1f, 0x11, 0x6f, 0xbc, 0xf0, - 0xca, 0x9f, 0x8b, 0xee, 0xce, 0x76, 0xec, 0xba, 0x9d, 0xb4, 0x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d0, 0xbb, 0x52, 0xa0, 0x9b, 0x08, 0x8c, 0x05, - 0x52, 0x04, 0x20, 0xa9, 0xe8, 0x00, 0x6a, 0x8b, 0x80, 0x52, 0xbd, 0x27, 0xb9, 0x76, 0x12, 0xae, - 0x93, 0x80, 0xd2, 0x31, 0xe3, 0xf8, 0xda, 0x73, 0xd9, 0x72, 0x52, 0x32, 0x25, 0x13, 0x3a, 0x02, - 0x60, 0x1c, 0x73, 0x62, 0xb9, 0xf4, 0x26, 0xd0, 0x37, 0xa4, 0xc8, 0x66, 0x3a, 0x26, 0x82, 0x32, - 0xa5, 0x37, 0x22, 0x3b, 0x1a, 0x4b, 0x00, 0x74, 0x0c, 0x3d, 0x25, 0xc3, 0x28, 0x0e, 0xd9, 0x32, - 0xe0, 0x7a, 0x3f, 0x5f, 0xf4, 0x54, 0xee, 0x22, 0x66, 0x98, 0x94, 0xcc, 0xae, 0x14, 0x49, 0x10, - 0x68, 0x06, 0x5b, 0x6b, 0xbb, 0x56, 0xb8, 0xf2, 0x3c, 0x99, 0xbf, 0x4d, 0xa9, 0xe8, 0x65, 0x41, - 0xd1, 0xf9, 0xca, 0xf3, 0xd6, 0x89, 0xec, 0xb3, 0x47, 0x78, 0x34, 0x04, 0xa5, 0x5f, 0x28, 0x11, - 0x4c, 0x3a, 0xca, 0x37, 0x94, 0x49, 0xfc, 0x80, 0x13, 0xa9, 0x6e, 0xad, 0xa6, 0xc3, 0x32, 0x30, - 0x1a, 0x25, 0x51, 0x45, 0x71, 0xcb, 0xe9, 0x5b, 0x52, 0xc7, 0x8f, 0x9e, 0xd4, 0x91, 0x76, 0x65, - 0x97, 0x65, 0x11, 0x22, 0x37, 0x1e, 0xc1, 0xb6, 0x6a, 0x5e, 0xd9, 0xa2, 0xdb, 0xf9, 0xdc, 0x7c, - 0x4a, 0xa9, 0xeb, 0x46, 0xed, 0xae, 0x45, 0x44, 0xbb, 0x7e, 0x80, 0x6e, 0x48, 0x48, 0x64, 0xb9, - 0x36, 0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, 0xcb, 0xfe, 0x6e, 0x55, 0x72, 0xbf, 0x5b, - 0xbf, 0xfc, 0x3d, 0xb4, 0x33, 0x5b, 0xef, 0xf1, 0x99, 0xd3, 0x05, 0xed, 0xf8, 0xd3, 0xd9, 0xc9, - 0x47, 0x6b, 0x76, 0x71, 0xda, 0x2f, 0x8b, 0x6b, 0x66, 0x3a, 0x1a, 0xcf, 0x2f, 0xa7, 0x97, 0x57, - 0x12, 0x53, 0x39, 0xfa, 0x3b, 0x34, 0xd4, 0xab, 0x83, 0xde, 0x43, 0x47, 0x7d, 0x5d, 0xf0, 0x88, - 0x60, 0x1f, 0x15, 0x1a, 0x68, 0xb7, 0x80, 0x31, 0x4a, 0xfb, 0xe5, 0xb7, 0x65, 0xf4, 0x1a, 0x6a, - 0xe7, 0x2e, 0x75, 0x50, 0xfe, 0xfe, 0xde, 0xcd, 0x83, 0x46, 0xe9, 0xf8, 0x57, 0x7f, 0x3d, 0x70, - 0x5c, 0xbe, 0x5c, 0x5d, 0x0f, 0x16, 0x81, 0x7f, 0xb8, 0x7c, 0x08, 0x49, 0xe4, 0x11, 0xdb, 0x21, - 0xd1, 0xe1, 0x0d, 0xbe, 0x8e, 0xdc, 0xc5, 0xa1, 0xfc, 0xf5, 0x65, 0x87, 0x4a, 0xec, 0xba, 0x21, - 0xc1, 0x77, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x9e, 0x0f, 0xde, 0x21, 0x0f, 0x00, 0x00, + // 1528 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x17, 0x6d, 0x6f, 0xe3, 0x48, + 0x39, 0xef, 0x89, 0x9f, 0xbc, 0x76, 0xb6, 0xbb, 0x67, 0xca, 0x09, 0x8a, 0xc5, 0xde, 0x15, 0x7a, + 0xa4, 0xa7, 0x1e, 0x88, 0x93, 0x0e, 0x84, 0xd2, 0x26, 0x34, 0xd1, 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88, 0xe8, 0xbb, 0x65, 0x7f, 0xb6, 0x71, 0x4b, 0x09, + 0x15, 0x78, 0x57, 0x4a, 0x6c, 0x22, 0x07, 0x73, 0xa2, 0xf7, 0xca, 0x56, 0xde, 0x4b, 0xca, 0xbc, + 0x62, 0x82, 0x93, 0x41, 0xe8, 0x2d, 0x34, 0x49, 0x10, 0xf1, 0x47, 0xbd, 0x2f, 0x05, 0xfa, 0xa9, + 0xc0, 0x4c, 0x20, 0x45, 0x00, 0x92, 0x8a, 0x0e, 0xa1, 0x61, 0x87, 0x94, 0xea, 0x03, 0xc9, 0xf5, + 0x3a, 0xe5, 0x3a, 0x0d, 0x29, 0x9d, 0x31, 0x8e, 0x6f, 0x7c, 0x8f, 0xad, 0xe7, 0x15, 0x53, 0x32, + 0xa1, 0x63, 0x00, 0xc6, 0x31, 0x27, 0x96, 0x47, 0x6f, 0x43, 0x7d, 0x28, 0x45, 0x76, 0xb2, 0x31, + 0x11, 0x94, 0x05, 0xbd, 0x15, 0xd9, 0xd1, 0x58, 0x0a, 0xa0, 0x13, 0x18, 0x28, 0x19, 0x46, 0x71, + 0xc4, 0xd6, 0x21, 0xd7, 0x47, 0xc5, 0xa2, 0x67, 0x72, 0x97, 0x09, 0xc3, 0xbc, 0x62, 0xf6, 0xa5, + 0x48, 0x8a, 0x40, 0x4b, 0x78, 0xb5, 0xb5, 0x6b, 0x45, 0x1b, 0xdf, 0x97, 0xf9, 0xdb, 0x91, 0x8a, + 0x3e, 0x2f, 0x29, 0xba, 0xd8, 0xf8, 0xfe, 0x36, 0x91, 0x23, 0xf6, 0x04, 0x8f, 0x26, 0xa0, 0xf4, + 0x0b, 0x25, 0x82, 0x49, 0x47, 0xc5, 0x86, 0x32, 0x49, 0x10, 0x72, 0x22, 0xd5, 0x6d, 0xd5, 0xf4, + 0x58, 0x0e, 0x46, 0xd3, 0x34, 0xaa, 0x38, 0x69, 0x39, 0xfd, 0x95, 0xd4, 0xf1, 0xe3, 0x67, 0x75, + 0x64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x47, 0xf2, + 0x87, 0x9a, 0x1d, 0x29, 0xb1, 0x9b, 0x96, 0x04, 0xbf, 0xf9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x3c, 0x64, 0xa0, 0xe2, 0x77, 0x0f, 0x00, 0x00, } diff --git a/protos/gossip/message.proto b/protos/gossip/message.proto index 18a0a4df854..744fb3f6c89 100644 --- a/protos/gossip/message.proto +++ b/protos/gossip/message.proto @@ -117,6 +117,8 @@ message GossipMessage { // Used to learn of a peer's certificate PeerIdentity peer_identity = 21; + + Acknowledgement ack = 22; } } @@ -312,4 +314,8 @@ message PvtDataPayload { // Encodes marhslaed bytes of rwset.TxPvtReadWriteSet // defined in rwset.proto bytes payload = 2; +} + +message Acknowledgement { + string error = 1; } \ No newline at end of file