From 2a5cf84e31226fe569d4a540cbd6e2f883d3627c Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Thu, 24 Aug 2023 16:09:29 +0200 Subject: [PATCH] fix tests --- proto/tendermint/types/types.pb.go | 265 ++++++++++++++++++----------- proto/tendermint/types/types.proto | 8 +- state/execution.go | 9 +- types/block.go | 4 + 4 files changed, 175 insertions(+), 111 deletions(-) diff --git a/proto/tendermint/types/types.pb.go b/proto/tendermint/types/types.pb.go index 7c41272a27..20c97dfd68 100644 --- a/proto/tendermint/types/types.pb.go +++ b/proto/tendermint/types/types.pb.go @@ -5,12 +5,12 @@ package types import ( fmt "fmt" + crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" + version "github.com/cometbft/cometbft/proto/tendermint/version" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - version "github.com/cometbft/cometbft/proto/tendermint/version" io "io" math "math" math_bits "math/bits" @@ -422,6 +422,10 @@ type Data struct { // This means that the block.AppHash of this block does not include these txs. // NOTE: not all txs here are valid. We're just agreeing on the order first. Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` + // Hash is the root of a binary Merkle tree where the leaves of the tree are + // the row and column roots of an extended data square. Hash is often referred + // to as the "data root". + Hash []byte `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"` } func (m *Data) Reset() { *m = Data{} } @@ -464,6 +468,13 @@ func (m *Data) GetTxs() [][]byte { return nil } +func (m *Data) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + // Blob (named after binary large object) is a chunk of data submitted by a user // to be published to the Celestia blockchain. The data of a Blob is published // to a namespace and is encoded into shares based on the format specified by @@ -1502,110 +1513,111 @@ func init() { func init() { proto.RegisterFile("tendermint/types/types.proto", fileDescriptor_d3a6e55e2345de56) } var fileDescriptor_d3a6e55e2345de56 = []byte{ - // 1647 bytes of a gzipped FileDescriptorProto + // 1649 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0x1a, 0xdb, 0x15, 0xf7, 0xc0, 0x00, 0xc3, 0x01, 0xec, 0xf1, 0xc8, 0x2f, 0x8f, 0x90, 0x67, 0x4c, 0xa9, 0xda, - 0xfa, 0xbd, 0x46, 0x38, 0x75, 0xaa, 0xa4, 0x5d, 0x64, 0x61, 0x6c, 0x27, 0xc1, 0xb1, 0x31, 0x1d, - 0x88, 0xa3, 0x56, 0x95, 0x46, 0x03, 0x73, 0x0d, 0xd3, 0x0c, 0x73, 0x47, 0x33, 0x17, 0x1b, 0xe7, - 0x13, 0x54, 0xde, 0x34, 0xab, 0xee, 0xbc, 0x4a, 0x17, 0xdd, 0xf7, 0x0b, 0x54, 0x5d, 0x65, 0x99, - 0x5d, 0xbb, 0x69, 0x5a, 0x39, 0x52, 0x95, 0x8f, 0x51, 0xdd, 0x3f, 0x33, 0x0c, 0x06, 0xda, 0x28, - 0x8a, 0xde, 0xc6, 0x9a, 0x7b, 0xce, 0xef, 0x9c, 0x7b, 0xfe, 0xde, 0x73, 0x30, 0x7c, 0x43, 0x90, - 0x6b, 0x21, 0x7f, 0x68, 0xbb, 0x64, 0x8b, 0x5c, 0x78, 0x28, 0xe0, 0x7f, 0x6b, 0x9e, 0x8f, 0x09, - 0xd6, 0xd4, 0x09, 0xb7, 0xc6, 0xe8, 0xa5, 0xb5, 0x3e, 0xee, 0x63, 0xc6, 0xdc, 0xa2, 0x5f, 0x1c, - 0x57, 0xda, 0xe8, 0x63, 0xdc, 0x77, 0xd0, 0x16, 0x3b, 0x75, 0x47, 0xa7, 0x5b, 0xc4, 0x1e, 0xa2, - 0x80, 0x98, 0x43, 0x4f, 0x00, 0xd6, 0x63, 0xd7, 0xf4, 0xfc, 0x0b, 0x8f, 0x60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1, 0x1b, 0x20, 0x37, 0x18, 0x05, 0x42, 0x5f, 0x28, 0xa3, 0xfd, 0x18, 0x94, - 0xde, 0xc0, 0xb4, 0x5d, 0xc3, 0xb6, 0x98, 0x45, 0xd9, 0x7a, 0xee, 0xfa, 0xfd, 0x46, 0x66, 0x97, - 0xd2, 0x1a, 0x7b, 0x7a, 0x86, 0x31, 0x1b, 0x96, 0x76, 0x0b, 0xd2, 0x03, 0x64, 0xf7, 0x07, 0x84, - 0x85, 0x25, 0xa9, 0x8b, 0x93, 0xf6, 0x0b, 0x90, 0x69, 0x41, 0x14, 0x65, 0x76, 0x77, 0xa9, 0xc6, - 0xab, 0xa5, 0x16, 0x56, 0x4b, 0xad, 0x13, 0x56, 0x4b, 0x5d, 0xa1, 0x17, 0xbf, 0xfe, 0xd7, 0x86, - 0xa4, 0x33, 0x09, 0x6d, 0x17, 0x0a, 0x8e, 0x19, 0x10, 0xa3, 0x4b, 0xc3, 0x46, 0xaf, 0x4f, 0x31, - 0x15, 0xb7, 0x67, 0x03, 0x22, 0x02, 0x2b, 0x4c, 0xcf, 0x51, 0x29, 0x4e, 0xb2, 0xb4, 0x4d, 0x50, - 0x99, 0x92, 0x1e, 0x1e, 0x0e, 0x6d, 0x62, 0xb0, 0xb8, 0xa7, 0x59, 0xdc, 0x97, 0x29, 0x7d, 0x97, - 0x91, 0x9f, 0xd2, 0x0c, 0xdc, 0x81, 0xac, 0x65, 0x12, 0x93, 0x43, 0x32, 0x0c, 0xa2, 0x50, 0x02, - 0x63, 0xfe, 0x04, 0x56, 0xa2, 0xaa, 0x0b, 0x38, 0x44, 0xe1, 0x5a, 0x26, 0x64, 0x06, 0xbc, 0x07, - 0x6b, 0x2e, 0x1a, 0x13, 0xe3, 0x26, 0x3a, 0xcb, 0xd0, 0x1a, 0xe5, 0x9d, 0x4c, 0x4b, 0xfc, 0x08, - 0x96, 0x7b, 0x61, 0xf0, 0x39, 0x16, 0x18, 0xb6, 0x10, 0x51, 0x19, 0xec, 0x36, 0x28, 0xa6, 0xe7, - 0x71, 0x40, 0x8e, 0x01, 0x32, 0xa6, 0xe7, 0x31, 0xd6, 0x77, 0xb0, 0xca, 0x7c, 0xf4, 0x51, 0x30, - 0x72, 0x88, 0x50, 0x92, 0x67, 0x98, 0x15, 0xca, 0xd0, 0x39, 0x9d, 0x61, 0x7f, 0x08, 0x05, 0x74, - 0x66, 0x5b, 0xc8, 0xed, 0x21, 0x8e, 0x2b, 0x30, 0x5c, 0x3e, 0x24, 0x32, 0xd0, 0xb7, 0xa0, 0x7a, - 0x3e, 0xf6, 0x70, 0x80, 0x7c, 0xc3, 0xb4, 0x2c, 0x1f, 0x05, 0x41, 0x71, 0x99, 0xeb, 0x0b, 0xe9, - 0x3b, 0x9c, 0x5c, 0x7d, 0x00, 0xf2, 0x9e, 0x49, 0x4c, 0x4d, 0x85, 0x24, 0x19, 0x07, 0x45, 0xa9, - 0x92, 0xdc, 0xcc, 0xeb, 0xf4, 0xf3, 0x40, 0x56, 0x12, 0x6a, 0xf2, 0x40, 0x56, 0x92, 0xaa, 0x7c, - 0x20, 0x2b, 0xb2, 0x9a, 0x3a, 0x90, 0x95, 0x94, 0x9a, 0x3e, 0x90, 0x95, 0xb4, 0x9a, 0xa9, 0xfe, - 0x41, 0x02, 0xb9, 0xee, 0xe0, 0xae, 0xf6, 0x03, 0xc8, 0xbb, 0xe6, 0x10, 0x05, 0x9e, 0xd9, 0x43, - 0x34, 0xc9, 0xbc, 0x29, 0x72, 0x11, 0xad, 0x61, 0xd1, 0x7e, 0xa1, 0x89, 0x08, 0x1b, 0x97, 0x7e, - 0x53, 0x3f, 0x82, 0x81, 0xe9, 0x23, 0x23, 0xac, 0xed, 0x24, 0x6b, 0xdc, 0x3c, 0x23, 0x9e, 0x88, - 0xda, 0xfd, 0x29, 0xac, 0x4e, 0x74, 0x87, 0x40, 0x99, 0x01, 0xd5, 0x88, 0x21, 0xc0, 0xd5, 0x8f, - 0x09, 0x90, 0x4f, 0x30, 0x41,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f, 0x65, 0xf6, 0x29, + 0xad, 0x71, 0xa0, 0x67, 0x18, 0xb3, 0x61, 0x69, 0x77, 0x20, 0x3d, 0x44, 0xf6, 0x60, 0x48, 0x58, + 0x58, 0x92, 0xba, 0x38, 0x69, 0xbf, 0x00, 0x99, 0x16, 0x44, 0x51, 0x66, 0x77, 0x97, 0x6a, 0xbc, + 0x5a, 0x6a, 0x61, 0xb5, 0xd4, 0xba, 0x61, 0xb5, 0xd4, 0x15, 0x7a, 0xf1, 0xeb, 0x7f, 0x6e, 0x49, + 0x3a, 0x93, 0xd0, 0xf6, 0xa1, 0xe0, 0x98, 0x01, 0x31, 0x7a, 0x34, 0x6c, 0xf4, 0xfa, 0x14, 0x53, + 0x71, 0x77, 0x3e, 0x20, 0x22, 0xb0, 0xc2, 0xf4, 0x1c, 0x95, 0xe2, 0x24, 0x4b, 0xdb, 0x06, 0x95, + 0x29, 0xe9, 0xe3, 0xd1, 0xc8, 0x26, 0x06, 0x8b, 0x7b, 0x9a, 0xc5, 0x7d, 0x95, 0xd2, 0xf7, 0x19, + 0xf9, 0x29, 0xcd, 0xc0, 0x3d, 0xc8, 0x5a, 0x26, 0x31, 0x39, 0x24, 0xc3, 0x20, 0x0a, 0x25, 0x30, + 0xe6, 0x8f, 0x60, 0x2d, 0xaa, 0xba, 0x80, 0x43, 0x14, 0xae, 0x65, 0x4a, 0x66, 0xc0, 0x07, 0xb0, + 0xe1, 0xa2, 0x09, 0x31, 0x6e, 0xa3, 0xb3, 0x0c, 0xad, 0x51, 0xde, 0xe9, 0xac, 0xc4, 0x0f, 0x60, + 0xb5, 0x1f, 0x06, 0x9f, 0x63, 0x81, 0x61, 0x0b, 0x11, 0x95, 0xc1, 0xee, 0x82, 0x62, 0x7a, 0x1e, + 0x07, 0xe4, 0x18, 0x20, 0x63, 0x7a, 0x1e, 0x63, 0x7d, 0x07, 0xeb, 0xcc, 0x47, 0x1f, 0x05, 0x63, + 0x87, 0x08, 0x25, 0x79, 0x86, 0x59,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 0x37, 0x9d, 0xff, 0x47, 0x47, 0xdc, 0x83, 0xac, 0x87, 0x1d, 0x83, 0x73, + 0x64, 0xc6, 0x51, 0x3c, 0xec, 0xe8, 0x73, 0x69, 0x4f, 0x7d, 0xa1, 0x76, 0x49, 0x7f, 0x81, 0xa8, + 0x65, 0x6e, 0x47, 0xcd, 0x87, 0x3c, 0x0f, 0x85, 0x98, 0xc4, 0x0f, 0x68, 0x0c, 0xd8, 0x68, 0x97, + 0xe6, 0x37, 0x07, 0x6e, 0x36, 0x47, 0xea, 0x02, 0x47, 0x25, 0xf8, 0xe0, 0x12, 0xcb, 0x40, 0x71, + 0x59, 0x59, 0xea, 0x02, 0x57, 0xfd, 0x83, 0x04, 0x70, 0x4c, 0x23, 0xcb, 0xfc, 0xa5, 0x33, 0x34, + 0x60, 0x26, 0x18, 0x33, 0x37, 0x97, 0x97, 0x25, 0x4d, 0xdc, 0x9f, 0x0f, 0xe2, 0x76, 0xef, 0x43, + 0x61, 0x5a, 0x8c, 0x01, 0x0a, 0x8d, 0x59, 0xa0, 0x24, 0x1a, 0x6d, 0x1d, 0x44, 0xf4, 0xfc, 0x79, + 0xec, 0x54, 0xfd, 0xab, 0x04, 0x59, 0x66, 0x53, 0x13, 0x11, 0x73, 0x26, 0x87, 0xd2, 0xe7, 0xe7, + 0x70, 0x13, 0x80, 0xab, 0x09, 0xec, 0x57, 0x48, 0x54, 0x56, 0x96, 0x51, 0x3a, 0xf6, 0x2b, 0xa4, + 0xfd, 0x2c, 0x0a, 0x78, 0xf2, 0xbf, 0x07, 0x5c, 0xb4, 0x74, 0x18, 0xf6, 0xaf, 0x21, 0xe3, 0x8e, + 0x47, 0x06, 0x1d, 0x68, 0x32, 0xaf, 0x56, 0x77, 0x3c, 0xea, 0x4e, 0x82, 0xea, 0x6f, 0x21, 0xd3, + 0x9d, 0xb0, 0xe5, 0x8e, 0x96, 0xa8, 0x8f, 0xb1, 0xd8, 0x28, 0xf8, 0x98, 0x52, 0x28, 0x81,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0xf9, 0xd3, 0x1f, 0xcb, 0x12, + 0xf5, 0xac, 0x30, 0x33, 0xda, 0xb4, 0xfb, 0xf0, 0x75, 0xa7, 0xf1, 0xa4, 0x75, 0x78, 0x60, 0x34, + 0x3b, 0x4f, 0x8c, 0xee, 0xaf, 0xda, 0x87, 0x31, 0xef, 0xd6, 0xae, 0xae, 0x2b, 0x39, 0xe1, 0xd2, + 0x32, 0x74, 0x5b, 0x3f, 0x3c, 0x3d, 0xe9, 0x1e, 0xaa, 0x12, 0x47, 0xb7, 0x7d, 0x74, 0x8e, 0x09, + 0x62, 0xe8, 0x07, 0x70, 0x77, 0x01, 0x3a, 0x72, 0x6c, 0xfd, 0xea, 0xba, 0x52, 0x68, 0xfb, 0x88, + 0x3f, 0xfb, 0x4c, 0xa2, 0x06, 0xc5, 0x79, 0x89, 0x93, 0xf6, 0x49, 0x67, 0xef, 0x58, 0xad, 0x94, + 0xd4, 0xab, 0xeb, 0x4a, 0x3e, 0x9c, 0xe1, 0x14, 0x3f, 0xf5, 0xac, 0xde, 0x7c, 0x7b, 0x53, 0x96, + 0xde, 0xdd, 0x94, 0xa5, 0x7f, 0xdd, 0x94, 0xa5, 0xd7, 0x1f, 0xca, 0x2b, 0xef, 0x3e, 0x94, 0x57, + 0xfe, 0xfe, 0xa1, 0xbc, 0xf2, 0xeb, 0x87, 0x03, 0x9b, 0x0c, 0xc7, 0xbd, 0x5a, 0x1f, 0x8f, 0x76, + 0xfa, 0x78, 0x84, 0x48, 0xef, 0x8c, 0x4c, 0x3f, 0xf8, 0xff, 0x02, 0x6e, 0xff, 0x3e, 0xef, 0xa5, + 0x19, 0xfd, 0xe1, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x05, 0x6d, 0xaf, 0x7f, 0x60, 0x10, 0x00, + 0x00, } func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { @@ -1874,6 +1886,13 @@ func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x32 + } if len(m.Txs) > 0 { for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Txs[iNdEx]) @@ -2797,6 +2816,10 @@ func (m *Data) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -4068,6 +4091,40 @@ func (m *Data) Unmarshal(dAtA []byte) error { m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/proto/tendermint/types/types.proto b/proto/tendermint/types/types.proto index db43a3e2fd..b5c77f7f2e 100644 --- a/proto/tendermint/types/types.proto +++ b/proto/tendermint/types/types.proto @@ -89,12 +89,16 @@ message Data { // NOTE: not all txs here are valid. We're just agreeing on the order first. repeated bytes txs = 1; - reserved 2, 3, 4, 5, 6; + reserved 2, 3, 4, 5; // field number 2 is reserved for intermediate state roots // field number 3 is reserved for evidence // field number 4 is reserved for blobs // field number 5 is reserved for square size - // field number 6 is reserved for data hash + + // Hash is the root of a binary Merkle tree where the leaves of the tree are + // the row and column roots of an extended data square. Hash is often referred + // to as the "data root". + bytes hash = 6; } // Blob (named after binary large object) is a chunk of data submitted by a user diff --git a/state/execution.go b/state/execution.go index b735b1eb24..02786fc6bf 100644 --- a/state/execution.go +++ b/state/execution.go @@ -137,20 +137,19 @@ func (blockExec *BlockExecutor) CreateProposalBlock( // Celestia passes the data root back as the last transaction if len(rpp.Txs) < 1 { - panic("state machine returned an invalid prepare proposal response: expected at least 2 transactions") + panic("state machine returned an invalid prepare proposal response: expected at least 1 transaction") } if len(rpp.Txs[len(rpp.Txs)-1]) != tmhash.Size { - panic(fmt.Sprintf("state machine returned an invalid prepare proposal response: expected second to last transaction to be a hash, got %d bytes", len(rpp.Txs[len(rpp.Txs)-2]))) + panic(fmt.Sprintf("state machine returned an invalid prepare proposal response: expected last transaction to be a hash, got %d bytes", len(rpp.Txs[len(rpp.Txs)-2]))) } // update the block with the response from PrepareProposal block.Data, _ = types.DataFromProto(&cmtproto.Data{ - Txs: rpp.Txs[:len(rpp.Txs)-1], + Txs: rpp.Txs[:len(rpp.Txs)-1], + Hash: rpp.Txs[len(rpp.Txs)-1], }) - block.DataHash = rpp.Txs[len(rpp.Txs)-1] - var blockDataSize int for _, tx := range block.Txs { blockDataSize += len(tx) diff --git a/types/block.go b/types/block.go index b24a567626..65cef983c2 100644 --- a/types/block.go +++ b/types/block.go @@ -1090,6 +1090,8 @@ func (data *Data) ToProto() cmtproto.Data { tp.Txs = txBzs } + tp.Hash = data.hash + return *tp } @@ -1111,6 +1113,8 @@ func DataFromProto(dp *cmtproto.Data) (Data, error) { data.Txs = Txs{} } + data.hash = dp.Hash + return *data, nil }