diff --git a/da/celestia/celestia.go b/da/celestia/celestia.go index 210a5af67de..1d60d348a71 100644 --- a/da/celestia/celestia.go +++ b/da/celestia/celestia.go @@ -130,53 +130,6 @@ func (c *DataAvailabilityLayerClient) SubmitBlock(ctx context.Context, block *ty } } -// CheckBlockAvailability queries DA layer to check data availability of block at given height. -func (c *DataAvailabilityLayerClient) CheckBlockAvailability(ctx context.Context, dataLayerHeight uint64) da.ResultCheckBlock { - header, err := c.rpc.Header.GetByHeight(ctx, dataLayerHeight) - if err != nil { - return da.ResultCheckBlock{ - BaseResult: da.BaseResult{ - Code: da.StatusError, - Message: err.Error(), - }, - } - } - if header.DAH == nil { - return da.ResultCheckBlock{ - BaseResult: da.BaseResult{ - Code: da.StatusSuccess, - DAHeight: dataLayerHeight, - }, - DataAvailable: false, - } - } - err = c.rpc.Share.SharesAvailable(ctx, header.DAH) - if err != nil { - if strings.Contains(err.Error(), share.ErrNotAvailable.Error()) { - return da.ResultCheckBlock{ - BaseResult: da.BaseResult{ - Code: da.StatusSuccess, - DAHeight: dataLayerHeight, - }, - DataAvailable: false, - } - } - return da.ResultCheckBlock{ - BaseResult: da.BaseResult{ - Code: da.StatusError, - Message: err.Error(), - }, - } - } - return da.ResultCheckBlock{ - BaseResult: da.BaseResult{ - Code: da.StatusSuccess, - DAHeight: dataLayerHeight, - }, - DataAvailable: true, - } -} - // RetrieveBlocks gets a batch of blocks from DA layer. func (c *DataAvailabilityLayerClient) RetrieveBlocks(ctx context.Context, dataLayerHeight uint64) da.ResultRetrieveBlocks { c.logger.Debug("trying to retrieve blob using Blob.GetAll", "daHeight", dataLayerHeight, "namespace", hex.EncodeToString(c.namespace.Bytes())) diff --git a/da/da.go b/da/da.go index d71d8adce17..0b391a0c777 100644 --- a/da/da.go +++ b/da/da.go @@ -83,9 +83,6 @@ type DataAvailabilityLayerClient interface { // This should create a transaction which (potentially) // triggers a state transition in the DA layer. SubmitBlock(ctx context.Context, block *types.Block) ResultSubmitBlock - - // CheckBlockAvailability queries DA layer to check data availability of block corresponding at given height. - CheckBlockAvailability(ctx context.Context, dataLayerHeight uint64) ResultCheckBlock } // BlockRetriever is additional interface that can be implemented by Data Availability Layer Client that is able to retrieve diff --git a/da/grpc/grpc.go b/da/grpc/grpc.go index 73194fac1fb..492cd51be20 100644 --- a/da/grpc/grpc.go +++ b/da/grpc/grpc.go @@ -97,18 +97,6 @@ func (d *DataAvailabilityLayerClient) SubmitBlock(ctx context.Context, block *ty } } -// CheckBlockAvailability proxies CheckBlockAvailability request to gRPC server. -func (d *DataAvailabilityLayerClient) CheckBlockAvailability(ctx context.Context, daHeight uint64) da.ResultCheckBlock { - resp, err := d.client.CheckBlockAvailability(ctx, &dalc.CheckBlockAvailabilityRequest{DAHeight: daHeight}) - if err != nil { - return da.ResultCheckBlock{BaseResult: da.BaseResult{Code: da.StatusError, Message: err.Error()}} - } - return da.ResultCheckBlock{ - BaseResult: da.BaseResult{Code: da.StatusCode(resp.Result.Code), Message: resp.Result.Message}, - DataAvailable: resp.DataAvailable, - } -} - // RetrieveBlocks proxies RetrieveBlocks request to gRPC server. func (d *DataAvailabilityLayerClient) RetrieveBlocks(ctx context.Context, daHeight uint64) da.ResultRetrieveBlocks { resp, err := d.client.RetrieveBlocks(ctx, &dalc.RetrieveBlocksRequest{DAHeight: daHeight}) diff --git a/da/grpc/mockserv/mockserv.go b/da/grpc/mockserv/mockserv.go index c50bf95296f..d44a6d8dc71 100644 --- a/da/grpc/mockserv/mockserv.go +++ b/da/grpc/mockserv/mockserv.go @@ -52,17 +52,6 @@ func (m *mockImpl) SubmitBlock(ctx context.Context, request *dalc.SubmitBlockReq }, nil } -func (m *mockImpl) CheckBlockAvailability(ctx context.Context, request *dalc.CheckBlockAvailabilityRequest) (*dalc.CheckBlockAvailabilityResponse, error) { - resp := m.mock.CheckBlockAvailability(ctx, request.DAHeight) - return &dalc.CheckBlockAvailabilityResponse{ - Result: &dalc.DAResponse{ - Code: dalc.StatusCode(resp.Code), - Message: resp.Message, - }, - DataAvailable: resp.DataAvailable, - }, nil -} - func (m *mockImpl) RetrieveBlocks(ctx context.Context, request *dalc.RetrieveBlocksRequest) (*dalc.RetrieveBlocksResponse, error) { resp := m.mock.RetrieveBlocks(ctx, request.DAHeight) blocks := make([]*rollkit.Block, len(resp.Blocks)) diff --git a/da/mock/mock.go b/da/mock/mock.go index 5760ea25745..bed52d7e5bf 100644 --- a/da/mock/mock.go +++ b/da/mock/mock.go @@ -164,12 +164,6 @@ func (m *DataAvailabilityLayerClient) SubmitBlock(ctx context.Context, block *ty } } -// CheckBlockAvailability queries DA layer to check data availability of block corresponding to given header. -func (m *DataAvailabilityLayerClient) CheckBlockAvailability(ctx context.Context, daHeight uint64) da.ResultCheckBlock { - blocksRes := m.RetrieveBlocks(ctx, daHeight) - return da.ResultCheckBlock{BaseResult: da.BaseResult{Code: blocksRes.Code}, DataAvailable: len(blocksRes.Blocks) > 0} -} - // RetrieveBlocks returns block at given height from data availability layer. func (m *DataAvailabilityLayerClient) RetrieveBlocks(ctx context.Context, daHeight uint64) da.ResultRetrieveBlocks { if daHeight >= atomic.LoadUint64(&m.daHeight) { diff --git a/da/test/da_test.go b/da/test/da_test.go index c5ec3a61dc6..8fea4f811de 100644 --- a/da/test/da_test.go +++ b/da/test/da_test.go @@ -79,70 +79,6 @@ func doTestLifecycle(t *testing.T, dalc da.DataAvailabilityLayerClient) { }() } -func TestDALC(t *testing.T) { - for _, dalc := range registry.RegisteredClients() { - t.Run(dalc, func(t *testing.T) { - doTestDALC(t, registry.GetClient(dalc)) - }) - } -} - -func doTestDALC(t *testing.T, dalc da.DataAvailabilityLayerClient) { - require := require.New(t) - assert := assert.New(t) - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - // mock DALC will advance block height every 100ms - conf := []byte{} - if _, ok := dalc.(*mock.DataAvailabilityLayerClient); ok { - conf = []byte(mockDaBlockTime.String()) - } - if _, ok := dalc.(*celestia.DataAvailabilityLayerClient); ok { - conf, _ = json.Marshal(testConfig) - } - kvStore, _ := store.NewDefaultInMemoryKVStore() - err := dalc.Init(testNamespaceID, conf, kvStore, test.NewLogger(t)) - require.NoError(err) - - err = dalc.Start() - require.NoError(err) - defer func() { - require.NoError(dalc.Stop()) - }() - - // wait a bit more than mockDaBlockTime, so mock can "produce" some blocks - time.Sleep(mockDaBlockTime + 20*time.Millisecond) - - // only blocks b1 and b2 will be submitted to DA - b1 := getRandomBlock(1, 10) - b2 := getRandomBlock(2, 10) - - resp := dalc.SubmitBlock(ctx, b1) - h1 := resp.DAHeight - assert.Equal(da.StatusSuccess, resp.Code) - - resp = dalc.SubmitBlock(ctx, b2) - h2 := resp.DAHeight - assert.Equal(da.StatusSuccess, resp.Code) - - // wait a bit more than mockDaBlockTime, so Rollkit blocks can be "included" in mock block - time.Sleep(mockDaBlockTime + 20*time.Millisecond) - - check := dalc.CheckBlockAvailability(ctx, h1) - assert.Equal(da.StatusSuccess, check.Code) - assert.True(check.DataAvailable) - - check = dalc.CheckBlockAvailability(ctx, h2) - assert.Equal(da.StatusSuccess, check.Code) - assert.True(check.DataAvailable) - - // this height should not be used by DALC - check = dalc.CheckBlockAvailability(ctx, h1-1) - assert.Equal(da.StatusSuccess, check.Code) - assert.False(check.DataAvailable) -} - func TestRetrieve(t *testing.T) { for _, client := range registry.RegisteredClients() { t.Run(client, func(t *testing.T) { diff --git a/proto/dalc/dalc.proto b/proto/dalc/dalc.proto index 5ca934f2220..d0a160a13d2 100644 --- a/proto/dalc/dalc.proto +++ b/proto/dalc/dalc.proto @@ -26,15 +26,6 @@ message SubmitBlockResponse { DAResponse result = 1; } -message CheckBlockAvailabilityRequest { - uint64 da_height = 1 [(gogoproto.customname) = "DAHeight"]; -} - -message CheckBlockAvailabilityResponse { - DAResponse result = 1; - bool data_available = 2; -} - message RetrieveBlocksRequest { uint64 da_height = 1 [(gogoproto.customname) = "DAHeight"]; } @@ -46,6 +37,5 @@ message RetrieveBlocksResponse { service DALCService { rpc SubmitBlock(SubmitBlockRequest) returns (SubmitBlockResponse) {} - rpc CheckBlockAvailability(CheckBlockAvailabilityRequest) returns (CheckBlockAvailabilityResponse) {} rpc RetrieveBlocks(RetrieveBlocksRequest) returns (RetrieveBlocksResponse) {} } diff --git a/types/pb/dalc/dalc.pb.go b/types/pb/dalc/dalc.pb.go index 3d0eff9dafc..33fd5f0ab72 100644 --- a/types/pb/dalc/dalc.pb.go +++ b/types/pb/dalc/dalc.pb.go @@ -207,102 +207,6 @@ func (m *SubmitBlockResponse) GetResult() *DAResponse { return nil } -type CheckBlockAvailabilityRequest struct { - DAHeight uint64 `protobuf:"varint,1,opt,name=da_height,json=daHeight,proto3" json:"da_height,omitempty"` -} - -func (m *CheckBlockAvailabilityRequest) Reset() { *m = CheckBlockAvailabilityRequest{} } -func (m *CheckBlockAvailabilityRequest) String() string { return proto.CompactTextString(m) } -func (*CheckBlockAvailabilityRequest) ProtoMessage() {} -func (*CheckBlockAvailabilityRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_45d7d8eda2693dc1, []int{3} -} -func (m *CheckBlockAvailabilityRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CheckBlockAvailabilityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CheckBlockAvailabilityRequest.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 *CheckBlockAvailabilityRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckBlockAvailabilityRequest.Merge(m, src) -} -func (m *CheckBlockAvailabilityRequest) XXX_Size() int { - return m.Size() -} -func (m *CheckBlockAvailabilityRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CheckBlockAvailabilityRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckBlockAvailabilityRequest proto.InternalMessageInfo - -func (m *CheckBlockAvailabilityRequest) GetDAHeight() uint64 { - if m != nil { - return m.DAHeight - } - return 0 -} - -type CheckBlockAvailabilityResponse struct { - Result *DAResponse `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` - DataAvailable bool `protobuf:"varint,2,opt,name=data_available,json=dataAvailable,proto3" json:"data_available,omitempty"` -} - -func (m *CheckBlockAvailabilityResponse) Reset() { *m = CheckBlockAvailabilityResponse{} } -func (m *CheckBlockAvailabilityResponse) String() string { return proto.CompactTextString(m) } -func (*CheckBlockAvailabilityResponse) ProtoMessage() {} -func (*CheckBlockAvailabilityResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_45d7d8eda2693dc1, []int{4} -} -func (m *CheckBlockAvailabilityResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CheckBlockAvailabilityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CheckBlockAvailabilityResponse.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 *CheckBlockAvailabilityResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckBlockAvailabilityResponse.Merge(m, src) -} -func (m *CheckBlockAvailabilityResponse) XXX_Size() int { - return m.Size() -} -func (m *CheckBlockAvailabilityResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CheckBlockAvailabilityResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckBlockAvailabilityResponse proto.InternalMessageInfo - -func (m *CheckBlockAvailabilityResponse) GetResult() *DAResponse { - if m != nil { - return m.Result - } - return nil -} - -func (m *CheckBlockAvailabilityResponse) GetDataAvailable() bool { - if m != nil { - return m.DataAvailable - } - return false -} - type RetrieveBlocksRequest struct { DAHeight uint64 `protobuf:"varint,1,opt,name=da_height,json=daHeight,proto3" json:"da_height,omitempty"` } @@ -311,7 +215,7 @@ func (m *RetrieveBlocksRequest) Reset() { *m = RetrieveBlocksRequest{} } func (m *RetrieveBlocksRequest) String() string { return proto.CompactTextString(m) } func (*RetrieveBlocksRequest) ProtoMessage() {} func (*RetrieveBlocksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_45d7d8eda2693dc1, []int{5} + return fileDescriptor_45d7d8eda2693dc1, []int{3} } func (m *RetrieveBlocksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -356,7 +260,7 @@ func (m *RetrieveBlocksResponse) Reset() { *m = RetrieveBlocksResponse{} func (m *RetrieveBlocksResponse) String() string { return proto.CompactTextString(m) } func (*RetrieveBlocksResponse) ProtoMessage() {} func (*RetrieveBlocksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_45d7d8eda2693dc1, []int{6} + return fileDescriptor_45d7d8eda2693dc1, []int{4} } func (m *RetrieveBlocksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -404,8 +308,6 @@ func init() { proto.RegisterType((*DAResponse)(nil), "dalc.DAResponse") proto.RegisterType((*SubmitBlockRequest)(nil), "dalc.SubmitBlockRequest") proto.RegisterType((*SubmitBlockResponse)(nil), "dalc.SubmitBlockResponse") - proto.RegisterType((*CheckBlockAvailabilityRequest)(nil), "dalc.CheckBlockAvailabilityRequest") - proto.RegisterType((*CheckBlockAvailabilityResponse)(nil), "dalc.CheckBlockAvailabilityResponse") proto.RegisterType((*RetrieveBlocksRequest)(nil), "dalc.RetrieveBlocksRequest") proto.RegisterType((*RetrieveBlocksResponse)(nil), "dalc.RetrieveBlocksResponse") } @@ -413,41 +315,36 @@ func init() { func init() { proto.RegisterFile("dalc/dalc.proto", fileDescriptor_45d7d8eda2693dc1) } var fileDescriptor_45d7d8eda2693dc1 = []byte{ - // 530 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcf, 0x8f, 0xd2, 0x40, - 0x14, 0xc7, 0x29, 0x8b, 0xc8, 0x3e, 0x14, 0x71, 0x56, 0x76, 0x2b, 0x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c0, 0xdd, 0x4d, 0x60, 0x61, 0xdc, 0xc5, 0xe5, - 0x83, 0xd6, 0xd7, 0x2c, 0x14, 0x4d, 0xfd, 0x9d, 0x61, 0x93, 0x78, 0x1e, 0x78, 0x04, 0x99, 0x50, - 0xdc, 0x98, 0x19, 0x24, 0x27, 0xb3, 0xfd, 0xd7, 0x08, 0x56, 0xef, 0xa7, 0x10, 0x51, 0xb7, 0x9a, - 0x41, 0x04, 0x8e, 0xd3, 0x9b, 0x8d, 0x1e, 0x8b, 0xb0, 0xbd, 0x63, 0x55, 0xad, 0xef, 0xbf, 0xf4, - 0xe7, 0x99, 0x33, 0x28, 0x6d, 0x37, 0x07, 0x9d, 0x8a, 0xc8, 0xd4, 0xb6, 0x57, 0x1f, 0xa4, 0xc3, - 0x75, 0xba, 0x76, 0xfb, 0xfb, 0x42, 0x91, 0x2e, 0x17, 0x8a, 0xf4, 0x6b, 0xa1, 0x48, 0xdf, 0x96, - 0x4a, 0xe6, 0x72, 0xa9, 0x64, 0x7e, 0x2c, 0x95, 0xcc, 0xc7, 0xc6, 0x30, 0x60, 0xa3, 0x99, 0xdb, - 0xf4, 0xa2, 0x89, 0xb6, 0xb3, 0x36, 0x34, 0x76, 0x31, 0x25, 0x54, 0x9b, 0xba, 0x7c, 0xc3, 0xb8, - 0x79, 0xbe, 0x2f, 0x5e, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x8f, 0x4d, 0x6f, 0x75, 0x04, - 0x00, 0x00, + // 464 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xdd, 0x8e, 0xd2, 0x40, + 0x14, 0xc7, 0x19, 0x40, 0xdc, 0x3d, 0x18, 0xac, 0xb3, 0xe2, 0x56, 0xd6, 0x54, 0xd2, 0x6c, 0x4c, + 0xf5, 0x82, 0x26, 0x78, 0xe7, 0x8d, 0xa1, 0x1f, 0x46, 0x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0x5e, 0x6a, 0xe8, 0xcf, 0x52, 0x43, 0xdf, 0x57, 0x5a, + 0xe5, 0x7a, 0xa5, 0x55, 0x7e, 0xad, 0xb4, 0xca, 0x47, 0x23, 0x4e, 0xc4, 0x2c, 0x0f, 0x7a, 0x21, + 0x9b, 0x9b, 0x7b, 0x03, 0x61, 0x8a, 0x6f, 0x0b, 0xca, 0xcd, 0x45, 0x20, 0x67, 0x27, 0x68, 0xc8, + 0x49, 0x78, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x15, 0x28, 0x38, 0xc7, 0x4f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -463,7 +360,6 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type DALCServiceClient interface { SubmitBlock(ctx context.Context, in *SubmitBlockRequest, opts ...grpc.CallOption) (*SubmitBlockResponse, error) - CheckBlockAvailability(ctx context.Context, in *CheckBlockAvailabilityRequest, opts ...grpc.CallOption) (*CheckBlockAvailabilityResponse, error) RetrieveBlocks(ctx context.Context, in *RetrieveBlocksRequest, opts ...grpc.CallOption) (*RetrieveBlocksResponse, error) } @@ -484,15 +380,6 @@ func (c *dALCServiceClient) SubmitBlock(ctx context.Context, in *SubmitBlockRequ return out, nil } -func (c *dALCServiceClient) CheckBlockAvailability(ctx context.Context, in *CheckBlockAvailabilityRequest, opts ...grpc.CallOption) (*CheckBlockAvailabilityResponse, error) { - out := new(CheckBlockAvailabilityResponse) - err := c.cc.Invoke(ctx, "/dalc.DALCService/CheckBlockAvailability", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *dALCServiceClient) RetrieveBlocks(ctx context.Context, in *RetrieveBlocksRequest, opts ...grpc.CallOption) (*RetrieveBlocksResponse, error) { out := new(RetrieveBlocksResponse) err := c.cc.Invoke(ctx, "/dalc.DALCService/RetrieveBlocks", in, out, opts...) @@ -505,7 +392,6 @@ func (c *dALCServiceClient) RetrieveBlocks(ctx context.Context, in *RetrieveBloc // DALCServiceServer is the server API for DALCService service. type DALCServiceServer interface { SubmitBlock(context.Context, *SubmitBlockRequest) (*SubmitBlockResponse, error) - CheckBlockAvailability(context.Context, *CheckBlockAvailabilityRequest) (*CheckBlockAvailabilityResponse, error) RetrieveBlocks(context.Context, *RetrieveBlocksRequest) (*RetrieveBlocksResponse, error) } @@ -516,9 +402,6 @@ type UnimplementedDALCServiceServer struct { func (*UnimplementedDALCServiceServer) SubmitBlock(ctx context.Context, req *SubmitBlockRequest) (*SubmitBlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitBlock not implemented") } -func (*UnimplementedDALCServiceServer) CheckBlockAvailability(ctx context.Context, req *CheckBlockAvailabilityRequest) (*CheckBlockAvailabilityResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CheckBlockAvailability not implemented") -} func (*UnimplementedDALCServiceServer) RetrieveBlocks(ctx context.Context, req *RetrieveBlocksRequest) (*RetrieveBlocksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RetrieveBlocks not implemented") } @@ -545,24 +428,6 @@ func _DALCService_SubmitBlock_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _DALCService_CheckBlockAvailability_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckBlockAvailabilityRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DALCServiceServer).CheckBlockAvailability(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dalc.DALCService/CheckBlockAvailability", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DALCServiceServer).CheckBlockAvailability(ctx, req.(*CheckBlockAvailabilityRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _DALCService_RetrieveBlocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RetrieveBlocksRequest) if err := dec(in); err != nil { @@ -589,10 +454,6 @@ var _DALCService_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitBlock", Handler: _DALCService_SubmitBlock_Handler, }, - { - MethodName: "CheckBlockAvailability", - Handler: _DALCService_CheckBlockAvailability_Handler, - }, { MethodName: "RetrieveBlocks", Handler: _DALCService_RetrieveBlocks_Handler, @@ -712,79 +573,6 @@ func (m *SubmitBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *CheckBlockAvailabilityRequest) 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 *CheckBlockAvailabilityRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CheckBlockAvailabilityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DAHeight != 0 { - i = encodeVarintDalc(dAtA, i, uint64(m.DAHeight)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CheckBlockAvailabilityResponse) 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 *CheckBlockAvailabilityResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CheckBlockAvailabilityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DataAvailable { - i-- - if m.DataAvailable { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.Result != nil { - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDalc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *RetrieveBlocksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -918,34 +706,6 @@ func (m *SubmitBlockResponse) Size() (n int) { return n } -func (m *CheckBlockAvailabilityRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DAHeight != 0 { - n += 1 + sovDalc(uint64(m.DAHeight)) - } - return n -} - -func (m *CheckBlockAvailabilityResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Result != nil { - l = m.Result.Size() - n += 1 + l + sovDalc(uint64(l)) - } - if m.DataAvailable { - n += 2 - } - return n -} - func (m *RetrieveBlocksRequest) Size() (n int) { if m == nil { return 0 @@ -1275,181 +1035,6 @@ func (m *SubmitBlockResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CheckBlockAvailabilityRequest) 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 ErrIntOverflowDalc - } - 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: CheckBlockAvailabilityRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CheckBlockAvailabilityRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DAHeight", wireType) - } - m.DAHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDalc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DAHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDalc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDalc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CheckBlockAvailabilityResponse) 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 ErrIntOverflowDalc - } - 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: CheckBlockAvailabilityResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CheckBlockAvailabilityResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDalc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDalc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDalc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Result == nil { - m.Result = &DAResponse{} - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DataAvailable", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDalc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DataAvailable = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipDalc(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDalc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *RetrieveBlocksRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0