forked from tw-bc-group/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kv_rwset.pb.go
410 lines (360 loc) · 15.3 KB
/
kv_rwset.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: ledger/rwset/kvrwset/kv_rwset.proto
/*
Package kvrwset is a generated protocol buffer package.
It is generated from these files:
ledger/rwset/kvrwset/kv_rwset.proto
It has these top-level messages:
KVRWSet
KVRead
KVWrite
Version
RangeQueryInfo
QueryReads
QueryReadsMerkleSummary
*/
package kvrwset
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model
type KVRWSet struct {
Reads []*KVRead `protobuf:"bytes,1,rep,name=reads" json:"reads,omitempty"`
RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo" json:"range_queries_info,omitempty"`
Writes []*KVWrite `protobuf:"bytes,3,rep,name=writes" json:"writes,omitempty"`
}
func (m *KVRWSet) Reset() { *m = KVRWSet{} }
func (m *KVRWSet) String() string { return proto.CompactTextString(m) }
func (*KVRWSet) ProtoMessage() {}
func (*KVRWSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *KVRWSet) GetReads() []*KVRead {
if m != nil {
return m.Reads
}
return nil
}
func (m *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo {
if m != nil {
return m.RangeQueriesInfo
}
return nil
}
func (m *KVRWSet) GetWrites() []*KVWrite {
if m != nil {
return m.Writes
}
return nil
}
// KVRead captures a read operation performed during transaction simulation
// A 'nil' version indicates a non-existing key read by the transaction
type KVRead struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
Version *Version `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
}
func (m *KVRead) Reset() { *m = KVRead{} }
func (m *KVRead) String() string { return proto.CompactTextString(m) }
func (*KVRead) ProtoMessage() {}
func (*KVRead) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *KVRead) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *KVRead) GetVersion() *Version {
if m != nil {
return m.Version
}
return nil
}
// KVWrite captures a write (update/delete) operation performed during transaction simulation
type KVWrite struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete" json:"is_delete,omitempty"`
Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *KVWrite) Reset() { *m = KVWrite{} }
func (m *KVWrite) String() string { return proto.CompactTextString(m) }
func (*KVWrite) ProtoMessage() {}
func (*KVWrite) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *KVWrite) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *KVWrite) GetIsDelete() bool {
if m != nil {
return m.IsDelete
}
return false
}
func (m *KVWrite) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
// Version encapsulates the version of a Key
// A version of a committed key is maintained as the height of the transaction that committed the key.
// The height is represenetd as a tuple <blockNum, txNum> where the txNum is the height of the transaction
// (starting with 1) within block
type Version struct {
BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum" json:"block_num,omitempty"`
TxNum uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum" json:"tx_num,omitempty"`
}
func (m *Version) Reset() { *m = Version{} }
func (m *Version) String() string { return proto.CompactTextString(m) }
func (*Version) ProtoMessage() {}
func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *Version) GetBlockNum() uint64 {
if m != nil {
return m.BlockNum
}
return 0
}
func (m *Version) GetTxNum() uint64 {
if m != nil {
return m.TxNum
}
return 0
}
// RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation.
// This helps protect transactions from phantom reads by varifying during validation whether any new items
// got committed within the given range between transaction simuation and validation
// (in addition to regular checks for updates/deletes of the existing items).
// readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash
// if the KVReads exceeds a pre-configured numbers
type RangeQueryInfo struct {
StartKey string `protobuf:"bytes,1,opt,name=start_key,json=startKey" json:"start_key,omitempty"`
EndKey string `protobuf:"bytes,2,opt,name=end_key,json=endKey" json:"end_key,omitempty"`
ItrExhausted bool `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted" json:"itr_exhausted,omitempty"`
// Types that are valid to be assigned to ReadsInfo:
// *RangeQueryInfo_RawReads
// *RangeQueryInfo_ReadsMerkleHashes
ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"`
}
func (m *RangeQueryInfo) Reset() { *m = RangeQueryInfo{} }
func (m *RangeQueryInfo) String() string { return proto.CompactTextString(m) }
func (*RangeQueryInfo) ProtoMessage() {}
func (*RangeQueryInfo) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
type isRangeQueryInfo_ReadsInfo interface {
isRangeQueryInfo_ReadsInfo()
}
type RangeQueryInfo_RawReads struct {
RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,oneof"`
}
type RangeQueryInfo_ReadsMerkleHashes struct {
ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,oneof"`
}
func (*RangeQueryInfo_RawReads) isRangeQueryInfo_ReadsInfo() {}
func (*RangeQueryInfo_ReadsMerkleHashes) isRangeQueryInfo_ReadsInfo() {}
func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo {
if m != nil {
return m.ReadsInfo
}
return nil
}
func (m *RangeQueryInfo) GetStartKey() string {
if m != nil {
return m.StartKey
}
return ""
}
func (m *RangeQueryInfo) GetEndKey() string {
if m != nil {
return m.EndKey
}
return ""
}
func (m *RangeQueryInfo) GetItrExhausted() bool {
if m != nil {
return m.ItrExhausted
}
return false
}
func (m *RangeQueryInfo) GetRawReads() *QueryReads {
if x, ok := m.GetReadsInfo().(*RangeQueryInfo_RawReads); ok {
return x.RawReads
}
return nil
}
func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary {
if x, ok := m.GetReadsInfo().(*RangeQueryInfo_ReadsMerkleHashes); ok {
return x.ReadsMerkleHashes
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*RangeQueryInfo) 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 _RangeQueryInfo_OneofMarshaler, _RangeQueryInfo_OneofUnmarshaler, _RangeQueryInfo_OneofSizer, []interface{}{
(*RangeQueryInfo_RawReads)(nil),
(*RangeQueryInfo_ReadsMerkleHashes)(nil),
}
}
func _RangeQueryInfo_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*RangeQueryInfo)
// reads_info
switch x := m.ReadsInfo.(type) {
case *RangeQueryInfo_RawReads:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.RawReads); err != nil {
return err
}
case *RangeQueryInfo_ReadsMerkleHashes:
b.EncodeVarint(5<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ReadsMerkleHashes); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("RangeQueryInfo.ReadsInfo has unexpected type %T", x)
}
return nil
}
func _RangeQueryInfo_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*RangeQueryInfo)
switch tag {
case 4: // reads_info.raw_reads
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(QueryReads)
err := b.DecodeMessage(msg)
m.ReadsInfo = &RangeQueryInfo_RawReads{msg}
return true, err
case 5: // reads_info.reads_merkle_hashes
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(QueryReadsMerkleSummary)
err := b.DecodeMessage(msg)
m.ReadsInfo = &RangeQueryInfo_ReadsMerkleHashes{msg}
return true, err
default:
return false, nil
}
}
func _RangeQueryInfo_OneofSizer(msg proto.Message) (n int) {
m := msg.(*RangeQueryInfo)
// reads_info
switch x := m.ReadsInfo.(type) {
case *RangeQueryInfo_RawReads:
s := proto.Size(x.RawReads)
n += proto.SizeVarint(4<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *RangeQueryInfo_ReadsMerkleHashes:
s := proto.Size(x.ReadsMerkleHashes)
n += proto.SizeVarint(5<<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
}
// QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution
type QueryReads struct {
KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads" json:"kv_reads,omitempty"`
}
func (m *QueryReads) Reset() { *m = QueryReads{} }
func (m *QueryReads) String() string { return proto.CompactTextString(m) }
func (*QueryReads) ProtoMessage() {}
func (*QueryReads) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *QueryReads) GetKvReads() []*KVRead {
if m != nil {
return m.KvReads
}
return nil
}
// QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads
// This allows to reduce the size of RWSet in the presence of query results
// by storing certain hashes instead of actual results.
// maxDegree field refers to the maximum number of children in the tree at any level
// maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level)
type QueryReadsMerkleSummary struct {
MaxDegree uint32 `protobuf:"varint,1,opt,name=max_degree,json=maxDegree" json:"max_degree,omitempty"`
MaxLevel uint32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel" json:"max_level,omitempty"`
MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"`
}
func (m *QueryReadsMerkleSummary) Reset() { *m = QueryReadsMerkleSummary{} }
func (m *QueryReadsMerkleSummary) String() string { return proto.CompactTextString(m) }
func (*QueryReadsMerkleSummary) ProtoMessage() {}
func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
func (m *QueryReadsMerkleSummary) GetMaxDegree() uint32 {
if m != nil {
return m.MaxDegree
}
return 0
}
func (m *QueryReadsMerkleSummary) GetMaxLevel() uint32 {
if m != nil {
return m.MaxLevel
}
return 0
}
func (m *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte {
if m != nil {
return m.MaxLevelHashes
}
return nil
}
func init() {
proto.RegisterType((*KVRWSet)(nil), "kvrwset.KVRWSet")
proto.RegisterType((*KVRead)(nil), "kvrwset.KVRead")
proto.RegisterType((*KVWrite)(nil), "kvrwset.KVWrite")
proto.RegisterType((*Version)(nil), "kvrwset.Version")
proto.RegisterType((*RangeQueryInfo)(nil), "kvrwset.RangeQueryInfo")
proto.RegisterType((*QueryReads)(nil), "kvrwset.QueryReads")
proto.RegisterType((*QueryReadsMerkleSummary)(nil), "kvrwset.QueryReadsMerkleSummary")
}
func init() { proto.RegisterFile("ledger/rwset/kvrwset/kv_rwset.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 552 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x53, 0x4d, 0x6b, 0xdb, 0x40,
0x10, 0x8d, 0xec, 0xd8, 0x92, 0xa7, 0x4e, 0xea, 0x6e, 0x5a, 0x22, 0x28, 0x05, 0xa3, 0x50, 0x30,
0x39, 0x48, 0x90, 0x5e, 0xda, 0x43, 0x2f, 0x25, 0x29, 0x29, 0x69, 0x03, 0xdd, 0x80, 0x03, 0xbd,
0x88, 0xb5, 0x35, 0xb6, 0x85, 0xf5, 0x91, 0xee, 0xae, 0x6c, 0xf9, 0x54, 0xfa, 0x53, 0xfa, 0x4f,
0xcb, 0x8e, 0x24, 0x3b, 0x01, 0xb7, 0x27, 0xed, 0xbc, 0x37, 0x6f, 0x76, 0xe6, 0x69, 0x16, 0xce,
0x12, 0x8c, 0xe6, 0x28, 0x03, 0xb9, 0x56, 0xa8, 0x83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