From 817465e5b38d0154e7979f43c3c0db94a2f170a2 Mon Sep 17 00:00:00 2001 From: Ian Shim <100327837+ian-shim@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:36:31 -0800 Subject: [PATCH] [relay] Return raw bundle bytes from relay (#884) --- api/grpc/relay/relay.pb.go | 361 ++++++++---------------------------- api/proto/relay/relay.proto | 30 +-- 2 files changed, 79 insertions(+), 312 deletions(-) diff --git a/api/grpc/relay/relay.pb.go b/api/grpc/relay/relay.pb.go index a9a60e74a..3ecd7dd8e 100644 --- a/api/grpc/relay/relay.pb.go +++ b/api/grpc/relay/relay.pb.go @@ -7,7 +7,6 @@ package relay import ( - v2 "github.com/Layr-Labs/eigenda/api/grpc/common/v2" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -21,59 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// The error codes that can occur while trying to fetch a blob or chunks. -type RelayErrorCode int32 - -const ( - // This relay does not know about the requested blob or the requested blob is assigned to a different relay. - RelayErrorCode_UNKNOWN_BLOB RelayErrorCode = 0 - // The relay is too busy to handle the request. - RelayErrorCode_BUSY RelayErrorCode = 1 - // An internal relay error occurred while trying to fetch the blob. - RelayErrorCode_INTERNAL_ERROR RelayErrorCode = 2 -) - -// Enum value maps for RelayErrorCode. -var ( - RelayErrorCode_name = map[int32]string{ - 0: "UNKNOWN_BLOB", - 1: "BUSY", - 2: "INTERNAL_ERROR", - } - RelayErrorCode_value = map[string]int32{ - "UNKNOWN_BLOB": 0, - "BUSY": 1, - "INTERNAL_ERROR": 2, - } -) - -func (x RelayErrorCode) Enum() *RelayErrorCode { - p := new(RelayErrorCode) - *p = x - return p -} - -func (x RelayErrorCode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RelayErrorCode) Descriptor() protoreflect.EnumDescriptor { - return file_relay_relay_proto_enumTypes[0].Descriptor() -} - -func (RelayErrorCode) Type() protoreflect.EnumType { - return &file_relay_relay_proto_enumTypes[0] -} - -func (x RelayErrorCode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RelayErrorCode.Descriptor instead. -func (RelayErrorCode) EnumDescriptor() ([]byte, []int) { - return file_relay_relay_proto_rawDescGZIP(), []int{0} -} - // A request to fetch one or more blobs. type GetBlobRequest struct { state protoimpl.MessageState @@ -451,13 +397,15 @@ func (*ChunkRequest_ByIndex) isChunkRequest_Request() {} func (*ChunkRequest_ByRange) isChunkRequest_Request() {} // The reply to a GetChunks request. +// Requests are fulfilled in all-or-nothing fashion. If any of the requested chunks are not found, the entire request will fail. type GetChunksReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The chunks requested. The order of these chunks will be the same as the order of the requested chunks. - Data []*Chunks `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` + // data is the raw data of the bundle (i.e. serialized byte array of the frames) + Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` } func (x *GetChunksReply) Reset() { @@ -492,192 +440,68 @@ func (*GetChunksReply) Descriptor() ([]byte, []int) { return file_relay_relay_proto_rawDescGZIP(), []int{6} } -func (x *GetChunksReply) GetData() []*Chunks { - if x != nil { - return x.Data - } - return nil -} - -// The chunks requested. If this request is in response to a request by index, the order of these chunks will be the -// -// same as the order of the requested indices. If this request is in response to a request by range, the first chunk -// will correspond to the first index requested, and so on. -type Chunks struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []*v2.Frame `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` -} - -func (x *Chunks) Reset() { - *x = Chunks{} - if protoimpl.UnsafeEnabled { - mi := &file_relay_relay_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Chunks) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Chunks) ProtoMessage() {} - -func (x *Chunks) ProtoReflect() protoreflect.Message { - mi := &file_relay_relay_proto_msgTypes[7] - 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 Chunks.ProtoReflect.Descriptor instead. -func (*Chunks) Descriptor() ([]byte, []int) { - return file_relay_relay_proto_rawDescGZIP(), []int{7} -} - -func (x *Chunks) GetData() []*v2.Frame { +func (x *GetChunksReply) GetData() [][]byte { if x != nil { return x.Data } return nil } -// An error that occurred while trying to fetch a blob or chunks. -type RelayError struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The error code that occurred while trying to fetch a blob or chunks. - ErrorCode RelayErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=node.RelayErrorCode" json:"error_code,omitempty"` - // A message explaining the error that occurred. - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *RelayError) Reset() { - *x = RelayError{} - if protoimpl.UnsafeEnabled { - mi := &file_relay_relay_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RelayError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RelayError) ProtoMessage() {} - -func (x *RelayError) ProtoReflect() protoreflect.Message { - mi := &file_relay_relay_proto_msgTypes[8] - 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 RelayError.ProtoReflect.Descriptor instead. -func (*RelayError) Descriptor() ([]byte, []int) { - return file_relay_relay_proto_rawDescGZIP(), []int{8} -} - -func (x *RelayError) GetErrorCode() RelayErrorCode { - if x != nil { - return x.ErrorCode - } - return RelayErrorCode_UNKNOWN_BLOB -} - -func (x *RelayError) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - 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, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x76, 0x32, 0x2f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x2b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x65, 0x79, 0x22, 0x22, 0x0a, - 0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6c, 0x6f, - 0x62, 0x22, 0xa1, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0e, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x55, 0x0a, 0x13, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, + 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x2b, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, + 0x6c, 0x6f, 0x62, 0x4b, 0x65, 0x79, 0x22, 0x22, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, + 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0xa1, 0x01, 0x0a, 0x10, 0x47, + 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x39, 0x0a, 0x0e, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x63, 0x68, 0x75, + 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2f, 0x0a, + 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x55, + 0x0a, 0x13, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x65, 0x79, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, + 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x13, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, - 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x13, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x89, 0x01, 0x0a, - 0x0c, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, - 0x08, 0x62, 0x79, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x42, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x07, 0x62, 0x79, - 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x36, 0x0a, 0x08, 0x62, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x43, - 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x62, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x09, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, - 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x06, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, - 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5b, 0x0a, 0x0a, - 0x52, 0x65, 0x6c, 0x61, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x0a, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x40, 0x0a, 0x0e, 0x52, 0x65, 0x6c, - 0x61, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x42, 0x4c, 0x4f, 0x42, 0x10, 0x00, 0x12, 0x08, 0x0a, - 0x04, 0x42, 0x55, 0x53, 0x59, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, - 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0x7b, 0x0a, 0x05, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x12, 0x35, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, - 0x14, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, - 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x09, 0x47, - 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x16, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, - 0x73, 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, + 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, 0x6e, 0x64, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x89, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x62, 0x79, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x48, 0x00, 0x52, 0x07, 0x62, 0x79, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x36, + 0x0a, 0x08, 0x62, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x62, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x7b, 0x0a, 0x05, 0x52, 0x65, 0x6c, 0x61, 0x79, + 0x12, 0x35, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x14, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x12, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x16, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 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 ( @@ -692,37 +516,29 @@ func file_relay_relay_proto_rawDescGZIP() []byte { return file_relay_relay_proto_rawDescData } -var file_relay_relay_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_relay_relay_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_relay_relay_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_relay_relay_proto_goTypes = []interface{}{ - (RelayErrorCode)(0), // 0: node.RelayErrorCode - (*GetBlobRequest)(nil), // 1: node.GetBlobRequest - (*GetBlobReply)(nil), // 2: node.GetBlobReply - (*GetChunksRequest)(nil), // 3: node.GetChunksRequest - (*ChunkRequestByIndex)(nil), // 4: node.ChunkRequestByIndex - (*ChunkRequestByRange)(nil), // 5: node.ChunkRequestByRange - (*ChunkRequest)(nil), // 6: node.ChunkRequest - (*GetChunksReply)(nil), // 7: node.GetChunksReply - (*Chunks)(nil), // 8: node.Chunks - (*RelayError)(nil), // 9: node.RelayError - (*v2.Frame)(nil), // 10: common.v2.Frame + (*GetBlobRequest)(nil), // 0: node.GetBlobRequest + (*GetBlobReply)(nil), // 1: node.GetBlobReply + (*GetChunksRequest)(nil), // 2: node.GetChunksRequest + (*ChunkRequestByIndex)(nil), // 3: node.ChunkRequestByIndex + (*ChunkRequestByRange)(nil), // 4: node.ChunkRequestByRange + (*ChunkRequest)(nil), // 5: node.ChunkRequest + (*GetChunksReply)(nil), // 6: node.GetChunksReply } var file_relay_relay_proto_depIdxs = []int32{ - 6, // 0: node.GetChunksRequest.chunk_requests:type_name -> node.ChunkRequest - 4, // 1: node.ChunkRequest.by_index:type_name -> node.ChunkRequestByIndex - 5, // 2: node.ChunkRequest.by_range:type_name -> node.ChunkRequestByRange - 8, // 3: node.GetChunksReply.data:type_name -> node.Chunks - 10, // 4: node.Chunks.data:type_name -> common.v2.Frame - 0, // 5: node.RelayError.error_code:type_name -> node.RelayErrorCode - 1, // 6: node.Relay.GetBlob:input_type -> node.GetBlobRequest - 3, // 7: node.Relay.GetChunks:input_type -> node.GetChunksRequest - 2, // 8: node.Relay.GetBlob:output_type -> node.GetBlobReply - 7, // 9: node.Relay.GetChunks:output_type -> node.GetChunksReply - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 5, // 0: node.GetChunksRequest.chunk_requests:type_name -> node.ChunkRequest + 3, // 1: node.ChunkRequest.by_index:type_name -> node.ChunkRequestByIndex + 4, // 2: node.ChunkRequest.by_range:type_name -> node.ChunkRequestByRange + 0, // 3: node.Relay.GetBlob:input_type -> node.GetBlobRequest + 2, // 4: node.Relay.GetChunks:input_type -> node.GetChunksRequest + 1, // 5: node.Relay.GetBlob:output_type -> node.GetBlobReply + 6, // 6: node.Relay.GetChunks:output_type -> node.GetChunksReply + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_relay_relay_proto_init() } @@ -815,30 +631,6 @@ func file_relay_relay_proto_init() { return nil } } - file_relay_relay_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Chunks); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_relay_relay_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RelayError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } file_relay_relay_proto_msgTypes[5].OneofWrappers = []interface{}{ (*ChunkRequest_ByIndex)(nil), @@ -849,14 +641,13 @@ func file_relay_relay_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_relay_relay_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, + NumEnums: 0, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, GoTypes: file_relay_relay_proto_goTypes, DependencyIndexes: file_relay_relay_proto_depIdxs, - EnumInfos: file_relay_relay_proto_enumTypes, MessageInfos: file_relay_relay_proto_msgTypes, }.Build() File_relay_relay_proto = out.File diff --git a/api/proto/relay/relay.proto b/api/proto/relay/relay.proto index 3b558352e..f5d0d3b72 100644 --- a/api/proto/relay/relay.proto +++ b/api/proto/relay/relay.proto @@ -1,6 +1,5 @@ syntax = "proto3"; package node; -import "common/v2/frame.proto"; option go_package = "github.com/Layr-Labs/eigenda/api/grpc/relay"; ///////////////////////////////////////////////////////////////////////////////////// @@ -71,32 +70,9 @@ message ChunkRequest { } // The reply to a GetChunks request. +// Requests are fulfilled in all-or-nothing fashion. If any of the requested chunks are not found, the entire request will fail. message GetChunksReply { // The chunks requested. The order of these chunks will be the same as the order of the requested chunks. - repeated Chunks data = 1; + // data is the raw data of the bundle (i.e. serialized byte array of the frames) + repeated bytes data = 1; } - -// The chunks requested. If this request is in response to a request by index, the order of these chunks will be the -// same as the order of the requested indices. If this request is in response to a request by range, the first chunk -// will correspond to the first index requested, and so on. -message Chunks { - repeated common.v2.Frame data = 1; -} - -// An error that occurred while trying to fetch a blob or chunks. -message RelayError { - // The error code that occurred while trying to fetch a blob or chunks. - RelayErrorCode error_code = 1; - // A message explaining the error that occurred. - string message = 2; -} - -// The error codes that can occur while trying to fetch a blob or chunks. -enum RelayErrorCode { - // This relay does not know about the requested blob or the requested blob is assigned to a different relay. - UNKNOWN_BLOB = 0; - // The relay is too busy to handle the request. - BUSY = 1; - // An internal relay error occurred while trying to fetch the blob. - INTERNAL_ERROR = 2; -} \ No newline at end of file