diff --git a/api/grpc/common/common.pb.go b/api/grpc/common/common.pb.go index ce3f5be228..0bc1aa56fa 100644 --- a/api/grpc/common/common.pb.go +++ b/api/grpc/common/common.pb.go @@ -77,6 +77,54 @@ func (x *G1Commitment) GetY() []byte { return nil } +// A chunk of a blob. +type ChunkData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *ChunkData) Reset() { + *x = ChunkData{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChunkData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChunkData) ProtoMessage() {} + +func (x *ChunkData) ProtoReflect() protoreflect.Message { + mi := &file_common_common_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 ChunkData.ProtoReflect.Descriptor instead. +func (*ChunkData) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{1} +} + +func (x *ChunkData) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + var File_common_common_proto protoreflect.FileDescriptor var file_common_common_proto_rawDesc = []byte{ @@ -84,11 +132,13 @@ var file_common_common_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x2a, 0x0a, 0x0c, 0x47, 0x31, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x79, 0x42, 0x2e, 0x5a, 0x2c, 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, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x79, 0x22, 0x1f, 0x0a, 0x09, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x2e, 0x5a, 0x2c, 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, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -103,9 +153,10 @@ func file_common_common_proto_rawDescGZIP() []byte { return file_common_common_proto_rawDescData } -var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_common_common_proto_goTypes = []interface{}{ (*G1Commitment)(nil), // 0: common.G1Commitment + (*ChunkData)(nil), // 1: common.ChunkData } var file_common_common_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -133,6 +184,18 @@ func file_common_common_proto_init() { return nil } } + file_common_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChunkData); 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{ @@ -140,7 +203,7 @@ func file_common_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_common_common_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/api/grpc/disperser/disperser.pb.go b/api/grpc/disperser/disperser.pb.go index 39b7f0a62c..0737f0e465 100644 --- a/api/grpc/disperser/disperser.pb.go +++ b/api/grpc/disperser/disperser.pb.go @@ -1182,6 +1182,113 @@ func (x *BatchHeader) GetReferenceBlockNumber() uint32 { 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. + BlobHeaderHash []byte `protobuf:"bytes,1,opt,name=blob_header_hash,json=blobHeaderHash,proto3" json:"blob_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_disperser_disperser_proto_msgTypes[16] + 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_disperser_disperser_proto_msgTypes[16] + 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_disperser_disperser_proto_rawDescGZIP(), []int{16} +} + +func (x *GetChunkRequest) GetBlobHeaderHash() []byte { + if x != nil { + return x.BlobHeaderHash + } + 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_disperser_disperser_proto_msgTypes[17] + 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_disperser_disperser_proto_msgTypes[17] + 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_disperser_disperser_proto_rawDescGZIP(), []int{17} +} + +func (x *GetChunkReply) GetChunk() *common.ChunkData { + if x != nil { + return x.Chunk + } + return nil +} + var File_disperser_disperser_proto protoreflect.FileDescriptor var file_disperser_disperser_proto_rawDesc = []byte{ @@ -1331,41 +1438,54 @@ var file_disperser_disperser_proto_rawDesc = []byte{ 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2a, 0x80, 0x01, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, - 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x52, 0x4f, 0x43, 0x45, 0x53, 0x53, 0x49, - 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x12, - 0x0d, 0x0a, 0x09, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x5a, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1b, - 0x0a, 0x17, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x53, - 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x53, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x44, - 0x49, 0x53, 0x50, 0x45, 0x52, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x32, 0xd9, 0x02, 0x0a, 0x09, - 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x0c, 0x44, 0x69, 0x73, - 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x70, - 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, - 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x73, 0x70, - 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, - 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x19, 0x44, 0x69, 0x73, - 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, - 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, - 0x73, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0d, 0x47, 0x65, - 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x64, 0x69, - 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x64, 0x69, 0x73, 0x70, - 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0c, 0x52, 0x65, 0x74, 0x72, 0x69, - 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, - 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, - 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x31, 0x5a, 0x2f, 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, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x5c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x62, 0x6c, 0x6f, 0x62, 0x48, 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, + 0x2a, 0x80, 0x01, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, + 0x50, 0x52, 0x4f, 0x43, 0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, + 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x49, 0x4e, 0x41, 0x4c, + 0x49, 0x5a, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, + 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, + 0x53, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x49, 0x53, 0x50, 0x45, 0x52, 0x53, 0x49, 0x4e, + 0x47, 0x10, 0x06, 0x32, 0x9d, 0x03, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, + 0x72, 0x12, 0x4e, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, + 0x62, 0x12, 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x69, + 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x69, + 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x00, 0x12, 0x5f, 0x0a, 0x19, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, + 0x62, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1f, + 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, + 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, + 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, + 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1a, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x4e, 0x0a, 0x0c, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x12, + 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, + 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x74, 0x72, + 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, + 0x42, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x1a, 0x2e, 0x64, 0x69, + 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, + 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x22, 0x00, 0x42, 0x31, 0x5a, 0x2f, 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, 0x64, 0x69, 0x73, + 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1381,7 +1501,7 @@ func file_disperser_disperser_proto_rawDescGZIP() []byte { } var file_disperser_disperser_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_disperser_disperser_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_disperser_disperser_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_disperser_disperser_proto_goTypes = []interface{}{ (BlobStatus)(0), // 0: disperser.BlobStatus (*AuthenticatedRequest)(nil), // 1: disperser.AuthenticatedRequest @@ -1400,7 +1520,10 @@ var file_disperser_disperser_proto_goTypes = []interface{}{ (*BlobVerificationProof)(nil), // 14: disperser.BlobVerificationProof (*BatchMetadata)(nil), // 15: disperser.BatchMetadata (*BatchHeader)(nil), // 16: disperser.BatchHeader - (*common.G1Commitment)(nil), // 17: common.G1Commitment + (*GetChunkRequest)(nil), // 17: disperser.GetChunkRequest + (*GetChunkReply)(nil), // 18: disperser.GetChunkReply + (*common.G1Commitment)(nil), // 19: common.G1Commitment + (*common.ChunkData)(nil), // 20: common.ChunkData } var file_disperser_disperser_proto_depIdxs = []int32{ 5, // 0: disperser.AuthenticatedRequest.disperse_request:type_name -> disperser.DisperseBlobRequest @@ -1412,23 +1535,26 @@ var file_disperser_disperser_proto_depIdxs = []int32{ 11, // 6: disperser.BlobStatusReply.info:type_name -> disperser.BlobInfo 12, // 7: disperser.BlobInfo.blob_header:type_name -> disperser.BlobHeader 14, // 8: disperser.BlobInfo.blob_verification_proof:type_name -> disperser.BlobVerificationProof - 17, // 9: disperser.BlobHeader.commitment:type_name -> common.G1Commitment + 19, // 9: disperser.BlobHeader.commitment:type_name -> common.G1Commitment 13, // 10: disperser.BlobHeader.blob_quorum_params:type_name -> disperser.BlobQuorumParam 15, // 11: disperser.BlobVerificationProof.batch_metadata:type_name -> disperser.BatchMetadata 16, // 12: disperser.BatchMetadata.batch_header:type_name -> disperser.BatchHeader - 5, // 13: disperser.Disperser.DisperseBlob:input_type -> disperser.DisperseBlobRequest - 1, // 14: disperser.Disperser.DisperseBlobAuthenticated:input_type -> disperser.AuthenticatedRequest - 7, // 15: disperser.Disperser.GetBlobStatus:input_type -> disperser.BlobStatusRequest - 9, // 16: disperser.Disperser.RetrieveBlob:input_type -> disperser.RetrieveBlobRequest - 6, // 17: disperser.Disperser.DisperseBlob:output_type -> disperser.DisperseBlobReply - 2, // 18: disperser.Disperser.DisperseBlobAuthenticated:output_type -> disperser.AuthenticatedReply - 8, // 19: disperser.Disperser.GetBlobStatus:output_type -> disperser.BlobStatusReply - 10, // 20: disperser.Disperser.RetrieveBlob:output_type -> disperser.RetrieveBlobReply - 17, // [17:21] is the sub-list for method output_type - 13, // [13:17] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 20, // 13: disperser.GetChunkReply.chunk:type_name -> common.ChunkData + 5, // 14: disperser.Disperser.DisperseBlob:input_type -> disperser.DisperseBlobRequest + 1, // 15: disperser.Disperser.DisperseBlobAuthenticated:input_type -> disperser.AuthenticatedRequest + 7, // 16: disperser.Disperser.GetBlobStatus:input_type -> disperser.BlobStatusRequest + 9, // 17: disperser.Disperser.RetrieveBlob:input_type -> disperser.RetrieveBlobRequest + 17, // 18: disperser.Disperser.GetChunk:input_type -> disperser.GetChunkRequest + 6, // 19: disperser.Disperser.DisperseBlob:output_type -> disperser.DisperseBlobReply + 2, // 20: disperser.Disperser.DisperseBlobAuthenticated:output_type -> disperser.AuthenticatedReply + 8, // 21: disperser.Disperser.GetBlobStatus:output_type -> disperser.BlobStatusReply + 10, // 22: disperser.Disperser.RetrieveBlob:output_type -> disperser.RetrieveBlobReply + 18, // 23: disperser.Disperser.GetChunk:output_type -> disperser.GetChunkReply + 19, // [19:24] is the sub-list for method output_type + 14, // [14:19] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_disperser_disperser_proto_init() } @@ -1629,6 +1755,30 @@ func file_disperser_disperser_proto_init() { return nil } } + file_disperser_disperser_proto_msgTypes[16].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_disperser_disperser_proto_msgTypes[17].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_disperser_disperser_proto_msgTypes[0].OneofWrappers = []interface{}{ (*AuthenticatedRequest_DisperseRequest)(nil), @@ -1644,7 +1794,7 @@ func file_disperser_disperser_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_disperser_disperser_proto_rawDesc, NumEnums: 1, - NumMessages: 16, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/api/grpc/disperser/disperser_grpc.pb.go b/api/grpc/disperser/disperser_grpc.pb.go index 14f8e9f93a..d76bd1638e 100644 --- a/api/grpc/disperser/disperser_grpc.pb.go +++ b/api/grpc/disperser/disperser_grpc.pb.go @@ -23,6 +23,7 @@ const ( Disperser_DisperseBlobAuthenticated_FullMethodName = "/disperser.Disperser/DisperseBlobAuthenticated" Disperser_GetBlobStatus_FullMethodName = "/disperser.Disperser/GetBlobStatus" Disperser_RetrieveBlob_FullMethodName = "/disperser.Disperser/RetrieveBlob" + Disperser_GetChunk_FullMethodName = "/disperser.Disperser/GetChunk" ) // DisperserClient is the client API for Disperser service. @@ -52,6 +53,8 @@ type DisperserClient interface { // The blob should have been initially dispersed via this Disperser service // for this API to work. RetrieveBlob(ctx context.Context, in *RetrieveBlobRequest, opts ...grpc.CallOption) (*RetrieveBlobReply, error) + // Retrieves the requested chunk from the Disperser's backend. + GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*GetChunkReply, error) } type disperserClient struct { @@ -120,6 +123,15 @@ func (c *disperserClient) RetrieveBlob(ctx context.Context, in *RetrieveBlobRequ return out, nil } +func (c *disperserClient) GetChunk(ctx context.Context, in *GetChunkRequest, opts ...grpc.CallOption) (*GetChunkReply, error) { + out := new(GetChunkReply) + err := c.cc.Invoke(ctx, Disperser_GetChunk_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DisperserServer is the server API for Disperser service. // All implementations must embed UnimplementedDisperserServer // for forward compatibility @@ -147,6 +159,8 @@ type DisperserServer interface { // The blob should have been initially dispersed via this Disperser service // for this API to work. RetrieveBlob(context.Context, *RetrieveBlobRequest) (*RetrieveBlobReply, error) + // Retrieves the requested chunk from the Disperser's backend. + GetChunk(context.Context, *GetChunkRequest) (*GetChunkReply, error) mustEmbedUnimplementedDisperserServer() } @@ -166,6 +180,9 @@ func (UnimplementedDisperserServer) GetBlobStatus(context.Context, *BlobStatusRe func (UnimplementedDisperserServer) RetrieveBlob(context.Context, *RetrieveBlobRequest) (*RetrieveBlobReply, error) { return nil, status.Errorf(codes.Unimplemented, "method RetrieveBlob not implemented") } +func (UnimplementedDisperserServer) GetChunk(context.Context, *GetChunkRequest) (*GetChunkReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChunk not implemented") +} func (UnimplementedDisperserServer) mustEmbedUnimplementedDisperserServer() {} // UnsafeDisperserServer may be embedded to opt out of forward compatibility for this service. @@ -259,6 +276,24 @@ func _Disperser_RetrieveBlob_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Disperser_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.(DisperserServer).GetChunk(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Disperser_GetChunk_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DisperserServer).GetChunk(ctx, req.(*GetChunkRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Disperser_ServiceDesc is the grpc.ServiceDesc for Disperser service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -278,6 +313,10 @@ var Disperser_ServiceDesc = grpc.ServiceDesc{ MethodName: "RetrieveBlob", Handler: _Disperser_RetrieveBlob_Handler, }, + { + MethodName: "GetChunk", + Handler: _Disperser_GetChunk_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/api/grpc/lightnode/lightnode.pb.go b/api/grpc/lightnode/lightnode.pb.go new file mode 100644 index 0000000000..f820a8916d --- /dev/null +++ b/api/grpc/lightnode/lightnode.pb.go @@ -0,0 +1,229 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v4.23.4 +// source: lightnode/lightnode.proto + +package lightnode + +import ( + _ "github.com/Layr-Labs/eigenda/api/grpc/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// A request from a DA node to an agent light node to stream the availability status of all chunks +// assigned to the light node. +type StreamChunkAvailabilityRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuthenticationToken []byte `protobuf:"bytes,1,opt,name=authentication_token,json=authenticationToken,proto3" json:"authentication_token,omitempty"` +} + +func (x *StreamChunkAvailabilityRequest) Reset() { + *x = StreamChunkAvailabilityRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_lightnode_lightnode_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamChunkAvailabilityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamChunkAvailabilityRequest) ProtoMessage() {} + +func (x *StreamChunkAvailabilityRequest) ProtoReflect() protoreflect.Message { + mi := &file_lightnode_lightnode_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 StreamChunkAvailabilityRequest.ProtoReflect.Descriptor instead. +func (*StreamChunkAvailabilityRequest) Descriptor() ([]byte, []int) { + return file_lightnode_lightnode_proto_rawDescGZIP(), []int{0} +} + +func (x *StreamChunkAvailabilityRequest) GetAuthenticationToken() []byte { + if x != nil { + return x.AuthenticationToken + } + return nil +} + +// A reply to a StreamAvailabilityStatus request. +type StreamChunkAvailabilityReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The hash of a blob header corresponding to a chunk the agent received and verified. From the light node's + // perspective, the blob is available if all chunks the light node wants to sample are available. + HeaderHash []byte `protobuf:"bytes,1,opt,name=header_hash,json=headerHash,proto3" json:"header_hash,omitempty"` +} + +func (x *StreamChunkAvailabilityReply) Reset() { + *x = StreamChunkAvailabilityReply{} + if protoimpl.UnsafeEnabled { + mi := &file_lightnode_lightnode_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamChunkAvailabilityReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamChunkAvailabilityReply) ProtoMessage() {} + +func (x *StreamChunkAvailabilityReply) ProtoReflect() protoreflect.Message { + mi := &file_lightnode_lightnode_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 StreamChunkAvailabilityReply.ProtoReflect.Descriptor instead. +func (*StreamChunkAvailabilityReply) Descriptor() ([]byte, []int) { + return file_lightnode_lightnode_proto_rawDescGZIP(), []int{1} +} + +func (x *StreamChunkAvailabilityReply) GetHeaderHash() []byte { + if x != nil { + return x.HeaderHash + } + return nil +} + +var File_lightnode_lightnode_proto protoreflect.FileDescriptor + +var file_lightnode_lightnode_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x6c, 0x69, 0x67, 0x68, + 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6c, 0x69, 0x67, + 0x68, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x1e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, + 0x14, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x61, 0x75, 0x74, + 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x22, 0x3f, 0x0a, 0x1c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x41, + 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, + 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, 0x32, 0x7d, 0x0a, 0x09, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x70, + 0x0a, 0x16, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x6c, 0x6f, 0x62, 0x41, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x29, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, + 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x41, 0x76, 0x61, 0x69, 0x6c, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x30, 0x01, + 0x42, 0x31, 0x5a, 0x2f, 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, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, + 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_lightnode_lightnode_proto_rawDescOnce sync.Once + file_lightnode_lightnode_proto_rawDescData = file_lightnode_lightnode_proto_rawDesc +) + +func file_lightnode_lightnode_proto_rawDescGZIP() []byte { + file_lightnode_lightnode_proto_rawDescOnce.Do(func() { + file_lightnode_lightnode_proto_rawDescData = protoimpl.X.CompressGZIP(file_lightnode_lightnode_proto_rawDescData) + }) + return file_lightnode_lightnode_proto_rawDescData +} + +var file_lightnode_lightnode_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_lightnode_lightnode_proto_goTypes = []interface{}{ + (*StreamChunkAvailabilityRequest)(nil), // 0: lightnode.StreamChunkAvailabilityRequest + (*StreamChunkAvailabilityReply)(nil), // 1: lightnode.StreamChunkAvailabilityReply +} +var file_lightnode_lightnode_proto_depIdxs = []int32{ + 0, // 0: lightnode.LightNode.StreamBlobAvailability:input_type -> lightnode.StreamChunkAvailabilityRequest + 1, // 1: lightnode.LightNode.StreamBlobAvailability:output_type -> lightnode.StreamChunkAvailabilityReply + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_lightnode_lightnode_proto_init() } +func file_lightnode_lightnode_proto_init() { + if File_lightnode_lightnode_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_lightnode_lightnode_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamChunkAvailabilityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_lightnode_lightnode_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamChunkAvailabilityReply); 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_lightnode_lightnode_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_lightnode_lightnode_proto_goTypes, + DependencyIndexes: file_lightnode_lightnode_proto_depIdxs, + MessageInfos: file_lightnode_lightnode_proto_msgTypes, + }.Build() + File_lightnode_lightnode_proto = out.File + file_lightnode_lightnode_proto_rawDesc = nil + file_lightnode_lightnode_proto_goTypes = nil + file_lightnode_lightnode_proto_depIdxs = nil +} diff --git a/api/grpc/lightnode/lightnode_grpc.pb.go b/api/grpc/lightnode/lightnode_grpc.pb.go new file mode 100644 index 0000000000..f30844e918 --- /dev/null +++ b/api/grpc/lightnode/lightnode_grpc.pb.go @@ -0,0 +1,144 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.23.4 +// source: lightnode/lightnode.proto + +package lightnode + +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 ( + LightNode_StreamBlobAvailability_FullMethodName = "/lightnode.LightNode/StreamBlobAvailability" +) + +// LightNodeClient is the client API for LightNode 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 LightNodeClient interface { + // StreamBlobAvailability streams the availability status blobs from the light node's perspective. + // A light node considers a blob to be available if all chunks it wants to sample are available. + // This API is for use by a DA node for monitoring the availability of chunks through its + // constellation of agent light nodes. + StreamBlobAvailability(ctx context.Context, in *StreamChunkAvailabilityRequest, opts ...grpc.CallOption) (LightNode_StreamBlobAvailabilityClient, error) +} + +type lightNodeClient struct { + cc grpc.ClientConnInterface +} + +func NewLightNodeClient(cc grpc.ClientConnInterface) LightNodeClient { + return &lightNodeClient{cc} +} + +func (c *lightNodeClient) StreamBlobAvailability(ctx context.Context, in *StreamChunkAvailabilityRequest, opts ...grpc.CallOption) (LightNode_StreamBlobAvailabilityClient, error) { + stream, err := c.cc.NewStream(ctx, &LightNode_ServiceDesc.Streams[0], LightNode_StreamBlobAvailability_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &lightNodeStreamBlobAvailabilityClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type LightNode_StreamBlobAvailabilityClient interface { + Recv() (*StreamChunkAvailabilityReply, error) + grpc.ClientStream +} + +type lightNodeStreamBlobAvailabilityClient struct { + grpc.ClientStream +} + +func (x *lightNodeStreamBlobAvailabilityClient) Recv() (*StreamChunkAvailabilityReply, error) { + m := new(StreamChunkAvailabilityReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// LightNodeServer is the server API for LightNode service. +// All implementations must embed UnimplementedLightNodeServer +// for forward compatibility +type LightNodeServer interface { + // StreamBlobAvailability streams the availability status blobs from the light node's perspective. + // A light node considers a blob to be available if all chunks it wants to sample are available. + // This API is for use by a DA node for monitoring the availability of chunks through its + // constellation of agent light nodes. + StreamBlobAvailability(*StreamChunkAvailabilityRequest, LightNode_StreamBlobAvailabilityServer) error + mustEmbedUnimplementedLightNodeServer() +} + +// UnimplementedLightNodeServer must be embedded to have forward compatible implementations. +type UnimplementedLightNodeServer struct { +} + +func (UnimplementedLightNodeServer) StreamBlobAvailability(*StreamChunkAvailabilityRequest, LightNode_StreamBlobAvailabilityServer) error { + return status.Errorf(codes.Unimplemented, "method StreamBlobAvailability not implemented") +} +func (UnimplementedLightNodeServer) mustEmbedUnimplementedLightNodeServer() {} + +// UnsafeLightNodeServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LightNodeServer will +// result in compilation errors. +type UnsafeLightNodeServer interface { + mustEmbedUnimplementedLightNodeServer() +} + +func RegisterLightNodeServer(s grpc.ServiceRegistrar, srv LightNodeServer) { + s.RegisterService(&LightNode_ServiceDesc, srv) +} + +func _LightNode_StreamBlobAvailability_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(StreamChunkAvailabilityRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(LightNodeServer).StreamBlobAvailability(m, &lightNodeStreamBlobAvailabilityServer{stream}) +} + +type LightNode_StreamBlobAvailabilityServer interface { + Send(*StreamChunkAvailabilityReply) error + grpc.ServerStream +} + +type lightNodeStreamBlobAvailabilityServer struct { + grpc.ServerStream +} + +func (x *lightNodeStreamBlobAvailabilityServer) Send(m *StreamChunkAvailabilityReply) error { + return x.ServerStream.SendMsg(m) +} + +// LightNode_ServiceDesc is the grpc.ServiceDesc for LightNode service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LightNode_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "lightnode.LightNode", + HandlerType: (*LightNodeServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamBlobAvailability", + Handler: _LightNode_StreamBlobAvailability_Handler, + ServerStreams: true, + }, + }, + Metadata: "lightnode/lightnode.proto", +} diff --git a/api/grpc/node/node.pb.go b/api/grpc/node/node.pb.go index b81c23ed2a..d765284378 100644 --- a/api/grpc/node/node.pb.go +++ b/api/grpc/node/node.pb.go @@ -1262,6 +1262,105 @@ func (x *NodeInfoReply) GetMemBytes() uint64 { return 0 } +// Request that all new blob headers be sent. +type StreamBlobHeadersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StreamBlobHeadersRequest) Reset() { + *x = StreamBlobHeadersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_node_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamBlobHeadersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamBlobHeadersRequest) ProtoMessage() {} + +func (x *StreamBlobHeadersRequest) 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 StreamBlobHeadersRequest.ProtoReflect.Descriptor instead. +func (*StreamBlobHeadersRequest) Descriptor() ([]byte, []int) { + return file_node_node_proto_rawDescGZIP(), []int{19} +} + +// Reply to StreamHeadersRequest +type StreamHeadersReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The header of the blob + BlobHeader *BlobHeader `protobuf:"bytes,1,opt,name=blob_header,json=blobHeader,proto3" json:"blob_header,omitempty"` + // Merkle proof that returned blob header belongs to the batch and is + // the batch's MerkleProof.index-th blob. + // This can be checked against the batch root on chain. + Proof *MerkleProof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (x *StreamHeadersReply) Reset() { + *x = StreamHeadersReply{} + if protoimpl.UnsafeEnabled { + mi := &file_node_node_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StreamHeadersReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StreamHeadersReply) ProtoMessage() {} + +func (x *StreamHeadersReply) 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 StreamHeadersReply.ProtoReflect.Descriptor instead. +func (*StreamHeadersReply) Descriptor() ([]byte, []int) { + return file_node_node_proto_rawDescGZIP(), []int{20} +} + +func (x *StreamHeadersReply) GetBlobHeader() *BlobHeader { + if x != nil { + return x.BlobHeader + } + return nil +} + +func (x *StreamHeadersReply) GetProof() *MerkleProof { + if x != nil { + return x.Proof + } + return nil +} + var File_node_node_proto protoreflect.FileDescriptor var file_node_node_proto_rawDesc = []byte{ @@ -1403,45 +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, 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, 0xda, 0x01, 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, 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 ( @@ -1457,65 +1570,71 @@ 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, 19) +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 - (*StoreChunksReply)(nil), // 2: node.StoreChunksReply - (*StoreBlobsRequest)(nil), // 3: node.StoreBlobsRequest - (*StoreBlobsReply)(nil), // 4: node.StoreBlobsReply - (*AttestBatchRequest)(nil), // 5: node.AttestBatchRequest - (*AttestBatchReply)(nil), // 6: node.AttestBatchReply - (*RetrieveChunksRequest)(nil), // 7: node.RetrieveChunksRequest - (*RetrieveChunksReply)(nil), // 8: node.RetrieveChunksReply - (*GetBlobHeaderRequest)(nil), // 9: node.GetBlobHeaderRequest - (*GetBlobHeaderReply)(nil), // 10: node.GetBlobHeaderReply - (*MerkleProof)(nil), // 11: node.MerkleProof - (*Blob)(nil), // 12: node.Blob - (*Bundle)(nil), // 13: node.Bundle - (*G2Commitment)(nil), // 14: node.G2Commitment - (*BlobHeader)(nil), // 15: node.BlobHeader - (*BlobQuorumInfo)(nil), // 16: node.BlobQuorumInfo - (*BatchHeader)(nil), // 17: node.BatchHeader - (*NodeInfoRequest)(nil), // 18: node.NodeInfoRequest - (*NodeInfoReply)(nil), // 19: node.NodeInfoReply - (*wrapperspb.BytesValue)(nil), // 20: google.protobuf.BytesValue - (*common.G1Commitment)(nil), // 21: common.G1Commitment + (ChunkEncodingFormat)(0), // 0: node.ChunkEncodingFormat + (*StoreChunksRequest)(nil), // 1: node.StoreChunksRequest + (*StoreChunksReply)(nil), // 2: node.StoreChunksReply + (*StoreBlobsRequest)(nil), // 3: node.StoreBlobsRequest + (*StoreBlobsReply)(nil), // 4: node.StoreBlobsReply + (*AttestBatchRequest)(nil), // 5: node.AttestBatchRequest + (*AttestBatchReply)(nil), // 6: node.AttestBatchReply + (*RetrieveChunksRequest)(nil), // 7: node.RetrieveChunksRequest + (*RetrieveChunksReply)(nil), // 8: node.RetrieveChunksReply + (*GetBlobHeaderRequest)(nil), // 9: node.GetBlobHeaderRequest + (*GetBlobHeaderReply)(nil), // 10: node.GetBlobHeaderReply + (*MerkleProof)(nil), // 11: node.MerkleProof + (*Blob)(nil), // 12: node.Blob + (*Bundle)(nil), // 13: node.Bundle + (*G2Commitment)(nil), // 14: node.G2Commitment + (*BlobHeader)(nil), // 15: node.BlobHeader + (*BlobQuorumInfo)(nil), // 16: node.BlobQuorumInfo + (*BatchHeader)(nil), // 17: node.BatchHeader + (*NodeInfoRequest)(nil), // 18: node.NodeInfoRequest + (*NodeInfoReply)(nil), // 19: node.NodeInfoReply + (*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 - 20, // 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 - 21, // 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 - 1, // 14: node.Dispersal.StoreChunks:input_type -> node.StoreChunksRequest - 3, // 15: node.Dispersal.StoreBlobs:input_type -> node.StoreBlobsRequest - 5, // 16: node.Dispersal.AttestBatch:input_type -> node.AttestBatchRequest - 18, // 17: node.Dispersal.NodeInfo:input_type -> node.NodeInfoRequest - 7, // 18: node.Retrieval.RetrieveChunks:input_type -> node.RetrieveChunksRequest - 9, // 19: node.Retrieval.GetBlobHeader:input_type -> node.GetBlobHeaderRequest - 18, // 20: node.Retrieval.NodeInfo:input_type -> node.NodeInfoRequest - 2, // 21: node.Dispersal.StoreChunks:output_type -> node.StoreChunksReply - 4, // 22: node.Dispersal.StoreBlobs:output_type -> node.StoreBlobsReply - 6, // 23: node.Dispersal.AttestBatch:output_type -> node.AttestBatchReply - 19, // 24: node.Dispersal.NodeInfo:output_type -> node.NodeInfoReply - 8, // 25: node.Retrieval.RetrieveChunks:output_type -> node.RetrieveChunksReply - 10, // 26: node.Retrieval.GetBlobHeader:output_type -> node.GetBlobHeaderReply - 19, // 27: node.Retrieval.NodeInfo:output_type -> node.NodeInfoReply - 21, // [21:28] is the sub-list for method output_type - 14, // [14:21] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] 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() } @@ -1752,6 +1871,30 @@ func file_node_node_proto_init() { return nil } } + file_node_node_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StreamBlobHeadersRequest); 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.(*StreamHeadersReply); 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{ @@ -1759,7 +1902,7 @@ func file_node_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_node_node_proto_rawDesc, NumEnums: 1, - NumMessages: 19, + 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 28a516cec7..a30bbbdeff 100644 --- a/api/grpc/node/node_grpc.pb.go +++ b/api/grpc/node/node_grpc.pb.go @@ -244,9 +244,10 @@ var Dispersal_ServiceDesc = grpc.ServiceDesc{ } const ( - Retrieval_RetrieveChunks_FullMethodName = "/node.Retrieval/RetrieveChunks" - Retrieval_GetBlobHeader_FullMethodName = "/node.Retrieval/GetBlobHeader" - Retrieval_NodeInfo_FullMethodName = "/node.Retrieval/NodeInfo" + Retrieval_RetrieveChunks_FullMethodName = "/node.Retrieval/RetrieveChunks" + Retrieval_GetBlobHeader_FullMethodName = "/node.Retrieval/GetBlobHeader" + Retrieval_NodeInfo_FullMethodName = "/node.Retrieval/NodeInfo" + Retrieval_StreamBlobHeaders_FullMethodName = "/node.Retrieval/StreamBlobHeaders" ) // RetrievalClient is the client API for Retrieval service. @@ -259,6 +260,8 @@ 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) + // StreamHeaders requests a stream all new headers. + StreamBlobHeaders(ctx context.Context, opts ...grpc.CallOption) (Retrieval_StreamBlobHeadersClient, error) } type retrievalClient struct { @@ -296,6 +299,37 @@ func (c *retrievalClient) NodeInfo(ctx context.Context, in *NodeInfoRequest, opt 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 { + return nil, err + } + x := &retrievalStreamBlobHeadersClient{stream} + return x, nil +} + +type Retrieval_StreamBlobHeadersClient interface { + Send(*StreamBlobHeadersRequest) error + Recv() (*StreamHeadersReply, error) + grpc.ClientStream +} + +type retrievalStreamBlobHeadersClient struct { + grpc.ClientStream +} + +func (x *retrievalStreamBlobHeadersClient) Send(m *StreamBlobHeadersRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *retrievalStreamBlobHeadersClient) Recv() (*StreamHeadersReply, error) { + m := new(StreamHeadersReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // RetrievalServer is the server API for Retrieval service. // All implementations must embed UnimplementedRetrievalServer // for forward compatibility @@ -306,6 +340,8 @@ type RetrievalServer interface { GetBlobHeader(context.Context, *GetBlobHeaderRequest) (*GetBlobHeaderReply, error) // Retrieve node info metadata NodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoReply, error) + // StreamHeaders requests a stream all new headers. + StreamBlobHeaders(Retrieval_StreamBlobHeadersServer) error mustEmbedUnimplementedRetrievalServer() } @@ -322,6 +358,9 @@ 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) StreamBlobHeaders(Retrieval_StreamBlobHeadersServer) error { + return status.Errorf(codes.Unimplemented, "method StreamBlobHeaders not implemented") +} func (UnimplementedRetrievalServer) mustEmbedUnimplementedRetrievalServer() {} // UnsafeRetrievalServer may be embedded to opt out of forward compatibility for this service. @@ -389,6 +428,32 @@ func _Retrieval_NodeInfo_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Retrieval_StreamBlobHeaders_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RetrievalServer).StreamBlobHeaders(&retrievalStreamBlobHeadersServer{stream}) +} + +type Retrieval_StreamBlobHeadersServer interface { + Send(*StreamHeadersReply) error + Recv() (*StreamBlobHeadersRequest, error) + grpc.ServerStream +} + +type retrievalStreamBlobHeadersServer struct { + grpc.ServerStream +} + +func (x *retrievalStreamBlobHeadersServer) Send(m *StreamHeadersReply) error { + return x.ServerStream.SendMsg(m) +} + +func (x *retrievalStreamBlobHeadersServer) Recv() (*StreamBlobHeadersRequest, error) { + m := new(StreamBlobHeadersRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // Retrieval_ServiceDesc is the grpc.ServiceDesc for Retrieval service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -409,6 +474,13 @@ var Retrieval_ServiceDesc = grpc.ServiceDesc{ Handler: _Retrieval_NodeInfo_Handler, }, }, - Streams: []grpc.StreamDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamBlobHeaders", + Handler: _Retrieval_StreamBlobHeaders_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, Metadata: "node/node.proto", } diff --git a/api/grpc/relay/relay.pb.go b/api/grpc/relay/relay.pb.go new file mode 100644 index 0000000000..1d6b078c9b --- /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 0000000000..07bfc09d3b --- /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/common/common.proto b/api/proto/common/common.proto index 343222f88c..c2dd9d5518 100644 --- a/api/proto/common/common.proto +++ b/api/proto/common/common.proto @@ -8,3 +8,12 @@ message G1Commitment { // The Y coordinate of the KZG commitment. This is the raw byte representation of the field element. bytes y = 2; } + +///////////////////////////////////////////////////////////////////////////////////// +// Experimental: the following definitions are experimental and subject to change. // +///////////////////////////////////////////////////////////////////////////////////// + +// A chunk of a blob. +message ChunkData { + bytes data = 1; +} \ No newline at end of file diff --git a/api/proto/disperser/disperser.proto b/api/proto/disperser/disperser.proto index d83aaf3124..536ef182c8 100644 --- a/api/proto/disperser/disperser.proto +++ b/api/proto/disperser/disperser.proto @@ -32,6 +32,13 @@ service Disperser { // The blob should have been initially dispersed via this Disperser service // for this API to work. rpc RetrieveBlob(RetrieveBlobRequest) returns (RetrieveBlobReply) {} + + ////////////////////////////////////////////////////////////////////////////// + // Experimental: the following RPCs are experimental and subject to change. // + ////////////////////////////////////////////////////////////////////////////// + + // Retrieves the requested chunk from the Disperser's backend. + rpc GetChunk(GetChunkRequest) returns (GetChunkReply) {} } // Requests and Responses @@ -39,17 +46,17 @@ service Disperser { // Authenicated Message Types message AuthenticatedRequest { - oneof payload { - DisperseBlobRequest disperse_request = 1; - AuthenticationData authentication_data = 2; - } + oneof payload { + DisperseBlobRequest disperse_request = 1; + AuthenticationData authentication_data = 2; + } } message AuthenticatedReply { - oneof payload { - BlobAuthHeader blob_auth_header = 1; - DisperseBlobReply disperse_reply = 2; - } + oneof payload { + BlobAuthHeader blob_auth_header = 1; + DisperseBlobReply disperse_reply = 2; + } } // BlobAuthHeader contains information about the blob for the client to verify and sign. @@ -250,3 +257,21 @@ message BatchHeader { // (e.g. operator stakes) at this block number. uint32 reference_block_number = 4; } + +///////////////////////////////////////////////////////////////////////////////////// +// Experimental: the following definitions are experimental and subject to change. // +///////////////////////////////////////////////////////////////////////////////////// + +// Request a specific chunk +message GetChunkRequest { + // The hash of the blob's header. + bytes blob_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/api/proto/lightnode/lightnode.proto b/api/proto/lightnode/lightnode.proto new file mode 100644 index 0000000000..90b0527212 --- /dev/null +++ b/api/proto/lightnode/lightnode.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package lightnode; +import "common/common.proto"; +option go_package = "github.com/Layr-Labs/eigenda/api/grpc/lightnode"; + +///////////////////////////////////////////////////////////////////////////////////// +// Experimental: the following definitions are experimental and subject to change. // +///////////////////////////////////////////////////////////////////////////////////// + +service LightNode { + // StreamBlobAvailability streams the availability status blobs from the light node's perspective. + // A light node considers a blob to be available if all chunks it wants to sample are available. + // This API is for use by a DA node for monitoring the availability of chunks through its + // constellation of agent light nodes. + rpc StreamBlobAvailability(StreamChunkAvailabilityRequest) returns (stream StreamChunkAvailabilityReply) {} +} + +// A request from a DA node to an agent light node to stream the availability status of all chunks +// assigned to the light node. +message StreamChunkAvailabilityRequest { + bytes authentication_token = 1; +} + +// A reply to a StreamAvailabilityStatus request. +message StreamChunkAvailabilityReply { + // The hash of a blob header corresponding to a chunk the agent received and verified. From the light node's + // perspective, the blob is available if all chunks the light node wants to sample are available. + bytes header_hash = 1; +} \ No newline at end of file diff --git a/api/proto/node/node.proto b/api/proto/node/node.proto index f32fea64a8..b9fb54144f 100644 --- a/api/proto/node/node.proto +++ b/api/proto/node/node.proto @@ -33,6 +33,13 @@ service Retrieval { rpc GetBlobHeader(GetBlobHeaderRequest) returns (GetBlobHeaderReply) {} // Retrieve node info metadata rpc NodeInfo(NodeInfoRequest) returns (NodeInfoReply) {} + + ////////////////////////////////////////////////////////////////////////////// + // Experimental: the following RPCs are experimental and subject to change. // + ////////////////////////////////////////////////////////////////////////////// + + // StreamHeaders requests a stream all new headers. + rpc StreamBlobHeaders(stream StreamBlobHeadersRequest) returns (stream StreamHeadersReply) {} } // Requests and replies @@ -216,3 +223,21 @@ message NodeInfoReply { uint32 num_cpu = 4; uint64 mem_bytes = 5; } + +///////////////////////////////////////////////////////////////////////////////////// +// Experimental: the following definitions are experimental and subject to change. // +///////////////////////////////////////////////////////////////////////////////////// + +// Request that all new blob headers be sent. +message StreamBlobHeadersRequest { +} + +// Reply to StreamHeadersRequest +message StreamHeadersReply { + // The header of the blob + BlobHeader blob_header = 1; + // Merkle proof that returned blob header belongs to the batch and is + // the batch's MerkleProof.index-th blob. + // This can be checked against the batch root on chain. + MerkleProof proof = 2; +} diff --git a/api/proto/relay/relay.proto b/api/proto/relay/relay.proto new file mode 100644 index 0000000000..d92f605761 --- /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/disperser/apiserver/server.go b/disperser/apiserver/server.go index fa3df5acff..b2c14220e6 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "google.golang.org/grpc/status" "math/rand" "net" "slices" @@ -773,6 +774,10 @@ func (s *DispersalServer) RetrieveBlob(ctx context.Context, req *pb.RetrieveBlob }, nil } +func (s *DispersalServer) GetChunk(context.Context, *pb.GetChunkRequest) (*pb.GetChunkReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChunk not implemented") +} + func (s *DispersalServer) GetRateConfig() *RateConfig { return &s.rateConfig } diff --git a/node/grpc/server.go b/node/grpc/server.go index dc5465469d..7c262fa57e 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -5,6 +5,8 @@ import ( "encoding/hex" "errors" "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "reflect" "runtime" "sync" @@ -154,6 +156,10 @@ 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) StreamBlobHeaders(pb.Retrieval_StreamBlobHeadersServer) error { + return status.Errorf(codes.Unimplemented, "method StreamBlobHeaders not implemented") +} + func (s *Server) handleStoreChunksRequest(ctx context.Context, in *pb.StoreChunksRequest) (*pb.StoreChunksReply, error) { start := time.Now()