From 4304c44af6973292546f0c419ed1109c58ca1160 Mon Sep 17 00:00:00 2001 From: sweexordious Date: Mon, 14 Oct 2024 12:21:09 +0400 Subject: [PATCH] feat: keep default to get proofs and expose partset without proof --- proto/tendermint/rpc/grpc/types.pb.go | 146 +++++++++++++------------- proto/tendermint/rpc/grpc/types.proto | 8 +- rpc/grpc/api.go | 4 +- rpc/grpc/types.pb.go | 146 +++++++++++++------------- types/part_set.go | 24 +++-- 5 files changed, 166 insertions(+), 162 deletions(-) diff --git a/proto/tendermint/rpc/grpc/types.pb.go b/proto/tendermint/rpc/grpc/types.pb.go index 4b626ae302..bd9b4d72d3 100644 --- a/proto/tendermint/rpc/grpc/types.pb.go +++ b/proto/tendermint/rpc/grpc/types.pb.go @@ -110,8 +110,8 @@ func (m *RequestBroadcastTx) GetTx() []byte { } type BlockByHashRequest struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - ProveParts bool `protobuf:"varint,2,opt,name=prove_parts,json=proveParts,proto3" json:"prove_parts,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + IgnoreProof bool `protobuf:"varint,2,opt,name=ignore_proof,json=ignoreProof,proto3" json:"ignore_proof,omitempty"` } func (m *BlockByHashRequest) Reset() { *m = BlockByHashRequest{} } @@ -154,16 +154,16 @@ func (m *BlockByHashRequest) GetHash() []byte { return nil } -func (m *BlockByHashRequest) GetProveParts() bool { +func (m *BlockByHashRequest) GetIgnoreProof() bool { if m != nil { - return m.ProveParts + return m.IgnoreProof } return false } type BlockByHeightRequest struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - ProveParts bool `protobuf:"varint,2,opt,name=prove_parts,json=proveParts,proto3" json:"prove_parts,omitempty"` + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + IgnoreProof bool `protobuf:"varint,2,opt,name=ignore_proof,json=ignoreProof,proto3" json:"ignore_proof,omitempty"` } func (m *BlockByHeightRequest) Reset() { *m = BlockByHeightRequest{} } @@ -206,9 +206,9 @@ func (m *BlockByHeightRequest) GetHeight() int64 { return 0 } -func (m *BlockByHeightRequest) GetProveParts() bool { +func (m *BlockByHeightRequest) GetIgnoreProof() bool { if m != nil { - return m.ProveParts + return m.IgnoreProof } return false } @@ -909,62 +909,62 @@ func init() { func init() { proto.RegisterFile("tendermint/rpc/grpc/types.proto", fileDescriptor_0ffff5682c662b95) } var fileDescriptor_0ffff5682c662b95 = []byte{ - // 871 bytes of a gzipped FileDescriptorProto + // 877 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x3a, 0xff, 0xdc, 0xe7, 0x24, 0x85, 0x71, 0x48, 0xdd, 0x6d, 0xe5, 0x98, 0x05, 0xa9, - 0x29, 0xa4, 0xeb, 0xca, 0x08, 0x21, 0x11, 0x2e, 0x75, 0x5b, 0x89, 0x88, 0x02, 0x61, 0x13, 0x8a, - 0xc4, 0xc5, 0xac, 0x77, 0x47, 0xbb, 0xab, 0xda, 0x3b, 0xcb, 0xcc, 0xd8, 0x75, 0xbf, 0x05, 0x17, - 0xbe, 0x0c, 0x12, 0xf7, 0x1c, 0x7b, 0xe4, 0x54, 0x81, 0xf3, 0x45, 0xd0, 0xcc, 0xce, 0x3a, 0xb3, - 0xf1, 0xae, 0xed, 0x03, 0x5c, 0xac, 0xb7, 0x6f, 0x7e, 0xbf, 0xf7, 0xde, 0xf8, 0xfd, 0x1b, 0x38, - 0xe4, 0x38, 0xf6, 0x31, 0x1d, 0x46, 0x31, 0x6f, 0xd3, 0xc4, 0x6b, 0x07, 0xe2, 0x87, 0xbf, 0x49, - 0x30, 0xb3, 0x13, 0x4a, 0x38, 0x41, 0xf5, 0x6b, 0x80, 0x4d, 0x13, 0xcf, 0x16, 0x00, 0xf3, 0x9e, - 0x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e8, 0xc1, 0xc2, 0x54, 0xcd, + 0xb5, 0x62, 0x7f, 0xbe, 0x0c, 0x74, 0x76, 0x2f, 0x06, 0x1f, 0xcf, 0xcd, 0x09, 0xf4, 0xf0, 0xda, + 0x64, 0x33, 0x11, 0x5b, 0xcb, 0xc2, 0xf5, 0xed, 0x5e, 0xc2, 0x46, 0xd2, 0x96, 0xc8, 0xc9, 0x65, + 0x66, 0xb6, 0x9f, 0xfd, 0xe9, 0x42, 0x8c, 0x96, 0xf4, 0xa1, 0x6a, 0x76, 0x32, 0xca, 0x7f, 0xda, + 0x9c, 0x6d, 0x69, 0x3f, 0x58, 0x02, 0xa9, 0x83, 0x8c, 0xa1, 0x96, 0xb3, 0x40, 0x51, 0x3b, 0x57, + 0xa1, 0x78, 0xd5, 0x16, 0xdc, 0x28, 0xdb, 0xcd, 0x8f, 0xac, 0xee, 0x8b, 0xb3, 0xf3, 0x86, 0xf5, + 0xee, 0xbc, 0x61, 0xfd, 0x73, 0xde, 0xb0, 0x7e, 0xbf, 0x68, 0xac, 0xbc, 0xbb, 0x68, 0xac, 0xfc, + 0x7d, 0xd1, 0x58, 0xf9, 0xb9, 0x13, 0x10, 0x11, 0x4e, 0x06, 0x2d, 0x9f, 0x8e, 0xdb, 0xe6, 0xb7, + 0xd9, 0xfc, 0x77, 0xe1, 0xa1, 0x4f, 0x19, 0x96, 0xc6, 0x60, 0x43, 0x7d, 0x93, 0x7d, 0xf9, 0x5f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x8b, 0x57, 0xf9, 0x3e, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1526,9 +1526,9 @@ func (m *BlockByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ProveParts { + if m.IgnoreProof { i-- - if m.ProveParts { + if m.IgnoreProof { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -1566,9 +1566,9 @@ func (m *BlockByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ProveParts { + if m.IgnoreProof { i-- - if m.ProveParts { + if m.IgnoreProof { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -2140,7 +2140,7 @@ func (m *BlockByHashRequest) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.ProveParts { + if m.IgnoreProof { n += 2 } return n @@ -2155,7 +2155,7 @@ func (m *BlockByHeightRequest) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.ProveParts { + if m.IgnoreProof { n += 2 } return n @@ -2569,7 +2569,7 @@ func (m *BlockByHashRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProveParts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreProof", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -2586,7 +2586,7 @@ func (m *BlockByHashRequest) Unmarshal(dAtA []byte) error { break } } - m.ProveParts = bool(v != 0) + m.IgnoreProof = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -2658,7 +2658,7 @@ func (m *BlockByHeightRequest) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProveParts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreProof", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -2675,7 +2675,7 @@ func (m *BlockByHeightRequest) Unmarshal(dAtA []byte) error { break } } - m.ProveParts = bool(v != 0) + m.IgnoreProof = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/proto/tendermint/rpc/grpc/types.proto b/proto/tendermint/rpc/grpc/types.proto index 0f038dc7e2..3a81ddd80c 100644 --- a/proto/tendermint/rpc/grpc/types.proto +++ b/proto/tendermint/rpc/grpc/types.proto @@ -17,13 +17,13 @@ message RequestBroadcastTx { } message BlockByHashRequest { - bytes hash = 1; - bool prove_parts = 2; + bytes hash = 1; + bool ignore_proof = 2; } message BlockByHeightRequest { - int64 height = 1; - bool prove_parts = 2; + int64 height = 1; + bool ignore_proof = 2; } message BlockMetaByHashRequest { diff --git a/rpc/grpc/api.go b/rpc/grpc/api.go index c519373437..a58bbd6db6 100644 --- a/rpc/grpc/api.go +++ b/rpc/grpc/api.go @@ -190,7 +190,7 @@ func (blockAPI *BlockAPI) BlockByHash(req *BlockByHashRequest, stream BlockAPI_B if err != nil { return err } - if !req.ProveParts { + if req.IgnoreProof { part.Proof = crypto.Proof{} } isLastPart := i == int(blockMeta.BlockID.PartSetHeader.Total)-1 @@ -213,7 +213,7 @@ func (blockAPI *BlockAPI) BlockByHeight(req *BlockByHeightRequest, stream BlockA if err != nil { return err } - if !req.ProveParts { + if req.IgnoreProof { part.Proof = crypto.Proof{} } isLastPart := i == int(blockMeta.BlockID.PartSetHeader.Total)-1 diff --git a/rpc/grpc/types.pb.go b/rpc/grpc/types.pb.go index 4b626ae302..bd9b4d72d3 100644 --- a/rpc/grpc/types.pb.go +++ b/rpc/grpc/types.pb.go @@ -110,8 +110,8 @@ func (m *RequestBroadcastTx) GetTx() []byte { } type BlockByHashRequest struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - ProveParts bool `protobuf:"varint,2,opt,name=prove_parts,json=proveParts,proto3" json:"prove_parts,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + IgnoreProof bool `protobuf:"varint,2,opt,name=ignore_proof,json=ignoreProof,proto3" json:"ignore_proof,omitempty"` } func (m *BlockByHashRequest) Reset() { *m = BlockByHashRequest{} } @@ -154,16 +154,16 @@ func (m *BlockByHashRequest) GetHash() []byte { return nil } -func (m *BlockByHashRequest) GetProveParts() bool { +func (m *BlockByHashRequest) GetIgnoreProof() bool { if m != nil { - return m.ProveParts + return m.IgnoreProof } return false } type BlockByHeightRequest struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - ProveParts bool `protobuf:"varint,2,opt,name=prove_parts,json=proveParts,proto3" json:"prove_parts,omitempty"` + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + IgnoreProof bool `protobuf:"varint,2,opt,name=ignore_proof,json=ignoreProof,proto3" json:"ignore_proof,omitempty"` } func (m *BlockByHeightRequest) Reset() { *m = BlockByHeightRequest{} } @@ -206,9 +206,9 @@ func (m *BlockByHeightRequest) GetHeight() int64 { return 0 } -func (m *BlockByHeightRequest) GetProveParts() bool { +func (m *BlockByHeightRequest) GetIgnoreProof() bool { if m != nil { - return m.ProveParts + return m.IgnoreProof } return false } @@ -909,62 +909,62 @@ func init() { func init() { proto.RegisterFile("tendermint/rpc/grpc/types.proto", fileDescriptor_0ffff5682c662b95) } var fileDescriptor_0ffff5682c662b95 = []byte{ - // 871 bytes of a gzipped FileDescriptorProto + // 877 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x3a, 0xff, 0xdc, 0xe7, 0x24, 0x85, 0x71, 0x48, 0xdd, 0x6d, 0xe5, 0x98, 0x05, 0xa9, - 0x29, 0xa4, 0xeb, 0xca, 0x08, 0x21, 0x11, 0x2e, 0x75, 0x5b, 0x89, 0x88, 0x02, 0x61, 0x13, 0x8a, - 0xc4, 0xc5, 0xac, 0x77, 0x47, 0xbb, 0xab, 0xda, 0x3b, 0xcb, 0xcc, 0xd8, 0x75, 0xbf, 0x05, 0x17, - 0xbe, 0x0c, 0x12, 0xf7, 0x1c, 0x7b, 0xe4, 0x54, 0x81, 0xf3, 0x45, 0xd0, 0xcc, 0xce, 0x3a, 0xb3, - 0xf1, 0xae, 0xed, 0x03, 0x5c, 0xac, 0xb7, 0x6f, 0x7e, 0xbf, 0xf7, 0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 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1526,9 +1526,9 @@ func (m *BlockByHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ProveParts { + if m.IgnoreProof { i-- - if m.ProveParts { + if m.IgnoreProof { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -1566,9 +1566,9 @@ func (m *BlockByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ProveParts { + if m.IgnoreProof { i-- - if m.ProveParts { + if m.IgnoreProof { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -2140,7 +2140,7 @@ func (m *BlockByHashRequest) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.ProveParts { + if m.IgnoreProof { n += 2 } return n @@ -2155,7 +2155,7 @@ func (m *BlockByHeightRequest) Size() (n int) { if m.Height != 0 { n += 1 + sovTypes(uint64(m.Height)) } - if m.ProveParts { + if m.IgnoreProof { n += 2 } return n @@ -2569,7 +2569,7 @@ func (m *BlockByHashRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProveParts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreProof", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -2586,7 +2586,7 @@ func (m *BlockByHashRequest) Unmarshal(dAtA []byte) error { break } } - m.ProveParts = bool(v != 0) + m.IgnoreProof = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -2658,7 +2658,7 @@ func (m *BlockByHeightRequest) Unmarshal(dAtA []byte) error { } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProveParts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreProof", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -2675,7 +2675,7 @@ func (m *BlockByHeightRequest) Unmarshal(dAtA []byte) error { break } } - m.ProveParts = bool(v != 0) + m.IgnoreProof = bool(v != 0) default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/types/part_set.go b/types/part_set.go index 880b3aaf4a..a654bb5b8f 100644 --- a/types/part_set.go +++ b/types/part_set.go @@ -271,6 +271,20 @@ func (ps *PartSet) Total() uint32 { } func (ps *PartSet) AddPart(part *Part) (bool, error) { + // The proof should be compatible with the number of parts. + if part.Proof.Total != int64(ps.total) { + return false, ErrPartSetInvalidProof + } + + // Check hash proof + if part.Proof.Verify(ps.Hash(), part.Bytes) != nil { + return false, ErrPartSetInvalidProof + } + + return ps.AddPartWithoutProof(part) +} + +func (ps *PartSet) AddPartWithoutProof(part *Part) (bool, error) { if ps == nil { return false, nil } @@ -287,16 +301,6 @@ func (ps *PartSet) AddPart(part *Part) (bool, error) { return false, nil } - // The proof should be compatible with the number of parts. - if part.Proof.Total != int64(ps.total) { - return false, ErrPartSetInvalidProof - } - - // Check hash proof - if part.Proof.Verify(ps.Hash(), part.Bytes) != nil { - return false, ErrPartSetInvalidProof - } - // Add part ps.parts[part.Index] = part ps.partsBitArray.SetIndex(int(part.Index), true)