forked from cosmos/ics23
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproofs.pb.go
4595 lines (4403 loc) · 109 KB
/
proofs.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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: cosmos/ics23/v1/proofs.proto
package ics23
import (
fmt "fmt"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
)
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type HashOp int32
const (
// NO_HASH is the default if no data passed. Note this is an illegal argument some places.
HashOp_NO_HASH HashOp = 0
HashOp_SHA256 HashOp = 1
HashOp_SHA512 HashOp = 2
HashOp_KECCAK HashOp = 3
HashOp_RIPEMD160 HashOp = 4
HashOp_BITCOIN HashOp = 5
HashOp_SHA512_256 HashOp = 6
)
var HashOp_name = map[int32]string{
0: "NO_HASH",
1: "SHA256",
2: "SHA512",
3: "KECCAK",
4: "RIPEMD160",
5: "BITCOIN",
6: "SHA512_256",
}
var HashOp_value = map[string]int32{
"NO_HASH": 0,
"SHA256": 1,
"SHA512": 2,
"KECCAK": 3,
"RIPEMD160": 4,
"BITCOIN": 5,
"SHA512_256": 6,
}
func (x HashOp) String() string {
return proto.EnumName(HashOp_name, int32(x))
}
func (HashOp) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{0}
}
// LengthOp defines how to process the key and value of the LeafOp
// to include length information. After encoding the length with the given
// algorithm, the length will be prepended to the key and value bytes.
// (Each one with it's own encoded length)
type LengthOp int32
const (
// NO_PREFIX don't include any length info
LengthOp_NO_PREFIX LengthOp = 0
// VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
LengthOp_VAR_PROTO LengthOp = 1
// VAR_RLP uses rlp int encoding of the length
LengthOp_VAR_RLP LengthOp = 2
// FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
LengthOp_FIXED32_BIG LengthOp = 3
// FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
LengthOp_FIXED32_LITTLE LengthOp = 4
// FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
LengthOp_FIXED64_BIG LengthOp = 5
// FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
LengthOp_FIXED64_LITTLE LengthOp = 6
// REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
LengthOp_REQUIRE_32_BYTES LengthOp = 7
// REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
LengthOp_REQUIRE_64_BYTES LengthOp = 8
)
var LengthOp_name = map[int32]string{
0: "NO_PREFIX",
1: "VAR_PROTO",
2: "VAR_RLP",
3: "FIXED32_BIG",
4: "FIXED32_LITTLE",
5: "FIXED64_BIG",
6: "FIXED64_LITTLE",
7: "REQUIRE_32_BYTES",
8: "REQUIRE_64_BYTES",
}
var LengthOp_value = map[string]int32{
"NO_PREFIX": 0,
"VAR_PROTO": 1,
"VAR_RLP": 2,
"FIXED32_BIG": 3,
"FIXED32_LITTLE": 4,
"FIXED64_BIG": 5,
"FIXED64_LITTLE": 6,
"REQUIRE_32_BYTES": 7,
"REQUIRE_64_BYTES": 8,
}
func (x LengthOp) String() string {
return proto.EnumName(LengthOp_name, int32(x))
}
func (LengthOp) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{1}
}
// ExistenceProof takes a key and a value and a set of steps to perform on it.
// The result of peforming all these steps will provide a "root hash", which can
// be compared to the value in a header.
//
// Since it is computationally infeasible to produce a hash collission for any of the used
// cryptographic hash functions, if someone can provide a series of operations to transform
// a given key and value into a root hash that matches some trusted root, these key and values
// must be in the referenced merkle tree.
//
// The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
// which should be controlled by a spec. Eg. with lengthOp as NONE,
// prefix = FOO, key = BAR, value = CHOICE
// and
// prefix = F, key = OOBAR, value = CHOICE
// would produce the same value.
//
// With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
// in the ProofSpec is valuable to prevent this mutability. And why all trees should
// length-prefix the data before hashing it.
type ExistenceProof struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
Leaf *LeafOp `protobuf:"bytes,3,opt,name=leaf,proto3" json:"leaf,omitempty"`
Path []*InnerOp `protobuf:"bytes,4,rep,name=path,proto3" json:"path,omitempty"`
}
func (m *ExistenceProof) Reset() { *m = ExistenceProof{} }
func (m *ExistenceProof) String() string { return proto.CompactTextString(m) }
func (*ExistenceProof) ProtoMessage() {}
func (*ExistenceProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{0}
}
func (m *ExistenceProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ExistenceProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ExistenceProof.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ExistenceProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExistenceProof.Merge(m, src)
}
func (m *ExistenceProof) XXX_Size() int {
return m.Size()
}
func (m *ExistenceProof) XXX_DiscardUnknown() {
xxx_messageInfo_ExistenceProof.DiscardUnknown(m)
}
var xxx_messageInfo_ExistenceProof proto.InternalMessageInfo
func (m *ExistenceProof) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
func (m *ExistenceProof) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
func (m *ExistenceProof) GetLeaf() *LeafOp {
if m != nil {
return m.Leaf
}
return nil
}
func (m *ExistenceProof) GetPath() []*InnerOp {
if m != nil {
return m.Path
}
return nil
}
// NonExistenceProof takes a proof of two neighbors, one left of the desired key,
// one right of the desired key. If both proofs are valid AND they are neighbors,
// then there is no valid proof for the given key.
type NonExistenceProof struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Left *ExistenceProof `protobuf:"bytes,2,opt,name=left,proto3" json:"left,omitempty"`
Right *ExistenceProof `protobuf:"bytes,3,opt,name=right,proto3" json:"right,omitempty"`
}
func (m *NonExistenceProof) Reset() { *m = NonExistenceProof{} }
func (m *NonExistenceProof) String() string { return proto.CompactTextString(m) }
func (*NonExistenceProof) ProtoMessage() {}
func (*NonExistenceProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{1}
}
func (m *NonExistenceProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *NonExistenceProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_NonExistenceProof.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *NonExistenceProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_NonExistenceProof.Merge(m, src)
}
func (m *NonExistenceProof) XXX_Size() int {
return m.Size()
}
func (m *NonExistenceProof) XXX_DiscardUnknown() {
xxx_messageInfo_NonExistenceProof.DiscardUnknown(m)
}
var xxx_messageInfo_NonExistenceProof proto.InternalMessageInfo
func (m *NonExistenceProof) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
func (m *NonExistenceProof) GetLeft() *ExistenceProof {
if m != nil {
return m.Left
}
return nil
}
func (m *NonExistenceProof) GetRight() *ExistenceProof {
if m != nil {
return m.Right
}
return nil
}
// CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
type CommitmentProof struct {
// Types that are valid to be assigned to Proof:
//
// *CommitmentProof_Exist
// *CommitmentProof_Nonexist
// *CommitmentProof_Batch
// *CommitmentProof_Compressed
Proof isCommitmentProof_Proof `protobuf_oneof:"proof"`
}
func (m *CommitmentProof) Reset() { *m = CommitmentProof{} }
func (m *CommitmentProof) String() string { return proto.CompactTextString(m) }
func (*CommitmentProof) ProtoMessage() {}
func (*CommitmentProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{2}
}
func (m *CommitmentProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *CommitmentProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CommitmentProof.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *CommitmentProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_CommitmentProof.Merge(m, src)
}
func (m *CommitmentProof) XXX_Size() int {
return m.Size()
}
func (m *CommitmentProof) XXX_DiscardUnknown() {
xxx_messageInfo_CommitmentProof.DiscardUnknown(m)
}
var xxx_messageInfo_CommitmentProof proto.InternalMessageInfo
type isCommitmentProof_Proof interface {
isCommitmentProof_Proof()
MarshalTo([]byte) (int, error)
Size() int
}
type CommitmentProof_Exist struct {
Exist *ExistenceProof `protobuf:"bytes,1,opt,name=exist,proto3,oneof" json:"exist,omitempty"`
}
type CommitmentProof_Nonexist struct {
Nonexist *NonExistenceProof `protobuf:"bytes,2,opt,name=nonexist,proto3,oneof" json:"nonexist,omitempty"`
}
type CommitmentProof_Batch struct {
Batch *BatchProof `protobuf:"bytes,3,opt,name=batch,proto3,oneof" json:"batch,omitempty"`
}
type CommitmentProof_Compressed struct {
Compressed *CompressedBatchProof `protobuf:"bytes,4,opt,name=compressed,proto3,oneof" json:"compressed,omitempty"`
}
func (*CommitmentProof_Exist) isCommitmentProof_Proof() {}
func (*CommitmentProof_Nonexist) isCommitmentProof_Proof() {}
func (*CommitmentProof_Batch) isCommitmentProof_Proof() {}
func (*CommitmentProof_Compressed) isCommitmentProof_Proof() {}
func (m *CommitmentProof) GetProof() isCommitmentProof_Proof {
if m != nil {
return m.Proof
}
return nil
}
func (m *CommitmentProof) GetExist() *ExistenceProof {
if x, ok := m.GetProof().(*CommitmentProof_Exist); ok {
return x.Exist
}
return nil
}
func (m *CommitmentProof) GetNonexist() *NonExistenceProof {
if x, ok := m.GetProof().(*CommitmentProof_Nonexist); ok {
return x.Nonexist
}
return nil
}
func (m *CommitmentProof) GetBatch() *BatchProof {
if x, ok := m.GetProof().(*CommitmentProof_Batch); ok {
return x.Batch
}
return nil
}
func (m *CommitmentProof) GetCompressed() *CompressedBatchProof {
if x, ok := m.GetProof().(*CommitmentProof_Compressed); ok {
return x.Compressed
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*CommitmentProof) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*CommitmentProof_Exist)(nil),
(*CommitmentProof_Nonexist)(nil),
(*CommitmentProof_Batch)(nil),
(*CommitmentProof_Compressed)(nil),
}
}
// LeafOp represents the raw key-value data we wish to prove, and
// must be flexible to represent the internal transformation from
// the original key-value pairs into the basis hash, for many existing
// merkle trees.
//
// key and value are passed in. So that the signature of this operation is:
// leafOp(key, value) -> output
//
// To process this, first prehash the keys and values if needed (ANY means no hash in this case):
// hkey = prehashKey(key)
// hvalue = prehashValue(value)
//
// Then combine the bytes, and hash it
// output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
type LeafOp struct {
Hash HashOp `protobuf:"varint,1,opt,name=hash,proto3,enum=cosmos.ics23.v1.HashOp" json:"hash,omitempty"`
PrehashKey HashOp `protobuf:"varint,2,opt,name=prehash_key,json=prehashKey,proto3,enum=cosmos.ics23.v1.HashOp" json:"prehash_key,omitempty"`
PrehashValue HashOp `protobuf:"varint,3,opt,name=prehash_value,json=prehashValue,proto3,enum=cosmos.ics23.v1.HashOp" json:"prehash_value,omitempty"`
Length LengthOp `protobuf:"varint,4,opt,name=length,proto3,enum=cosmos.ics23.v1.LengthOp" json:"length,omitempty"`
// prefix is a fixed bytes that may optionally be included at the beginning to differentiate
// a leaf node from an inner node.
Prefix []byte `protobuf:"bytes,5,opt,name=prefix,proto3" json:"prefix,omitempty"`
}
func (m *LeafOp) Reset() { *m = LeafOp{} }
func (m *LeafOp) String() string { return proto.CompactTextString(m) }
func (*LeafOp) ProtoMessage() {}
func (*LeafOp) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{3}
}
func (m *LeafOp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LeafOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LeafOp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LeafOp) XXX_Merge(src proto.Message) {
xxx_messageInfo_LeafOp.Merge(m, src)
}
func (m *LeafOp) XXX_Size() int {
return m.Size()
}
func (m *LeafOp) XXX_DiscardUnknown() {
xxx_messageInfo_LeafOp.DiscardUnknown(m)
}
var xxx_messageInfo_LeafOp proto.InternalMessageInfo
func (m *LeafOp) GetHash() HashOp {
if m != nil {
return m.Hash
}
return HashOp_NO_HASH
}
func (m *LeafOp) GetPrehashKey() HashOp {
if m != nil {
return m.PrehashKey
}
return HashOp_NO_HASH
}
func (m *LeafOp) GetPrehashValue() HashOp {
if m != nil {
return m.PrehashValue
}
return HashOp_NO_HASH
}
func (m *LeafOp) GetLength() LengthOp {
if m != nil {
return m.Length
}
return LengthOp_NO_PREFIX
}
func (m *LeafOp) GetPrefix() []byte {
if m != nil {
return m.Prefix
}
return nil
}
// InnerOp represents a merkle-proof step that is not a leaf.
// It represents concatenating two children and hashing them to provide the next result.
//
// The result of the previous step is passed in, so the signature of this op is:
// innerOp(child) -> output
//
// The result of applying InnerOp should be:
// output = op.hash(op.prefix || child || op.suffix)
//
// where the || operator is concatenation of binary data,
// and child is the result of hashing all the tree below this step.
//
// Any special data, like prepending child with the length, or prepending the entire operation with
// some value to differentiate from leaf nodes, should be included in prefix and suffix.
// If either of prefix or suffix is empty, we just treat it as an empty string
type InnerOp struct {
Hash HashOp `protobuf:"varint,1,opt,name=hash,proto3,enum=cosmos.ics23.v1.HashOp" json:"hash,omitempty"`
Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
Suffix []byte `protobuf:"bytes,3,opt,name=suffix,proto3" json:"suffix,omitempty"`
}
func (m *InnerOp) Reset() { *m = InnerOp{} }
func (m *InnerOp) String() string { return proto.CompactTextString(m) }
func (*InnerOp) ProtoMessage() {}
func (*InnerOp) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{4}
}
func (m *InnerOp) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *InnerOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_InnerOp.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *InnerOp) XXX_Merge(src proto.Message) {
xxx_messageInfo_InnerOp.Merge(m, src)
}
func (m *InnerOp) XXX_Size() int {
return m.Size()
}
func (m *InnerOp) XXX_DiscardUnknown() {
xxx_messageInfo_InnerOp.DiscardUnknown(m)
}
var xxx_messageInfo_InnerOp proto.InternalMessageInfo
func (m *InnerOp) GetHash() HashOp {
if m != nil {
return m.Hash
}
return HashOp_NO_HASH
}
func (m *InnerOp) GetPrefix() []byte {
if m != nil {
return m.Prefix
}
return nil
}
func (m *InnerOp) GetSuffix() []byte {
if m != nil {
return m.Suffix
}
return nil
}
// ProofSpec defines what the expected parameters are for a given proof type.
// This can be stored in the client and used to validate any incoming proofs.
//
// verify(ProofSpec, Proof) -> Proof | Error
//
// As demonstrated in tests, if we don't fix the algorithm used to calculate the
// LeafHash for a given tree, there are many possible key-value pairs that can
// generate a given hash (by interpretting the preimage differently).
// We need this for proper security, requires client knows a priori what
// tree format server uses. But not in code, rather a configuration object.
type ProofSpec struct {
// any field in the ExistenceProof must be the same as in this spec.
// except Prefix, which is just the first bytes of prefix (spec can be longer)
LeafSpec *LeafOp `protobuf:"bytes,1,opt,name=leaf_spec,json=leafSpec,proto3" json:"leaf_spec,omitempty"`
InnerSpec *InnerSpec `protobuf:"bytes,2,opt,name=inner_spec,json=innerSpec,proto3" json:"inner_spec,omitempty"`
// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
MaxDepth int32 `protobuf:"varint,3,opt,name=max_depth,json=maxDepth,proto3" json:"max_depth,omitempty"`
// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
MinDepth int32 `protobuf:"varint,4,opt,name=min_depth,json=minDepth,proto3" json:"min_depth,omitempty"`
// prehash_key_before_comparison is a flag that indicates whether to use the
// prehash_key specified by LeafOp to compare lexical ordering of keys for
// non-existence proofs.
PrehashKeyBeforeComparison bool `protobuf:"varint,5,opt,name=prehash_key_before_comparison,json=prehashKeyBeforeComparison,proto3" json:"prehash_key_before_comparison,omitempty"`
}
func (m *ProofSpec) Reset() { *m = ProofSpec{} }
func (m *ProofSpec) String() string { return proto.CompactTextString(m) }
func (*ProofSpec) ProtoMessage() {}
func (*ProofSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{5}
}
func (m *ProofSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ProofSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ProofSpec.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ProofSpec) XXX_Merge(src proto.Message) {
xxx_messageInfo_ProofSpec.Merge(m, src)
}
func (m *ProofSpec) XXX_Size() int {
return m.Size()
}
func (m *ProofSpec) XXX_DiscardUnknown() {
xxx_messageInfo_ProofSpec.DiscardUnknown(m)
}
var xxx_messageInfo_ProofSpec proto.InternalMessageInfo
func (m *ProofSpec) GetLeafSpec() *LeafOp {
if m != nil {
return m.LeafSpec
}
return nil
}
func (m *ProofSpec) GetInnerSpec() *InnerSpec {
if m != nil {
return m.InnerSpec
}
return nil
}
func (m *ProofSpec) GetMaxDepth() int32 {
if m != nil {
return m.MaxDepth
}
return 0
}
func (m *ProofSpec) GetMinDepth() int32 {
if m != nil {
return m.MinDepth
}
return 0
}
func (m *ProofSpec) GetPrehashKeyBeforeComparison() bool {
if m != nil {
return m.PrehashKeyBeforeComparison
}
return false
}
// InnerSpec contains all store-specific structure info to determine if two proofs from a
// given store are neighbors.
//
// This enables:
//
// isLeftMost(spec: InnerSpec, op: InnerOp)
// isRightMost(spec: InnerSpec, op: InnerOp)
// isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
type InnerSpec struct {
// Child order is the ordering of the children node, must count from 0
// iavl tree is [0, 1] (left then right)
// merk is [0, 2, 1] (left, right, here)
ChildOrder []int32 `protobuf:"varint,1,rep,packed,name=child_order,json=childOrder,proto3" json:"child_order,omitempty"`
ChildSize int32 `protobuf:"varint,2,opt,name=child_size,json=childSize,proto3" json:"child_size,omitempty"`
MinPrefixLength int32 `protobuf:"varint,3,opt,name=min_prefix_length,json=minPrefixLength,proto3" json:"min_prefix_length,omitempty"`
MaxPrefixLength int32 `protobuf:"varint,4,opt,name=max_prefix_length,json=maxPrefixLength,proto3" json:"max_prefix_length,omitempty"`
// empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
EmptyChild []byte `protobuf:"bytes,5,opt,name=empty_child,json=emptyChild,proto3" json:"empty_child,omitempty"`
// hash is the algorithm that must be used for each InnerOp
Hash HashOp `protobuf:"varint,6,opt,name=hash,proto3,enum=cosmos.ics23.v1.HashOp" json:"hash,omitempty"`
}
func (m *InnerSpec) Reset() { *m = InnerSpec{} }
func (m *InnerSpec) String() string { return proto.CompactTextString(m) }
func (*InnerSpec) ProtoMessage() {}
func (*InnerSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{6}
}
func (m *InnerSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *InnerSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_InnerSpec.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *InnerSpec) XXX_Merge(src proto.Message) {
xxx_messageInfo_InnerSpec.Merge(m, src)
}
func (m *InnerSpec) XXX_Size() int {
return m.Size()
}
func (m *InnerSpec) XXX_DiscardUnknown() {
xxx_messageInfo_InnerSpec.DiscardUnknown(m)
}
var xxx_messageInfo_InnerSpec proto.InternalMessageInfo
func (m *InnerSpec) GetChildOrder() []int32 {
if m != nil {
return m.ChildOrder
}
return nil
}
func (m *InnerSpec) GetChildSize() int32 {
if m != nil {
return m.ChildSize
}
return 0
}
func (m *InnerSpec) GetMinPrefixLength() int32 {
if m != nil {
return m.MinPrefixLength
}
return 0
}
func (m *InnerSpec) GetMaxPrefixLength() int32 {
if m != nil {
return m.MaxPrefixLength
}
return 0
}
func (m *InnerSpec) GetEmptyChild() []byte {
if m != nil {
return m.EmptyChild
}
return nil
}
func (m *InnerSpec) GetHash() HashOp {
if m != nil {
return m.Hash
}
return HashOp_NO_HASH
}
// BatchProof is a group of multiple proof types than can be compressed
type BatchProof struct {
Entries []*BatchEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
}
func (m *BatchProof) Reset() { *m = BatchProof{} }
func (m *BatchProof) String() string { return proto.CompactTextString(m) }
func (*BatchProof) ProtoMessage() {}
func (*BatchProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{7}
}
func (m *BatchProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BatchProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BatchProof.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *BatchProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_BatchProof.Merge(m, src)
}
func (m *BatchProof) XXX_Size() int {
return m.Size()
}
func (m *BatchProof) XXX_DiscardUnknown() {
xxx_messageInfo_BatchProof.DiscardUnknown(m)
}
var xxx_messageInfo_BatchProof proto.InternalMessageInfo
func (m *BatchProof) GetEntries() []*BatchEntry {
if m != nil {
return m.Entries
}
return nil
}
// Use BatchEntry not CommitmentProof, to avoid recursion
type BatchEntry struct {
// Types that are valid to be assigned to Proof:
//
// *BatchEntry_Exist
// *BatchEntry_Nonexist
Proof isBatchEntry_Proof `protobuf_oneof:"proof"`
}
func (m *BatchEntry) Reset() { *m = BatchEntry{} }
func (m *BatchEntry) String() string { return proto.CompactTextString(m) }
func (*BatchEntry) ProtoMessage() {}
func (*BatchEntry) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{8}
}
func (m *BatchEntry) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BatchEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BatchEntry.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *BatchEntry) XXX_Merge(src proto.Message) {
xxx_messageInfo_BatchEntry.Merge(m, src)
}
func (m *BatchEntry) XXX_Size() int {
return m.Size()
}
func (m *BatchEntry) XXX_DiscardUnknown() {
xxx_messageInfo_BatchEntry.DiscardUnknown(m)
}
var xxx_messageInfo_BatchEntry proto.InternalMessageInfo
type isBatchEntry_Proof interface {
isBatchEntry_Proof()
MarshalTo([]byte) (int, error)
Size() int
}
type BatchEntry_Exist struct {
Exist *ExistenceProof `protobuf:"bytes,1,opt,name=exist,proto3,oneof" json:"exist,omitempty"`
}
type BatchEntry_Nonexist struct {
Nonexist *NonExistenceProof `protobuf:"bytes,2,opt,name=nonexist,proto3,oneof" json:"nonexist,omitempty"`
}
func (*BatchEntry_Exist) isBatchEntry_Proof() {}
func (*BatchEntry_Nonexist) isBatchEntry_Proof() {}
func (m *BatchEntry) GetProof() isBatchEntry_Proof {
if m != nil {
return m.Proof
}
return nil
}
func (m *BatchEntry) GetExist() *ExistenceProof {
if x, ok := m.GetProof().(*BatchEntry_Exist); ok {
return x.Exist
}
return nil
}
func (m *BatchEntry) GetNonexist() *NonExistenceProof {
if x, ok := m.GetProof().(*BatchEntry_Nonexist); ok {
return x.Nonexist
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*BatchEntry) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*BatchEntry_Exist)(nil),
(*BatchEntry_Nonexist)(nil),
}
}
type CompressedBatchProof struct {
Entries []*CompressedBatchEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
LookupInners []*InnerOp `protobuf:"bytes,2,rep,name=lookup_inners,json=lookupInners,proto3" json:"lookup_inners,omitempty"`
}
func (m *CompressedBatchProof) Reset() { *m = CompressedBatchProof{} }
func (m *CompressedBatchProof) String() string { return proto.CompactTextString(m) }
func (*CompressedBatchProof) ProtoMessage() {}
func (*CompressedBatchProof) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{9}
}
func (m *CompressedBatchProof) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *CompressedBatchProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CompressedBatchProof.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *CompressedBatchProof) XXX_Merge(src proto.Message) {
xxx_messageInfo_CompressedBatchProof.Merge(m, src)
}
func (m *CompressedBatchProof) XXX_Size() int {
return m.Size()
}
func (m *CompressedBatchProof) XXX_DiscardUnknown() {
xxx_messageInfo_CompressedBatchProof.DiscardUnknown(m)
}
var xxx_messageInfo_CompressedBatchProof proto.InternalMessageInfo
func (m *CompressedBatchProof) GetEntries() []*CompressedBatchEntry {
if m != nil {
return m.Entries
}
return nil
}
func (m *CompressedBatchProof) GetLookupInners() []*InnerOp {
if m != nil {
return m.LookupInners
}
return nil
}
// Use BatchEntry not CommitmentProof, to avoid recursion
type CompressedBatchEntry struct {
// Types that are valid to be assigned to Proof:
//
// *CompressedBatchEntry_Exist
// *CompressedBatchEntry_Nonexist
Proof isCompressedBatchEntry_Proof `protobuf_oneof:"proof"`
}
func (m *CompressedBatchEntry) Reset() { *m = CompressedBatchEntry{} }
func (m *CompressedBatchEntry) String() string { return proto.CompactTextString(m) }
func (*CompressedBatchEntry) ProtoMessage() {}
func (*CompressedBatchEntry) Descriptor() ([]byte, []int) {
return fileDescriptor_5e599a3f914c9389, []int{10}
}
func (m *CompressedBatchEntry) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *CompressedBatchEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CompressedBatchEntry.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *CompressedBatchEntry) XXX_Merge(src proto.Message) {
xxx_messageInfo_CompressedBatchEntry.Merge(m, src)
}
func (m *CompressedBatchEntry) XXX_Size() int {
return m.Size()
}
func (m *CompressedBatchEntry) XXX_DiscardUnknown() {
xxx_messageInfo_CompressedBatchEntry.DiscardUnknown(m)
}
var xxx_messageInfo_CompressedBatchEntry proto.InternalMessageInfo
type isCompressedBatchEntry_Proof interface {
isCompressedBatchEntry_Proof()
MarshalTo([]byte) (int, error)
Size() int
}
type CompressedBatchEntry_Exist struct {
Exist *CompressedExistenceProof `protobuf:"bytes,1,opt,name=exist,proto3,oneof" json:"exist,omitempty"`
}
type CompressedBatchEntry_Nonexist struct {
Nonexist *CompressedNonExistenceProof `protobuf:"bytes,2,opt,name=nonexist,proto3,oneof" json:"nonexist,omitempty"`
}
func (*CompressedBatchEntry_Exist) isCompressedBatchEntry_Proof() {}
func (*CompressedBatchEntry_Nonexist) isCompressedBatchEntry_Proof() {}
func (m *CompressedBatchEntry) GetProof() isCompressedBatchEntry_Proof {
if m != nil {
return m.Proof
}
return nil
}
func (m *CompressedBatchEntry) GetExist() *CompressedExistenceProof {
if x, ok := m.GetProof().(*CompressedBatchEntry_Exist); ok {
return x.Exist
}
return nil
}