From 9c81c5850fafee2bea652601f9484ffd220e5f22 Mon Sep 17 00:00:00 2001 From: keruch Date: Wed, 3 Jul 2024 17:21:44 +0200 Subject: [PATCH] feat(da): added commitment type and additional comments --- proto/gen.sh | 8 +- proto/types/interchain_da/da.proto | 20 +- types/pb/dalc/dalc.pb.go | 7 +- types/pb/interchain_da/da.pb.go | 414 +++++++++++++++++++++++++++-- types/pb/interchain_da/query.pb.go | 7 +- 5 files changed, 425 insertions(+), 31 deletions(-) diff --git a/proto/gen.sh b/proto/gen.sh index f4501b5e6..5a4ed5ede 100755 --- a/proto/gen.sh +++ b/proto/gen.sh @@ -29,7 +29,13 @@ done cd $SCRIPT_DIR mkdir -p ./proto/pb rm -rf $TARGET_DIR/* -docker run -v $PWD:/workspace --workdir /workspace tendermintdev/docker-build-proto sh ./proto/protoc.sh + +protoVer=v0.7 +protoImageName=tendermintdev/sdk-proto-gen:$protoVer +containerProtoGen=cosmos-sdk-proto-gen-$protoVer +containerProtoFmt=cosmos-sdk-proto-fmt-$protoVer + +docker run -v $PWD:/workspace --workdir /workspace $protoImageName sh ./proto/protoc.sh # Copy the generated files to the target directories for TARGET_DIR in $TARGETS; do diff --git a/proto/types/interchain_da/da.proto b/proto/types/interchain_da/da.proto index a41f5b35b..c235064bb 100644 --- a/proto/types/interchain_da/da.proto +++ b/proto/types/interchain_da/da.proto @@ -6,6 +6,7 @@ package dymension.interchain_da; import "gogoproto/gogo.proto"; import "types/cosmos/base/v1beta1/coin.proto"; +import "types/tendermint/crypto/proof.proto"; option go_package = "github.com/dymensionxyz/dymint/types/pb/interchain_da"; @@ -16,7 +17,10 @@ message Params { cosmos.base.v1beta1.Coin cost_per_byte = 1 [ (gogoproto.nullable) = false ]; // MaxBlobSize is the hard cap of how many bytes a blob can be. uint32 max_blob_size = 2; - // DisputePeriod is the number of blocks the blob is stored for. + // DisputePeriod is the number of blocks the blob is stored for. In the + // current implementation, the dispute period equals the store time. Meaning, + // a dispute can't be submitted after the dispute period is over because both + // the blob and the metadata are pruned. uint64 dispute_period = 3; } @@ -25,3 +29,17 @@ message BlobMetadata { // BlobHash is the hash of the submitted blob. string blob_hash = 1; } + +// Commitment defines the commitment type used by the InterchainDALayer. +message Commitment { + // ClientID identifies the client_id of the DA chain where the blob was posted. + string client_id = 1; + // BlobHeight identifies the height at which the blob was posted. + uint64 blob_height = 2; + // BlobHash is the hash of the submitted blob. + string blob_hash = 3; + // BlobID is the unique ID of the blob. + uint64 blob_id = 4; + // MerkleProof is a merkle inclusion proof of the blob. + tendermint.crypto.ProofOps merkle_proof = 5; +} diff --git a/types/pb/dalc/dalc.pb.go b/types/pb/dalc/dalc.pb.go index d1ba2a1cf..29fc9377d 100644 --- a/types/pb/dalc/dalc.pb.go +++ b/types/pb/dalc/dalc.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" dymint "github.com/dymensionxyz/dymint/types/pb/dymint" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -466,10 +467,10 @@ type DALCServiceClient interface { } type dALCServiceClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewDALCServiceClient(cc *grpc.ClientConn) DALCServiceClient { +func NewDALCServiceClient(cc grpc1.ClientConn) DALCServiceClient { return &dALCServiceClient{cc} } @@ -521,7 +522,7 @@ func (*UnimplementedDALCServiceServer) RetrieveBatches(ctx context.Context, req return nil, status.Errorf(codes.Unimplemented, "method RetrieveBatches not implemented") } -func RegisterDALCServiceServer(s *grpc.Server, srv DALCServiceServer) { +func RegisterDALCServiceServer(s grpc1.Server, srv DALCServiceServer) { s.RegisterService(&_DALCService_serviceDesc, srv) } diff --git a/types/pb/interchain_da/da.pb.go b/types/pb/interchain_da/da.pb.go index 0f7829bca..0efb3d577 100644 --- a/types/pb/interchain_da/da.pb.go +++ b/types/pb/interchain_da/da.pb.go @@ -8,6 +8,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + crypto "github.com/tendermint/tendermint/proto/tendermint/crypto" io "io" math "math" math_bits "math/bits" @@ -31,7 +32,10 @@ type Params struct { CostPerByte types.Coin `protobuf:"bytes,1,opt,name=cost_per_byte,json=costPerByte,proto3" json:"cost_per_byte"` // MaxBlobSize is the hard cap of how many bytes a blob can be. MaxBlobSize uint32 `protobuf:"varint,2,opt,name=max_blob_size,json=maxBlobSize,proto3" json:"max_blob_size,omitempty"` - // DisputePeriod is the number of blocks the blob is stored for. + // DisputePeriod is the number of blocks the blob is stored for. In the + // current implementation, the dispute period equals the store time. Meaning, + // a dispute can't be submitted after the dispute period is over because both + // the blob and the metadata are pruned. DisputePeriod uint64 `protobuf:"varint,3,opt,name=dispute_period,json=disputePeriod,proto3" json:"dispute_period,omitempty"` } @@ -135,36 +139,126 @@ func (m *BlobMetadata) GetBlobHash() string { return "" } +// Commitment defines the commitment type used by the InterchainDALayer. +type Commitment struct { + // ClientID identifies the client_id of the DA chain where the blob was posted. + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + // BlobHeight identifies the height at which the blob was posted. + BlobHeight uint64 `protobuf:"varint,2,opt,name=blob_height,json=blobHeight,proto3" json:"blob_height,omitempty"` + // BlobHash is the hash of the submitted blob. + BlobHash string `protobuf:"bytes,3,opt,name=blob_hash,json=blobHash,proto3" json:"blob_hash,omitempty"` + // BlobID is the unique ID of the blob. + BlobId uint64 `protobuf:"varint,4,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` + // MerkleProof is a merkle inclusion proof of the blob. + MerkleProof *crypto.ProofOps `protobuf:"bytes,5,opt,name=merkle_proof,json=merkleProof,proto3" json:"merkle_proof,omitempty"` +} + +func (m *Commitment) Reset() { *m = Commitment{} } +func (m *Commitment) String() string { return proto.CompactTextString(m) } +func (*Commitment) ProtoMessage() {} +func (*Commitment) Descriptor() ([]byte, []int) { + return fileDescriptor_c9a26af1837c1a56, []int{2} +} +func (m *Commitment) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Commitment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Commitment.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 *Commitment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Commitment.Merge(m, src) +} +func (m *Commitment) XXX_Size() int { + return m.Size() +} +func (m *Commitment) XXX_DiscardUnknown() { + xxx_messageInfo_Commitment.DiscardUnknown(m) +} + +var xxx_messageInfo_Commitment proto.InternalMessageInfo + +func (m *Commitment) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *Commitment) GetBlobHeight() uint64 { + if m != nil { + return m.BlobHeight + } + return 0 +} + +func (m *Commitment) GetBlobHash() string { + if m != nil { + return m.BlobHash + } + return "" +} + +func (m *Commitment) GetBlobId() uint64 { + if m != nil { + return m.BlobId + } + return 0 +} + +func (m *Commitment) GetMerkleProof() *crypto.ProofOps { + if m != nil { + return m.MerkleProof + } + return nil +} + func init() { proto.RegisterType((*Params)(nil), "dymension.interchain_da.Params") proto.RegisterType((*BlobMetadata)(nil), "dymension.interchain_da.BlobMetadata") + proto.RegisterType((*Commitment)(nil), "dymension.interchain_da.Commitment") } func init() { proto.RegisterFile("types/interchain_da/da.proto", fileDescriptor_c9a26af1837c1a56) } var fileDescriptor_c9a26af1837c1a56 = []byte{ - // 325 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0xc3, 0x30, - 0x1c, 0xc6, 0x1b, 0x1d, 0xc3, 0x75, 0xd6, 0x43, 0x11, 0x9c, 0x53, 0xea, 0x18, 0x0a, 0x03, 0x21, - 0x61, 0x8a, 0x2f, 0xd0, 0x5d,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8c, 0xb0, 0x6f, 0x49, 0x4c, - 0x7b, 0xc7, 0x03, 0x32, 0x6a, 0x45, 0xde, 0x3e, 0x9d, 0xd6, 0xe1, 0xf0, 0xde, 0x3d, 0xb5, 0x93, - 0x17, 0x61, 0x20, 0x05, 0x03, 0xfe, 0x95, 0xdb, 0xa9, 0xb1, 0x19, 0xe8, 0xac, 0xfe, 0x5b, 0x27, - 0x3a, 0xb1, 0xc1, 0x33, 0xe8, 0x2c, 0x7c, 0x5d, 0x6f, 0x03, 0xb2, 0xd9, 0x06, 0xe4, 0x77, 0x1b, - 0x90, 0xcf, 0x5d, 0xe0, 0x6c, 0x76, 0x81, 0xf3, 0xbd, 0x0b, 0x9c, 0xf7, 0xa7, 0x99, 0x34, 0xd9, - 0x82, 0xd3, 0x04, 0x73, 0xf6, 0x6f, 0x70, 0x59, 0xad, 0xec, 0x45, 0x2a, 0xc3, 0x1a, 0x4d, 0x05, - 0x3f, 0xd4, 0xce, 0xdb, 0xb5, 0x9f, 0xc7, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x87, 0xa2, 0x93, - 0xfe, 0x94, 0x01, 0x00, 0x00, + // 443 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xc1, 0x6e, 0x13, 0x31, + 0x10, 0x86, 0xb3, 0x34, 0x04, 0xea, 0x34, 0x1c, 0x56, 0x48, 0x5d, 0x5a, 0xb4, 0x8d, 0x02, 0x48, + 0x91, 0x90, 0xbc, 0x2a, 0x88, 0x2b, 0x87, 0xe4, 0x42, 0x0f, 0xa8, 0xd1, 0x72, 0xe3, 0xb2, 0xf2, + 0xae, 0x87, 0xac, 0x45, 0xec, 0x59, 0xad, 0xa7, 0x28, 0x9b, 0xa7, 0xe0, 0xc8, 0xe3, 0x70, 0xec, + 0xb1, 0x47, 0x4e, 0x08, 0x25, 0x2f, 0x82, 0x6c, 0x07, 0xaa, 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x37, 0x27, 0x7c, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -240,6 +334,65 @@ func (m *BlobMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Commitment) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Commitment) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Commitment) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MerkleProof != nil { + { + size, err := m.MerkleProof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDa(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.BlobId != 0 { + i = encodeVarintDa(dAtA, i, uint64(m.BlobId)) + i-- + dAtA[i] = 0x20 + } + if len(m.BlobHash) > 0 { + i -= len(m.BlobHash) + copy(dAtA[i:], m.BlobHash) + i = encodeVarintDa(dAtA, i, uint64(len(m.BlobHash))) + i-- + dAtA[i] = 0x1a + } + if m.BlobHeight != 0 { + i = encodeVarintDa(dAtA, i, uint64(m.BlobHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintDa(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintDa(dAtA []byte, offset int, v uint64) int { offset -= sovDa(v) base := offset @@ -281,6 +434,33 @@ func (m *BlobMetadata) Size() (n int) { return n } +func (m *Commitment) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovDa(uint64(l)) + } + if m.BlobHeight != 0 { + n += 1 + sovDa(uint64(m.BlobHeight)) + } + l = len(m.BlobHash) + if l > 0 { + n += 1 + l + sovDa(uint64(l)) + } + if m.BlobId != 0 { + n += 1 + sovDa(uint64(m.BlobId)) + } + if m.MerkleProof != nil { + l = m.MerkleProof.Size() + n += 1 + l + sovDa(uint64(l)) + } + return n +} + func sovDa(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -490,6 +670,194 @@ func (m *BlobMetadata) Unmarshal(dAtA []byte) error { } return nil } +func (m *Commitment) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Commitment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Commitment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDa + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDa + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobHeight", wireType) + } + m.BlobHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlobHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDa + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDa + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlobHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobId", wireType) + } + m.BlobId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlobId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MerkleProof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDa + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDa + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MerkleProof == nil { + m.MerkleProof = &crypto.ProofOps{} + } + if err := m.MerkleProof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDa(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDa + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipDa(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/pb/interchain_da/query.pb.go b/types/pb/interchain_da/query.pb.go index f53fb5aab..31587ee8a 100644 --- a/types/pb/interchain_da/query.pb.go +++ b/types/pb/interchain_da/query.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -266,10 +267,10 @@ type QueryClient interface { } type queryClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewQueryClient(cc *grpc.ClientConn) QueryClient { +func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } @@ -310,7 +311,7 @@ func (*UnimplementedQueryServer) Blob(ctx context.Context, req *QueryBlobRequest return nil, status.Errorf(codes.Unimplemented, "method Blob not implemented") } -func RegisterQueryServer(s *grpc.Server, srv QueryServer) { +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) }