From ad0a710d2a10188ffeb213794589255631d3101e Mon Sep 17 00:00:00 2001 From: Cody Littley Date: Tue, 17 Sep 2024 08:30:32 -0500 Subject: [PATCH] Moved getChunk to relay Signed-off-by: Cody Littley --- api/grpc/node/node.pb.go | 332 +++++++++----------------------- api/grpc/node/node_grpc.pb.go | 39 ---- api/grpc/relay/relay.pb.go | 237 +++++++++++++++++++++++ api/grpc/relay/relay_grpc.pb.go | 111 +++++++++++ api/proto/node/node.proto | 16 -- api/proto/relay/relay.proto | 30 +++ node/grpc/server.go | 4 - 7 files changed, 469 insertions(+), 300 deletions(-) create mode 100644 api/grpc/relay/relay.pb.go create mode 100644 api/grpc/relay/relay_grpc.pb.go create mode 100644 api/proto/relay/relay.proto diff --git a/api/grpc/node/node.pb.go b/api/grpc/node/node.pb.go index 9b7cf4ea7..d76528437 100644 --- a/api/grpc/node/node.pb.go +++ b/api/grpc/node/node.pb.go @@ -1262,113 +1262,6 @@ func (x *NodeInfoReply) GetMemBytes() uint64 { return 0 } -// Request a specific chunk -type GetChunkRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The hash of the blob's header. - HeaderHash []byte `protobuf:"bytes,1,opt,name=header_hash,json=headerHash,proto3" json:"header_hash,omitempty"` - // The index of the chunk within the blob. - ChunkIndex uint32 `protobuf:"varint,2,opt,name=chunk_index,json=chunkIndex,proto3" json:"chunk_index,omitempty"` -} - -func (x *GetChunkRequest) Reset() { - *x = GetChunkRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetChunkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetChunkRequest) ProtoMessage() {} - -func (x *GetChunkRequest) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetChunkRequest.ProtoReflect.Descriptor instead. -func (*GetChunkRequest) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{19} -} - -func (x *GetChunkRequest) GetHeaderHash() []byte { - if x != nil { - return x.HeaderHash - } - return nil -} - -func (x *GetChunkRequest) GetChunkIndex() uint32 { - if x != nil { - return x.ChunkIndex - } - return 0 -} - -// Reply to GetChunkRequest -type GetChunkReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The chunk requested. - Chunk *common.ChunkData `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` -} - -func (x *GetChunkReply) Reset() { - *x = GetChunkReply{} - if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetChunkReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetChunkReply) ProtoMessage() {} - -func (x *GetChunkReply) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetChunkReply.ProtoReflect.Descriptor instead. -func (*GetChunkReply) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{20} -} - -func (x *GetChunkReply) GetChunk() *common.ChunkData { - if x != nil { - return x.Chunk - } - return nil -} - // Request that all new blob headers be sent. type StreamBlobHeadersRequest struct { state protoimpl.MessageState @@ -1379,7 +1272,7 @@ type StreamBlobHeadersRequest struct { func (x *StreamBlobHeadersRequest) Reset() { *x = StreamBlobHeadersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[21] + mi := &file_node_node_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1392,7 +1285,7 @@ func (x *StreamBlobHeadersRequest) String() string { func (*StreamBlobHeadersRequest) ProtoMessage() {} func (x *StreamBlobHeadersRequest) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[21] + mi := &file_node_node_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1405,7 +1298,7 @@ func (x *StreamBlobHeadersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamBlobHeadersRequest.ProtoReflect.Descriptor instead. func (*StreamBlobHeadersRequest) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{21} + return file_node_node_proto_rawDescGZIP(), []int{19} } // Reply to StreamHeadersRequest @@ -1425,7 +1318,7 @@ type StreamHeadersReply struct { func (x *StreamHeadersReply) Reset() { *x = StreamHeadersReply{} if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[22] + mi := &file_node_node_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1438,7 +1331,7 @@ func (x *StreamHeadersReply) String() string { func (*StreamHeadersReply) ProtoMessage() {} func (x *StreamHeadersReply) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[22] + mi := &file_node_node_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1451,7 +1344,7 @@ func (x *StreamHeadersReply) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamHeadersReply.ProtoReflect.Descriptor instead. func (*StreamHeadersReply) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{22} + return file_node_node_proto_rawDescGZIP(), []int{20} } func (x *StreamHeadersReply) GetBlobHeader() *BlobHeader { @@ -1609,72 +1502,59 @@ var file_node_node_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x70, 0x75, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x43, 0x70, 0x75, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x53, - 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x22, 0x38, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x1a, 0x0a, - 0x18, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x70, 0x0a, 0x12, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x31, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x62, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2a, 0x36, 0x0a, 0x13, 0x43, - 0x68, 0x75, 0x6e, 0x6b, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, - 0x09, 0x0a, 0x05, 0x47, 0x4e, 0x41, 0x52, 0x4b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x4f, - 0x42, 0x10, 0x02, 0x32, 0x8b, 0x02, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x61, - 0x6c, 0x12, 0x41, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, - 0x12, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x6c, 0x6f, - 0x62, 0x73, 0x12, 0x17, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x42, - 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6e, 0x6f, - 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, - 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x15, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, - 0x00, 0x32, 0xe9, 0x02, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x61, 0x6c, 0x12, - 0x4a, 0x0a, 0x0e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, - 0x73, 0x12, 0x1b, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, - 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, - 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0d, 0x47, - 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x6e, - 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x15, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, - 0x0a, 0x08, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x15, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x13, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, - 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x2c, 0x5a, - 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, 0x61, 0x79, 0x72, - 0x2d, 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x65, 0x69, 0x67, 0x65, 0x6e, 0x64, 0x61, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x1a, + 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x70, 0x0a, 0x12, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x31, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6c, 0x6f, + 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2a, 0x36, 0x0a, 0x13, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x09, 0x0a, 0x05, 0x47, 0x4e, 0x41, 0x52, 0x4b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x47, + 0x4f, 0x42, 0x10, 0x02, 0x32, 0x8b, 0x02, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, + 0x61, 0x6c, 0x12, 0x41, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x73, 0x12, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x6c, + 0x6f, 0x62, 0x73, 0x12, 0x17, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x12, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x15, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x32, 0xaf, 0x02, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x61, 0x6c, + 0x12, 0x4a, 0x0a, 0x0e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, + 0x6b, 0x73, 0x12, 0x1b, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, + 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0d, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x2e, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x15, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x53, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, + 0x28, 0x01, 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x4c, 0x61, 0x79, 0x72, 0x2d, 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x65, 0x69, 0x67, + 0x65, 0x6e, 0x64, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6e, 0x6f, + 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1690,7 +1570,7 @@ func file_node_node_proto_rawDescGZIP() []byte { } var file_node_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_node_node_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_node_node_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_node_node_proto_goTypes = []interface{}{ (ChunkEncodingFormat)(0), // 0: node.ChunkEncodingFormat (*StoreChunksRequest)(nil), // 1: node.StoreChunksRequest @@ -1712,55 +1592,49 @@ var file_node_node_proto_goTypes = []interface{}{ (*BatchHeader)(nil), // 17: node.BatchHeader (*NodeInfoRequest)(nil), // 18: node.NodeInfoRequest (*NodeInfoReply)(nil), // 19: node.NodeInfoReply - (*GetChunkRequest)(nil), // 20: node.GetChunkRequest - (*GetChunkReply)(nil), // 21: node.GetChunkReply - (*StreamBlobHeadersRequest)(nil), // 22: node.StreamBlobHeadersRequest - (*StreamHeadersReply)(nil), // 23: node.StreamHeadersReply - (*wrapperspb.BytesValue)(nil), // 24: google.protobuf.BytesValue - (*common.G1Commitment)(nil), // 25: common.G1Commitment - (*common.ChunkData)(nil), // 26: common.ChunkData + (*StreamBlobHeadersRequest)(nil), // 20: node.StreamBlobHeadersRequest + (*StreamHeadersReply)(nil), // 21: node.StreamHeadersReply + (*wrapperspb.BytesValue)(nil), // 22: google.protobuf.BytesValue + (*common.G1Commitment)(nil), // 23: common.G1Commitment } var file_node_node_proto_depIdxs = []int32{ 17, // 0: node.StoreChunksRequest.batch_header:type_name -> node.BatchHeader 12, // 1: node.StoreChunksRequest.blobs:type_name -> node.Blob 12, // 2: node.StoreBlobsRequest.blobs:type_name -> node.Blob - 24, // 3: node.StoreBlobsReply.signatures:type_name -> google.protobuf.BytesValue + 22, // 3: node.StoreBlobsReply.signatures:type_name -> google.protobuf.BytesValue 17, // 4: node.AttestBatchRequest.batch_header:type_name -> node.BatchHeader 0, // 5: node.RetrieveChunksReply.chunk_encoding_format:type_name -> node.ChunkEncodingFormat 15, // 6: node.GetBlobHeaderReply.blob_header:type_name -> node.BlobHeader 11, // 7: node.GetBlobHeaderReply.proof:type_name -> node.MerkleProof 15, // 8: node.Blob.header:type_name -> node.BlobHeader 13, // 9: node.Blob.bundles:type_name -> node.Bundle - 25, // 10: node.BlobHeader.commitment:type_name -> common.G1Commitment + 23, // 10: node.BlobHeader.commitment:type_name -> common.G1Commitment 14, // 11: node.BlobHeader.length_commitment:type_name -> node.G2Commitment 14, // 12: node.BlobHeader.length_proof:type_name -> node.G2Commitment 16, // 13: node.BlobHeader.quorum_headers:type_name -> node.BlobQuorumInfo - 26, // 14: node.GetChunkReply.chunk:type_name -> common.ChunkData - 15, // 15: node.StreamHeadersReply.blob_header:type_name -> node.BlobHeader - 11, // 16: node.StreamHeadersReply.proof:type_name -> node.MerkleProof - 1, // 17: node.Dispersal.StoreChunks:input_type -> node.StoreChunksRequest - 3, // 18: node.Dispersal.StoreBlobs:input_type -> node.StoreBlobsRequest - 5, // 19: node.Dispersal.AttestBatch:input_type -> node.AttestBatchRequest - 18, // 20: node.Dispersal.NodeInfo:input_type -> node.NodeInfoRequest - 7, // 21: node.Retrieval.RetrieveChunks:input_type -> node.RetrieveChunksRequest - 9, // 22: node.Retrieval.GetBlobHeader:input_type -> node.GetBlobHeaderRequest - 18, // 23: node.Retrieval.NodeInfo:input_type -> node.NodeInfoRequest - 20, // 24: node.Retrieval.GetChunk:input_type -> node.GetChunkRequest - 22, // 25: node.Retrieval.StreamBlobHeaders:input_type -> node.StreamBlobHeadersRequest - 2, // 26: node.Dispersal.StoreChunks:output_type -> node.StoreChunksReply - 4, // 27: node.Dispersal.StoreBlobs:output_type -> node.StoreBlobsReply - 6, // 28: node.Dispersal.AttestBatch:output_type -> node.AttestBatchReply - 19, // 29: node.Dispersal.NodeInfo:output_type -> node.NodeInfoReply - 8, // 30: node.Retrieval.RetrieveChunks:output_type -> node.RetrieveChunksReply - 10, // 31: node.Retrieval.GetBlobHeader:output_type -> node.GetBlobHeaderReply - 19, // 32: node.Retrieval.NodeInfo:output_type -> node.NodeInfoReply - 21, // 33: node.Retrieval.GetChunk:output_type -> node.GetChunkReply - 23, // 34: node.Retrieval.StreamBlobHeaders:output_type -> node.StreamHeadersReply - 26, // [26:35] is the sub-list for method output_type - 17, // [17:26] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 15, // 14: node.StreamHeadersReply.blob_header:type_name -> node.BlobHeader + 11, // 15: node.StreamHeadersReply.proof:type_name -> node.MerkleProof + 1, // 16: node.Dispersal.StoreChunks:input_type -> node.StoreChunksRequest + 3, // 17: node.Dispersal.StoreBlobs:input_type -> node.StoreBlobsRequest + 5, // 18: node.Dispersal.AttestBatch:input_type -> node.AttestBatchRequest + 18, // 19: node.Dispersal.NodeInfo:input_type -> node.NodeInfoRequest + 7, // 20: node.Retrieval.RetrieveChunks:input_type -> node.RetrieveChunksRequest + 9, // 21: node.Retrieval.GetBlobHeader:input_type -> node.GetBlobHeaderRequest + 18, // 22: node.Retrieval.NodeInfo:input_type -> node.NodeInfoRequest + 20, // 23: node.Retrieval.StreamBlobHeaders:input_type -> node.StreamBlobHeadersRequest + 2, // 24: node.Dispersal.StoreChunks:output_type -> node.StoreChunksReply + 4, // 25: node.Dispersal.StoreBlobs:output_type -> node.StoreBlobsReply + 6, // 26: node.Dispersal.AttestBatch:output_type -> node.AttestBatchReply + 19, // 27: node.Dispersal.NodeInfo:output_type -> node.NodeInfoReply + 8, // 28: node.Retrieval.RetrieveChunks:output_type -> node.RetrieveChunksReply + 10, // 29: node.Retrieval.GetBlobHeader:output_type -> node.GetBlobHeaderReply + 19, // 30: node.Retrieval.NodeInfo:output_type -> node.NodeInfoReply + 21, // 31: node.Retrieval.StreamBlobHeaders:output_type -> node.StreamHeadersReply + 24, // [24:32] is the sub-list for method output_type + 16, // [16:24] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_node_node_proto_init() } @@ -1998,30 +1872,6 @@ func file_node_node_proto_init() { } } file_node_node_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetChunkRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_node_node_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetChunkReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_node_node_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamBlobHeadersRequest); i { case 0: return &v.state @@ -2033,7 +1883,7 @@ func file_node_node_proto_init() { return nil } } - file_node_node_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_node_node_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamHeadersReply); i { case 0: return &v.state @@ -2052,7 +1902,7 @@ func file_node_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_node_node_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 21, NumExtensions: 0, NumServices: 2, }, diff --git a/api/grpc/node/node_grpc.pb.go b/api/grpc/node/node_grpc.pb.go index 6790973ae..a30bbbdef 100644 --- a/api/grpc/node/node_grpc.pb.go +++ b/api/grpc/node/node_grpc.pb.go @@ -247,7 +247,6 @@ const ( Retrieval_RetrieveChunks_FullMethodName = "/node.Retrieval/RetrieveChunks" Retrieval_GetBlobHeader_FullMethodName = "/node.Retrieval/GetBlobHeader" Retrieval_NodeInfo_FullMethodName = "/node.Retrieval/NodeInfo" - Retrieval_GetChunk_FullMethodName = "/node.Retrieval/GetChunk" Retrieval_StreamBlobHeaders_FullMethodName = "/node.Retrieval/StreamBlobHeaders" ) @@ -261,8 +260,6 @@ type RetrievalClient interface { GetBlobHeader(ctx context.Context, in *GetBlobHeaderRequest, opts ...grpc.CallOption) (*GetBlobHeaderReply, error) // Retrieve node info metadata NodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoReply, error) - // GetChunk retrieves a specific chunk for a blob custodied at the Node. - GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*GetChunkReply, error) // StreamHeaders requests a stream all new headers. StreamBlobHeaders(ctx context.Context, opts ...grpc.CallOption) (Retrieval_StreamBlobHeadersClient, error) } @@ -302,15 +299,6 @@ func (c *retrievalClient) NodeInfo(ctx context.Context, in *NodeInfoRequest, opt return out, nil } -func (c *retrievalClient) GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*GetChunkReply, error) { - out := new(GetChunkReply) - err := c.cc.Invoke(ctx, Retrieval_GetChunk_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *retrievalClient) StreamBlobHeaders(ctx context.Context, opts ...grpc.CallOption) (Retrieval_StreamBlobHeadersClient, error) { stream, err := c.cc.NewStream(ctx, &Retrieval_ServiceDesc.Streams[0], Retrieval_StreamBlobHeaders_FullMethodName, opts...) if err != nil { @@ -352,8 +340,6 @@ type RetrievalServer interface { GetBlobHeader(context.Context, *GetBlobHeaderRequest) (*GetBlobHeaderReply, error) // Retrieve node info metadata NodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoReply, error) - // GetChunk retrieves a specific chunk for a blob custodied at the Node. - GetChunk(context.Context, *GetChunkRequest) (*GetChunkReply, error) // StreamHeaders requests a stream all new headers. StreamBlobHeaders(Retrieval_StreamBlobHeadersServer) error mustEmbedUnimplementedRetrievalServer() @@ -372,9 +358,6 @@ func (UnimplementedRetrievalServer) GetBlobHeader(context.Context, *GetBlobHeade func (UnimplementedRetrievalServer) NodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoReply, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeInfo not implemented") } -func (UnimplementedRetrievalServer) GetChunk(context.Context, *GetChunkRequest) (*GetChunkReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetChunk not implemented") -} func (UnimplementedRetrievalServer) StreamBlobHeaders(Retrieval_StreamBlobHeadersServer) error { return status.Errorf(codes.Unimplemented, "method StreamBlobHeaders not implemented") } @@ -445,24 +428,6 @@ func _Retrieval_NodeInfo_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } -func _Retrieval_GetChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetChunkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RetrievalServer).GetChunk(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Retrieval_GetChunk_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RetrievalServer).GetChunk(ctx, req.(*GetChunkRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Retrieval_StreamBlobHeaders_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(RetrievalServer).StreamBlobHeaders(&retrievalStreamBlobHeadersServer{stream}) } @@ -508,10 +473,6 @@ var Retrieval_ServiceDesc = grpc.ServiceDesc{ MethodName: "NodeInfo", Handler: _Retrieval_NodeInfo_Handler, }, - { - MethodName: "GetChunk", - Handler: _Retrieval_GetChunk_Handler, - }, }, Streams: []grpc.StreamDesc{ { diff --git a/api/grpc/relay/relay.pb.go b/api/grpc/relay/relay.pb.go new file mode 100644 index 000000000..1d6b078c9 --- /dev/null +++ b/api/grpc/relay/relay.pb.go @@ -0,0 +1,237 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v4.23.4 +// source: relay/relay.proto + +package relay + +import ( + common "github.com/Layr-Labs/eigenda/api/grpc/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/known/wrapperspb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Request a specific chunk +type GetChunkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of the blob's header. + HeaderHash []byte `protobuf:"bytes,1,opt,name=header_hash,json=headerHash,proto3" json:"header_hash,omitempty"` + // The index of the chunk within the blob. + ChunkIndex uint32 `protobuf:"varint,2,opt,name=chunk_index,json=chunkIndex,proto3" json:"chunk_index,omitempty"` +} + +func (x *GetChunkRequest) Reset() { + *x = GetChunkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_relay_relay_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChunkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChunkRequest) ProtoMessage() {} + +func (x *GetChunkRequest) ProtoReflect() protoreflect.Message { + mi := &file_relay_relay_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChunkRequest.ProtoReflect.Descriptor instead. +func (*GetChunkRequest) Descriptor() ([]byte, []int) { + return file_relay_relay_proto_rawDescGZIP(), []int{0} +} + +func (x *GetChunkRequest) GetHeaderHash() []byte { + if x != nil { + return x.HeaderHash + } + return nil +} + +func (x *GetChunkRequest) GetChunkIndex() uint32 { + if x != nil { + return x.ChunkIndex + } + return 0 +} + +// Reply to GetChunkRequest +type GetChunkReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The chunk requested. + Chunk *common.ChunkData `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` +} + +func (x *GetChunkReply) Reset() { + *x = GetChunkReply{} + if protoimpl.UnsafeEnabled { + mi := &file_relay_relay_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChunkReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChunkReply) ProtoMessage() {} + +func (x *GetChunkReply) ProtoReflect() protoreflect.Message { + mi := &file_relay_relay_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChunkReply.ProtoReflect.Descriptor instead. +func (*GetChunkReply) Descriptor() ([]byte, []int) { + return file_relay_relay_proto_rawDescGZIP(), []int{1} +} + +func (x *GetChunkReply) GetChunk() *common.ChunkData { + if x != nil { + return x.Chunk + } + return nil +} + +var File_relay_relay_proto protoreflect.FileDescriptor + +var file_relay_relay_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, + 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x22, 0x38, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x32, 0x41, 0x0a, + 0x05, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x38, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x12, 0x15, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, + 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4c, + 0x61, 0x79, 0x72, 0x2d, 0x4c, 0x61, 0x62, 0x73, 0x2f, 0x65, 0x69, 0x67, 0x65, 0x6e, 0x64, 0x61, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_relay_relay_proto_rawDescOnce sync.Once + file_relay_relay_proto_rawDescData = file_relay_relay_proto_rawDesc +) + +func file_relay_relay_proto_rawDescGZIP() []byte { + file_relay_relay_proto_rawDescOnce.Do(func() { + file_relay_relay_proto_rawDescData = protoimpl.X.CompressGZIP(file_relay_relay_proto_rawDescData) + }) + return file_relay_relay_proto_rawDescData +} + +var file_relay_relay_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_relay_relay_proto_goTypes = []interface{}{ + (*GetChunkRequest)(nil), // 0: node.GetChunkRequest + (*GetChunkReply)(nil), // 1: node.GetChunkReply + (*common.ChunkData)(nil), // 2: common.ChunkData +} +var file_relay_relay_proto_depIdxs = []int32{ + 2, // 0: node.GetChunkReply.chunk:type_name -> common.ChunkData + 0, // 1: node.Relay.GetChunk:input_type -> node.GetChunkRequest + 1, // 2: node.Relay.GetChunk:output_type -> node.GetChunkReply + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_relay_relay_proto_init() } +func file_relay_relay_proto_init() { + if File_relay_relay_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_relay_relay_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChunkRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_relay_relay_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChunkReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_relay_relay_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_relay_relay_proto_goTypes, + DependencyIndexes: file_relay_relay_proto_depIdxs, + MessageInfos: file_relay_relay_proto_msgTypes, + }.Build() + File_relay_relay_proto = out.File + file_relay_relay_proto_rawDesc = nil + file_relay_relay_proto_goTypes = nil + file_relay_relay_proto_depIdxs = nil +} diff --git a/api/grpc/relay/relay_grpc.pb.go b/api/grpc/relay/relay_grpc.pb.go new file mode 100644 index 000000000..07bfc09d3 --- /dev/null +++ b/api/grpc/relay/relay_grpc.pb.go @@ -0,0 +1,111 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.23.4 +// source: relay/relay.proto + +package relay + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Relay_GetChunk_FullMethodName = "/node.Relay/GetChunk" +) + +// RelayClient is the client API for Relay service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RelayClient interface { + // GetChunk retrieves a specific chunk for a blob custodied at the Node. + GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*GetChunkReply, error) +} + +type relayClient struct { + cc grpc.ClientConnInterface +} + +func NewRelayClient(cc grpc.ClientConnInterface) RelayClient { + return &relayClient{cc} +} + +func (c *relayClient) GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*GetChunkReply, error) { + out := new(GetChunkReply) + err := c.cc.Invoke(ctx, Relay_GetChunk_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RelayServer is the server API for Relay service. +// All implementations must embed UnimplementedRelayServer +// for forward compatibility +type RelayServer interface { + // GetChunk retrieves a specific chunk for a blob custodied at the Node. + GetChunk(context.Context, *GetChunkRequest) (*GetChunkReply, error) + mustEmbedUnimplementedRelayServer() +} + +// UnimplementedRelayServer must be embedded to have forward compatible implementations. +type UnimplementedRelayServer struct { +} + +func (UnimplementedRelayServer) GetChunk(context.Context, *GetChunkRequest) (*GetChunkReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChunk not implemented") +} +func (UnimplementedRelayServer) mustEmbedUnimplementedRelayServer() {} + +// UnsafeRelayServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RelayServer will +// result in compilation errors. +type UnsafeRelayServer interface { + mustEmbedUnimplementedRelayServer() +} + +func RegisterRelayServer(s grpc.ServiceRegistrar, srv RelayServer) { + s.RegisterService(&Relay_ServiceDesc, srv) +} + +func _Relay_GetChunk_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChunkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RelayServer).GetChunk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Relay_GetChunk_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RelayServer).GetChunk(ctx, req.(*GetChunkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Relay_ServiceDesc is the grpc.ServiceDesc for Relay service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Relay_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "node.Relay", + HandlerType: (*RelayServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetChunk", + Handler: _Relay_GetChunk_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "relay/relay.proto", +} diff --git a/api/proto/node/node.proto b/api/proto/node/node.proto index 9b9226445..b9fb54144 100644 --- a/api/proto/node/node.proto +++ b/api/proto/node/node.proto @@ -38,8 +38,6 @@ service Retrieval { // Experimental: the following RPCs are experimental and subject to change. // ////////////////////////////////////////////////////////////////////////////// - // GetChunk retrieves a specific chunk for a blob custodied at the Node. - rpc GetChunk(GetChunkRequest) returns (GetChunkReply) {} // StreamHeaders requests a stream all new headers. rpc StreamBlobHeaders(stream StreamBlobHeadersRequest) returns (stream StreamHeadersReply) {} } @@ -230,20 +228,6 @@ message NodeInfoReply { // Experimental: the following definitions are experimental and subject to change. // ///////////////////////////////////////////////////////////////////////////////////// -// Request a specific chunk -message GetChunkRequest { - // The hash of the blob's header. - bytes header_hash = 1; - // The index of the chunk within the blob. - uint32 chunk_index = 2; -} - -// Reply to GetChunkRequest -message GetChunkReply { - // The chunk requested. - common.ChunkData chunk = 1; -} - // Request that all new blob headers be sent. message StreamBlobHeadersRequest { } diff --git a/api/proto/relay/relay.proto b/api/proto/relay/relay.proto new file mode 100644 index 000000000..de5c429e0 --- /dev/null +++ b/api/proto/relay/relay.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package node; +import "google/protobuf/wrappers.proto"; +import "common/common.proto"; +option go_package = "github.com/Layr-Labs/eigenda/api/grpc/relay"; + +///////////////////////////////////////////////////////////////////////////////////// +// Experimental: the following definitions are experimental and subject to change. // +///////////////////////////////////////////////////////////////////////////////////// + +service Relay { + // Note: the relay API is still being fleshed out. This definition is not yet complete. + + // GetChunk retrieves a specific chunk for a blob custodied at the Node. + rpc GetChunk(GetChunkRequest) returns (GetChunkReply) {} +} + +// Request a specific chunk +message GetChunkRequest { + // The hash of the blob's header. + bytes header_hash = 1; + // The index of the chunk within the blob. + uint32 chunk_index = 2; +} + +// Reply to GetChunkRequest +message GetChunkReply { + // The chunk requested. + common.ChunkData chunk = 1; +} \ No newline at end of file diff --git a/node/grpc/server.go b/node/grpc/server.go index bb56cdef9..7c262fa57 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -156,10 +156,6 @@ func (s *Server) NodeInfo(ctx context.Context, in *pb.NodeInfoRequest) (*pb.Node return &pb.NodeInfoReply{Semver: node.SemVer, Os: runtime.GOOS, Arch: runtime.GOARCH, NumCpu: uint32(runtime.GOMAXPROCS(0)), MemBytes: memBytes}, nil } -func (s *Server) GetChunk(context.Context, *pb.GetChunkRequest) (*pb.GetChunkReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetChunk not implemented") -} - func (s *Server) StreamBlobHeaders(pb.Retrieval_StreamBlobHeadersServer) error { return status.Errorf(codes.Unimplemented, "method StreamBlobHeaders not implemented") }