diff --git a/Makefile b/Makefile index acbc58a676..77c0c9af8c 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ protoc: clean --go-grpc_opt=paths=source_relative \ $(PROTOS)/**/*.proto # Generate Protobuf for sub directories of ./api/proto/disperser - protoc -I $(PROTOS_DISPERSER) \ + protoc -I $(PROTOS_DISPERSER) -I $(PROTOS) \ --go_out=$(PROTO_GEN_DISPERSER_PATH) \ --go_opt=paths=source_relative \ --go-grpc_out=$(PROTO_GEN_DISPERSER_PATH) \ diff --git a/api/grpc/churner/churner.pb.go b/api/grpc/churner/churner.pb.go index 0a19410a44..5313be5c84 100644 --- a/api/grpc/churner/churner.pb.go +++ b/api/grpc/churner/churner.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.15.8 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: churner/churner.proto package churner @@ -39,7 +39,7 @@ type ChurnRequest struct { // will fail to proceed. // - If any of the quorum fails to register, this entire request will fail. // - // The IDs must be in range [0, 255]. + // The IDs must be in range [0, 254]. QuorumIds []uint32 `protobuf:"varint,5,rep,packed,name=quorum_ids,json=quorumIds,proto3" json:"quorum_ids,omitempty"` // The Ethereum address (in hex like "0x123abcdef...") of the operator. OperatorAddress string `protobuf:"bytes,6,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` diff --git a/api/grpc/churner/churner_grpc.pb.go b/api/grpc/churner/churner_grpc.pb.go index bdeec0916a..75fdbed77f 100644 --- a/api/grpc/churner/churner_grpc.pb.go +++ b/api/grpc/churner/churner_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.15.8 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 // source: churner/churner.proto package churner @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Churner_Churn_FullMethodName = "/churner.Churner/Churn" -) - // ChurnerClient is the client API for Churner 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. @@ -39,7 +35,7 @@ func NewChurnerClient(cc grpc.ClientConnInterface) ChurnerClient { func (c *churnerClient) Churn(ctx context.Context, in *ChurnRequest, opts ...grpc.CallOption) (*ChurnReply, error) { out := new(ChurnReply) - err := c.cc.Invoke(ctx, Churner_Churn_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/churner.Churner/Churn", in, out, opts...) if err != nil { return nil, err } @@ -84,7 +80,7 @@ func _Churner_Churn_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Churner_Churn_FullMethodName, + FullMethod: "/churner.Churner/Churn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ChurnerServer).Churn(ctx, req.(*ChurnRequest)) diff --git a/api/grpc/common/common.pb.go b/api/grpc/common/common.pb.go new file mode 100644 index 0000000000..c1829695bf --- /dev/null +++ b/api/grpc/common/common.pb.go @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.12.4 +// source: common/common.proto + +package common + +import ( + 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) +) + +type G1Commitment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The X coordinate of the KZG commitment. This is the raw byte representation of the field element. + X []byte `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"` + // The Y coordinate of the KZG commitment. This is the raw byte representation of the field element. + Y []byte `protobuf:"bytes,2,opt,name=y,proto3" json:"y,omitempty"` +} + +func (x *G1Commitment) Reset() { + *x = G1Commitment{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *G1Commitment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*G1Commitment) ProtoMessage() {} + +func (x *G1Commitment) ProtoReflect() protoreflect.Message { + mi := &file_common_common_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 G1Commitment.ProtoReflect.Descriptor instead. +func (*G1Commitment) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{0} +} + +func (x *G1Commitment) GetX() []byte { + if x != nil { + return x.X + } + return nil +} + +func (x *G1Commitment) GetY() []byte { + if x != nil { + return x.Y + } + return nil +} + +var File_common_common_proto protoreflect.FileDescriptor + +var file_common_common_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 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, +} + +var ( + file_common_common_proto_rawDescOnce sync.Once + file_common_common_proto_rawDescData = file_common_common_proto_rawDesc +) + +func file_common_common_proto_rawDescGZIP() []byte { + file_common_common_proto_rawDescOnce.Do(func() { + file_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_common_proto_rawDescData) + }) + return file_common_common_proto_rawDescData +} + +var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_common_proto_goTypes = []interface{}{ + (*G1Commitment)(nil), // 0: common.G1Commitment +} +var file_common_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] 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_common_common_proto_init() } +func file_common_common_proto_init() { + if File_common_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*G1Commitment); 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_common_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_common_proto_goTypes, + DependencyIndexes: file_common_common_proto_depIdxs, + MessageInfos: file_common_common_proto_msgTypes, + }.Build() + File_common_common_proto = out.File + file_common_common_proto_rawDesc = nil + file_common_common_proto_goTypes = nil + file_common_common_proto_depIdxs = nil +} diff --git a/api/grpc/disperser/disperser.pb.go b/api/grpc/disperser/disperser.pb.go index 281bedadfa..f749ca9064 100644 --- a/api/grpc/disperser/disperser.pb.go +++ b/api/grpc/disperser/disperser.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.15.8 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: disperser/disperser.proto package disperser import ( + common "github.com/Layr-Labs/eigenda/api/grpc/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -704,7 +705,7 @@ type SecurityParams struct { // The ID of the quorum. // The quorum must be already registered on EigenLayer. The ID must be - // in range [0, 255]. + // in range [0, 254]. QuorumId uint32 `protobuf:"varint,1,opt,name=quorum_id,json=quorumId,proto3" json:"quorum_id,omitempty"` // The max percentage of stake within the quorum that can be held by or delegated // to adversarial operators. @@ -847,8 +848,8 @@ type BlobHeader struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // KZG commitment to the blob. - Commitment []byte `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"` + // KZG commitment of the blob. + Commitment *common.G1Commitment `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"` // The length of the blob in symbols (each symbol is 31 bytes). DataLength uint32 `protobuf:"varint,2,opt,name=data_length,json=dataLength,proto3" json:"data_length,omitempty"` // The params of the quorums that this blob participates in. @@ -887,7 +888,7 @@ func (*BlobHeader) Descriptor() ([]byte, []int) { return file_disperser_disperser_proto_rawDescGZIP(), []int{12} } -func (x *BlobHeader) GetCommitment() []byte { +func (x *BlobHeader) GetCommitment() *common.G1Commitment { if x != nil { return x.Commitment } @@ -1254,190 +1255,193 @@ var File_disperser_disperser_proto protoreflect.FileDescriptor var file_disperser_disperser_proto_rawDesc = []byte{ 0x0a, 0x19, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x64, 0x69, 0x73, - 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x22, 0xc0, 0x01, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x4b, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 0x48, 0x00, 0x52, 0x0f, 0x64, 0x69, 0x73, - 0x70, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x13, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x64, 0x69, 0x73, 0x70, - 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, - 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x42, 0x09, - 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xad, 0x01, 0x0a, 0x12, 0x41, 0x75, - 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x45, 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, - 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x41, 0x75, 0x74, 0x68, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, 0x6f, 0x62, 0x41, 0x75, 0x74, - 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, 0x64, 0x69, 0x73, 0x70, 0x65, - 0x72, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 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, 0x48, 0x00, 0x52, - 0x0d, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x09, - 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x41, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, - 0x62, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x13, 0x63, - 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, - 0x6e, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x22, 0x45, 0x0a, 0x12, - 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x01, 0x0a, 0x14, + 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x10, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, + 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 0x48, 0x00, + 0x52, 0x0f, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x50, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x22, 0x8c, 0x01, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, - 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x42, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, - 0x72, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x49, 0x64, 0x22, 0x61, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, - 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, - 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, - 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xad, + 0x01, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x45, 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x61, 0x75, + 0x74, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, + 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0e, 0x62, 0x6c, + 0x6f, 0x62, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0e, + 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 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, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x41, + 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x62, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x63, + 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x22, 0x45, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x8c, 0x01, 0x0a, 0x13, 0x44, 0x69, 0x73, + 0x70, 0x65, 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x70, 0x65, + 0x72, 0x73, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2d, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x27, 0x0a, 0x04, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, 0x73, 0x70, - 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, - 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x60, 0x0a, 0x13, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, - 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x5f, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, - 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x27, 0x0a, 0x11, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, - 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x89, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x64, 0x12, - 0x2f, 0x0a, 0x13, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x5f, 0x74, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x61, 0x64, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, - 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x71, 0x75, 0x6f, 0x72, - 0x75, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x08, - 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, - 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x58, 0x0a, 0x17, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, - 0x6f, 0x62, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x52, 0x15, 0x62, 0x6c, 0x6f, 0x62, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x97, 0x01, 0x0a, 0x0a, 0x42, - 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, - 0x61, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, - 0x64, 0x61, 0x74, 0x61, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x48, 0x0a, 0x12, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, - 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x22, 0xdf, 0x01, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x71, 0x75, 0x6f, 0x72, - 0x75, 0x6d, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0c, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x44, 0x0a, - 0x1e, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1c, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x61, 0x67, 0x65, 0x12, 0x3e, 0x0a, 0x1b, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x74, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, - 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x19, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, - 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xe2, 0x01, 0x0a, 0x15, 0x42, 0x6c, 0x6f, 0x62, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x12, 0x19, 0x0a, 0x08, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x62, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3f, 0x0a, 0x0e, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x25, 0x0a, 0x0e, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x71, 0x75, - 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x22, 0xf8, 0x01, 0x0a, 0x0d, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, - 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x62, 0x61, 0x74, - 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, - 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x3a, - 0x0a, 0x19, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x17, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x22, 0xc5, 0x01, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, - 0x68, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x19, - 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x17, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, - 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 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, 0x70, - 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, - 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, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x32, 0x0a, 0x11, 0x42, 0x6c, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x69, + 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x15, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, + 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x27, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x60, 0x0a, 0x13, 0x52, 0x65, 0x74, + 0x72, 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, + 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x27, 0x0a, 0x11, 0x52, + 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x89, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x72, 0x75, + 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, + 0x79, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x12, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x36, 0x0a, + 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, + 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x58, 0x0a, 0x17, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, + 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x15, 0x62, 0x6c, 0x6f, 0x62, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, + 0xad, 0x01, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x31, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x4c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x48, 0x0a, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x71, 0x75, + 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, + 0x6f, 0x62, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x10, 0x62, + 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, + 0xdf, 0x01, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x1e, 0x61, 0x64, 0x76, 0x65, + 0x72, 0x73, 0x61, 0x72, 0x79, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x5f, + 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x1c, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x3e, + 0x0a, 0x1b, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x19, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x4c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x22, 0xe2, 0x01, 0x0a, 0x15, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x19, 0x0a, 0x08, 0x62, + 0x61, 0x74, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x62, + 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3f, 0x0a, 0x0e, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, + 0x25, 0x0a, 0x0e, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x22, 0xf8, 0x01, 0x0a, 0x0d, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x64, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x79, + 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, + 0x68, 0x22, 0xc5, 0x01, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x25, 0x0a, 0x0e, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x71, 0x75, 0x6f, 0x72, 0x75, + 0x6d, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, + 0x67, 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, 0x70, 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, 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, } var ( @@ -1473,6 +1477,7 @@ var file_disperser_disperser_proto_goTypes = []interface{}{ (*BlobVerificationProof)(nil), // 15: disperser.BlobVerificationProof (*BatchMetadata)(nil), // 16: disperser.BatchMetadata (*BatchHeader)(nil), // 17: disperser.BatchHeader + (*common.G1Commitment)(nil), // 18: common.G1Commitment } var file_disperser_disperser_proto_depIdxs = []int32{ 5, // 0: disperser.AuthenticatedRequest.disperse_request:type_name -> disperser.DisperseBlobRequest @@ -1485,22 +1490,23 @@ var file_disperser_disperser_proto_depIdxs = []int32{ 12, // 7: disperser.BlobStatusReply.info:type_name -> disperser.BlobInfo 13, // 8: disperser.BlobInfo.blob_header:type_name -> disperser.BlobHeader 15, // 9: disperser.BlobInfo.blob_verification_proof:type_name -> disperser.BlobVerificationProof - 14, // 10: disperser.BlobHeader.blob_quorum_params:type_name -> disperser.BlobQuorumParam - 16, // 11: disperser.BlobVerificationProof.batch_metadata:type_name -> disperser.BatchMetadata - 17, // 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 + 18, // 10: disperser.BlobHeader.commitment:type_name -> common.G1Commitment + 14, // 11: disperser.BlobHeader.blob_quorum_params:type_name -> disperser.BlobQuorumParam + 16, // 12: disperser.BlobVerificationProof.batch_metadata:type_name -> disperser.BatchMetadata + 17, // 13: disperser.BatchMetadata.batch_header:type_name -> disperser.BatchHeader + 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 + 6, // 18: disperser.Disperser.DisperseBlob:output_type -> disperser.DisperseBlobReply + 2, // 19: disperser.Disperser.DisperseBlobAuthenticated:output_type -> disperser.AuthenticatedReply + 8, // 20: disperser.Disperser.GetBlobStatus:output_type -> disperser.BlobStatusReply + 10, // 21: disperser.Disperser.RetrieveBlob:output_type -> disperser.RetrieveBlobReply + 18, // [18:22] is the sub-list for method output_type + 14, // [14:18] 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() } diff --git a/api/grpc/disperser/disperser_grpc.pb.go b/api/grpc/disperser/disperser_grpc.pb.go index da92a853c4..b0ddb284aa 100644 --- a/api/grpc/disperser/disperser_grpc.pb.go +++ b/api/grpc/disperser/disperser_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.15.8 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 // source: disperser/disperser.proto package disperser @@ -18,13 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Disperser_DisperseBlob_FullMethodName = "/disperser.Disperser/DisperseBlob" - Disperser_DisperseBlobAuthenticated_FullMethodName = "/disperser.Disperser/DisperseBlobAuthenticated" - Disperser_GetBlobStatus_FullMethodName = "/disperser.Disperser/GetBlobStatus" - Disperser_RetrieveBlob_FullMethodName = "/disperser.Disperser/RetrieveBlob" -) - // DisperserClient is the client API for Disperser 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. @@ -64,7 +57,7 @@ func NewDisperserClient(cc grpc.ClientConnInterface) DisperserClient { func (c *disperserClient) DisperseBlob(ctx context.Context, in *DisperseBlobRequest, opts ...grpc.CallOption) (*DisperseBlobReply, error) { out := new(DisperseBlobReply) - err := c.cc.Invoke(ctx, Disperser_DisperseBlob_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/disperser.Disperser/DisperseBlob", in, out, opts...) if err != nil { return nil, err } @@ -72,7 +65,7 @@ func (c *disperserClient) DisperseBlob(ctx context.Context, in *DisperseBlobRequ } func (c *disperserClient) DisperseBlobAuthenticated(ctx context.Context, opts ...grpc.CallOption) (Disperser_DisperseBlobAuthenticatedClient, error) { - stream, err := c.cc.NewStream(ctx, &Disperser_ServiceDesc.Streams[0], Disperser_DisperseBlobAuthenticated_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &Disperser_ServiceDesc.Streams[0], "/disperser.Disperser/DisperseBlobAuthenticated", opts...) if err != nil { return nil, err } @@ -104,7 +97,7 @@ func (x *disperserDisperseBlobAuthenticatedClient) Recv() (*AuthenticatedReply, func (c *disperserClient) GetBlobStatus(ctx context.Context, in *BlobStatusRequest, opts ...grpc.CallOption) (*BlobStatusReply, error) { out := new(BlobStatusReply) - err := c.cc.Invoke(ctx, Disperser_GetBlobStatus_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/disperser.Disperser/GetBlobStatus", in, out, opts...) if err != nil { return nil, err } @@ -113,7 +106,7 @@ func (c *disperserClient) GetBlobStatus(ctx context.Context, in *BlobStatusReque func (c *disperserClient) RetrieveBlob(ctx context.Context, in *RetrieveBlobRequest, opts ...grpc.CallOption) (*RetrieveBlobReply, error) { out := new(RetrieveBlobReply) - err := c.cc.Invoke(ctx, Disperser_RetrieveBlob_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/disperser.Disperser/RetrieveBlob", in, out, opts...) if err != nil { return nil, err } @@ -189,7 +182,7 @@ func _Disperser_DisperseBlob_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Disperser_DisperseBlob_FullMethodName, + FullMethod: "/disperser.Disperser/DisperseBlob", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DisperserServer).DisperseBlob(ctx, req.(*DisperseBlobRequest)) @@ -233,7 +226,7 @@ func _Disperser_GetBlobStatus_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Disperser_GetBlobStatus_FullMethodName, + FullMethod: "/disperser.Disperser/GetBlobStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DisperserServer).GetBlobStatus(ctx, req.(*BlobStatusRequest)) @@ -251,7 +244,7 @@ func _Disperser_RetrieveBlob_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Disperser_RetrieveBlob_FullMethodName, + FullMethod: "/disperser.Disperser/RetrieveBlob", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DisperserServer).RetrieveBlob(ctx, req.(*RetrieveBlobRequest)) diff --git a/api/grpc/node/node.pb.go b/api/grpc/node/node.pb.go index c203e4ffb7..772ba14ea4 100644 --- a/api/grpc/node/node.pb.go +++ b/api/grpc/node/node.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.15.8 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: node/node.proto package node import ( + common "github.com/Layr-Labs/eigenda/api/grpc/common" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -139,7 +140,7 @@ type RetrieveChunksRequest struct { BlobIndex uint32 `protobuf:"varint,2,opt,name=blob_index,json=blobIndex,proto3" json:"blob_index,omitempty"` // Which quorum of the blob to retrieve for (note: a blob can have multiple // quorums and the chunks for different quorums at a Node can be different). - // The ID must be in range [0, 255]. + // The ID must be in range [0, 254]. QuorumId uint32 `protobuf:"varint,3,opt,name=quorum_id,json=quorumId,proto3" json:"quorum_id,omitempty"` } @@ -540,19 +541,94 @@ func (x *Bundle) GetChunks() [][]byte { return nil } +type G2Commitment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The A0 element of the X coordinate of G2 point. + XA0 []byte `protobuf:"bytes,1,opt,name=x_a0,json=xA0,proto3" json:"x_a0,omitempty"` + // The A1 element of the X coordinate of G2 point. + XA1 []byte `protobuf:"bytes,2,opt,name=x_a1,json=xA1,proto3" json:"x_a1,omitempty"` + // The A0 element of the Y coordinate of G2 point. + YA0 []byte `protobuf:"bytes,3,opt,name=y_a0,json=yA0,proto3" json:"y_a0,omitempty"` + // The A1 element of the Y coordinate of G2 point. + YA1 []byte `protobuf:"bytes,4,opt,name=y_a1,json=yA1,proto3" json:"y_a1,omitempty"` +} + +func (x *G2Commitment) Reset() { + *x = G2Commitment{} + if protoimpl.UnsafeEnabled { + mi := &file_node_node_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *G2Commitment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*G2Commitment) ProtoMessage() {} + +func (x *G2Commitment) ProtoReflect() protoreflect.Message { + mi := &file_node_node_proto_msgTypes[9] + 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 G2Commitment.ProtoReflect.Descriptor instead. +func (*G2Commitment) Descriptor() ([]byte, []int) { + return file_node_node_proto_rawDescGZIP(), []int{9} +} + +func (x *G2Commitment) GetXA0() []byte { + if x != nil { + return x.XA0 + } + return nil +} + +func (x *G2Commitment) GetXA1() []byte { + if x != nil { + return x.XA1 + } + return nil +} + +func (x *G2Commitment) GetYA0() []byte { + if x != nil { + return x.YA0 + } + return nil +} + +func (x *G2Commitment) GetYA1() []byte { + if x != nil { + return x.YA1 + } + return nil +} + type BlobHeader struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The KZG commitment to the polynomial representing the blob. - Commitment []byte `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"` - // The KZG commitment to the polynomial representing the blob on G2, it is uesd + Commitment *common.G1Commitment `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"` + // The KZG commitment to the polynomial representing the blob on G2, it is used // for proving the degree of the polynomial - LengthCommitment []byte `protobuf:"bytes,2,opt,name=length_commitment,json=lengthCommitment,proto3" json:"length_commitment,omitempty"` + LengthCommitment *G2Commitment `protobuf:"bytes,2,opt,name=length_commitment,json=lengthCommitment,proto3" json:"length_commitment,omitempty"` // The low degree proof. It's the KZG commitment to the polynomial shifted to // the largest SRS degree. - LengthProof []byte `protobuf:"bytes,3,opt,name=length_proof,json=lengthProof,proto3" json:"length_proof,omitempty"` + LengthProof *G2Commitment `protobuf:"bytes,3,opt,name=length_proof,json=lengthProof,proto3" json:"length_proof,omitempty"` // The length of the original blob in number of symbols (in the field where // the polynomial is defined). Length uint32 `protobuf:"varint,4,opt,name=length,proto3" json:"length,omitempty"` @@ -565,7 +641,7 @@ type BlobHeader struct { func (x *BlobHeader) Reset() { *x = BlobHeader{} if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[9] + mi := &file_node_node_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -578,7 +654,7 @@ func (x *BlobHeader) String() string { func (*BlobHeader) ProtoMessage() {} func (x *BlobHeader) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[9] + mi := &file_node_node_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -591,24 +667,24 @@ func (x *BlobHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobHeader.ProtoReflect.Descriptor instead. func (*BlobHeader) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{9} + return file_node_node_proto_rawDescGZIP(), []int{10} } -func (x *BlobHeader) GetCommitment() []byte { +func (x *BlobHeader) GetCommitment() *common.G1Commitment { if x != nil { return x.Commitment } return nil } -func (x *BlobHeader) GetLengthCommitment() []byte { +func (x *BlobHeader) GetLengthCommitment() *G2Commitment { if x != nil { return x.LengthCommitment } return nil } -func (x *BlobHeader) GetLengthProof() []byte { +func (x *BlobHeader) GetLengthProof() *G2Commitment { if x != nil { return x.LengthProof } @@ -653,7 +729,7 @@ type BlobQuorumInfo struct { func (x *BlobQuorumInfo) Reset() { *x = BlobQuorumInfo{} if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[10] + mi := &file_node_node_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -666,7 +742,7 @@ func (x *BlobQuorumInfo) String() string { func (*BlobQuorumInfo) ProtoMessage() {} func (x *BlobQuorumInfo) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[10] + mi := &file_node_node_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -679,7 +755,7 @@ func (x *BlobQuorumInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobQuorumInfo.ProtoReflect.Descriptor instead. func (*BlobQuorumInfo) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{10} + return file_node_node_proto_rawDescGZIP(), []int{11} } func (x *BlobQuorumInfo) GetQuorumId() uint32 { @@ -732,7 +808,7 @@ type BatchHeader struct { func (x *BatchHeader) Reset() { *x = BatchHeader{} if protoimpl.UnsafeEnabled { - mi := &file_node_node_proto_msgTypes[11] + mi := &file_node_node_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -745,7 +821,7 @@ func (x *BatchHeader) String() string { func (*BatchHeader) ProtoMessage() {} func (x *BatchHeader) ProtoReflect() protoreflect.Message { - mi := &file_node_node_proto_msgTypes[11] + mi := &file_node_node_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -758,7 +834,7 @@ func (x *BatchHeader) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchHeader.ProtoReflect.Descriptor instead. func (*BatchHeader) Descriptor() ([]byte, []int) { - return file_node_node_proto_rawDescGZIP(), []int{11} + return file_node_node_proto_rawDescGZIP(), []int{12} } func (x *BatchHeader) GetBatchRoot() []byte { @@ -779,107 +855,118 @@ var File_node_node_proto protoreflect.FileDescriptor var file_node_node_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x6c, 0x0a, 0x12, 0x53, 0x74, 0x6f, 0x72, 0x65, - 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, - 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x05, - 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x30, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, - 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x7f, 0x0a, 0x15, 0x52, 0x65, 0x74, 0x72, 0x69, - 0x65, 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, - 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, - 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, - 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x64, 0x22, 0x2d, 0x0a, 0x13, 0x52, 0x65, 0x74, 0x72, - 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x6f, 0x12, 0x04, 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, 0x6c, 0x0a, 0x12, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x34, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, + 0x6c, 0x6f, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x22, 0x30, 0x0a, 0x10, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1c, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x7f, 0x0a, 0x15, + 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x1b, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x64, 0x22, 0x2d, 0x0a, + 0x13, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x7e, 0x0a, 0x14, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x1b, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x22, 0x3b, + 0x0a, 0x0b, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, 0x0a, + 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x58, 0x0a, 0x04, 0x42, + 0x6c, 0x6f, 0x62, 0x12, 0x28, 0x0a, 0x06, 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, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, + 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x07, 0x62, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x22, 0x20, 0x0a, 0x06, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x7e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x6c, - 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, - 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x71, 0x75, - 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6c, - 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x22, 0x3b, 0x0a, 0x0b, 0x4d, 0x65, 0x72, - 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x58, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x28, - 0x0a, 0x06, 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, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x07, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x07, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x73, - 0x22, 0x20, 0x0a, 0x06, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, - 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, - 0x6b, 0x73, 0x22, 0xf0, 0x01, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x3b, 0x0a, 0x0e, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xca, 0x01, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, - 0x6f, 0x72, 0x75, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x72, - 0x75, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, - 0x72, 0x79, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x12, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x54, 0x68, 0x72, - 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, - 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x22, 0x62, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x74, - 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, 0x03, 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, 0x32, 0x4e, 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, 0x32, 0xa0, 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, 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, + 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x22, 0x5a, 0x0a, 0x0c, 0x47, 0x32, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x11, 0x0a, 0x04, 0x78, 0x5f, 0x61, 0x30, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x78, 0x41, 0x30, 0x12, 0x11, 0x0a, 0x04, 0x78, 0x5f, + 0x61, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x78, 0x41, 0x31, 0x12, 0x11, 0x0a, + 0x04, 0x79, 0x5f, 0x61, 0x30, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x79, 0x41, 0x30, + 0x12, 0x11, 0x0a, 0x04, 0x79, 0x5f, 0x61, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x79, 0x41, 0x31, 0x22, 0xae, 0x02, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x62, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x34, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x47, 0x31, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x11, 0x6c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x32, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0c, 0x6c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x47, 0x32, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x3b, 0x0a, 0x0e, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x49, 0x64, 0x22, 0xca, 0x01, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x62, 0x51, 0x75, 0x6f, + 0x72, 0x75, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x71, 0x75, 0x6f, 0x72, 0x75, + 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, + 0x79, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x12, 0x61, 0x64, 0x76, 0x65, 0x72, 0x73, 0x61, 0x72, 0x79, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, + 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x4c, 0x65, 0x6e, + 0x67, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x22, 0x62, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x74, 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, 0x03, 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, 0x32, 0x4e, 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, 0x32, 0xa0, 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, 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 ( @@ -894,7 +981,7 @@ func file_node_node_proto_rawDescGZIP() []byte { return file_node_node_proto_rawDescData } -var file_node_node_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_node_node_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_node_node_proto_goTypes = []interface{}{ (*StoreChunksRequest)(nil), // 0: node.StoreChunksRequest (*StoreChunksReply)(nil), // 1: node.StoreChunksReply @@ -905,29 +992,34 @@ var file_node_node_proto_goTypes = []interface{}{ (*MerkleProof)(nil), // 6: node.MerkleProof (*Blob)(nil), // 7: node.Blob (*Bundle)(nil), // 8: node.Bundle - (*BlobHeader)(nil), // 9: node.BlobHeader - (*BlobQuorumInfo)(nil), // 10: node.BlobQuorumInfo - (*BatchHeader)(nil), // 11: node.BatchHeader + (*G2Commitment)(nil), // 9: node.G2Commitment + (*BlobHeader)(nil), // 10: node.BlobHeader + (*BlobQuorumInfo)(nil), // 11: node.BlobQuorumInfo + (*BatchHeader)(nil), // 12: node.BatchHeader + (*common.G1Commitment)(nil), // 13: common.G1Commitment } var file_node_node_proto_depIdxs = []int32{ - 11, // 0: node.StoreChunksRequest.batch_header:type_name -> node.BatchHeader + 12, // 0: node.StoreChunksRequest.batch_header:type_name -> node.BatchHeader 7, // 1: node.StoreChunksRequest.blobs:type_name -> node.Blob - 9, // 2: node.GetBlobHeaderReply.blob_header:type_name -> node.BlobHeader + 10, // 2: node.GetBlobHeaderReply.blob_header:type_name -> node.BlobHeader 6, // 3: node.GetBlobHeaderReply.proof:type_name -> node.MerkleProof - 9, // 4: node.Blob.header:type_name -> node.BlobHeader + 10, // 4: node.Blob.header:type_name -> node.BlobHeader 8, // 5: node.Blob.bundles:type_name -> node.Bundle - 10, // 6: node.BlobHeader.quorum_headers:type_name -> node.BlobQuorumInfo - 0, // 7: node.Dispersal.StoreChunks:input_type -> node.StoreChunksRequest - 2, // 8: node.Retrieval.RetrieveChunks:input_type -> node.RetrieveChunksRequest - 4, // 9: node.Retrieval.GetBlobHeader:input_type -> node.GetBlobHeaderRequest - 1, // 10: node.Dispersal.StoreChunks:output_type -> node.StoreChunksReply - 3, // 11: node.Retrieval.RetrieveChunks:output_type -> node.RetrieveChunksReply - 5, // 12: node.Retrieval.GetBlobHeader:output_type -> node.GetBlobHeaderReply - 10, // [10:13] is the sub-list for method output_type - 7, // [7:10] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 13, // 6: node.BlobHeader.commitment:type_name -> common.G1Commitment + 9, // 7: node.BlobHeader.length_commitment:type_name -> node.G2Commitment + 9, // 8: node.BlobHeader.length_proof:type_name -> node.G2Commitment + 11, // 9: node.BlobHeader.quorum_headers:type_name -> node.BlobQuorumInfo + 0, // 10: node.Dispersal.StoreChunks:input_type -> node.StoreChunksRequest + 2, // 11: node.Retrieval.RetrieveChunks:input_type -> node.RetrieveChunksRequest + 4, // 12: node.Retrieval.GetBlobHeader:input_type -> node.GetBlobHeaderRequest + 1, // 13: node.Dispersal.StoreChunks:output_type -> node.StoreChunksReply + 3, // 14: node.Retrieval.RetrieveChunks:output_type -> node.RetrieveChunksReply + 5, // 15: node.Retrieval.GetBlobHeader:output_type -> node.GetBlobHeaderReply + 13, // [13:16] is the sub-list for method output_type + 10, // [10:13] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_node_node_proto_init() } @@ -1045,7 +1137,7 @@ func file_node_node_proto_init() { } } file_node_node_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobHeader); i { + switch v := v.(*G2Commitment); i { case 0: return &v.state case 1: @@ -1057,7 +1149,7 @@ func file_node_node_proto_init() { } } file_node_node_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobQuorumInfo); i { + switch v := v.(*BlobHeader); i { case 0: return &v.state case 1: @@ -1069,6 +1161,18 @@ func file_node_node_proto_init() { } } file_node_node_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlobQuorumInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_node_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchHeader); i { case 0: return &v.state @@ -1087,7 +1191,7 @@ func file_node_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_node_node_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 2, }, diff --git a/api/grpc/node/node_grpc.pb.go b/api/grpc/node/node_grpc.pb.go index 35aa773cba..285fc83024 100644 --- a/api/grpc/node/node_grpc.pb.go +++ b/api/grpc/node/node_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.15.8 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 // source: node/node.proto package node @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Dispersal_StoreChunks_FullMethodName = "/node.Dispersal/StoreChunks" -) - // DispersalClient is the client API for Dispersal 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. @@ -45,7 +41,7 @@ func NewDispersalClient(cc grpc.ClientConnInterface) DispersalClient { func (c *dispersalClient) StoreChunks(ctx context.Context, in *StoreChunksRequest, opts ...grpc.CallOption) (*StoreChunksReply, error) { out := new(StoreChunksReply) - err := c.cc.Invoke(ctx, Dispersal_StoreChunks_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/node.Dispersal/StoreChunks", in, out, opts...) if err != nil { return nil, err } @@ -96,7 +92,7 @@ func _Dispersal_StoreChunks_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Dispersal_StoreChunks_FullMethodName, + FullMethod: "/node.Dispersal/StoreChunks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DispersalServer).StoreChunks(ctx, req.(*StoreChunksRequest)) @@ -120,11 +116,6 @@ var Dispersal_ServiceDesc = grpc.ServiceDesc{ Metadata: "node/node.proto", } -const ( - Retrieval_RetrieveChunks_FullMethodName = "/node.Retrieval/RetrieveChunks" - Retrieval_GetBlobHeader_FullMethodName = "/node.Retrieval/GetBlobHeader" -) - // RetrievalClient is the client API for Retrieval 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. @@ -145,7 +136,7 @@ func NewRetrievalClient(cc grpc.ClientConnInterface) RetrievalClient { func (c *retrievalClient) RetrieveChunks(ctx context.Context, in *RetrieveChunksRequest, opts ...grpc.CallOption) (*RetrieveChunksReply, error) { out := new(RetrieveChunksReply) - err := c.cc.Invoke(ctx, Retrieval_RetrieveChunks_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/node.Retrieval/RetrieveChunks", in, out, opts...) if err != nil { return nil, err } @@ -154,7 +145,7 @@ func (c *retrievalClient) RetrieveChunks(ctx context.Context, in *RetrieveChunks func (c *retrievalClient) GetBlobHeader(ctx context.Context, in *GetBlobHeaderRequest, opts ...grpc.CallOption) (*GetBlobHeaderReply, error) { out := new(GetBlobHeaderReply) - err := c.cc.Invoke(ctx, Retrieval_GetBlobHeader_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/node.Retrieval/GetBlobHeader", in, out, opts...) if err != nil { return nil, err } @@ -205,7 +196,7 @@ func _Retrieval_RetrieveChunks_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Retrieval_RetrieveChunks_FullMethodName, + FullMethod: "/node.Retrieval/RetrieveChunks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RetrievalServer).RetrieveChunks(ctx, req.(*RetrieveChunksRequest)) @@ -223,7 +214,7 @@ func _Retrieval_GetBlobHeader_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Retrieval_GetBlobHeader_FullMethodName, + FullMethod: "/node.Retrieval/GetBlobHeader", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RetrievalServer).GetBlobHeader(ctx, req.(*GetBlobHeaderRequest)) diff --git a/api/grpc/retriever/retriever.pb.go b/api/grpc/retriever/retriever.pb.go index b03bcc0f87..cef5a3c26d 100644 --- a/api/grpc/retriever/retriever.pb.go +++ b/api/grpc/retriever/retriever.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.15.8 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: retriever/retriever.proto package retriever diff --git a/api/grpc/retriever/retriever_grpc.pb.go b/api/grpc/retriever/retriever_grpc.pb.go index a4290efca6..be1556599b 100644 --- a/api/grpc/retriever/retriever_grpc.pb.go +++ b/api/grpc/retriever/retriever_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.15.8 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 // source: retriever/retriever.proto package retriever @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Retriever_RetrieveBlob_FullMethodName = "/retriever.Retriever/RetrieveBlob" -) - // RetrieverClient is the client API for Retriever 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. @@ -41,7 +37,7 @@ func NewRetrieverClient(cc grpc.ClientConnInterface) RetrieverClient { func (c *retrieverClient) RetrieveBlob(ctx context.Context, in *BlobRequest, opts ...grpc.CallOption) (*BlobReply, error) { out := new(BlobReply) - err := c.cc.Invoke(ctx, Retriever_RetrieveBlob_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/retriever.Retriever/RetrieveBlob", in, out, opts...) if err != nil { return nil, err } @@ -88,7 +84,7 @@ func _Retriever_RetrieveBlob_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Retriever_RetrieveBlob_FullMethodName, + FullMethod: "/retriever.Retriever/RetrieveBlob", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RetrieverServer).RetrieveBlob(ctx, req.(*BlobRequest)) diff --git a/api/proto/common/common.proto b/api/proto/common/common.proto new file mode 100644 index 0000000000..343222f88c --- /dev/null +++ b/api/proto/common/common.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; +package common; +option go_package = "github.com/Layr-Labs/eigenda/api/grpc/common"; + +message G1Commitment { + // The X coordinate of the KZG commitment. This is the raw byte representation of the field element. + bytes x = 1; + // The Y coordinate of the KZG commitment. This is the raw byte representation of the field element. + bytes y = 2; +} diff --git a/api/proto/disperser/disperser.proto b/api/proto/disperser/disperser.proto index 2a21f31a68..d6e0d6e768 100644 --- a/api/proto/disperser/disperser.proto +++ b/api/proto/disperser/disperser.proto @@ -1,7 +1,7 @@ syntax = "proto3"; - -option go_package = "github.com/Layr-Labs/eigenda/api/grpc/disperser"; package disperser; +import "common/common.proto"; +option go_package = "github.com/Layr-Labs/eigenda/api/grpc/disperser"; // Disperser defines the public APIs for dispersing blobs. service Disperser { @@ -128,7 +128,7 @@ message RetrieveBlobReply { message SecurityParams { // The ID of the quorum. // The quorum must be already registered on EigenLayer. The ID must be - // in range [0, 255]. + // in range [0, 254]. uint32 quorum_id = 1; // The max percentage of stake within the quorum that can be held by or delegated // to adversarial operators. @@ -189,8 +189,8 @@ message BlobInfo { } message BlobHeader { - // KZG commitment to the blob. - bytes commitment = 1; + // KZG commitment of the blob. + common.G1Commitment commitment = 1; // The length of the blob in symbols (each symbol is 31 bytes). uint32 data_length = 2; // The params of the quorums that this blob participates in. diff --git a/api/proto/node/node.proto b/api/proto/node/node.proto index 5ee2af2fa6..384a238be8 100644 --- a/api/proto/node/node.proto +++ b/api/proto/node/node.proto @@ -1,7 +1,7 @@ syntax = "proto3"; - -option go_package = "github.com/Layr-Labs/eigenda/api/grpc/node"; package node; +import "common/common.proto"; +option go_package = "github.com/Layr-Labs/eigenda/api/grpc/node"; // The EigenDA Node implements two services, Dispersal and Retrieval, as defined below, // for better security and separation of concerns. @@ -47,7 +47,7 @@ message RetrieveChunksRequest { uint32 blob_index = 2; // Which quorum of the blob to retrieve for (note: a blob can have multiple // quorums and the chunks for different quorums at a Node can be different). - // The ID must be in range [0, 255]. + // The ID must be in range [0, 254]. uint32 quorum_id = 3; } @@ -105,15 +105,26 @@ message Bundle { repeated bytes chunks = 1; } +message G2Commitment { + // The A0 element of the X coordinate of G2 point. + bytes x_a0 = 1; + // The A1 element of the X coordinate of G2 point. + bytes x_a1 = 2; + // The A0 element of the Y coordinate of G2 point. + bytes y_a0 = 3; + // The A1 element of the Y coordinate of G2 point. + bytes y_a1 = 4; +} + message BlobHeader { // The KZG commitment to the polynomial representing the blob. - bytes commitment = 1; - // The KZG commitment to the polynomial representing the blob on G2, it is uesd - // for proving the degree of the polynomial - bytes length_commitment = 2; + common.G1Commitment commitment = 1; + // The KZG commitment to the polynomial representing the blob on G2, it is used + // for proving the degree of the polynomial + G2Commitment length_commitment = 2; // The low degree proof. It's the KZG commitment to the polynomial shifted to // the largest SRS degree. - bytes length_proof = 3; + G2Commitment length_proof = 3; // The length of the original blob in number of symbols (in the field where // the polynomial is defined). uint32 length = 4; diff --git a/clients/tests/retrieval_client_test.go b/clients/tests/retrieval_client_test.go index 98f893f668..d275870b4e 100644 --- a/clients/tests/retrieval_client_test.go +++ b/clients/tests/retrieval_client_test.go @@ -26,14 +26,15 @@ const numOperators = 10 func makeTestEncoder() (core.Encoder, error) { config := &kzgEncoder.KzgConfig{ - G1Path: "../../inabox/resources/kzg/g1.point", - G2Path: "../../inabox/resources/kzg/g2.point", - CacheDir: "../../inabox/resources/kzg/SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../../inabox/resources/kzg/g1.point", + G2Path: "../../inabox/resources/kzg/g2.point", + CacheDir: "../../inabox/resources/kzg/SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } - kzgEncoderGroup, err := kzgEncoder.NewKzgEncoderGroup(config) + kzgEncoderGroup, err := kzgEncoder.NewKzgEncoderGroup(config, true) if err != nil { return nil, err } diff --git a/core/data.go b/core/data.go index 4e39358b97..ca0e124950 100644 --- a/core/data.go +++ b/core/data.go @@ -28,6 +28,13 @@ type SecurityParam struct { QuorumRate common.RateParam `json:"quorum_rate"` } +const ( + // We use uint8 to count the number of quorums, so we can have at most 255 quorums, + // which means the max ID can not be larger than 254 (from 0 to 254, there are 255 + // different IDs). + MaxQuorumID = 254 +) + func (s *SecurityParam) String() string { return fmt.Sprintf("QuorumID: %d, AdversaryThreshold: %d, QuorumThreshold: %d", s.QuorumID, s.AdversaryThreshold, s.QuorumThreshold) } @@ -121,10 +128,10 @@ func (b *BlobHeader) EncodedSizeAllQuorums() int64 { // BlomCommitments contains the blob's commitment, degree proof, and the actual degree. type BlobCommitments struct { - Commitment *Commitment `json:"commitment"` - LengthCommitment *LengthCommitment `json:"length_commitment"` - LengthProof *LengthProof `json:"length_proof"` - Length uint `json:"length"` + Commitment *G1Commitment `json:"commitment"` + LengthCommitment *G2Commitment `json:"length_commitment"` + LengthProof *LengthProof `json:"length_proof"` + Length uint `json:"length"` } // Batch @@ -201,7 +208,7 @@ func (cb Bundles) Size() int64 { // Sample is a chunk with associated metadata used by the Universal Batch Verifier type Sample struct { - Commitment *Commitment + Commitment *G1Commitment Chunk *Chunk AssignmentIndex ChunkNumber BlobIndex int diff --git a/core/encoding.go b/core/encoding.go index 5a13bcd2fb..79dc4d636f 100644 --- a/core/encoding.go +++ b/core/encoding.go @@ -10,19 +10,13 @@ import ( // Commitments // Commitment is a polynomial commitment (e.g. a kzg commitment) -type Commitment struct { - *bn254.G1Point -} +type G1Commitment bn254.G1Point // Commitment is a polynomial commitment (e.g. a kzg commitment) -type LengthCommitment struct { - *bn254.G2Point -} +type G2Commitment bn254.G2Point // LengthProof is a polynomial commitment on G2 (e.g. a kzg commitment) used for low degree proof -type LengthProof struct { - *bn254.G2Point -} +type LengthProof = G2Commitment // The proof used to open a commitment. In the case of Kzg, this is also a kzg commitment, and is different from a Commitment only semantically. type Proof = bn254.G1Point diff --git a/core/encoding/cli.go b/core/encoding/cli.go index a3f7260a55..3df33493fd 100644 --- a/core/encoding/cli.go +++ b/core/encoding/cli.go @@ -17,6 +17,7 @@ const ( VerboseFlagName = "kzg.verbose" PreloadEncoderFlagName = "kzg.preload-encoder" CacheEncodedBlobsFlagName = "cache-encoded-blobs" + SRSLoadingNumberFlagName = "kzg.srs-load" ) func CLIFlags(envPrefix string) []cli.Flag { @@ -45,6 +46,12 @@ func CLIFlags(envPrefix string) []cli.Flag { Required: true, EnvVar: common.PrefixEnvVar(envPrefix, "SRS_ORDER"), }, + cli.Uint64Flag{ + Name: SRSLoadingNumberFlagName, + Usage: "Number of SRS points to load into memory", + Required: true, + EnvVar: common.PrefixEnvVar(envPrefix, "SRS_LOAD"), + }, cli.Uint64Flag{ Name: NumWorkerFlagName, Usage: "Number of workers for multithreading", @@ -79,6 +86,7 @@ func ReadCLIConfig(ctx *cli.Context) EncoderConfig { cfg.G2Path = ctx.GlobalString(G2PathFlagName) cfg.CacheDir = ctx.GlobalString(CachePathFlagName) cfg.SRSOrder = ctx.GlobalUint64(SRSOrderFlagName) + cfg.SRSNumberToLoad = ctx.GlobalUint64(SRSLoadingNumberFlagName) cfg.NumWorker = ctx.GlobalUint64(NumWorkerFlagName) cfg.Verbose = ctx.GlobalBool(VerboseFlagName) cfg.PreloadEncoder = ctx.GlobalBool(PreloadEncoderFlagName) diff --git a/core/encoding/encoder.go b/core/encoding/encoder.go index 898021aa74..8b2917e92b 100644 --- a/core/encoding/encoder.go +++ b/core/encoding/encoder.go @@ -6,6 +6,7 @@ import ( "github.com/Layr-Labs/eigenda/core" "github.com/Layr-Labs/eigenda/pkg/encoding/encoder" "github.com/Layr-Labs/eigenda/pkg/encoding/kzgEncoder" + "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" lru "github.com/hashicorp/golang-lru/v2" ) @@ -26,8 +27,8 @@ type Encoder struct { var _ core.Encoder = &Encoder{} -func NewEncoder(config EncoderConfig) (*Encoder, error) { - kzgEncoderGroup, err := kzgEncoder.NewKzgEncoderGroup(&config.KzgConfig) +func NewEncoder(config EncoderConfig, loadG2Points bool) (*Encoder, error) { + kzgEncoderGroup, err := kzgEncoder.NewKzgEncoderGroup(&config.KzgConfig, loadG2Points) if err != nil { return nil, err } @@ -82,9 +83,9 @@ func (e *Encoder) Encode(data []byte, params core.EncodingParams) (core.BlobComm length := uint(len(encoder.ToFrArray(data))) commitments := core.BlobCommitments{ - Commitment: &core.Commitment{G1Point: commit}, - LengthCommitment: &core.LengthCommitment{G2Point: lowDegreeCommit}, - LengthProof: &core.LengthProof{G2Point: lowDegreeProof}, + Commitment: (*core.G1Commitment)(commit), + LengthCommitment: (*core.G2Commitment)(lowDegreeCommit), + LengthProof: (*core.G2Commitment)(lowDegreeProof), Length: length, } @@ -99,8 +100,7 @@ func (e *Encoder) Encode(data []byte, params core.EncodingParams) (core.BlobComm } func (e *Encoder) VerifyBlobLength(commitments core.BlobCommitments) error { - //commitments.Commitment.G1Point, - return e.EncoderGroup.VerifyCommit(commitments.LengthCommitment.G2Point, commitments.LengthProof.G2Point, uint64(commitments.Length-1)) + return e.EncoderGroup.VerifyCommit((*bn254.G2Point)(commitments.LengthCommitment), (*bn254.G2Point)(commitments.LengthProof), uint64(commitments.Length)) } @@ -115,7 +115,7 @@ func (e *Encoder) VerifyChunks(chunks []*core.Chunk, indices []core.ChunkNumber, for ind := range chunks { err = verifier.VerifyFrame( - commitments.Commitment.G1Point, + (*bn254.G1Point)(commitments.Commitment), &kzgEncoder.Frame{ Proof: chunks[ind].Proof, Coeffs: chunks[ind].Coeffs, @@ -137,8 +137,8 @@ func (e *Encoder) VerifyCommitEquivalenceBatch(commitments []core.BlobCommitment for i, c := range commitments { commitmentsPair[i] = kzgEncoder.CommitmentPair{ - Commitment: *c.Commitment.G1Point, - LengthCommitment: *c.LengthCommitment.G2Point, + Commitment: (bn254.G1Point)(*c.Commitment), + LengthCommitment: (bn254.G2Point)(*c.LengthCommitment), } } return e.EncoderGroup.BatchVerifyCommitEquivalence(commitmentsPair) @@ -159,7 +159,7 @@ func (e *Encoder) UniversalVerifySubBatch(params core.EncodingParams, samplesCor } sample := kzgEncoder.Sample{ - Commitment: *sc.Commitment.G1Point, + Commitment: (bn254.G1Point)(*sc.Commitment), Proof: sc.Chunk.Proof, RowIndex: sc.BlobIndex, Coeffs: sc.Chunk.Coeffs, diff --git a/core/encoding/encoder_test.go b/core/encoding/encoder_test.go index 75017e8536..ee4d7cb4bb 100644 --- a/core/encoding/encoder_test.go +++ b/core/encoding/encoder_test.go @@ -29,14 +29,15 @@ func init() { // makeTestEncoder makes an encoder currently using the only supported backend. func makeTestEncoder() (core.Encoder, error) { config := kzgEncoder.KzgConfig{ - G1Path: "../../inabox/resources/kzg/g1.point.300000", - G2Path: "../../inabox/resources/kzg/g2.point.300000", - CacheDir: "../../inabox/resources/kzg/SRSTables", - SRSOrder: 300000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../../inabox/resources/kzg/g1.point.300000", + G2Path: "../../inabox/resources/kzg/g2.point.300000", + CacheDir: "../../inabox/resources/kzg/SRSTables", + SRSOrder: 300000, + SRSNumberToLoad: 300000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } - return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}) + return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}, true) } func TestEncoder(t *testing.T) { diff --git a/core/serialization.go b/core/serialization.go index 1bff430fa5..eda00a1bd3 100644 --- a/core/serialization.go +++ b/core/serialization.go @@ -12,7 +12,6 @@ import ( "slices" binding "github.com/Layr-Labs/eigenda/contracts/bindings/EigenDAServiceManager" - "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" bn "github.com/consensys/gnark-crypto/ecc/bn254" "github.com/ethereum/go-ethereum/accounts/abi" @@ -247,7 +246,7 @@ func (h *BlobHeader) GetQuorumBlobParamsHash() ([32]byte, error) { } func (h *BlobHeader) Encode() ([]byte, error) { - if h.Commitment == nil || h.Commitment.G1Point == nil { + if h.Commitment == nil { return nil, ErrInvalidCommitment } @@ -377,72 +376,43 @@ func (c *Chunk) Deserialize(data []byte) (*Chunk, error) { return c, err } -func (c Commitment) Serialize() ([]byte, error) { +func (c *G1Commitment) Serialize() ([]byte, error) { return encode(c) } -func (c *Commitment) Deserialize(data []byte) (*Commitment, error) { +func (c *G1Commitment) Deserialize(data []byte) (*G1Commitment, error) { err := decode(data, c) return c, err } -func (c *Commitment) UnmarshalJSON(data []byte) error { +func (c *G1Commitment) UnmarshalJSON(data []byte) error { var g1Point bn.G1Affine err := json.Unmarshal(data, &g1Point) if err != nil { return err } - c.G1Point = &bn254.G1Point{ - X: g1Point.X, - Y: g1Point.Y, - } - + c.X = g1Point.X + c.Y = g1Point.Y return nil } -func (c LengthCommitment) Serialize() ([]byte, error) { +func (c *G2Commitment) Serialize() ([]byte, error) { return encode(c) } -func (c *LengthCommitment) Deserialize(data []byte) (*LengthCommitment, error) { +func (c *G2Commitment) Deserialize(data []byte) (*G2Commitment, error) { err := decode(data, c) return c, err } -func (c *LengthCommitment) UnmarshalJSON(data []byte) error { +func (c *G2Commitment) UnmarshalJSON(data []byte) error { var g2Point bn.G2Affine err := json.Unmarshal(data, &g2Point) if err != nil { return err } - c.G2Point = &bn254.G2Point{ - X: g2Point.X, - Y: g2Point.Y, - } - - return nil -} - -func (c LengthProof) Serialize() ([]byte, error) { - return encode(c) -} - -func (c *LengthProof) Deserialize(data []byte) (*LengthProof, error) { - err := decode(data, c) - return c, err -} - -func (c *LengthProof) UnmarshalJSON(data []byte) error { - var g2Point bn.G2Affine - err := json.Unmarshal(data, &g2Point) - if err != nil { - return err - } - c.G2Point = &bn254.G2Point{ - X: g2Point.X, - Y: g2Point.Y, - } - + c.X = g2Point.X + c.Y = g2Point.Y return nil } diff --git a/core/serialization_test.go b/core/serialization_test.go index 348809fc63..020b5880d5 100644 --- a/core/serialization_test.go +++ b/core/serialization_test.go @@ -57,7 +57,7 @@ func TestBlobHeaderEncoding(t *testing.T) { commitX = *commitX.SetBigInt(big.NewInt(1)) commitY = *commitY.SetBigInt(big.NewInt(2)) - commitment := &kzgbn254.G1Point{ + commitment := &core.G1Commitment{ X: commitX, Y: commitY, } @@ -72,7 +72,6 @@ func TestBlobHeaderEncoding(t *testing.T) { _, err = lengthYA1.SetString("4082367875863433681332203403145435568316851327593401208105741076214120093531") assert.NoError(t, err) - var lengthProof, lengthCommitment kzgbn254.G2Point lengthProof.X.A0 = lengthXA0 lengthProof.X.A1 = lengthXA1 @@ -83,16 +82,10 @@ func TestBlobHeaderEncoding(t *testing.T) { blobHeader := &core.BlobHeader{ BlobCommitments: core.BlobCommitments{ - Commitment: &core.Commitment{ - commitment, - }, - LengthCommitment: &core.LengthCommitment{ - &lengthCommitment, - }, - LengthProof: &core.LengthProof{ - &lengthProof, - }, - Length: 10, + Commitment: commitment, + LengthCommitment: (*core.G2Commitment)(&lengthCommitment), + LengthProof: (*core.G2Commitment)(&lengthProof), + Length: 10, }, QuorumInfos: []*core.BlobQuorumInfo{ { @@ -153,17 +146,15 @@ func TestCommitmentMarshaling(t *testing.T) { commitX = *commitX.SetBigInt(big.NewInt(1)) commitY = *commitY.SetBigInt(big.NewInt(2)) - commitment := &core.Commitment{ - G1Point: &kzgbn254.G1Point{ - X: commitX, - Y: commitY, - }, + commitment := &core.G1Commitment{ + X: commitX, + Y: commitY, } marshalled, err := json.Marshal(commitment) assert.NoError(t, err) - recovered := new(core.Commitment) + recovered := new(core.G1Commitment) err = json.Unmarshal(marshalled, recovered) assert.NoError(t, err) assert.Equal(t, recovered, commitment) diff --git a/core/test/core_test.go b/core/test/core_test.go index d75bad3a71..380c45633d 100644 --- a/core/test/core_test.go +++ b/core/test/core_test.go @@ -41,14 +41,15 @@ func setup(m *testing.M) { // makeTestEncoder makes an encoder currently using the only supported backend. func makeTestEncoder() (core.Encoder, error) { config := kzgEncoder.KzgConfig{ - G1Path: "../../inabox/resources/kzg/g1.point", - G2Path: "../../inabox/resources/kzg/g2.point", - CacheDir: "../../inabox/resources/kzg/SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../../inabox/resources/kzg/g1.point", + G2Path: "../../inabox/resources/kzg/g2.point", + CacheDir: "../../inabox/resources/kzg/SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } - return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}) + return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}, true) } @@ -124,10 +125,10 @@ func prepareBatch(t *testing.T, cst core.IndexedChainState, blobs []core.Blob, q blobHeader := &core.BlobHeader{ BlobCommitments: core.BlobCommitments{ - Commitment: commitments.Commitment, + Commitment: commitments.Commitment, LengthCommitment: commitments.LengthCommitment, - LengthProof: commitments.LengthProof, - Length: commitments.Length, + LengthProof: commitments.LengthProof, + Length: commitments.Length, }, QuorumInfos: []*core.BlobQuorumInfo{quorumHeader}, } diff --git a/disperser/api/grpc/encoder/encoder.pb.go b/disperser/api/grpc/encoder/encoder.pb.go index cc258bb4c5..ae23088d55 100644 --- a/disperser/api/grpc/encoder/encoder.pb.go +++ b/disperser/api/grpc/encoder/encoder.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v3.15.8 +// protoc-gen-go v1.28.1 +// protoc v3.12.4 // source: encoder/encoder.proto package encoder diff --git a/disperser/api/grpc/encoder/encoder_grpc.pb.go b/disperser/api/grpc/encoder/encoder_grpc.pb.go index f3fbdd2b5d..77b8f0be45 100644 --- a/disperser/api/grpc/encoder/encoder_grpc.pb.go +++ b/disperser/api/grpc/encoder/encoder_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.15.8 +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 // source: encoder/encoder.proto package encoder @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Encoder_EncodeBlob_FullMethodName = "/encoder.Encoder/EncodeBlob" -) - // EncoderClient is the client API for Encoder 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. @@ -39,7 +35,7 @@ func NewEncoderClient(cc grpc.ClientConnInterface) EncoderClient { func (c *encoderClient) EncodeBlob(ctx context.Context, in *EncodeBlobRequest, opts ...grpc.CallOption) (*EncodeBlobReply, error) { out := new(EncodeBlobReply) - err := c.cc.Invoke(ctx, Encoder_EncodeBlob_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/encoder.Encoder/EncodeBlob", in, out, opts...) if err != nil { return nil, err } @@ -84,7 +80,7 @@ func _Encoder_EncodeBlob_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Encoder_EncodeBlob_FullMethodName, + FullMethod: "/encoder.Encoder/EncodeBlob", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EncoderServer).EncodeBlob(ctx, req.(*EncodeBlobRequest)) diff --git a/disperser/apiserver/server.go b/disperser/apiserver/server.go index c2da60ca22..a66a2a8532 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -11,6 +11,7 @@ import ( "sync" "time" + commonpb "github.com/Layr-Labs/eigenda/api/grpc/common" pb "github.com/Layr-Labs/eigenda/api/grpc/disperser" "github.com/Layr-Labs/eigenda/common" healthcheck "github.com/Layr-Labs/eigenda/common/healthcheck" @@ -191,8 +192,8 @@ func (s *DispersalServer) disperseBlob(ctx context.Context, blob *core.Blob, aut } seenQuorums := make(map[uint8]struct{}) - // The quorum ID must be in range [0, 255]. It'll actually be converted - // to uint8, so it cannot be greater than 255. + // The quorum ID must be in range [0, 254]. It'll actually be converted + // to uint8, so it cannot be greater than 254. for _, param := range securityParams { if _, ok := seenQuorums[param.QuorumID]; ok { return nil, fmt.Errorf("invalid request: security_params must not contain duplicate quorum_id") @@ -449,11 +450,6 @@ func (s *DispersalServer) GetBlobStatus(ctx context.Context, req *pb.BlobStatusR s.logger.Debug("isConfirmed", "metadata", metadata, "isConfirmed", isConfirmed) if isConfirmed { confirmationInfo := metadata.ConfirmationInfo - commit, err := confirmationInfo.BlobCommitment.Commitment.Serialize() - if err != nil { - return nil, err - } - dataLength := uint32(confirmationInfo.BlobCommitment.Length) quorumInfos := confirmationInfo.BlobQuorumInfos slices.SortStableFunc[[]*core.BlobQuorumInfo](quorumInfos, func(a, b *core.BlobQuorumInfo) int { @@ -479,7 +475,10 @@ func (s *DispersalServer) GetBlobStatus(ctx context.Context, req *pb.BlobStatusR Status: getResponseStatus(metadata.BlobStatus), Info: &pb.BlobInfo{ BlobHeader: &pb.BlobHeader{ - Commitment: commit, + Commitment: &commonpb.G1Commitment{ + X: confirmationInfo.BlobCommitment.Commitment.X.Marshal(), + Y: confirmationInfo.BlobCommitment.Commitment.Y.Marshal(), + }, DataLength: dataLength, BlobQuorumParams: blobQuorumParams, }, diff --git a/disperser/apiserver/server_test.go b/disperser/apiserver/server_test.go index a2cba775a0..69621acfaa 100644 --- a/disperser/apiserver/server_test.go +++ b/disperser/apiserver/server_test.go @@ -26,7 +26,6 @@ import ( "github.com/Layr-Labs/eigenda/core/mock" "github.com/Layr-Labs/eigenda/disperser" "github.com/Layr-Labs/eigenda/inabox/deploy" - "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/ory/dockertest/v3" "github.com/stretchr/testify/assert" @@ -141,9 +140,10 @@ func TestGetBlobStatus(t *testing.T) { }) assert.NoError(t, err) assert.Equal(t, reply.GetStatus(), pb.BlobStatus_CONFIRMED) - actualCommitment, err := new(core.Commitment).Deserialize(reply.GetInfo().GetBlobHeader().GetCommitment()) - assert.NoError(t, err) - assert.Equal(t, actualCommitment, confirmedMetadata.ConfirmationInfo.BlobCommitment.Commitment) + actualCommitX := reply.GetInfo().GetBlobHeader().GetCommitment().X + actualCommitY := reply.GetInfo().GetBlobHeader().GetCommitment().Y + assert.Equal(t, actualCommitX, confirmedMetadata.ConfirmationInfo.BlobCommitment.Commitment.X.Marshal()) + assert.Equal(t, actualCommitY, confirmedMetadata.ConfirmationInfo.BlobCommitment.Commitment.Y.Marshal()) assert.Equal(t, reply.GetInfo().GetBlobHeader().GetDataLength(), uint32(confirmedMetadata.ConfirmationInfo.BlobCommitment.Length)) actualBlobQuorumParams := make([]*pb.BlobQuorumParam, len(securityParams)) @@ -464,11 +464,9 @@ func simulateBlobConfirmation(t *testing.T, requestID []byte, blobSize uint, sec _, err = commitY.SetString("9207254729396071334325696286939045899948985698134704137261649190717970615186") assert.NoError(t, err) - commitment := &core.Commitment{ - G1Point: &bn254.G1Point{ - X: commitX, - Y: commitY, - }, + commitment := &core.G1Commitment{ + X: commitX, + Y: commitY, } dataLength := 32 batchID := uint32(99) diff --git a/disperser/batcher/batcher_test.go b/disperser/batcher/batcher_test.go index 5d335e94d5..669fc7147e 100644 --- a/disperser/batcher/batcher_test.go +++ b/disperser/batcher/batcher_test.go @@ -43,14 +43,15 @@ type batcherComponents struct { // makeTestEncoder makes an encoder currently using the only supported backend. func makeTestEncoder() (core.Encoder, error) { config := kzgEncoder.KzgConfig{ - G1Path: "../../inabox/resources/kzg/g1.point", - G2Path: "../../inabox/resources/kzg/g2.point", - CacheDir: "../../inabox/resources/kzg/SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../../inabox/resources/kzg/g1.point", + G2Path: "../../inabox/resources/kzg/g2.point", + CacheDir: "../../inabox/resources/kzg/SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } - return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}) + return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}, true) } func makeTestBlob(securityParams []*core.SecurityParam) core.Blob { diff --git a/disperser/batcher/grpc/dispatcher.go b/disperser/batcher/grpc/dispatcher.go index 83547c3aad..883f0be991 100644 --- a/disperser/batcher/grpc/dispatcher.go +++ b/disperser/batcher/grpc/dispatcher.go @@ -4,6 +4,7 @@ import ( "context" "time" + commonpb "github.com/Layr-Labs/eigenda/api/grpc/common" "github.com/Layr-Labs/eigenda/api/grpc/node" "github.com/Layr-Labs/eigenda/common" "github.com/Layr-Labs/eigenda/core" @@ -127,19 +128,22 @@ func GetStoreChunksRequest(blobMessages []*core.BlobMessage, header *core.BatchH } func getBlobMessage(blob *core.BlobMessage) (*node.Blob, error) { - commitData, err := blob.BlobHeader.Commitment.Serialize() - if err != nil { - return nil, err + commitData := &commonpb.G1Commitment{ + X: blob.BlobHeader.Commitment.X.Marshal(), + Y: blob.BlobHeader.Commitment.Y.Marshal(), } - - lengthCommitData, err := blob.BlobHeader.LengthCommitment.Serialize() - if err != nil { - return nil, err + var lengthCommitData, lengthProofData node.G2Commitment + if blob.BlobHeader.LengthCommitment != nil { + lengthCommitData.XA0 = blob.BlobHeader.LengthCommitment.X.A0.Marshal() + lengthCommitData.XA1 = blob.BlobHeader.LengthCommitment.X.A1.Marshal() + lengthCommitData.YA0 = blob.BlobHeader.LengthCommitment.Y.A0.Marshal() + lengthCommitData.YA1 = blob.BlobHeader.LengthCommitment.Y.A1.Marshal() } - - lengthProofData, err := blob.BlobHeader.LengthProof.Serialize() - if err != nil { - return nil, err + if blob.BlobHeader.LengthProof != nil { + lengthProofData.XA0 = blob.BlobHeader.LengthProof.X.A0.Marshal() + lengthProofData.XA1 = blob.BlobHeader.LengthProof.X.A1.Marshal() + lengthProofData.YA0 = blob.BlobHeader.LengthProof.Y.A0.Marshal() + lengthProofData.YA1 = blob.BlobHeader.LengthProof.Y.A1.Marshal() } quorumHeaders := make([]*node.BlobQuorumInfo, len(blob.BlobHeader.QuorumInfos)) @@ -170,8 +174,8 @@ func getBlobMessage(blob *core.BlobMessage) (*node.Blob, error) { return &node.Blob{ Header: &node.BlobHeader{ Commitment: commitData, - LengthCommitment: lengthCommitData, - LengthProof: lengthProofData, + LengthCommitment: &lengthCommitData, + LengthProof: &lengthProofData, Length: uint32(blob.BlobHeader.Length), QuorumHeaders: quorumHeaders, }, diff --git a/disperser/cmd/encoder/encoder.go b/disperser/cmd/encoder/encoder.go index 4e8e7cac3d..81fb87e3e3 100644 --- a/disperser/cmd/encoder/encoder.go +++ b/disperser/cmd/encoder/encoder.go @@ -15,7 +15,7 @@ type EncoderGRPCServer struct { func NewEncoderGRPCServer(config Config, logger common.Logger) (*EncoderGRPCServer, error) { - coreEncoder, err := encoding.NewEncoder(config.EncoderConfig) + coreEncoder, err := encoding.NewEncoder(config.EncoderConfig, true) if err != nil { return nil, fmt.Errorf("failed to create encoder: %w", err) } diff --git a/disperser/common/blobstore/blob_metadata_store_test.go b/disperser/common/blobstore/blob_metadata_store_test.go index 5647459411..0b132ab0bb 100644 --- a/disperser/common/blobstore/blob_metadata_store_test.go +++ b/disperser/common/blobstore/blob_metadata_store_test.go @@ -8,7 +8,6 @@ import ( commondynamodb "github.com/Layr-Labs/eigenda/common/aws/dynamodb" "github.com/Layr-Labs/eigenda/core" "github.com/Layr-Labs/eigenda/disperser" - "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" "github.com/aws/aws-sdk-go-v2/service/dynamodb/types" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/ethereum/go-ethereum/common" @@ -211,11 +210,9 @@ func getConfirmedMetadata(t *testing.T, metadataKey disperser.BlobKey) *disperse assert.NoError(t, err) _, err = commitY.SetString("9207254729396071334325696286939045899948985698134704137261649190717970615186") assert.NoError(t, err) - commitment := &core.Commitment{ - G1Point: &bn254.G1Point{ - X: commitX, - Y: commitY, - }, + commitment := &core.G1Commitment{ + X: commitX, + Y: commitY, } dataLength := 32 batchID := uint32(99) diff --git a/disperser/dataapi/server_test.go b/disperser/dataapi/server_test.go index 5145eca97c..a6b1e8b11f 100644 --- a/disperser/dataapi/server_test.go +++ b/disperser/dataapi/server_test.go @@ -20,7 +20,6 @@ import ( prommock "github.com/Layr-Labs/eigenda/disperser/dataapi/prometheus/mock" "github.com/Layr-Labs/eigenda/disperser/dataapi/subgraph" subgraphmock "github.com/Layr-Labs/eigenda/disperser/dataapi/subgraph/mock" - "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/ethereum/go-ethereum/common" "github.com/gin-gonic/gin" @@ -311,11 +310,9 @@ func markBlobConfirmed(t *testing.T, blob *core.Blob, key disperser.BlobKey, bat assert.NoError(t, err) _, err = commitY.SetString("9207254729396071334325696286939045899948985698134704137261649190717970615186") assert.NoError(t, err) - commitment := &core.Commitment{ - G1Point: &bn254.G1Point{ - X: commitX, - Y: commitY, - }, + commitment := &core.G1Commitment{ + X: commitX, + Y: commitY, } confirmationInfo := &disperser.ConfirmationInfo{ diff --git a/disperser/encoder/client.go b/disperser/encoder/client.go index 5f449d01b9..964f9617b6 100644 --- a/disperser/encoder/client.go +++ b/disperser/encoder/client.go @@ -47,11 +47,11 @@ func (c client) EncodeBlob(ctx context.Context, data []byte, encodingParams core return nil, nil, err } - commitment, err := new(core.Commitment).Deserialize(reply.GetCommitment().GetCommitment()) + commitment, err := new(core.G1Commitment).Deserialize(reply.GetCommitment().GetCommitment()) if err != nil { return nil, nil, err } - lengthCommitment, err := new(core.LengthCommitment).Deserialize(reply.GetCommitment().GetLengthCommitment()) + lengthCommitment, err := new(core.G2Commitment).Deserialize(reply.GetCommitment().GetLengthCommitment()) if err != nil { return nil, nil, err } diff --git a/disperser/encoder/server_test.go b/disperser/encoder/server_test.go index e881c7e05a..a74aa80701 100644 --- a/disperser/encoder/server_test.go +++ b/disperser/encoder/server_test.go @@ -29,18 +29,19 @@ var ( var logger = &cmock.Logger{} -func makeTestEncoder() (*encoding.Encoder, ServerConfig) { +func makeTestEncoder(numPoint uint64) (*encoding.Encoder, ServerConfig) { kzgConfig := kzgEncoder.KzgConfig{ - G1Path: "../../inabox/resources/kzg/g1.point", - G2Path: "../../inabox/resources/kzg/g2.point", - CacheDir: "../../inabox/resources/kzg/SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../../inabox/resources/kzg/g1.point", + G2Path: "../../inabox/resources/kzg/g2.point", + CacheDir: "../../inabox/resources/kzg/SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: numPoint, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } encodingConfig := encoding.EncoderConfig{KzgConfig: kzgConfig} - encoder, _ := encoding.NewEncoder(encodingConfig) + encoder, _ := encoding.NewEncoder(encodingConfig, true) encoderServerConfig := ServerConfig{ GrpcPort: "3000", MaxConcurrentRequests: 16, @@ -50,7 +51,7 @@ func makeTestEncoder() (*encoding.Encoder, ServerConfig) { return encoder, encoderServerConfig } -var testEncoder, testServerConfig = makeTestEncoder() +var testEncoder, testServerConfig = makeTestEncoder(3000) func getTestData() (core.Blob, core.EncodingParams) { var quorumID core.QuorumID = 0 @@ -161,7 +162,6 @@ func TestThrottling(t *testing.T) { _, err = lengthYA1.SetString("4082367875863433681332203403145435568316851327593401208105741076214120093531") assert.NoError(t, err) - var lengthProof, lengthCommitment bn254.G2Point lengthProof.X.A0 = lengthXA0 lengthProof.X.A1 = lengthXA1 @@ -176,20 +176,15 @@ func TestThrottling(t *testing.T) { encoder := &encoding.MockEncoder{ Delay: 500 * time.Millisecond, } + blobCommitment := core.BlobCommitments{ - Commitment: &core.Commitment{ - G1Point: &bn254.G1Point{ - X: X1, - Y: Y1, - }, - }, - LengthCommitment: &core.LengthCommitment{ - G2Point: &lengthCommitment, + Commitment: &core.G1Commitment{ + X: X1, + Y: Y1, }, - LengthProof: &core.LengthProof{ - G2Point: &lengthProof, - }, - Length: 10, + LengthCommitment: (*core.G2Commitment)(&lengthCommitment), + LengthProof: (*core.G2Commitment)(&lengthProof), + Length: 10, } encoder.On("Encode", mock.Anything, mock.Anything).Return(blobCommitment, []*core.Chunk{}, nil) @@ -246,3 +241,64 @@ func TestThrottling(t *testing.T) { } } } + +func TestEncoderPointsLoading(t *testing.T) { + // encoder 1 only loads 1500 points + encoder1, config1 := makeTestEncoder(1500) + metrics := NewMetrics("9000", logger) + server1 := NewServer(config1, logger, encoder1, metrics) + + testBlobData, testEncodingParams := getTestData() + + testEncodingParamsProto := &pb.EncodingParams{ + ChunkLength: uint32(testEncodingParams.ChunkLength), + NumChunks: uint32(testEncodingParams.NumChunks), + } + + encodeBlobRequestProto := &pb.EncodeBlobRequest{ + Data: []byte(testBlobData.Data), + EncodingParams: testEncodingParamsProto, + } + + reply1, err := server1.EncodeBlob(context.Background(), encodeBlobRequestProto) + assert.NoError(t, err) + assert.NotNil(t, reply1.Chunks) + + // Decode Server Data + var chunksData []*core.Chunk + + for i := range reply1.Chunks { + chunkSerialized, _ := new(core.Chunk).Deserialize(reply1.GetChunks()[i]) + // perform an operation + chunksData = append(chunksData, chunkSerialized) + } + assert.NotNil(t, chunksData) + + // Indices obtained from Encoder_Test + indices := []core.ChunkNumber{ + 0, 1, 2, 3, 4, 5, 6, 7, + } + + maxInputSize := uint64(len(gettysburgAddressBytes)) + 10 + decoded, err := testEncoder.Decode(chunksData, indices, testEncodingParams, maxInputSize) + assert.Nil(t, err) + recovered := bytes.TrimRight(decoded, "\x00") + assert.Equal(t, recovered, gettysburgAddressBytes) + + // encoder 2 only loads 2900 points + encoder2, config2 := makeTestEncoder(2900) + server2 := NewServer(config2, logger, encoder2, metrics) + + reply2, err := server2.EncodeBlob(context.Background(), encodeBlobRequestProto) + assert.NoError(t, err) + assert.NotNil(t, reply2.Chunks) + + for i := range reply2.Chunks { + chunkSerialized, _ := new(core.Chunk).Deserialize(reply2.GetChunks()[i]) + // perform an operation + assert.Equal(t, len(chunkSerialized.Coeffs), len(chunksData[i].Coeffs)) + assert.Equal(t, chunkSerialized.Coeffs, chunksData[i].Coeffs) + assert.Equal(t, chunkSerialized.Proof, chunksData[i].Proof) + } + +} diff --git a/inabox/deploy/config.go b/inabox/deploy/config.go index bece714cd1..e2fc9e3371 100644 --- a/inabox/deploy/config.go +++ b/inabox/deploy/config.go @@ -206,6 +206,7 @@ func (env *Config) generateBatcherVars(ind int, key, graphUrl, logPath string) B BATCHER_BLS_OPERATOR_STATE_RETRIVER: env.EigenDA.OperatorStateRetreiver, BATCHER_EIGENDA_SERVICE_MANAGER: env.EigenDA.ServiceManager, BATCHER_SRS_ORDER: "300000", + BATCHER_SRS_LOAD: "300000", BATCHER_CHAIN_RPC: "", BATCHER_PRIVATE_KEY: key[2:], BATCHER_STD_LOG_LEVEL: "debug", @@ -237,6 +238,7 @@ func (env *Config) generateEncoderVars(ind int, grpcPort string) EncoderVars { DISPERSER_ENCODER_G1_PATH: "", DISPERSER_ENCODER_G2_PATH: "", DISPERSER_ENCODER_SRS_ORDER: "", + DISPERSER_ENCODER_SRS_LOAD: "", DISPERSER_ENCODER_CACHE_PATH: "", DISPERSER_ENCODER_VERBOSE: "", DISPERSER_ENCODER_NUM_WORKERS: fmt.Sprint(runtime.GOMAXPROCS(0)), @@ -298,6 +300,7 @@ func (env *Config) generateOperatorVars(ind int, name, key, churnerUrl, logPath, NODE_G2_PATH: "", NODE_CACHE_PATH: "", NODE_SRS_ORDER: "", + NODE_SRS_LOAD: "", NODE_NUM_WORKERS: fmt.Sprint(runtime.GOMAXPROCS(0)), NODE_VERBOSE: "true", NODE_CHAIN_RPC: "", @@ -334,6 +337,7 @@ func (env *Config) generateRetrieverVars(ind int, key string, graphUrl, logPath, RETRIEVER_G2_PATH: "", RETRIEVER_CACHE_PATH: "", RETRIEVER_SRS_ORDER: "", + RETRIEVER_SRS_LOAD: "", RETRIEVER_NUM_WORKERS: fmt.Sprint(runtime.GOMAXPROCS(0)), RETRIEVER_VERBOSE: "true", RETRIEVER_CACHE_ENCODED_BLOBS: "false", diff --git a/inabox/deploy/env_vars.go b/inabox/deploy/env_vars.go index 98813ee001..3076ec550d 100644 --- a/inabox/deploy/env_vars.go +++ b/inabox/deploy/env_vars.go @@ -98,6 +98,8 @@ type BatcherVars struct { BATCHER_SRS_ORDER string + BATCHER_SRS_LOAD string + BATCHER_METRICS_HTTP_PORT string BATCHER_INDEXER_DATA_DIR string @@ -171,6 +173,8 @@ type EncoderVars struct { DISPERSER_ENCODER_SRS_ORDER string + DISPERSER_ENCODER_SRS_LOAD string + DISPERSER_ENCODER_NUM_WORKERS string DISPERSER_ENCODER_VERBOSE string @@ -264,6 +268,8 @@ type OperatorVars struct { NODE_SRS_ORDER string + NODE_SRS_LOAD string + NODE_NUM_WORKERS string NODE_VERBOSE string @@ -323,6 +329,8 @@ type RetrieverVars struct { RETRIEVER_SRS_ORDER string + RETRIEVER_SRS_LOAD string + RETRIEVER_NUM_WORKERS string RETRIEVER_VERBOSE string diff --git a/inabox/templates/testconfig-anvil-docker.yaml b/inabox/templates/testconfig-anvil-docker.yaml index f4d5a67ea0..bee44fca45 100644 --- a/inabox/templates/testconfig-anvil-docker.yaml +++ b/inabox/templates/testconfig-anvil-docker.yaml @@ -41,6 +41,7 @@ services: G2_PATH: resources/kzg/g2.point CACHE_PATH: resources/kzg/SRSTables SRS_ORDER: 3000 + SRS_LOAD: 2900 CHALLENGE_ORDER: 3000 STD_LOG_LEVEL: "trace" FILE_LOG_LEVEL: "trace" diff --git a/inabox/templates/testconfig-anvil-nochurner.yaml b/inabox/templates/testconfig-anvil-nochurner.yaml index cc52f9c7d4..65da4fd752 100644 --- a/inabox/templates/testconfig-anvil-nochurner.yaml +++ b/inabox/templates/testconfig-anvil-nochurner.yaml @@ -40,6 +40,7 @@ services: G2_PATH: resources/kzg/g2.point CACHE_PATH: resources/kzg/SRSTables SRS_ORDER: 3000 + SRS_LOAD: 2900 CHALLENGE_ORDER: 3000 STD_LOG_LEVEL: "trace" FILE_LOG_LEVEL: "trace" diff --git a/inabox/templates/testconfig-anvil-nograph.yaml b/inabox/templates/testconfig-anvil-nograph.yaml index 53c8e4e31c..a6581264e2 100644 --- a/inabox/templates/testconfig-anvil-nograph.yaml +++ b/inabox/templates/testconfig-anvil-nograph.yaml @@ -40,6 +40,7 @@ services: G2_PATH: resources/kzg/g2.point CACHE_PATH: resources/kzg/SRSTables SRS_ORDER: 3000 + SRS_LOAD: 2900 CHALLENGE_ORDER: 3000 STD_LOG_LEVEL: "trace" FILE_LOG_LEVEL: "trace" diff --git a/inabox/templates/testconfig-anvil.yaml b/inabox/templates/testconfig-anvil.yaml index 7d4349ab47..5a9cf9163d 100644 --- a/inabox/templates/testconfig-anvil.yaml +++ b/inabox/templates/testconfig-anvil.yaml @@ -41,6 +41,7 @@ services: G2_PATH: resources/kzg/g2.point CACHE_PATH: resources/kzg/SRSTables SRS_ORDER: 3000 + SRS_LOAD: 2900 CHALLENGE_ORDER: 3000 STD_LOG_LEVEL: "trace" FILE_LOG_LEVEL: "trace" diff --git a/inabox/templates/testconfig-docker-anvil.yaml b/inabox/templates/testconfig-docker-anvil.yaml index 6dd21492ee..7d338dcca0 100644 --- a/inabox/templates/testconfig-docker-anvil.yaml +++ b/inabox/templates/testconfig-docker-anvil.yaml @@ -45,6 +45,7 @@ services: G2_PATH: /data/kzg/g2.point CACHE_PATH: /data/kzg/SRSTables SRS_ORDER: 3000 + SRS_LOAD: 2000 CHALLENGE_ORDER: 3000 STD_LOG_LEVEL: "trace" VERBOSE: true diff --git a/inabox/templates/testconfig-geth.yaml b/inabox/templates/testconfig-geth.yaml index bb380e0c63..078a466c2f 100644 --- a/inabox/templates/testconfig-geth.yaml +++ b/inabox/templates/testconfig-geth.yaml @@ -32,6 +32,7 @@ services: G2_PATH: resources/kzg/g2.point CACHE_PATH: resources/kzg/SRSTables SRS_ORDER: 3000 + SRS_LOAD: 3000 CHALLENGE_ORDER: 3000 STD_LOG_LEVEL: "trace" VERBOSE: true diff --git a/inabox/tests/integration_suite_test.go b/inabox/tests/integration_suite_test.go index 22e5ed526f..a169b39a5b 100644 --- a/inabox/tests/integration_suite_test.go +++ b/inabox/tests/integration_suite_test.go @@ -158,15 +158,16 @@ func setupRetrievalClient(testConfig *deploy.Config) error { } encoder, err := encoding.NewEncoder(encoding.EncoderConfig{ KzgConfig: kzgEncoder.KzgConfig{ - G1Path: testConfig.Retriever.RETRIEVER_G1_PATH, - G2Path: testConfig.Retriever.RETRIEVER_G2_PATH, - CacheDir: testConfig.Retriever.RETRIEVER_CACHE_PATH, - NumWorker: 1, - SRSOrder: uint64(srsOrder), - Verbose: true, - PreloadEncoder: false, + G1Path: testConfig.Retriever.RETRIEVER_G1_PATH, + G2Path: testConfig.Retriever.RETRIEVER_G2_PATH, + CacheDir: testConfig.Retriever.RETRIEVER_CACHE_PATH, + NumWorker: 1, + SRSOrder: uint64(srsOrder), + SRSNumberToLoad: uint64(srsOrder), + Verbose: true, + PreloadEncoder: false, }, - }) + }, false) if err != nil { return err } diff --git a/inabox/tests/integration_test.go b/inabox/tests/integration_test.go index 2024554c0d..8531919d47 100644 --- a/inabox/tests/integration_test.go +++ b/inabox/tests/integration_test.go @@ -157,9 +157,6 @@ var _ = Describe("Inabox Integration", func() { }) func blobHeaderFromProto(blobHeader *disperserpb.BlobHeader) rollupbindings.IEigenDAServiceManagerBlobHeader { - commitmentBytes := blobHeader.GetCommitment() - commitment, err := new(core.Commitment).Deserialize(commitmentBytes) - Expect(err).To(BeNil()) quorums := make([]rollupbindings.IEigenDAServiceManagerQuorumBlobParam, len(blobHeader.GetBlobQuorumParams())) for i, quorum := range blobHeader.GetBlobQuorumParams() { quorums[i] = rollupbindings.IEigenDAServiceManagerQuorumBlobParam{ @@ -169,11 +166,10 @@ func blobHeaderFromProto(blobHeader *disperserpb.BlobHeader) rollupbindings.IEig ChunkLength: quorum.ChunkLength, } } - return rollupbindings.IEigenDAServiceManagerBlobHeader{ Commitment: rollupbindings.BN254G1Point{ - X: commitment.X.BigInt(new(big.Int)), - Y: commitment.Y.BigInt(new(big.Int)), + X: new(big.Int).SetBytes(blobHeader.GetCommitment().X), + Y: new(big.Int).SetBytes(blobHeader.GetCommitment().Y), }, DataLength: blobHeader.GetDataLength(), QuorumBlobParams: quorums, diff --git a/node/grpc/server.go b/node/grpc/server.go index 1126dd6680..c4b64610da 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -173,8 +173,8 @@ func (s *Server) RetrieveChunks(ctx context.Context, in *pb.RetrieveChunksReques })) defer timer.ObserveDuration() - if in.GetQuorumId() > 255 { - return nil, fmt.Errorf("invalid request: quorum ID must be in range [0, 255], but found %d", in.GetQuorumId()) + if in.GetQuorumId() > core.MaxQuorumID { + return nil, fmt.Errorf("invalid request: quorum ID must be in range [0, %d], but found %d", core.MaxQuorumID, in.GetQuorumId()) } var batchHeaderHash [32]byte diff --git a/node/grpc/server_test.go b/node/grpc/server_test.go index 9e9b7eff81..6af185ff75 100644 --- a/node/grpc/server_test.go +++ b/node/grpc/server_test.go @@ -9,6 +9,7 @@ import ( "testing" "time" + commonpb "github.com/Layr-Labs/eigenda/api/grpc/common" pb "github.com/Layr-Labs/eigenda/api/grpc/node" "github.com/Layr-Labs/eigenda/common/logging" commonmock "github.com/Layr-Labs/eigenda/common/mock" @@ -18,7 +19,6 @@ import ( "github.com/Layr-Labs/eigenda/node" "github.com/Layr-Labs/eigenda/node/grpc" "github.com/Layr-Labs/eigenda/pkg/encoding/kzgEncoder" - "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" "github.com/Layr-Labs/eigensdk-go/metrics" "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/prometheus/client_golang/prometheus" @@ -44,14 +44,15 @@ func TestMain(m *testing.M) { // makeTestEncoder makes an encoder currently using the only supported backend. func makeTestEncoder() (core.Encoder, error) { config := kzgEncoder.KzgConfig{ - G1Path: "../../inabox/resources/kzg/g1.point.300000", - G2Path: "../../inabox/resources/kzg/g2.point.300000", - CacheDir: "../../inabox/resources/kzg/SRSTables", - SRSOrder: 300000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../../inabox/resources/kzg/g1.point.300000", + G2Path: "../../inabox/resources/kzg/g2.point.300000", + CacheDir: "../../inabox/resources/kzg/SRSTables", + SRSOrder: 300000, + SRSNumberToLoad: 300000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } - return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}) + return encoding.NewEncoder(encoding.EncoderConfig{KzgConfig: config}, true) } func newTestServer(t *testing.T, mockValidator bool) *grpc.Server { @@ -126,17 +127,13 @@ func newTestServer(t *testing.T, mockValidator bool) *grpc.Server { } func makeStoreChunksRequest(t *testing.T, quorumThreshold, adversaryThreshold uint8) (*pb.StoreChunksRequest, [32]byte, [32]byte, []*core.BlobHeader, []*pb.BlobHeader) { - var commitX, commitY, lengthX, lengthY fp.Element + var commitX, commitY fp.Element _, err := commitX.SetString("21661178944771197726808973281966770251114553549453983978976194544185382599016") assert.NoError(t, err) _, err = commitY.SetString("9207254729396071334325696286939045899948985698134704137261649190717970615186") assert.NoError(t, err) - _, err = lengthX.SetString("18730744272503541936633286178165146673834730535090946570310418711896464442549") - assert.NoError(t, err) - _, err = lengthY.SetString("15356431458378126778840641829778151778222945686256112821552210070627093656047") - assert.NoError(t, err) - commitment := bn254.G1Point{ + commitment := &core.G1Commitment{ X: commitX, Y: commitY, } @@ -150,8 +147,7 @@ func makeStoreChunksRequest(t *testing.T, quorumThreshold, adversaryThreshold ui _, err = lengthYA1.SetString("4082367875863433681332203403145435568316851327593401208105741076214120093531") assert.NoError(t, err) - - var lengthProof, lengthCommitment bn254.G2Point + var lengthProof, lengthCommitment core.G2Commitment lengthProof.X.A0 = lengthXA0 lengthProof.X.A1 = lengthXA1 lengthProof.Y.A0 = lengthYA0 @@ -171,18 +167,18 @@ func makeStoreChunksRequest(t *testing.T, quorumThreshold, adversaryThreshold ui blobHeaders := []*core.BlobHeader{ { BlobCommitments: core.BlobCommitments{ - Commitment: &core.Commitment{G1Point: &commitment}, - LengthCommitment: &core.LengthCommitment{G2Point: &lengthCommitment}, - LengthProof: &core.LengthProof{G2Point: &lengthProof}, + Commitment: commitment, + LengthCommitment: &lengthCommitment, + LengthProof: &lengthProof, Length: 48, }, QuorumInfos: []*core.BlobQuorumInfo{quorumHeader}, }, { BlobCommitments: core.BlobCommitments{ - Commitment: &core.Commitment{G1Point: &commitment}, - LengthCommitment: &core.LengthCommitment{G2Point: &lengthCommitment}, - LengthProof: &core.LengthProof{G2Point: &lengthProof}, + Commitment: commitment, + LengthCommitment: &lengthCommitment, + LengthProof: &lengthProof, Length: 50, }, QuorumInfos: []*core.BlobQuorumInfo{quorumHeader}, @@ -317,12 +313,19 @@ func TestGetBlobHeader(t *testing.T) { } func blobHeaderToProto(t *testing.T, blobHeader *core.BlobHeader) *pb.BlobHeader { - serializedCommitment, err := blobHeader.Commitment.Serialize() - assert.NoError(t, err) - serializedLengthCommitment, err := blobHeader.LengthCommitment.Serialize() - assert.NoError(t, err) - serializedLengthProof, err := blobHeader.LengthProof.Serialize() - assert.NoError(t, err) + var lengthCommitment, lengthProof pb.G2Commitment + if blobHeader.LengthCommitment != nil { + lengthCommitment.XA0 = blobHeader.LengthCommitment.X.A0.Marshal() + lengthCommitment.XA1 = blobHeader.LengthCommitment.X.A1.Marshal() + lengthCommitment.YA0 = blobHeader.LengthCommitment.Y.A0.Marshal() + lengthCommitment.YA1 = blobHeader.LengthCommitment.Y.A1.Marshal() + } + if blobHeader.LengthProof != nil { + lengthProof.XA0 = blobHeader.LengthProof.X.A0.Marshal() + lengthProof.XA1 = blobHeader.LengthProof.X.A1.Marshal() + lengthProof.YA0 = blobHeader.LengthProof.Y.A0.Marshal() + lengthProof.YA1 = blobHeader.LengthProof.Y.A1.Marshal() + } quorumHeader := &pb.BlobQuorumInfo{ QuorumId: uint32(blobHeader.QuorumInfos[0].QuorumID), QuorumThreshold: uint32(blobHeader.QuorumInfos[0].QuorumThreshold), @@ -331,9 +334,12 @@ func blobHeaderToProto(t *testing.T, blobHeader *core.BlobHeader) *pb.BlobHeader } return &pb.BlobHeader{ - Commitment: serializedCommitment, - LengthCommitment: serializedLengthCommitment, - LengthProof: serializedLengthProof, + Commitment: &commonpb.G1Commitment{ + X: blobHeader.Commitment.X.Marshal(), + Y: blobHeader.Commitment.Y.Marshal(), + }, + LengthCommitment: &lengthCommitment, + LengthProof: &lengthProof, Length: uint32(blobHeader.Length), QuorumHeaders: []*pb.BlobQuorumInfo{quorumHeader}, } diff --git a/node/grpc/utils.go b/node/grpc/utils.go index e6fb78adda..8f6bcf7eda 100644 --- a/node/grpc/utils.go +++ b/node/grpc/utils.go @@ -8,6 +8,7 @@ import ( pb "github.com/Layr-Labs/eigenda/api/grpc/node" "github.com/Layr-Labs/eigenda/core" "github.com/Layr-Labs/eigenda/node" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/wealdtech/go-merkletree" "github.com/wealdtech/go-merkletree/keccak256" "google.golang.org/protobuf/proto" @@ -57,18 +58,24 @@ func GetBlobMessages(in *pb.StoreChunksRequest) ([]*core.BlobMessage, error) { // Constructs a core.BlobHeader from a proto of pb.BlobHeader. func GetBlobHeaderFromProto(h *pb.BlobHeader) (*core.BlobHeader, error) { - commitment, err := new(core.Commitment).Deserialize(h.GetCommitment()) - if err != nil { - return nil, err + commitX := new(fp.Element).SetBytes(h.GetCommitment().GetX()) + commitY := new(fp.Element).SetBytes(h.GetCommitment().GetY()) + commitment := &core.G1Commitment{ + X: *commitX, + Y: *commitY, } - lengthCommitment, err := new(core.LengthCommitment).Deserialize(h.GetLengthCommitment()) - if err != nil { - return nil, err + var lengthCommitment, lengthProof core.G2Commitment + if h.GetLengthCommitment() != nil { + lengthCommitment.X.A0 = *new(fp.Element).SetBytes(h.GetLengthCommitment().GetXA0()) + lengthCommitment.X.A1 = *new(fp.Element).SetBytes(h.GetLengthCommitment().GetXA1()) + lengthCommitment.Y.A0 = *new(fp.Element).SetBytes(h.GetLengthCommitment().GetYA0()) + lengthCommitment.Y.A1 = *new(fp.Element).SetBytes(h.GetLengthCommitment().GetYA1()) } - - lenProof, err := new(core.LengthProof).Deserialize(h.GetLengthProof()) - if err != nil { - return nil, err + if h.GetLengthProof() != nil { + lengthProof.X.A0 = *new(fp.Element).SetBytes(h.GetLengthProof().GetXA0()) + lengthProof.X.A1 = *new(fp.Element).SetBytes(h.GetLengthProof().GetXA1()) + lengthProof.Y.A0 = *new(fp.Element).SetBytes(h.GetLengthProof().GetYA0()) + lengthProof.Y.A1 = *new(fp.Element).SetBytes(h.GetLengthProof().GetYA1()) } quorumHeaders := make([]*core.BlobQuorumInfo, len(h.GetQuorumHeaders())) @@ -87,8 +94,8 @@ func GetBlobHeaderFromProto(h *pb.BlobHeader) (*core.BlobHeader, error) { return &core.BlobHeader{ BlobCommitments: core.BlobCommitments{ Commitment: commitment, - LengthCommitment: lengthCommitment, - LengthProof: lenProof, + LengthCommitment: &lengthCommitment, + LengthProof: &lengthProof, Length: uint(h.GetLength()), }, QuorumInfos: quorumHeaders, diff --git a/node/node.go b/node/node.go index 3681010c89..3a1f63c5ee 100644 --- a/node/node.go +++ b/node/node.go @@ -113,7 +113,7 @@ func NewNode(config *Config, pubIPProvider pubip.Provider, logger common.Logger) nodeApi := nodeapi.NewNodeApi(AppName, SemVer, ":"+config.NodeApiPort, logger) // Make validator - enc, err := encoding.NewEncoder(config.EncoderConfig) + enc, err := encoding.NewEncoder(config.EncoderConfig, false) if err != nil { return nil, err } diff --git a/node/store_test.go b/node/store_test.go index b9da983559..1802fa881a 100644 --- a/node/store_test.go +++ b/node/store_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + commonpb "github.com/Layr-Labs/eigenda/api/grpc/common" pb "github.com/Layr-Labs/eigenda/api/grpc/node" "github.com/Layr-Labs/eigenda/common/mock" "github.com/Layr-Labs/eigenda/core" @@ -40,7 +41,6 @@ func CreateBatch(t *testing.T) (*core.BatchHeader, []*core.BlobMessage, []*pb.Bl _, err = lengthYA1.SetString("4082367875863433681332203403145435568316851327593401208105741076214120093531") assert.NoError(t, err) - var lengthProof, lengthCommitment bn254.G2Point lengthProof.X.A0 = lengthXA0 lengthProof.X.A1 = lengthXA1 @@ -74,9 +74,9 @@ func CreateBatch(t *testing.T) (*core.BatchHeader, []*core.BlobMessage, []*pb.Bl { BlobHeader: &core.BlobHeader{ BlobCommitments: core.BlobCommitments{ - Commitment: &core.Commitment{G1Point: &commitment}, - LengthCommitment: &core.LengthCommitment{G2Point: &lengthCommitment}, - LengthProof: &core.LengthProof{G2Point: &lengthProof}, + Commitment: (*core.G1Commitment)(&commitment), + LengthCommitment: (*core.G2Commitment)(&lengthCommitment), + LengthProof: (*core.LengthProof)(&lengthProof), Length: 48, }, QuorumInfos: []*core.BlobQuorumInfo{quorumHeader}, @@ -90,9 +90,9 @@ func CreateBatch(t *testing.T) (*core.BatchHeader, []*core.BlobMessage, []*pb.Bl { BlobHeader: &core.BlobHeader{ BlobCommitments: core.BlobCommitments{ - Commitment: &core.Commitment{G1Point: &commitment}, - LengthCommitment: &core.LengthCommitment{G2Point: &lengthCommitment}, - LengthProof: &core.LengthProof{G2Point: &lengthProof}, + Commitment: (*core.G1Commitment)(&commitment), + LengthCommitment: (*core.G2Commitment)(&lengthCommitment), + LengthProof: (*core.G2Commitment)(&lengthProof), Length: 50, }, QuorumInfos: []*core.BlobQuorumInfo{quorumHeader}, @@ -110,13 +110,6 @@ func CreateBatch(t *testing.T) (*core.BatchHeader, []*core.BlobMessage, []*pb.Bl ReferenceBlockNumber: 0, } - serializedCommitment0, err := core.Commitment{G1Point: &commitment}.Serialize() - assert.NoError(t, err) - serializedLengthCommitment0, err := core.LengthCommitment{G2Point: &lengthCommitment}.Serialize() - assert.NoError(t, err) - serializedLengthProof0, err := core.LengthProof{G2Point: &lengthProof}.Serialize() - assert.NoError(t, err) - quorumHeaderProto := &pb.BlobQuorumInfo{ QuorumId: uint32(quorumHeader.QuorumID), AdversaryThreshold: uint32(quorumHeader.AdversaryThreshold), @@ -125,19 +118,45 @@ func CreateBatch(t *testing.T) (*core.BatchHeader, []*core.BlobMessage, []*pb.Bl } blobHeaderProto0 := &pb.BlobHeader{ - Commitment: serializedCommitment0, - LengthCommitment: serializedLengthCommitment0, - LengthProof: serializedLengthProof0, - Length: uint32(48), - QuorumHeaders: []*pb.BlobQuorumInfo{quorumHeaderProto}, + Commitment: &commonpb.G1Commitment{ + X: commitment.X.Marshal(), + Y: commitment.Y.Marshal(), + }, + LengthCommitment: &pb.G2Commitment{ + XA0: lengthCommitment.X.A0.Marshal(), + XA1: lengthCommitment.X.A1.Marshal(), + YA0: lengthCommitment.Y.A0.Marshal(), + YA1: lengthCommitment.Y.A1.Marshal(), + }, + LengthProof: &pb.G2Commitment{ + XA0: lengthProof.X.A0.Marshal(), + XA1: lengthProof.X.A1.Marshal(), + YA0: lengthProof.Y.A0.Marshal(), + YA1: lengthProof.Y.A1.Marshal(), + }, + Length: uint32(48), + QuorumHeaders: []*pb.BlobQuorumInfo{quorumHeaderProto}, } blobHeaderProto1 := &pb.BlobHeader{ - Commitment: serializedCommitment0, - LengthCommitment: serializedLengthCommitment0, - LengthProof: serializedLengthProof0, - Length: uint32(50), - QuorumHeaders: []*pb.BlobQuorumInfo{quorumHeaderProto}, + Commitment: &commonpb.G1Commitment{ + X: commitment.X.Marshal(), + Y: commitment.Y.Marshal(), + }, + LengthCommitment: &pb.G2Commitment{ + XA0: lengthCommitment.X.A0.Marshal(), + XA1: lengthCommitment.X.A1.Marshal(), + YA0: lengthCommitment.Y.A0.Marshal(), + YA1: lengthCommitment.Y.A1.Marshal(), + }, + LengthProof: &pb.G2Commitment{ + XA0: lengthProof.X.A0.Marshal(), + XA1: lengthProof.X.A1.Marshal(), + YA0: lengthProof.Y.A0.Marshal(), + YA1: lengthProof.Y.A1.Marshal(), + }, + Length: uint32(50), + QuorumHeaders: []*pb.BlobQuorumInfo{quorumHeaderProto}, } blobs := []*pb.Blob{ { diff --git a/pkg/encoding/kzgEncoder/batchCommitEquivalence_test.go b/pkg/encoding/kzgEncoder/batchCommitEquivalence_test.go index 0521373e39..3f8834f649 100644 --- a/pkg/encoding/kzgEncoder/batchCommitEquivalence_test.go +++ b/pkg/encoding/kzgEncoder/batchCommitEquivalence_test.go @@ -5,6 +5,7 @@ import ( rs "github.com/Layr-Labs/eigenda/pkg/encoding/encoder" kzgRs "github.com/Layr-Labs/eigenda/pkg/encoding/kzgEncoder" + "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -13,24 +14,45 @@ func TestBatchEquivalence(t *testing.T) { teardownSuite := setupSuite(t) defer teardownSuite(t) - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) enc, err := group.NewKzgEncoder(params) require.Nil(t, err) + inputFr := rs.ToFrArray(GETTYSBURG_ADDRESS_BYTES) + commit, g2commit, _, _, _, err := enc.Encode(inputFr) + require.Nil(t, err) + numBlob := 5 commitPairs := make([]kzgRs.CommitmentPair, numBlob) for z := 0; z < numBlob; z++ { - inputFr := rs.ToFrArray(GETTYSBURG_ADDRESS_BYTES) + commitPairs[z] = kzgRs.CommitmentPair{ + Commitment: *commit, + LengthCommitment: *g2commit, + } + } + + assert.NoError(t, group.BatchVerifyCommitEquivalence(commitPairs), "batch equivalence negative test failed\n") + + var modifiedCommit bn254.G1Point + bn254.AddG1(&modifiedCommit, commit, commit) + for z := 0; z < numBlob; z++ { + commitPairs[z] = kzgRs.CommitmentPair{ + Commitment: modifiedCommit, + LengthCommitment: *g2commit, + } + } - commit, g2commit, _, _, _, err := enc.Encode(inputFr) - require.Nil(t, err) + assert.Error(t, group.BatchVerifyCommitEquivalence(commitPairs), "batch equivalence negative test failed\n") + for z := 0; z < numBlob; z++ { commitPairs[z] = kzgRs.CommitmentPair{ Commitment: *commit, LengthCommitment: *g2commit, } } - assert.True(t, group.BatchVerifyCommitEquivalence(commitPairs) == nil, "batch equivalence test failed\n") + bn254.AddG1(&commitPairs[numBlob/2].Commitment, &commitPairs[numBlob/2].Commitment, &commitPairs[numBlob/2].Commitment) + + assert.Error(t, group.BatchVerifyCommitEquivalence(commitPairs), "batch equivalence negative test failed in outer loop\n") } diff --git a/pkg/encoding/kzgEncoder/degree_test.go b/pkg/encoding/kzgEncoder/degree_test.go new file mode 100644 index 0000000000..6454a821d1 --- /dev/null +++ b/pkg/encoding/kzgEncoder/degree_test.go @@ -0,0 +1,36 @@ +package kzgEncoder_test + +import ( + "testing" + + rs "github.com/Layr-Labs/eigenda/pkg/encoding/encoder" + kzgRs "github.com/Layr-Labs/eigenda/pkg/encoding/kzgEncoder" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestLengthProof(t *testing.T) { + teardownSuite := setupSuite(t) + defer teardownSuite(t) + + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) + params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) + enc, err := group.NewKzgEncoder(params) + require.Nil(t, err) + + numBlob := 5 + for z := 0; z < numBlob; z++ { + extra := make([]byte, z*31*2) + inputBytes := append(GETTYSBURG_ADDRESS_BYTES, extra...) + inputFr := rs.ToFrArray(inputBytes) + + _, lowDegreeCommitment, lowDegreeProof, _, _, err := enc.Encode(inputFr) + require.Nil(t, err) + + length := len(inputFr) + assert.NoError(t, group.VerifyCommit(lowDegreeCommitment, lowDegreeProof, uint64(length)), "low degree verification failed\n") + + length = len(inputFr) - 10 + assert.Error(t, group.VerifyCommit(lowDegreeCommitment, lowDegreeProof, uint64(length)), "low degree verification failed\n") + } +} diff --git a/pkg/encoding/kzgEncoder/encoder.go b/pkg/encoding/kzgEncoder/encoder.go index 64e847fdcc..5b728d5480 100644 --- a/pkg/encoding/kzgEncoder/encoder.go +++ b/pkg/encoding/kzgEncoder/encoder.go @@ -1,6 +1,7 @@ package kzgEncoder import ( + "errors" "fmt" "log" "math" @@ -20,19 +21,22 @@ import ( ) type KzgConfig struct { - G1Path string - G2Path string - CacheDir string - NumWorker uint64 - SRSOrder uint64 // Order is the total size of SRS - Verbose bool - PreloadEncoder bool + G1Path string + G2Path string + CacheDir string + NumWorker uint64 + SRSOrder uint64 // Order is the total size of SRS + SRSNumberToLoad uint64 // Number of points to be loaded from the begining + Verbose bool + PreloadEncoder bool } type KzgEncoderGroup struct { *KzgConfig - Srs *kzg.SRS - mu sync.Mutex + Srs *kzg.SRS + G2Trailing []bls.G2Point + mu sync.Mutex + LoadG2Points bool Encoders map[rs.EncodingParams]*KzgEncoder Verifiers map[rs.EncodingParams]*KzgVerifier @@ -42,7 +46,8 @@ type KzgEncoder struct { *rs.Encoder *KzgConfig - Srs *kzg.SRS + Srs *kzg.SRS + G2Trailing []bls.G2Point Fs *kzg.FFTSettings Ks *kzg.KZGSettings @@ -51,17 +56,39 @@ type KzgEncoder struct { FFTPointsT [][]bls.G1Point // transpose of FFTPoints } -func NewKzgEncoderGroup(config *KzgConfig) (*KzgEncoderGroup, error) { +func NewKzgEncoderGroup(config *KzgConfig, loadG2Points bool) (*KzgEncoderGroup, error) { + + if config.SRSNumberToLoad > config.SRSOrder { + return nil, errors.New("SRSOrder is less than srsNumberToLoad") + } + // read the whole order, and treat it as entire SRS for low degree proof - s1, err := utils.ReadG1Points(config.G1Path, config.SRSOrder, config.NumWorker) + s1, err := utils.ReadG1Points(config.G1Path, config.SRSNumberToLoad, config.NumWorker) if err != nil { log.Println("failed to read G1 points", err) return nil, err } - s2, err := utils.ReadG2Points(config.G2Path, config.SRSOrder, config.NumWorker) - if err != nil { - log.Println("failed to read G2 points", err) - return nil, err + + s2 := make([]bls.G2Point, 0) + g2Trailing := make([]bls.G2Point, 0) + + // PreloadEncoder is by default not used by operator node, PreloadEncoder + if loadG2Points { + s2, err = utils.ReadG2Points(config.G2Path, config.SRSNumberToLoad, config.NumWorker) + if err != nil { + log.Println("failed to read G2 points", err) + return nil, err + } + + g2Trailing, err = utils.ReadG2PointSection( + config.G2Path, + config.SRSOrder-config.SRSNumberToLoad, + config.SRSOrder, // last exclusive + config.NumWorker, + ) + if err != nil { + return nil, err + } } srs, err := kzg.NewSrs(s1, s2) @@ -73,10 +100,12 @@ func NewKzgEncoderGroup(config *KzgConfig) (*KzgEncoderGroup, error) { fmt.Println("numthread", runtime.GOMAXPROCS(0)) encoderGroup := &KzgEncoderGroup{ - KzgConfig: config, - Srs: srs, - Encoders: make(map[rs.EncodingParams]*KzgEncoder), - Verifiers: make(map[rs.EncodingParams]*KzgVerifier), + KzgConfig: config, + Srs: srs, + G2Trailing: g2Trailing, + Encoders: make(map[rs.EncodingParams]*KzgEncoder), + Verifiers: make(map[rs.EncodingParams]*KzgVerifier), + LoadG2Points: loadG2Points, } if config.PreloadEncoder { @@ -97,6 +126,33 @@ func NewKzgEncoderGroup(config *KzgConfig) (*KzgEncoderGroup, error) { } +// Read the n-th G1 point from SRS. +func ReadG1Point(n uint64, g *KzgConfig) (bls.G1Point, error) { + if n > g.SRSOrder { + return bls.G1Point{}, fmt.Errorf("requested power %v is larger than SRSOrder %v", n, g.SRSOrder) + } + + g1point, err := utils.ReadG1PointSection(g.G1Path, n, n+1, 1) + if err != nil { + return bls.G1Point{}, err + } + + return g1point[0], nil +} + +// Read the n-th G2 point from SRS. +func ReadG2Point(n uint64, g *KzgConfig) (bls.G2Point, error) { + if n > g.SRSOrder { + return bls.G2Point{}, fmt.Errorf("requested power %v is larger than SRSOrder %v", n, g.SRSOrder) + } + + g2point, err := utils.ReadG2PointSection(g.G2Path, n, n+1, 1) + if err != nil { + return bls.G2Point{}, err + } + return g2point[0], nil +} + func (g *KzgEncoderGroup) PreloadAllEncoders() error { paramsAll, err := GetAllPrecomputedSrsMap(g.CacheDir) if err != nil { @@ -196,6 +252,7 @@ func (g *KzgEncoderGroup) newKzgEncoder(params rs.EncodingParams) (*KzgEncoder, Encoder: encoder, KzgConfig: g.KzgConfig, Srs: g.Srs, + G2Trailing: g.G2Trailing, Fs: fs, Ks: ks, SFs: sfs, @@ -218,6 +275,10 @@ func (g *KzgEncoder) Encode(inputFr []bls.Fr) (*bls.G1Point, *bls.G2Point, *bls. return nil, nil, nil, nil, nil, err } + if len(poly.Coeffs) > int(g.KzgConfig.SRSNumberToLoad) { + return nil, nil, nil, nil, nil, fmt.Errorf("poly Coeff length %v is greater than Loaded SRS points %v", len(poly.Coeffs), int(g.KzgConfig.SRSNumberToLoad)) + } + // compute commit for the full poly commit := g.Commit(poly.Coeffs) lowDegreeCommitment := bls.LinCombG2(g.Srs.G2[:len(poly.Coeffs)], poly.Coeffs) @@ -235,10 +296,11 @@ func (g *KzgEncoder) Encode(inputFr []bls.Fr) (*bls.G1Point, *bls.G2Point, *bls. log.Println("low degree verification info") } - shiftedSecret := g.Srs.G2[g.SRSOrder-polyDegreePlus1:] + shiftedSecret := g.G2Trailing[g.KzgConfig.SRSNumberToLoad-polyDegreePlus1:] //The proof of low degree is commitment of the polynomial shifted to the largest srs degree lowDegreeProof := bls.LinCombG2(shiftedSecret, poly.Coeffs[:polyDegreePlus1]) + //fmt.Println("kzgFFT lowDegreeProof", lowDegreeProof, "poly len ", len(fullCoeffsPoly), "order", len(g.Ks.SecretG2) ) //ok := VerifyLowDegreeProof(&commit, lowDegreeProof, polyDegreePlus1-1, g.SRSOrder, g.Srs.G2) //if !ok { @@ -291,8 +353,8 @@ func (g *KzgEncoder) Commit(polyFr []bls.Fr) bls.G1Point { // proof = commit(shiftedPoly) on G1 // so we can verify by checking // e( commit_1, [x^shift]_2) = e( proof_1, G_2 ) -func VerifyLowDegreeProof(lengthCommit *bls.G2Point, proof *bls.G2Point, claimedDegree uint64, SRSOrder uint64, srsG1 []bls.G1Point) bool { - return bls.PairingsVerify(&srsG1[SRSOrder-1-claimedDegree], lengthCommit, &bls.GenG1, proof) +func VerifyLowDegreeProof(lengthCommit *bls.G2Point, proof *bls.G2Point, g1Challenge *bls.G1Point) bool { + return bls.PairingsVerify(g1Challenge, lengthCommit, &bls.GenG1, proof) } // get Fiat-Shamir challenge diff --git a/pkg/encoding/kzgEncoder/encoder_fuzz_test.go b/pkg/encoding/kzgEncoder/encoder_fuzz_test.go index d14ff4abbd..9551b0c526 100644 --- a/pkg/encoding/kzgEncoder/encoder_fuzz_test.go +++ b/pkg/encoding/kzgEncoder/encoder_fuzz_test.go @@ -13,7 +13,7 @@ func FuzzOnlySystematic(f *testing.F) { f.Add(GETTYSBURG_ADDRESS_BYTES) f.Fuzz(func(t *testing.T, input []byte) { - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(10, 3, uint64(len(input))) enc, err := group.NewKzgEncoder(params) diff --git a/pkg/encoding/kzgEncoder/encoder_suite_test.go b/pkg/encoding/kzgEncoder/encoder_suite_test.go index 91325e5fc0..3ab6c60a9f 100644 --- a/pkg/encoding/kzgEncoder/encoder_suite_test.go +++ b/pkg/encoding/kzgEncoder/encoder_suite_test.go @@ -30,6 +30,7 @@ func setupSuite(t *testing.T) func(t *testing.T) { G2Path: "../../../inabox/resources/kzg/g2.point", CacheDir: "../../../inabox/resources/kzg/SRSTables", SRSOrder: 3000, + SRSNumberToLoad: 2900, NumWorker: uint64(runtime.GOMAXPROCS(0)), } diff --git a/pkg/encoding/kzgEncoder/frame.go b/pkg/encoding/kzgEncoder/frame.go index e5e716d56a..ef5fe5bc10 100644 --- a/pkg/encoding/kzgEncoder/frame.go +++ b/pkg/encoding/kzgEncoder/frame.go @@ -37,7 +37,7 @@ func Decode(b []byte) (Frame, error) { } // Verify function assumes the Data stored is coefficients of coset's interpolating poly -func (f *Frame) Verify(ks *kzg.KZGSettings, commitment *bls.G1Point, x *bls.Fr) bool { +func (f *Frame) Verify(ks *kzg.KZGSettings, commitment *bls.G1Point, x *bls.Fr, g2Atn *bls.G2Point) bool { var xPow bls.Fr bls.CopyFr(&xPow, &bls.ONE) @@ -53,10 +53,12 @@ func (f *Frame) Verify(ks *kzg.KZGSettings, commitment *bls.G1Point, x *bls.Fr) // [s^n - x^n]_2 var xnMinusYn bls.G2Point - bls.SubG2(&xnMinusYn, &ks.Srs.G2[len(f.Coeffs)], &xn2) + + bls.SubG2(&xnMinusYn, g2Atn, &xn2) // [interpolation_polynomial(s)]_1 is1 := bls.LinCombG1(ks.Srs.G1[:len(f.Coeffs)], f.Coeffs) + // [commitment - interpolation_polynomial(s)]_1 = [commit]_1 - [interpolation_polynomial(s)]_1 var commitMinusInterpolation bls.G1Point bls.SubG1(&commitMinusInterpolation, commitment, is1) diff --git a/pkg/encoding/kzgEncoder/frame_test.go b/pkg/encoding/kzgEncoder/frame_test.go index 8d2069f7fd..8934c680ea 100644 --- a/pkg/encoding/kzgEncoder/frame_test.go +++ b/pkg/encoding/kzgEncoder/frame_test.go @@ -16,7 +16,7 @@ func TestEncodeDecodeFrame_AreInverses(t *testing.T) { teardownSuite := setupSuite(t) defer teardownSuite(t) - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) @@ -44,7 +44,7 @@ func TestVerify(t *testing.T) { teardownSuite := setupSuite(t) defer teardownSuite(t) - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) @@ -64,5 +64,7 @@ func TestVerify(t *testing.T) { lc := enc.Fs.ExpandedRootsOfUnity[uint64(0)] require.NotNil(t, lc) - assert.True(t, frames[0].Verify(enc.Ks, commit, &lc)) + g2Atn, err := kzgRs.ReadG2Point(uint64(len(frames[0].Coeffs)), kzgConfig) + require.Nil(t, err) + assert.True(t, frames[0].Verify(enc.Ks, commit, &lc, &g2Atn)) } diff --git a/pkg/encoding/kzgEncoder/multiframe.go b/pkg/encoding/kzgEncoder/multiframe.go index ce5783ac0d..e566c1e9fd 100644 --- a/pkg/encoding/kzgEncoder/multiframe.go +++ b/pkg/encoding/kzgEncoder/multiframe.go @@ -176,6 +176,10 @@ func (group *KzgEncoderGroup) UniversalVerify(params rs.EncodingParams, samples D := params.ChunkLen + if D > group.SRSNumberToLoad { + return fmt.Errorf("requested chunkLen %v is larger than Loaded SRS points %v.", D, group.SRSNumberToLoad) + } + n := len(samples) fmt.Printf("Batch verify %v frames of %v symbols out of %v blobs \n", n, params.ChunkLen, m) @@ -195,7 +199,11 @@ func (group *KzgEncoderGroup) UniversalVerify(params rs.EncodingParams, samples lhsG1 := bls.LinCombG1(proofs, randomsFr) // lhs g2 - lhsG2 := &ks.Srs.G2[D] + G2atD, err := ReadG2Point(D, group.KzgConfig) + if err != nil { + return err + } + lhsG2 := &G2atD // rhs g2 rhsG2 := &bls.GenG2 diff --git a/pkg/encoding/kzgEncoder/multiframe_test.go b/pkg/encoding/kzgEncoder/multiframe_test.go index 3d3cc70386..3f72bab728 100644 --- a/pkg/encoding/kzgEncoder/multiframe_test.go +++ b/pkg/encoding/kzgEncoder/multiframe_test.go @@ -13,7 +13,7 @@ func TestUniversalVerify(t *testing.T) { teardownSuite := setupSuite(t) defer teardownSuite(t) - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) enc, err := group.NewKzgEncoder(params) require.Nil(t, err) diff --git a/pkg/encoding/kzgEncoder/multiprover_test.go b/pkg/encoding/kzgEncoder/multiprover_test.go index 9def8d6c1e..11b6eefd7f 100644 --- a/pkg/encoding/kzgEncoder/multiprover_test.go +++ b/pkg/encoding/kzgEncoder/multiprover_test.go @@ -14,7 +14,7 @@ func TestProveAllCosetThreads(t *testing.T) { teardownSuite := setupSuite(t) defer teardownSuite(t) - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) enc, err := group.NewKzgEncoder(params) @@ -37,6 +37,8 @@ func TestProveAllCosetThreads(t *testing.T) { fmt.Printf("frame %v leading coset %v\n", i, j) lc := enc.Fs.ExpandedRootsOfUnity[uint64(j)] - assert.True(t, f.Verify(enc.Ks, commit, &lc), "Proof %v failed\n", i) + g2Atn, err := kzgRs.ReadG2Point(uint64(len(f.Coeffs)), kzgConfig) + require.Nil(t, err) + assert.True(t, f.Verify(enc.Ks, commit, &lc, &g2Atn), "Proof %v failed\n", i) } } diff --git a/pkg/encoding/kzgEncoder/verifier.go b/pkg/encoding/kzgEncoder/verifier.go index e463024972..6897b13d65 100644 --- a/pkg/encoding/kzgEncoder/verifier.go +++ b/pkg/encoding/kzgEncoder/verifier.go @@ -71,9 +71,14 @@ func (g *KzgEncoderGroup) newKzgVerifier(params rs.EncodingParams) (*KzgVerifier // VerifyCommit verifies the low degree proof; since it doesn't depend on the encoding parameters // we leave it as a method of the KzgEncoderGroup -func (v *KzgEncoderGroup) VerifyCommit(lengthCommit *wbls.G2Point, lowDegreeProof *wbls.G2Point, degree uint64) error { +func (v *KzgEncoderGroup) VerifyCommit(lengthCommit *wbls.G2Point, lowDegreeProof *wbls.G2Point, length uint64) error { - if !VerifyLowDegreeProof(lengthCommit, lowDegreeProof, degree, v.SRSOrder, v.Srs.G1) { + g1Challenge, err := ReadG1Point(v.SRSOrder-length, v.KzgConfig) + if err != nil { + return err + } + + if !VerifyLowDegreeProof(lengthCommit, lowDegreeProof, &g1Challenge) { return errors.New("low degree proof fails") } return nil @@ -90,7 +95,11 @@ func (v *KzgVerifier) VerifyFrame(commit *wbls.G1Point, f *Frame, index uint64) return err } - if !f.Verify(v.Ks, commit, &v.Ks.ExpandedRootsOfUnity[j]) { + g2Atn, err := ReadG2Point(uint64(len(f.Coeffs)), v.KzgConfig) + if err != nil { + return err + } + if !f.Verify(v.Ks, commit, &v.Ks.ExpandedRootsOfUnity[j], &g2Atn) { return errors.New("multireveal proof fails") } diff --git a/pkg/encoding/kzgEncoder/zero_padding_test.go b/pkg/encoding/kzgEncoder/zero_padding_test.go index 8c6ca041f5..af450e2fe9 100644 --- a/pkg/encoding/kzgEncoder/zero_padding_test.go +++ b/pkg/encoding/kzgEncoder/zero_padding_test.go @@ -13,7 +13,7 @@ func TestProveZeroPadding(t *testing.T) { teardownSuite := setupSuite(t) defer teardownSuite(t) - group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + group, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.GetEncodingParams(numSys, numPar, uint64(len(GETTYSBURG_ADDRESS_BYTES))) enc, err := group.NewKzgEncoder(params) diff --git a/pkg/encoding/main.go b/pkg/encoding/main.go index 4088b4792e..fe32838d39 100644 --- a/pkg/encoding/main.go +++ b/pkg/encoding/main.go @@ -11,15 +11,36 @@ import ( rs "github.com/Layr-Labs/eigenda/pkg/encoding/encoder" kzgRs "github.com/Layr-Labs/eigenda/pkg/encoding/kzgEncoder" - kzg "github.com/Layr-Labs/eigenda/pkg/kzg" bls "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" ) func main() { // TestKzgRs() - err := kzg.WriteGeneratorPoints(30000) - if err != nil { - log.Println("WriteGeneratorPoints failed:", err) + //err := kzg.WriteGeneratorPoints(30000) + //if err != nil { + // log.Println("WriteGeneratorPoints failed:", err) + //} + readpoints() +} + +func readpoints() { + kzgConfig := &kzgRs.KzgConfig{ + G1Path: "../../inabox/resources/kzg/g1.point", + G2Path: "../../inabox/resources/kzg/g2.point", + CacheDir: "SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), + } + + // create encoding object + kzgGroup, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) + fmt.Println("there are ", len(kzgGroup.Srs.G1), "points") + for i := 0; i < len(kzgGroup.Srs.G1); i++ { + fmt.Printf("%v %v\n", i, string(kzgGroup.Srs.G1[i].MarshalText())) + } + if kzgGroup.Srs.G1[0].X == bls.GenG1.X && kzgGroup.Srs.G1[0].Y == bls.GenG1.Y { + fmt.Println("start with gen") } } @@ -36,15 +57,16 @@ func TestKzgRs() { //fmt.Printf(" Data size(byte): %v\n", len(inputBytes)) kzgConfig := &kzgRs.KzgConfig{ - G1Path: "g1.point", - G2Path: "g2.point", - CacheDir: "SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "g1.point", + G2Path: "g2.point", + CacheDir: "SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } // create encoding object - kzgGroup, _ := kzgRs.NewKzgEncoderGroup(kzgConfig) + kzgGroup, _ := kzgRs.NewKzgEncoderGroup(kzgConfig, true) params := rs.EncodingParams{NumChunks: 200, ChunkLen: 180} enc, _ := kzgGroup.NewKzgEncoder(params) @@ -85,7 +107,12 @@ func TestKzgRs() { fmt.Printf("frame %v leading coset %v\n", i, j) lc := enc.Fs.ExpandedRootsOfUnity[uint64(j)] - ok := f.Verify(enc.Ks, commit, &lc) + + g2Atn, err := kzgRs.ReadG2Point(uint64(len(f.Coeffs)), kzgConfig) + if err != nil { + log.Fatalf("Load g2 %v failed\n", err) + } + ok := f.Verify(enc.Ks, commit, &lc, &g2Atn) if !ok { log.Fatalf("Proof %v failed\n", i) } diff --git a/pkg/encoding/utils/pointsIO.go b/pkg/encoding/utils/pointsIO.go index 4fc0b05979..53cdf279ec 100644 --- a/pkg/encoding/utils/pointsIO.go +++ b/pkg/encoding/utils/pointsIO.go @@ -2,10 +2,10 @@ package utils import ( "bufio" + "fmt" "io" "log" "os" - "sync" "time" bls "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" @@ -43,10 +43,9 @@ func ReadG1Points(filepath string, n uint64, numWorker uint64) ([]bls.G1Point, e return nil, err } - //todo: resolve panic defer func() { if err := g1f.Close(); err != nil { - panic(err) + log.Printf("G1 close error %v\n", err) } }() @@ -70,13 +69,12 @@ func ReadG1Points(filepath string, n uint64, numWorker uint64) ([]bls.G1Point, e s1Outs := make([]bls.G1Point, n) - var wg sync.WaitGroup - wg.Add(int(numWorker)) - start := uint64(0) end := uint64(0) size := n / numWorker + results := make(chan error, numWorker) + for i := uint64(0); i < numWorker; i++ { start = i * size @@ -86,10 +84,16 @@ func ReadG1Points(filepath string, n uint64, numWorker uint64) ([]bls.G1Point, e end = (i + 1) * size } //fmt.Printf("worker %v start %v end %v. size %v\n", i, start, end, end - start) - //todo: handle error? - go readG1Worker(buf, s1Outs, start, end, G1PointBytes, &wg) + + go readG1Worker(buf, s1Outs, start, end, G1PointBytes, results) + } + + for w := uint64(0); w < numWorker; w++ { + err := <-results + if err != nil { + return nil, err + } } - wg.Wait() // measure parsing time t = time.Now() @@ -98,17 +102,20 @@ func ReadG1Points(filepath string, n uint64, numWorker uint64) ([]bls.G1Point, e return s1Outs, nil } +// from is inclusive, to is exclusive func ReadG1PointSection(filepath string, from, to uint64, numWorker uint64) ([]bls.G1Point, error) { + if to <= from { + return nil, fmt.Errorf("The range to read is invalid, from: %v, to: %v", from, to) + } g1f, err := os.Open(filepath) if err != nil { log.Println("ReadG1PointSection.ERR.0", err) return nil, err } - //todo: how to handle? defer func() { if err := g1f.Close(); err != nil { - panic(err) + log.Printf("g1 close error %v\n", err) } }() @@ -139,13 +146,12 @@ func ReadG1PointSection(filepath string, from, to uint64, numWorker uint64) ([]b s1Outs := make([]bls.G1Point, n) - var wg sync.WaitGroup - wg.Add(int(numWorker)) - start := uint64(0) end := uint64(0) size := n / numWorker + results := make(chan error, numWorker) + for i := uint64(0); i < numWorker; i++ { start = i * size @@ -154,10 +160,16 @@ func ReadG1PointSection(filepath string, from, to uint64, numWorker uint64) ([]b } else { end = (i + 1) * size } - //todo: handle error? - go readG1Worker(buf, s1Outs, start, end, G1PointBytes, &wg) + + go readG1Worker(buf, s1Outs, start, end, G1PointBytes, results) + } + + for w := uint64(0); w < numWorker; w++ { + err := <-results + if err != nil { + return nil, err + } } - wg.Wait() // measure parsing time t = time.Now() @@ -172,16 +184,17 @@ func readG1Worker( start uint64, // in element, not in byte end uint64, step uint64, - wg *sync.WaitGroup, + results chan<- error, ) { for i := start; i < end; i++ { g1 := buf[i*step : (i+1)*step] err := outs[i].UnmarshalText(g1[:]) if err != nil { + results <- err panic(err) } } - wg.Done() + results <- nil } func readG2Worker( @@ -190,16 +203,18 @@ func readG2Worker( start uint64, // in element, not in byte end uint64, step uint64, - wg *sync.WaitGroup, + results chan<- error, ) { for i := start; i < end; i++ { g1 := buf[i*step : (i+1)*step] err := outs[i].UnmarshalText(g1[:]) if err != nil { + results <- err log.Println("Unmarshalling error:", err) + panic(err) } } - wg.Done() + results <- nil } func ReadG2Points(filepath string, n uint64, numWorker uint64) ([]bls.G2Point, error) { @@ -209,10 +224,10 @@ func ReadG2Points(filepath string, n uint64, numWorker uint64) ([]bls.G2Point, e log.Println("ReadG2Points.ERR.0", err) return nil, err } - //todo: resolve panic + defer func() { if err := g1f.Close(); err != nil { - panic(err) + log.Printf("g2 close error %v\n", err) } }() @@ -237,12 +252,87 @@ func ReadG2Points(filepath string, n uint64, numWorker uint64) ([]bls.G2Point, e s2Outs := make([]bls.G2Point, n) - var wg sync.WaitGroup - wg.Add(int(numWorker)) + results := make(chan error, numWorker) start := uint64(0) end := uint64(0) size := n / numWorker + for i := uint64(0); i < numWorker; i++ { + start = i * size + + if i == numWorker-1 { + end = n + } else { + end = (i + 1) * size + } + + go readG2Worker(buf, s2Outs, start, end, G2PointBytes, results) + } + + for w := uint64(0); w < numWorker; w++ { + err := <-results + if err != nil { + return nil, err + } + } + + // measure parsing time + t = time.Now() + elapsed = t.Sub(startTimer) + log.Println(" Parsing takes", elapsed) + return s2Outs, nil +} + +// from is inclusive, to is exclusive +func ReadG2PointSection(filepath string, from, to uint64, numWorker uint64) ([]bls.G2Point, error) { + if to <= from { + return nil, fmt.Errorf("The range to read is invalid, from: %v, to: %v", from, to) + } + g2f, err := os.Open(filepath) + if err != nil { + log.Println("ReadG2PointSection.ERR.0", err) + return nil, err + } + + defer func() { + if err := g2f.Close(); err != nil { + log.Printf("error %v\n", err) + } + }() + + n := to - from + + startTimer := time.Now() + g2r := bufio.NewReaderSize(g2f, int(to*G2PointBytes)) + + _, err = g2f.Seek(int64(from*G2PointBytes), 0) + if err != nil { + return nil, err + } + + if n < numWorker { + numWorker = n + } + + buf, err := ReadDesiredBytes(g2r, n*G2PointBytes) + if err != nil { + return nil, err + } + + // measure reading time + t := time.Now() + elapsed := t.Sub(startTimer) + log.Printf(" Reading G2 points (%v bytes) takes %v\n", (n * G2PointBytes), elapsed) + startTimer = time.Now() + + s2Outs := make([]bls.G2Point, n) + + results := make(chan error, numWorker) + + start := uint64(0) + end := uint64(0) + size := n / numWorker + for i := uint64(0); i < numWorker; i++ { start = i * size @@ -252,9 +342,14 @@ func ReadG2Points(filepath string, n uint64, numWorker uint64) ([]bls.G2Point, e end = (i + 1) * size } //todo: handle error? - go readG2Worker(buf, s2Outs, start, end, G2PointBytes, &wg) + go readG2Worker(buf, s2Outs, start, end, G2PointBytes, results) + } + for w := uint64(0); w < numWorker; w++ { + err := <-results + if err != nil { + return nil, err + } } - wg.Wait() // measure parsing time t = time.Now() diff --git a/pkg/kzg/srs.go b/pkg/kzg/srs.go index 7a3bb5882a..e63610346d 100644 --- a/pkg/kzg/srs.go +++ b/pkg/kzg/srs.go @@ -24,11 +24,7 @@ package kzg -import ( - "errors" - - bls "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" -) +import bls "github.com/Layr-Labs/eigenda/pkg/kzg/bn254" type SRS struct { @@ -40,9 +36,6 @@ type SRS struct { func NewSrs(G1 []bls.G1Point, G2 []bls.G2Point) (*SRS, error) { - if len(G1) != len(G2) { - return nil, errors.New("secret list lengths don't match") - } return &SRS{ G1: G1, G2: G2, diff --git a/retriever/cmd/main.go b/retriever/cmd/main.go index c7fbfd3fd5..5318816296 100644 --- a/retriever/cmd/main.go +++ b/retriever/cmd/main.go @@ -75,7 +75,7 @@ func RetrieverMain(ctx *cli.Context) error { } nodeClient := clients.NewNodeClient(config.Timeout) - encoder, err := encoding.NewEncoder(config.EncoderConfig) + encoder, err := encoding.NewEncoder(config.EncoderConfig, false) if err != nil { log.Fatalln("could not start tcp listener", err) } diff --git a/retriever/server_test.go b/retriever/server_test.go index d0c7f2b72d..2c0c25ab36 100644 --- a/retriever/server_test.go +++ b/retriever/server_test.go @@ -32,14 +32,15 @@ var ( func makeTestEncoder() (core.Encoder, error) { config := &kzgEncoder.KzgConfig{ - G1Path: "../inabox/resources/kzg/g1.point", - G2Path: "../inabox/resources/kzg/g2.point", - CacheDir: "../inabox/resources/kzg/SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../inabox/resources/kzg/g1.point", + G2Path: "../inabox/resources/kzg/g2.point", + CacheDir: "../inabox/resources/kzg/SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } - kzgEncoderGroup, err := kzgEncoder.NewKzgEncoderGroup(config) + kzgEncoderGroup, err := kzgEncoder.NewKzgEncoderGroup(config, false) if err != nil { return nil, err } diff --git a/test/integration_test.go b/test/integration_test.go index 37604c161c..5c1f3cc3fa 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -16,6 +16,7 @@ import ( "time" "github.com/Layr-Labs/eigenda/common/pubip" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" clientsmock "github.com/Layr-Labs/eigenda/clients/mock" "github.com/Layr-Labs/eigenda/disperser/apiserver" @@ -76,15 +77,17 @@ func init() { // makeTestEncoder makes an encoder currently using the only supported backend. func mustMakeTestEncoder() core.Encoder { config := kzgEncoder.KzgConfig{ - G1Path: "../inabox/resources/kzg/g1.point", - G2Path: "../inabox/resources/kzg/g2.point", - CacheDir: "../inabox/resources/kzg/SRSTables", - SRSOrder: 3000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "../inabox/resources/kzg/g1.point", + G2Path: "../inabox/resources/kzg/g2.point", + CacheDir: "../inabox/resources/kzg/SRSTables", + SRSOrder: 3000, + SRSNumberToLoad: 3000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } encoder, err := encoding.NewEncoder( encoding.EncoderConfig{KzgConfig: config}, + true, ) if err != nil { log.Fatalln("failed to initialize new encoder") @@ -499,15 +502,23 @@ func TestDispersalAndRetrieval(t *testing.T) { QuorumId: uint32(0), }) assert.NoError(t, err) - actualCommitment, err := new(core.Commitment).Deserialize(headerReply.GetBlobHeader().GetCommitment()) - assert.NoError(t, err) - actualLengthCommitment, err := new(core.LengthCommitment).Deserialize(headerReply.GetBlobHeader().GetLengthCommitment()) - assert.NoError(t, err) - actualLengthProof, err := new(core.LengthProof).Deserialize(headerReply.GetBlobHeader().GetLengthProof()) - assert.NoError(t, err) + actualCommitment := &core.G1Commitment{ + X: *new(fp.Element).SetBytes(headerReply.GetBlobHeader().GetCommitment().GetX()), + Y: *new(fp.Element).SetBytes(headerReply.GetBlobHeader().GetCommitment().GetY()), + } + var actualLengthCommitment, actualLengthProof core.G2Commitment + actualLengthCommitment.X.A0.SetBytes(headerReply.GetBlobHeader().GetLengthCommitment().GetXA0()) + actualLengthCommitment.X.A1.SetBytes(headerReply.GetBlobHeader().GetLengthCommitment().GetXA1()) + actualLengthCommitment.Y.A0.SetBytes(headerReply.GetBlobHeader().GetLengthCommitment().GetYA0()) + actualLengthCommitment.Y.A1.SetBytes(headerReply.GetBlobHeader().GetLengthCommitment().GetYA1()) + actualLengthProof.X.A0.SetBytes(headerReply.GetBlobHeader().GetLengthProof().GetXA0()) + actualLengthProof.X.A1.SetBytes(headerReply.GetBlobHeader().GetLengthProof().GetXA1()) + actualLengthProof.Y.A0.SetBytes(headerReply.GetBlobHeader().GetLengthProof().GetYA0()) + actualLengthProof.Y.A1.SetBytes(headerReply.GetBlobHeader().GetLengthProof().GetYA1()) + assert.Equal(t, metadata.ConfirmationInfo.BlobCommitment.Commitment, actualCommitment) - assert.Equal(t, metadata.ConfirmationInfo.BlobCommitment.LengthCommitment, actualLengthCommitment) - assert.Equal(t, metadata.ConfirmationInfo.BlobCommitment.LengthProof, actualLengthProof) + assert.Equal(t, metadata.ConfirmationInfo.BlobCommitment.LengthCommitment, &actualLengthCommitment) + assert.Equal(t, metadata.ConfirmationInfo.BlobCommitment.LengthProof, &actualLengthProof) assert.Equal(t, uint32(metadata.ConfirmationInfo.BlobCommitment.Length), headerReply.GetBlobHeader().GetLength()) assert.Len(t, headerReply.GetBlobHeader().GetQuorumHeaders(), 1) assert.Equal(t, uint32(0), headerReply.GetBlobHeader().GetQuorumHeaders()[0].GetQuorumId()) diff --git a/test/synthetic-test/synthetic_client_test.go b/test/synthetic-test/synthetic_client_test.go index 35a0d81c45..a6581aae3f 100644 --- a/test/synthetic-test/synthetic_client_test.go +++ b/test/synthetic-test/synthetic_client_test.go @@ -579,11 +579,12 @@ func TestEncodeBlob(t *testing.T) { // Test Assumes below params set for Encoder kzgConfig := kzgEncoder.KzgConfig{ - G1Path: "/data/kzg/g1.point", - G2Path: "/data/kzg/g2.point", - CacheDir: "/data/kzg/SRSTables", - SRSOrder: 300000, - NumWorker: uint64(runtime.GOMAXPROCS(0)), + G1Path: "/data/kzg/g1.point", + G2Path: "/data/kzg/g2.point", + CacheDir: "/data/kzg/SRSTables", + SRSOrder: 300000, + SRSNumberToLoad: 300000, + NumWorker: uint64(runtime.GOMAXPROCS(0)), } encodingConfig := encoding.EncoderConfig{KzgConfig: kzgConfig}