From 907689c47dfb55ba74100c722778246cd513e126 Mon Sep 17 00:00:00 2001 From: denyeart Date: Sat, 18 Feb 2017 08:14:52 -0500 Subject: [PATCH] Remove dup Transaction timestamp and version fields The Transaction timestamp and version fields are duplicates of fields that are already on the transaction's ChainHeader, and nobody is using them. The header is the appropriate place for these fields, not in the Transaction itself. Note, there is a 1-to-1 relationship between the ChainHeader and the Transaction, no reason to include the fields twice. Change-Id: I039d4ca07d51d27d0e9c4b1a00f9b39db2ba08c8 Signed-off-by: denyeart --- protos/peer/transaction.pb.go | 73 ++++++++++++++--------------------- protos/peer/transaction.proto | 9 +---- 2 files changed, 30 insertions(+), 52 deletions(-) diff --git a/protos/peer/transaction.pb.go b/protos/peer/transaction.pb.go index 6473944fb2f..432287480ad 100644 --- a/protos/peer/transaction.pb.go +++ b/protos/peer/transaction.pb.go @@ -7,7 +7,7 @@ package peer import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import google_protobuf1 "github.com/golang/protobuf/ptypes/timestamp" +import _ "github.com/golang/protobuf/ptypes/timestamp" import common "github.com/hyperledger/fabric/protos/common" // Reference imports to suppress errors if they are not otherwise used. @@ -71,14 +71,9 @@ func (m *ProcessedTransaction) GetTransactionEnvelope() *common.Envelope { // independent proposals (and their action) might be included in a transaction // to ensure that they are treated atomically. type Transaction struct { - // Version indicates message protocol version. - Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` - // Timestamp is the local time that the - // message was created by the sender - Timestamp *google_protobuf1.Timestamp `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` // The payload is an array of TransactionAction. An array is necessary to // accommodate multiple actions per transaction - Actions []*TransactionAction `protobuf:"bytes,3,rep,name=actions" json:"actions,omitempty"` + Actions []*TransactionAction `protobuf:"bytes,1,rep,name=actions" json:"actions,omitempty"` } func (m *Transaction) Reset() { *m = Transaction{} } @@ -86,13 +81,6 @@ func (m *Transaction) String() string { return proto.CompactTextStrin func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptor8, []int{2} } -func (m *Transaction) GetTimestamp() *google_protobuf1.Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - func (m *Transaction) GetActions() []*TransactionAction { if m != nil { return m.Actions @@ -181,34 +169,31 @@ func init() { func init() { proto.RegisterFile("peer/transaction.proto", fileDescriptor8) } var fileDescriptor8 = []byte{ - // 449 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x53, 0x4d, 0x6b, 0xdb, 0x40, - 0x14, 0x44, 0x09, 0x71, 0x9a, 0xe7, 0x1c, 0xe2, 0x75, 0x70, 0x14, 0x13, 0x48, 0xd0, 0x29, 0x25, - 0x20, 0x81, 0x73, 0x68, 0x29, 0xbd, 0xd4, 0xc5, 0x77, 0xa3, 0xe6, 0xd4, 0x43, 0xcd, 0x4a, 0x7a, - 0x91, 0x17, 0xa4, 0xdd, 0x65, 0x77, 0x6d, 0xf0, 0x9f, 0x68, 0x6f, 0xfd, 0xbd, 0xc5, 0xfb, 0x61, - 0x29, 0x75, 0x7b, 0x91, 0x78, 0x6f, 0x46, 0x33, 0xa3, 0x61, 0x17, 0x26, 0x12, 0x51, 0x65, 0x46, - 0x51, 0xae, 0x69, 0x69, 0x98, 0xe0, 0xa9, 0x54, 0xc2, 0x08, 0x32, 0xb0, 0x2f, 0x3d, 0xbd, 0xaf, - 0x85, 0xa8, 0x1b, 0xcc, 0xec, 0x58, 0x6c, 0x5e, 0x33, 0xc3, 0x5a, 0xd4, 0x86, 0xb6, 0xd2, 0x11, - 0xa7, 0x77, 0x56, 0x40, 0x2a, 0x21, 0x85, 0xa6, 0xcd, 0x4a, 0xa1, 0x96, 0x82, 0x6b, 0xf4, 0xe8, - 0xb8, 0x14, 0x6d, 0x2b, 0x78, 0xe6, 0x5e, 0x6e, 0x99, 0xfc, 0x80, 0xd1, 0x37, 0x56, 0x73, 0xac, - 0x5e,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 0x06, 0x64, 0x75, 0x38, 0x06, 0x41, 0xc7, 0x19, 0xc4, - 0x07, 0xc6, 0xd2, 0x13, 0xc2, 0xd7, 0x1f, 0x60, 0xe0, 0xa2, 0xf9, 0x2e, 0xee, 0xc3, 0x3f, 0x1d, - 0xdc, 0x16, 0xbc, 0x12, 0x4a, 0x63, 0xe5, 0xff, 0xcc, 0xd3, 0x93, 0x9f, 0x11, 0xdc, 0xfc, 0x87, - 0x43, 0x3e, 0xc1, 0xed, 0xd1, 0x79, 0xfc, 0x2b, 0xd1, 0x4d, 0x20, 0xe4, 0x1e, 0xef, 0x02, 0x5d, - 0xa2, 0x53, 0x6b, 0x91, 0x1b, 0x1d, 0x9f, 0xd8, 0xaa, 0xc7, 0x21, 0xd6, 0xa2, 0xc3, 0xf2, 0x37, - 0xc4, 0xf9, 0xd3, 0xf7, 0xf7, 0x35, 0x33, 0xeb, 0x4d, 0xb1, 0x3f, 0x47, 0xd9, 0x7a, 0x27, 0x51, - 0x35, 0x58, 0xd5, 0xa8, 0xb2, 0x57, 0x5a, 0x28, 0x56, 0xba, 0x1b, 0xa4, 0xb3, 0xfd, 0x75, 0x29, - 0xdc, 0xed, 0x7a, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x86, 0x51, 0xa3, 0x83, 0x7e, 0x03, 0x00, - 0x00, + // 416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x93, 0xcf, 0x6b, 0xdb, 0x30, + 0x14, 0xc7, 0x49, 0xc7, 0xd2, 0xed, 0xa5, 0x87, 0x46, 0x29, 0xa9, 0x1b, 0x0a, 0x1d, 0x3e, 0x75, + 0x14, 0x62, 0x48, 0x0f, 0x83, 0xb1, 0xcb, 0x32, 0x72, 0x0f, 0xde, 0x4e, 0x3b, 0x2c, 0xc8, 0xd6, + 0xab, 0x2d, 0xb0, 0x25, 0x21, 0x29, 0x85, 0xfc, 0x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x37, + 0x7e, 0x72, 0xb3, 0x1c, 0x50, 0x5f, 0xdd, 0x33, 0x8f, 0x64, 0xba, 0x81, 0xe9, 0x89, 0x4a, 0xe6, + 0x30, 0xae, 0x91, 0x32, 0xd4, 0x61, 0x2b, 0x42, 0x44, 0x12, 0x38, 0x57, 0xf4, 0xd0, 0x48, 0xca, + 0xc2, 0xf8, 0x31, 0x4c, 0xff, 0x8c, 0x60, 0xfe, 0xad, 0xa6, 0x5c, 0x94, 0x92, 0xa1, 0xaf, 0xb2, + 0xf5, 0x12, 0xf9, 0x02, 0x8b, 0x32, 0x2a, 0xbb, 0xe3, 0x89, 0xc5, 0x3a, 0xde, 0x20, 0x39, 0x12, + 0xdb, 0x00, 0xc4, 0xaf, 0x3f, 0xc1, 0xd8, 0xb7, 0xe6, 0x1c, 0x27, 0xab, 0xbb, 0x38, 0xd3, 0xd1, + 0x6d, 0x23, 0x98, 0xd4, 0x06, 0x59, 0x98, 0x2c, 0xe0, 0xe9, 0xef, 0x11, 0x5c, 0xbf, 0xc2, 0x90, + 0xcf, 0x70, 0x73, 0x72, 0x75, 0xfe, 0xe9, 0xe8, 0x3a, 0x02, 0x79, 0xd0, 0xfb, 0x86, 0x2e, 0xd0, + 0x57, 0x6b, 0x51, 0x58, 0x93, 0x9c, 0xb9, 0xad, 0x9e, 0xc5, 0xb6, 0x36, 0xbd, 0x96, 0xbf, 0x00, + 0xd7, 0x0f, 0x3f, 0x3f, 0x56, 0xdc, 0xd6, 0xfb, 0xa2, 0x3b, 0xf2, 0xac, 0x3e, 0x28, 0xd4, 0x0d, + 0xb2, 0x0a, 0x75, 0xf6, 0x44, 0x0b, 0xcd, 0x4b, 0x7f, 0xd9, 0x4d, 0xd6, 0xdd, 0xec, 0xc2, 0xff, + 0x08, 0x8f, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x49, 0x51, 0x7e, 0xba, 0x29, 0x03, 0x00, 0x00, } diff --git a/protos/peer/transaction.proto b/protos/peer/transaction.proto index 6118c790dcb..7f650bd1c00 100644 --- a/protos/peer/transaction.proto +++ b/protos/peer/transaction.proto @@ -67,16 +67,9 @@ message ProcessedTransaction { // to ensure that they are treated atomically. message Transaction { - // Version indicates message protocol version. - int32 version = 1; - - // Timestamp is the local time that the - // message was created by the sender - google.protobuf.Timestamp timestamp = 2; - // The payload is an array of TransactionAction. An array is necessary to // accommodate multiple actions per transaction - repeated TransactionAction actions = 3; + repeated TransactionAction actions = 1; } // TransactionAction binds a proposal to its action. The type field in the