From aa12b7718feb959197f1002377a5467a15f49e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Wed, 18 Sep 2024 16:43:42 +0200 Subject: [PATCH] refactor: use google.protobuf.Timestamp instead of int64 Replaced the int64 timestamp with google.protobuf.Timestamp in the GetIdsResponse message. Adjusted the generated code to handle the new timestamp type and updated the protobuf imports accordingly. --- proto/da/da.proto | 4 +- proxy/grpc/client.go | 8 ++- proxy/grpc/server.go | 7 ++- types/pb/da/da.pb.go | 141 ++++++++++++++++++++++++++----------------- 4 files changed, 100 insertions(+), 60 deletions(-) diff --git a/proto/da/da.proto b/proto/da/da.proto index 87fc805..de3ab40 100644 --- a/proto/da/da.proto +++ b/proto/da/da.proto @@ -1,6 +1,8 @@ syntax = "proto3"; package da; +import "google/protobuf/timestamp.proto"; + // DAService is the protobuf service definition for interaction with Data Availability layers. service DAService { // MaxBlobSize returns the maximum blob size @@ -79,7 +81,7 @@ message GetIdsRequest { // GetIdsResponse is the response type for the GetIds rpc method. message GetIdsResponse { repeated ID ids = 1; - int64 timestamp = 2; + google.protobuf.Timestamp timestamp = 2; } // GetProofsRequest is the request type for the GetProofs rpc method. diff --git a/proxy/grpc/client.go b/proxy/grpc/client.go index 1df9547..3babea8 100644 --- a/proxy/grpc/client.go +++ b/proxy/grpc/client.go @@ -2,8 +2,8 @@ package grpc import ( "context" - "time" + "github.com/cosmos/gogoproto/types" "google.golang.org/grpc" "github.com/rollkit/go-da" @@ -73,7 +73,11 @@ func (c *Client) GetIDs(ctx context.Context, height uint64, namespace da.Namespa return nil, err } - return &da.GetIDsResult{IDs: idsPB2DA(resp.Ids), Timestamp: time.UnixMicro(resp.Timestamp)}, nil + timestamp, err := types.TimestampFromProto(resp.Timestamp) + if err != nil { + return nil, err + } + return &da.GetIDsResult{IDs: idsPB2DA(resp.Ids), Timestamp: timestamp}, nil } // GetProofs returns inclusion Proofs for all Blobs located in DA at given height. diff --git a/proxy/grpc/server.go b/proxy/grpc/server.go index 26ba73a..d77b82c 100644 --- a/proxy/grpc/server.go +++ b/proxy/grpc/server.go @@ -3,6 +3,7 @@ package grpc import ( "context" + "github.com/cosmos/gogoproto/types" "google.golang.org/grpc" "github.com/rollkit/go-da" @@ -43,7 +44,11 @@ func (p *proxySrv) GetIds(ctx context.Context, request *pbda.GetIdsRequest) (*pb return nil, err } - return &pbda.GetIdsResponse{Ids: idsDA2PB(ret.IDs), Timestamp: ret.Timestamp.UnixMicro()}, nil + timestamp, err := types.TimestampProto(ret.Timestamp) + if err != nil { + return nil, err + } + return &pbda.GetIdsResponse{Ids: idsDA2PB(ret.IDs), Timestamp: timestamp}, nil } func (p *proxySrv) Commit(ctx context.Context, request *pbda.CommitRequest) (*pbda.CommitResponse, error) { diff --git a/types/pb/da/da.pb.go b/types/pb/da/da.pb.go index baaaf1d..bc60ad5 100644 --- a/types/pb/da/da.pb.go +++ b/types/pb/da/da.pb.go @@ -7,7 +7,9 @@ import ( context "context" encoding_binary "encoding/binary" fmt "fmt" - proto "github.com/gogo/protobuf/proto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + types "github.com/cosmos/gogoproto/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -487,8 +489,8 @@ func (m *GetIdsRequest) GetNamespace() *Namespace { // GetIdsResponse is the response type for the GetIds rpc method. type GetIdsResponse struct { - Ids []*ID `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Ids []*ID `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + Timestamp *types.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } func (m *GetIdsResponse) Reset() { *m = GetIdsResponse{} } @@ -531,11 +533,11 @@ func (m *GetIdsResponse) GetIds() []*ID { return nil } -func (m *GetIdsResponse) GetTimestamp() int64 { +func (m *GetIdsResponse) GetTimestamp() *types.Timestamp { if m != nil { return m.Timestamp } - return 0 + return nil } // GetProofsRequest is the request type for the GetProofs rpc method. @@ -979,46 +981,48 @@ func init() { func init() { proto.RegisterFile("da/da.proto", fileDescriptor_feb508392bc12c0f) } var fileDescriptor_feb508392bc12c0f = []byte{ - // 617 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4d, 0x6f, 0xd3, 0x4c, - 0x10, 0x8e, 0xe3, 0x36, 0x8d, 0xc7, 0x6f, 0xd2, 0x76, 0x9b, 0xb7, 0x58, 0xa6, 0x58, 0xed, 0x9e, - 0x22, 0x3e, 0x0a, 0x14, 0x09, 0x04, 0x27, 0x28, 0x95, 0x42, 0x0f, 0xa0, 0xca, 0x41, 0x48, 0x48, - 0x48, 0xd1, 0xa6, 0x5e, 0x52, 0x4b, 0x71, 0x6c, 0xb2, 0x9b, 0xaa, 0x2a, 0x67, 0xee, 0x48, 0xfc, - 0x29, 0x8e, 0x3d, 0x72, 0x44, 0xc9, 0x1f, 0x41, 0xeb, 0xdd, 0xb5, 0xe3, 0x56, 0x26, 0x8a, 0xc4, - 0x71, 0xbe, 0x9e, 0x79, 0x3c, 0xf3, 0xcc, 0x1a, 0xec, 0x80, 0x3c, 0x0c, 0xc8, 0x7e, 0x32, 0x8e, - 0x79, 0x8c, 0xaa, 0x01, 0xc1, 0x7b, 0x60, 0xbd, 0x23, 0x11, 0x65, 0x09, 0x39, 0xa5, 0xa8, 0x05, - 0xab, 0xe7, 0x64, 0x38, 0xa1, 0x8e, 0xb1, 0x6b, 0xb4, 0xff, 0xf3, 0xa5, 0x81, 0x77, 0x60, 0xe5, - 0x70, 0x18, 0xf7, 0x4b, 0xa2, 0x2e, 0x54, 0x8f, 0x8f, 0x4a, 0x62, 0x18, 0xe0, 0x75, 0x1c, 0x45, - 0x21, 0x8f, 0xe8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, 0x9b, 0x2a, - 0x98, 0xdf, 0xb1, 0x8b, 0xe6, 0x5d, 0x59, 0xc9, 0x0b, 0xb0, 0x32, 0xcd, 0xa3, 0x96, 0x4a, 0x29, - 0x5c, 0x97, 0xfb, 0xff, 0x35, 0xef, 0x7c, 0x3b, 0x29, 0x38, 0xd9, 0xae, 0x70, 0x03, 0xb2, 0x5d, - 0x51, 0xb8, 0xb2, 0x44, 0xae, 0x5c, 0x96, 0x14, 0x34, 0x29, 0x4b, 0x8a, 0x8a, 0xc0, 0x15, 0xf4, - 0x0c, 0xea, 0x7a, 0xf8, 0x68, 0x4b, 0x64, 0x5c, 0xd3, 0x81, 0xdb, 0x2a, 0x3a, 0x75, 0xe1, 0xa1, - 0xf3, 0x73, 0xea, 0x19, 0x57, 0x53, 0xcf, 0xf8, 0x3d, 0xf5, 0x8c, 0xef, 0x33, 0xaf, 0x72, 0x35, - 0xf3, 0x2a, 0xbf, 0x66, 0x5e, 0xa5, 0x5f, 0x4b, 0xff, 0x31, 0x4f, 0xfe, 0x04, 0x00, 0x00, 0xff, - 0xff, 0x4e, 0x5c, 0x6b, 0xa9, 0x72, 0x06, 0x00, 0x00, + // 641 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x4f, 0x13, 0x41, + 0x14, 0xef, 0xb6, 0x50, 0xba, 0x6f, 0x6d, 0x81, 0xa1, 0xe2, 0x66, 0xd5, 0x15, 0xe6, 0xd4, 0xf8, + 0x51, 0x14, 0x13, 0xbf, 0x4e, 0x8a, 0x24, 0x0d, 0x07, 0x0d, 0xd9, 0x12, 0x13, 0x13, 0x13, 0x32, + 0x65, 0x87, 0xb2, 0x49, 0xb7, 0xb3, 0x76, 0xa6, 0x84, 0xe0, 0xd9, 0xbb, 0x89, 0xff, 0x94, 0x47, + 0x8e, 0x1e, 0x0d, 0xfc, 0x23, 0x66, 0x76, 0x66, 0x76, 0xbb, 0x90, 0xda, 0x34, 0xf1, 0xf8, 0xbe, + 0x7e, 0xef, 0x37, 0xef, 0xfd, 0xde, 0x80, 0x13, 0x92, 0xad, 0x90, 0xb4, 0x93, 0x11, 0x13, 0x0c, + 0x95, 0x43, 0xe2, 0x3d, 0xe8, 0x33, 0xd6, 0x1f, 0xd0, 0xad, 0xd4, 0xd3, 0x1b, 0x1f, 0x6f, 0x89, + 0x28, 0xa6, 0x5c, 0x90, 0x38, 0x51, 0x49, 0x78, 0x13, 0xec, 0x8f, 0x24, 0xa6, 0x3c, 0x21, 0x47, + 0x14, 0x35, 0x61, 0xf1, 0x94, 0x0c, 0xc6, 0xd4, 0xb5, 0x36, 0xac, 0xd6, 0xad, 0x40, 0x19, 0xf8, + 0x1e, 0x2c, 0xec, 0x0c, 0x58, 0x6f, 0x4a, 0xd4, 0x83, 0xf2, 0xde, 0xee, 0x94, 0x18, 0x06, 0x78, + 0xcf, 0xe2, 0x38, 0x12, 0x31, 0x1d, 0x8a, 0x29, 0x39, 0xf7, 0x61, 0x71, 0x7f, 0xc4, 0xd8, 0xf1, + 0x94, 0x70, 0x13, 0xd0, 0x07, 0x72, 0x26, 0xfb, 0x77, 0xa3, 0x73, 0x1a, 0xd0, 0xaf, 0x63, 0xca, + 0x05, 0x7e, 0x0d, 0x6b, 0x05, 0x2f, 0x4f, 0xd8, 0x90, 0x53, 0x84, 0xa1, 0x1e, 0x93, 0xb3, 0xc3, + 0xde, 0x80, 0xf5, 0x0e, 0x79, 0x74, 0xae, 0xa0, 0x16, 0x02, 0x27, 0xce, 0x73, 0x71, 0x17, 0xa0, + 0x43, 0x85, 0x06, 0x42, 0x2e, 0x54, 0xa2, 0x90, 0xbb, 0xd6, 0x46, 0xa5, 0xe5, 0x6c, 0x57, 0xdb, + 0x21, 0x69, 0xef, 0xed, 0x06, 0xd2, 0x85, 0x1e, 0x81, 0x3d, 0x34, 0x83, 0x71, 0xcb, 0x1b, 0x56, + 0xcb, 0xd9, 0xae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, 0x97, 0x7a, 0xd5, + 0xf4, 0x8b, 0x79, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x5c, 0x10, 0x6e, 0xaf, 0x06, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1050,10 +1054,10 @@ type DAServiceClient interface { } type dAServiceClient struct { - cc *grpc.ClientConn + cc grpc1.ClientConn } -func NewDAServiceClient(cc *grpc.ClientConn) DAServiceClient { +func NewDAServiceClient(cc grpc1.ClientConn) DAServiceClient { return &dAServiceClient{cc} } @@ -1164,7 +1168,7 @@ func (*UnimplementedDAServiceServer) Validate(ctx context.Context, req *Validate return nil, status.Errorf(codes.Unimplemented, "method Validate not implemented") } -func RegisterDAServiceServer(s *grpc.Server, srv DAServiceServer) { +func RegisterDAServiceServer(s grpc1.Server, srv DAServiceServer) { s.RegisterService(&_DAService_serviceDesc, srv) } @@ -1678,10 +1682,17 @@ func (m *GetIdsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Timestamp != 0 { - i = encodeVarintDa(dAtA, i, uint64(m.Timestamp)) + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDa(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } if len(m.Ids) > 0 { for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { @@ -2229,8 +2240,9 @@ func (m *GetIdsResponse) Size() (n int) { n += 1 + l + sovDa(uint64(l)) } } - if m.Timestamp != 0 { - n += 1 + sovDa(uint64(m.Timestamp)) + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovDa(uint64(l)) } return n } @@ -3299,10 +3311,10 @@ func (m *GetIdsResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } - m.Timestamp = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowDa @@ -3312,11 +3324,28 @@ func (m *GetIdsResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift + 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.Timestamp == nil { + m.Timestamp = &types.Timestamp{} + } + if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDa(dAtA[iNdEx:])