From 967b5ef1246671f9f51ba91e3b818559fc133f57 Mon Sep 17 00:00:00 2001 From: Artem Barger Date: Fri, 12 Jan 2018 14:20:23 +0200 Subject: [PATCH] [FAB-7695]: Restructure filtered events proto msg. Currently FilteredBlock proto message inlcude the common.HeaderType information, while this information should be available per transaction base. E.g. instead of having: message FilteredBlock { string channel_id = 1; uint64 number = 2; // The position in the blockchain common.HeaderType type = 3; repeated FilteredTransaction filtered_tx = 4; } this commit moves transaction header type into FilteredTransaction and introduces a new extensible field to accomodate possible future extenstion for more transaction types: message FilteredTransaction { string txid = 1; common.HeaderType type = 2; TxValidationCode tx_validation_code = 3; oneof Data { FilteredProposalResponse proposal_response = 4; } } Change-Id: I92315ba391a35714282ed390c2c3d825673dc240 Signed-off-by: Artem Barger --- core/peer/deliverevents.go | 29 ++-- core/peer/deliverevents_test.go | 18 ++- events/producer/eventhelper.go | 13 +- protos/peer/admin.pb.go | 3 +- protos/peer/events.pb.go | 272 +++++++++++++++++++++----------- protos/peer/events.proto | 18 ++- 6 files changed, 233 insertions(+), 120 deletions(-) diff --git a/core/peer/deliverevents.go b/core/peer/deliverevents.go index 4f6694603a8..b9bd96ec283 100644 --- a/core/peer/deliverevents.go +++ b/core/peer/deliverevents.go @@ -181,32 +181,34 @@ func (block *blockEvent) toFilteredBlock() (*peer.FilteredBlock, error) { return nil, err } - filteredBlock.Type = common.HeaderType(chdr.Type) filteredBlock.ChannelId = chdr.ChannelId - if filteredBlock.Type == common.HeaderType_ENDORSER_TRANSACTION { + filteredTransaction := &peer.FilteredTransaction{ + Txid: chdr.TxId, + Type: common.HeaderType(chdr.Type), + TxValidationCode: txsFltr.Flag(txIndex)} + + if filteredTransaction.Type == common.HeaderType_ENDORSER_TRANSACTION { tx, err := utils.GetTransaction(payload.Data) if err != nil { return nil, errors.WithMessage(err, "error unmarshal transaction payload for block event") } - filteredActionArray, err := transactionActions(tx.Actions).toFilteredActions() + filteredTransaction.Data, err = transactionActions(tx.Actions).toFilteredActions() if err != nil { logger.Errorf(err.Error()) return nil, err } - filteredBlock.FilteredTx = append(filteredBlock.FilteredTx, &peer.FilteredTransaction{ - Txid: chdr.TxId, - TxValidationCode: txsFltr.Flag(txIndex), - FilteredAction: filteredActionArray}) } + + filteredBlock.FilteredTx = append(filteredBlock.FilteredTx, filteredTransaction) } return filteredBlock, nil } -func (ta transactionActions) toFilteredActions() ([]*peer.FilteredAction, error) { - var res []*peer.FilteredAction +func (ta transactionActions) toFilteredActions() (*peer.FilteredTransaction_ProposalResponse, error) { + proposalResponse := &peer.FilteredProposalResponse{} for _, action := range ta { chaincodeActionPayload, err := utils.GetChaincodeActionPayload(action.Payload) if err != nil { @@ -229,16 +231,19 @@ func (ta transactionActions) toFilteredActions() ([]*peer.FilteredAction, error) } if ccEvent.GetChaincodeId() != "" { - res = append(res, &peer.FilteredAction{ + filteredAction := &peer.FilteredChaincodeAction{ CcEvent: &peer.ChaincodeEvent{ TxId: ccEvent.TxId, ChaincodeId: ccEvent.ChaincodeId, EventName: ccEvent.EventName, }, - }) + } + proposalResponse.ChaincodeActions = append(proposalResponse.ChaincodeActions, filteredAction) } } - return res, nil + return &peer.FilteredTransaction_ProposalResponse{ + ProposalResponse: proposalResponse, + }, nil } func dumpStacktraceOnPanic() { diff --git a/core/peer/deliverevents_test.go b/core/peer/deliverevents_test.go index a076d9d34b0..c9626a2f321 100644 --- a/core/peer/deliverevents_test.go +++ b/core/peer/deliverevents_test.go @@ -247,13 +247,17 @@ func TestEventsServer_DeliverFiltered(t *testing.T) { test.Equal(uint64(0), block.Number) test.Equal(test.channelID, block.ChannelId) test.Equal(1, len(block.FilteredTx)) - test.Equal(test.txID, block.FilteredTx[0].Txid) - test.Equal(peer.TxValidationCode_VALID, block.FilteredTx[0].TxValidationCode) - filteredActions := block.FilteredTx[0].FilteredAction - test.Equal(1, len(filteredActions)) - test.Equal(test.eventName, filteredActions[0].CcEvent.EventName) - test.Equal(test.txID, filteredActions[0].CcEvent.TxId) - test.Equal(test.chaincodeName, filteredActions[0].CcEvent.ChaincodeId) + tx := block.FilteredTx[0] + test.Equal(test.txID, tx.Txid) + test.Equal(peer.TxValidationCode_VALID, tx.TxValidationCode) + test.Equal(common.HeaderType_ENDORSER_TRANSACTION, tx.Type) + proposalResponse := tx.GetProposalResponse() + test.NotNil(proposalResponse) + chaincodeActions := proposalResponse.ChaincodeActions + test.Equal(1, len(chaincodeActions)) + test.Equal(test.eventName, chaincodeActions[0].CcEvent.EventName) + test.Equal(test.txID, chaincodeActions[0].CcEvent.TxId) + test.Equal(test.chaincodeName, chaincodeActions[0].CcEvent.ChaincodeId) default: test.FailNow("Unexpected response type") } diff --git a/events/producer/eventhelper.go b/events/producer/eventhelper.go index 176a48b9319..5c07f1722d9 100644 --- a/events/producer/eventhelper.go +++ b/events/producer/eventhelper.go @@ -68,8 +68,8 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event return nil, nil, "", fmt.Errorf("error unmarshalling transaction payload for block event: %s", err) } - filteredTx := &pb.FilteredTransaction{Txid: chdr.TxId, TxValidationCode: txsFltr.Flag(txIndex)} - filteredActionArray := []*pb.FilteredAction{} + filteredTx := &pb.FilteredTransaction{Txid: chdr.TxId, TxValidationCode: txsFltr.Flag(txIndex), Type: headerType} + proposalResponse := &pb.FilteredProposalResponse{} for _, action := range tx.Actions { chaincodeActionPayload, err := utils.GetChaincodeActionPayload(action.Payload) if err != nil { @@ -90,14 +90,14 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event return nil, nil, "", fmt.Errorf("error unmarshalling chaincode event for block event: %s", err) } - filteredAction := &pb.FilteredAction{} + chaincodeAction := &pb.FilteredChaincodeAction{} if ccEvent.GetChaincodeId() != "" { filteredCcEvent := ccEvent // nil out ccevent payload filteredCcEvent.Payload = nil - filteredAction.CcEvent = filteredCcEvent + chaincodeAction.CcEvent = filteredCcEvent } - filteredActionArray = append(filteredActionArray, filteredAction) + proposalResponse.ChaincodeActions = append(proposalResponse.ChaincodeActions, chaincodeAction) // Drop read write set from transaction before sending block event // Performance issue with chaincode deploy txs and causes nodejs grpc @@ -114,7 +114,7 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event return nil, nil, "", fmt.Errorf("error marshalling tx action payload for block event: %s", err) } } - filteredTx.FilteredAction = filteredActionArray + filteredTx.Data = &pb.FilteredTransaction_ProposalResponse{ProposalResponse: proposalResponse} filteredTxArray = append(filteredTxArray, filteredTx) payload.Data, err = utils.GetBytesTransaction(tx) @@ -136,7 +136,6 @@ func CreateBlockEvents(block *common.Block) (bevent *pb.Event, fbevent *pb.Event } filteredBlockForEvent.ChannelId = channelID filteredBlockForEvent.Number = block.Header.Number - filteredBlockForEvent.Type = headerType filteredBlockForEvent.FilteredTx = filteredTxArray return CreateBlockEvent(blockForEvent), CreateFilteredBlockEvent(filteredBlockForEvent), channelID, nil diff --git a/protos/peer/admin.pb.go b/protos/peer/admin.pb.go index 828ccfd9de0..53fe6450a8a 100644 --- a/protos/peer/admin.pb.go +++ b/protos/peer/admin.pb.go @@ -49,7 +49,8 @@ It has these top-level messages: Unregister FilteredBlock FilteredTransaction - FilteredAction + FilteredProposalResponse + FilteredChaincodeAction SignedEvent Event DeliverResponse diff --git a/protos/peer/events.pb.go b/protos/peer/events.pb.go index a4591db7280..19737fab3db 100644 --- a/protos/peer/events.pb.go +++ b/protos/peer/events.pb.go @@ -253,7 +253,6 @@ func (m *Unregister) GetEvents() []*Interest { type FilteredBlock struct { ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId" json:"channel_id,omitempty"` Number uint64 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` - Type common.HeaderType `protobuf:"varint,3,opt,name=type,enum=common.HeaderType" json:"type,omitempty"` FilteredTx []*FilteredTransaction `protobuf:"bytes,4,rep,name=filtered_tx,json=filteredTx" json:"filtered_tx,omitempty"` } @@ -276,13 +275,6 @@ func (m *FilteredBlock) GetNumber() uint64 { return 0 } -func (m *FilteredBlock) GetType() common.HeaderType { - if m != nil { - return m.Type - } - return common.HeaderType_MESSAGE -} - func (m *FilteredBlock) GetFilteredTx() []*FilteredTransaction { if m != nil { return m.FilteredTx @@ -294,8 +286,11 @@ func (m *FilteredBlock) GetFilteredTx() []*FilteredTransaction { // within a block. type FilteredTransaction struct { Txid string `protobuf:"bytes,1,opt,name=txid" json:"txid,omitempty"` - TxValidationCode TxValidationCode `protobuf:"varint,2,opt,name=tx_validation_code,json=txValidationCode,enum=protos.TxValidationCode" json:"tx_validation_code,omitempty"` - FilteredAction []*FilteredAction `protobuf:"bytes,3,rep,name=filtered_action,json=filteredAction" json:"filtered_action,omitempty"` + Type common.HeaderType `protobuf:"varint,2,opt,name=type,enum=common.HeaderType" json:"type,omitempty"` + TxValidationCode TxValidationCode `protobuf:"varint,3,opt,name=tx_validation_code,json=txValidationCode,enum=protos.TxValidationCode" json:"tx_validation_code,omitempty"` + // Types that are valid to be assigned to Data: + // *FilteredTransaction_ProposalResponse + Data isFilteredTransaction_Data `protobuf_oneof:"Data"` } func (m *FilteredTransaction) Reset() { *m = FilteredTransaction{} } @@ -303,6 +298,23 @@ func (m *FilteredTransaction) String() string { return proto.CompactT func (*FilteredTransaction) ProtoMessage() {} func (*FilteredTransaction) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{6} } +type isFilteredTransaction_Data interface { + isFilteredTransaction_Data() +} + +type FilteredTransaction_ProposalResponse struct { + ProposalResponse *FilteredProposalResponse `protobuf:"bytes,4,opt,name=proposal_response,json=proposalResponse,oneof"` +} + +func (*FilteredTransaction_ProposalResponse) isFilteredTransaction_Data() {} + +func (m *FilteredTransaction) GetData() isFilteredTransaction_Data { + if m != nil { + return m.Data + } + return nil +} + func (m *FilteredTransaction) GetTxid() string { if m != nil { return m.Txid @@ -310,6 +322,13 @@ func (m *FilteredTransaction) GetTxid() string { return "" } +func (m *FilteredTransaction) GetType() common.HeaderType { + if m != nil { + return m.Type + } + return common.HeaderType_MESSAGE +} + func (m *FilteredTransaction) GetTxValidationCode() TxValidationCode { if m != nil { return m.TxValidationCode @@ -317,25 +336,98 @@ func (m *FilteredTransaction) GetTxValidationCode() TxValidationCode { return TxValidationCode_VALID } -func (m *FilteredTransaction) GetFilteredAction() []*FilteredAction { +func (m *FilteredTransaction) GetProposalResponse() *FilteredProposalResponse { + if x, ok := m.GetData().(*FilteredTransaction_ProposalResponse); ok { + return x.ProposalResponse + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*FilteredTransaction) 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 _FilteredTransaction_OneofMarshaler, _FilteredTransaction_OneofUnmarshaler, _FilteredTransaction_OneofSizer, []interface{}{ + (*FilteredTransaction_ProposalResponse)(nil), + } +} + +func _FilteredTransaction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*FilteredTransaction) + // Data + switch x := m.Data.(type) { + case *FilteredTransaction_ProposalResponse: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ProposalResponse); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("FilteredTransaction.Data has unexpected type %T", x) + } + return nil +} + +func _FilteredTransaction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*FilteredTransaction) + switch tag { + case 4: // Data.proposal_response + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FilteredProposalResponse) + err := b.DecodeMessage(msg) + m.Data = &FilteredTransaction_ProposalResponse{msg} + return true, err + default: + return false, nil + } +} + +func _FilteredTransaction_OneofSizer(msg proto.Message) (n int) { + m := msg.(*FilteredTransaction) + // Data + switch x := m.Data.(type) { + case *FilteredTransaction_ProposalResponse: + s := proto.Size(x.ProposalResponse) + n += proto.SizeVarint(4<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// FilteredProposalResponse reciprocal of TransactionAction +// message from regular block +type FilteredProposalResponse struct { + ChaincodeActions []*FilteredChaincodeAction `protobuf:"bytes,1,rep,name=chaincodeActions" json:"chaincodeActions,omitempty"` +} + +func (m *FilteredProposalResponse) Reset() { *m = FilteredProposalResponse{} } +func (m *FilteredProposalResponse) String() string { return proto.CompactTextString(m) } +func (*FilteredProposalResponse) ProtoMessage() {} +func (*FilteredProposalResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{7} } + +func (m *FilteredProposalResponse) GetChaincodeActions() []*FilteredChaincodeAction { if m != nil { - return m.FilteredAction + return m.ChaincodeActions } return nil } -// FilteredAction is a minimal set of information about an action within a +// FilteredChaincodeAction is a minimal set of information about an action within a // transaction. -type FilteredAction struct { +type FilteredChaincodeAction struct { CcEvent *ChaincodeEvent `protobuf:"bytes,1,opt,name=ccEvent" json:"ccEvent,omitempty"` } -func (m *FilteredAction) Reset() { *m = FilteredAction{} } -func (m *FilteredAction) String() string { return proto.CompactTextString(m) } -func (*FilteredAction) ProtoMessage() {} -func (*FilteredAction) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{7} } +func (m *FilteredChaincodeAction) Reset() { *m = FilteredChaincodeAction{} } +func (m *FilteredChaincodeAction) String() string { return proto.CompactTextString(m) } +func (*FilteredChaincodeAction) ProtoMessage() {} +func (*FilteredChaincodeAction) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{8} } -func (m *FilteredAction) GetCcEvent() *ChaincodeEvent { +func (m *FilteredChaincodeAction) GetCcEvent() *ChaincodeEvent { if m != nil { return m.CcEvent } @@ -353,7 +445,7 @@ type SignedEvent struct { func (m *SignedEvent) Reset() { *m = SignedEvent{} } func (m *SignedEvent) String() string { return proto.CompactTextString(m) } func (*SignedEvent) ProtoMessage() {} -func (*SignedEvent) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{8} } +func (*SignedEvent) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{9} } func (m *SignedEvent) GetSignature() []byte { if m != nil { @@ -393,7 +485,7 @@ type Event struct { func (m *Event) Reset() { *m = Event{} } func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{9} } +func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{10} } type isEvent_Event interface { isEvent_Event() @@ -657,7 +749,7 @@ type DeliverResponse struct { func (m *DeliverResponse) Reset() { *m = DeliverResponse{} } func (m *DeliverResponse) String() string { return proto.CompactTextString(m) } func (*DeliverResponse) ProtoMessage() {} -func (*DeliverResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{10} } +func (*DeliverResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{11} } type isDeliverResponse_Type interface { isDeliverResponse_Type() @@ -801,7 +893,8 @@ func init() { proto.RegisterType((*Unregister)(nil), "protos.Unregister") proto.RegisterType((*FilteredBlock)(nil), "protos.FilteredBlock") proto.RegisterType((*FilteredTransaction)(nil), "protos.FilteredTransaction") - proto.RegisterType((*FilteredAction)(nil), "protos.FilteredAction") + proto.RegisterType((*FilteredProposalResponse)(nil), "protos.FilteredProposalResponse") + proto.RegisterType((*FilteredChaincodeAction)(nil), "protos.FilteredChaincodeAction") proto.RegisterType((*SignedEvent)(nil), "protos.SignedEvent") proto.RegisterType((*Event)(nil), "protos.Event") proto.RegisterType((*DeliverResponse)(nil), "protos.DeliverResponse") @@ -917,10 +1010,10 @@ var _Events_serviceDesc = grpc.ServiceDesc{ // Client API for Deliver service type DeliverClient interface { - // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a marshaled SeekInfo message, + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, // then a stream of block replies is received. Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) - // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a marshaled SeekInfo message, + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, // then a stream of **filtered** block replies is received. DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) } @@ -998,10 +1091,10 @@ func (x *deliverDeliverFilteredClient) Recv() (*DeliverResponse, error) { // Server API for Deliver service type DeliverServer interface { - // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a marshaled SeekInfo message, + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, // then a stream of block replies is received. Deliver(Deliver_DeliverServer) error - // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a marshaled SeekInfo message, + // deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, // then a stream of **filtered** block replies is received. DeliverFiltered(Deliver_DeliverFilteredServer) error } @@ -1086,66 +1179,69 @@ var _Deliver_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("peer/events.proto", fileDescriptor5) } var fileDescriptor5 = []byte{ - // 973 bytes of a gzipped FileDescriptorProto + // 1011 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0x8e, 0x9b, 0x34, 0x89, 0x4f, 0x7e, 0x36, 0x9d, 0x42, 0xb1, 0xb2, 0xfc, 0x2c, 0x46, 0xa0, - 0xc2, 0x45, 0x52, 0xc2, 0x0a, 0xa1, 0x15, 0x02, 0xd5, 0x49, 0x8a, 0xc3, 0xee, 0xb6, 0xab, 0x69, - 0x96, 0x0b, 0x2e, 0xb0, 0x1c, 0xe7, 0xc4, 0x31, 0xeb, 0xd8, 0xd1, 0xcc, 0xa4, 0x4a, 0x1f, 0x81, - 0x27, 0x41, 0x42, 0x5c, 0xf1, 0x1a, 0xbc, 0x14, 0xf2, 0xd8, 0x63, 0x27, 0x59, 0x90, 0xe8, 0x55, - 0x3c, 0xe7, 0x6f, 0xbe, 0x73, 0xbe, 0x73, 0xce, 0x04, 0x4e, 0xd6, 0x88, 0xac, 0x8f, 0x77, 0x18, - 0x09, 0xde, 0x5b, 0xb3, 0x58, 0xc4, 0xa4, 0x2a, 0x7f, 0x78, 0xf7, 0xd4, 0x8b, 0x57, 0xab, 0x38, - 0xea, 0xa7, 0x3f, 0xa9, 0xb2, 0xfb, 0x91, 0x1f, 0xc7, 0x7e, 0x88, 0x7d, 0x79, 0x9a, 0x6d, 0x16, - 0x7d, 0x11, 0xac, 0x90, 0x0b, 0x77, 0xb5, 0xce, 0x0c, 0xba, 0x32, 0xa0, 0xb7, 0x74, 0x83, 0xc8, - 0x8b, 0xe7, 0xe8, 0xc8, 0xd0, 0x99, 0xee, 0x4c, 0xea, 0x04, 0x73, 0x23, 0xee, 0x7a, 0x22, 0x50, - 0x41, 0xcd, 0x57, 0xd0, 0x1c, 0x2a, 0x07, 0x8a, 0x3e, 0xf9, 0x18, 0x9a, 0x45, 0x80, 0x60, 0x6e, - 0x68, 0x4f, 0xb4, 0x73, 0x9d, 0x36, 0x72, 0xd9, 0x64, 0x4e, 0x3e, 0x00, 0x90, 0x91, 0x9d, 0xc8, - 0x5d, 0xa1, 0x71, 0x24, 0x0d, 0x74, 0x29, 0xb9, 0x76, 0x57, 0x68, 0xfe, 0xae, 0x41, 0x7d, 0x12, - 0x09, 0x64, 0xc8, 0x05, 0xb9, 0x50, 0xb6, 0xe2, 0x7e, 0x8d, 0x32, 0x58, 0x7b, 0x70, 0x92, 0x5e, - 0xcd, 0x7b, 0xe3, 0x44, 0x33, 0xbd, 0x5f, 0x63, 0xe6, 0x9e, 0x7c, 0x92, 0x11, 0x90, 0x02, 0x00, - 0x43, 0xdf, 0x09, 0xa2, 0x45, 0x2c, 0x6f, 0x69, 0x0c, 0xde, 0x51, 0x9e, 0xbb, 0x90, 0xed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85, 0xae, 0x95, 0x05, 0xb6, 0x18, 0x81, + 0x02, 0x17, 0x49, 0x09, 0x2b, 0x84, 0x56, 0x08, 0xa9, 0xf9, 0x29, 0x0e, 0xdd, 0x6d, 0xab, 0x69, + 0x96, 0x0b, 0x2e, 0xb0, 0x26, 0xce, 0xc4, 0x31, 0xeb, 0xd8, 0xd6, 0xcc, 0xa4, 0x4a, 0xef, 0xb9, + 0xe1, 0x49, 0x90, 0x78, 0x15, 0xde, 0x86, 0x27, 0x40, 0x1e, 0xcf, 0xd8, 0x69, 0x4a, 0x25, 0x7a, + 0x65, 0xcf, 0x39, 0xdf, 0xf9, 0xfd, 0xce, 0x19, 0x1b, 0x0e, 0x13, 0x4a, 0x59, 0x97, 0xde, 0xd2, + 0x48, 0xf0, 0x4e, 0xc2, 0x62, 0x11, 0xa3, 0x8a, 0x7c, 0xf0, 0xd6, 0x91, 0x17, 0x2f, 0x97, 0x71, + 0xd4, 0xcd, 0x1e, 0x99, 0xb2, 0xf5, 0xd2, 0x8f, 0x63, 0x3f, 0xa4, 0x5d, 0x79, 0x9a, 0xae, 0xe6, + 0x5d, 0x11, 0x2c, 0x29, 0x17, 0x64, 0x99, 0x28, 0x40, 0x4b, 0x3a, 0xf4, 0x16, 0x24, 0x88, 0xbc, + 0x78, 0x46, 0x5d, 0xe9, 0x5a, 0xe9, 0x8e, 0xa5, 0x4e, 0x30, 0x12, 0x71, 0xe2, 0x89, 0x40, 0x3b, + 0xb5, 0xaf, 0x61, 0x7f, 0xa0, 0x0d, 0x30, 0xf5, 0xd1, 0xa7, 0xb0, 0x5f, 0x38, 0x08, 0x66, 0x96, + 0x71, 0x62, 0xb4, 0x4d, 0x5c, 0xcf, 0x65, 0xe3, 0x19, 0xfa, 0x18, 0x40, 0x7a, 0x76, 0x23, 0xb2, + 0xa4, 0xd6, 0x8e, 0x04, 0x98, 0x52, 0x72, 0x49, 0x96, 0xd4, 0xfe, 0xd3, 0x80, 0xda, 0x38, 0x12, + 0x94, 0x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 0xa1, 0xef, 0xa1, 0x3e, 0x57, 0x7e, 0x5c, 0xb1, + 0xb6, 0xca, 0x32, 0xee, 0x0b, 0x1d, 0x57, 0x87, 0xd8, 0xac, 0x09, 0x34, 0x7e, 0xb2, 0xb6, 0xff, + 0x31, 0xe0, 0xe8, 0x3f, 0x30, 0x08, 0x41, 0x59, 0xac, 0xf3, 0x34, 0xe4, 0x3b, 0xfa, 0x02, 0xca, + 0x72, 0x0c, 0x76, 0xe4, 0x18, 0xa0, 0x8e, 0x9a, 0x6e, 0x87, 0x92, 0x19, 0x65, 0x72, 0x0e, 0xa4, + 0x1e, 0x9d, 0x03, 0x12, 0x6b, 0xf7, 0x96, 0x84, 0xc1, 0x8c, 0xa4, 0xce, 0xdc, 0x94, 0x59, 0xc9, + 0xe3, 0x41, 0xcf, 0xca, 0x9b, 0xbc, 0xfe, 0x39, 0x07, 0x0c, 0x52, 0xe6, 0x9b, 0x62, 0x4b, 0x82, + 0xae, 0xe0, 0x30, 0x61, 0x71, 0x12, 0x73, 0x12, 0xba, 0x8c, 0xf2, 0x24, 0x8e, 0x38, 0xb5, 0xca, + 0x92, 0xab, 0x93, 0xed, 0xfa, 0xae, 0x15, 0x10, 0x2b, 0x5c, 0x3a, 0x55, 0xc9, 0x96, 0xac, 0x5f, + 0x81, 0xf2, 0x90, 0x08, 0x62, 0xfb, 0x60, 0x3d, 0x66, 0x87, 0x2e, 0xa0, 0x98, 0xc6, 0x33, 0xd9, + 0x0b, 0xcd, 0xe5, 0xcb, 0xed, 0x98, 0x83, 0xfb, 0x38, 0xfc, 0xc0, 0xd0, 0xbe, 0x80, 0xe7, 0x8f, + 0x80, 0xd1, 0x29, 0x54, 0x3d, 0x4f, 0x6e, 0x90, 0x1a, 0xbf, 0xe3, 0x07, 0xcb, 0x21, 0xb5, 0x58, + 0xc3, 0xec, 0x0b, 0xa8, 0xdf, 0x04, 0x7e, 0x44, 0x67, 0xf2, 0x88, 0x3e, 0x02, 0x93, 0x07, 0x7e, +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 0xe6, 0x77, + 0x16, 0x77, 0x09, 0x65, 0x21, 0x9d, 0xf9, 0x94, 0x75, 0xe6, 0x64, 0xca, 0x02, 0x4f, 0x9b, 0xa5, + 0x7f, 0x02, 0xfd, 0x46, 0x56, 0xeb, 0x35, 0xf1, 0xde, 0x13, 0x9f, 0xfe, 0xf2, 0xa5, 0x1f, 0x88, + 0xc5, 0x6a, 0x9a, 0xc6, 0xea, 0x6e, 0x58, 0x76, 0x33, 0xcb, 0xec, 0x97, 0x83, 0x77, 0x53, 0xcb, + 0x69, 0xf6, 0x8f, 0xf2, 0xcd, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x83, 0x4c, 0xd5, 0xcb, 0xbf, + 0x08, 0x00, 0x00, } diff --git a/protos/peer/events.proto b/protos/peer/events.proto index e3da40a4bd8..4c8734f39b1 100644 --- a/protos/peer/events.proto +++ b/protos/peer/events.proto @@ -80,7 +80,6 @@ message Unregister { message FilteredBlock { string channel_id = 1; uint64 number = 2; // The position in the blockchain - common.HeaderType type = 3; repeated FilteredTransaction filtered_tx = 4; } @@ -88,13 +87,22 @@ message FilteredBlock { //within a block. message FilteredTransaction { string txid = 1; - TxValidationCode tx_validation_code = 2; - repeated FilteredAction filtered_action = 3; + common.HeaderType type = 2; + TxValidationCode tx_validation_code = 3; + oneof Data { + FilteredProposalResponse proposal_response = 4; + } +} + +// FilteredProposalResponse reciprocal of TransactionAction +// message from regular block +message FilteredProposalResponse { + repeated FilteredChaincodeAction chaincodeActions = 1; } -//FilteredAction is a minimal set of information about an action within a +//FilteredChaincodeAction is a minimal set of information about an action within a //transaction. -message FilteredAction { +message FilteredChaincodeAction { ChaincodeEvent ccEvent = 1; }