From cc49ed345fb5f48dee944019cf4941ae567537d4 Mon Sep 17 00:00:00 2001 From: Goran Rojovic Date: Wed, 19 Feb 2025 12:42:55 +0100 Subject: [PATCH 1/9] feat: generate neccessary files --- Makefile | 7 +- ...layer_certificate_submission_service.pb.go | 295 +++++++++ ...layer_certificate_submission_service.proto | 34 ++ ..._certificate_submission_service_grpc.pb.go | 119 ++++ .../node/agglayer_configuration_service.pb.go | 224 +++++++ .../node/agglayer_configuration_service.proto | 22 + .../agglayer_configuration_service_grpc.pb.go | 119 ++++ .../node/agglayer_network_state_service.pb.go | 537 +++++++++++++++++ .../node/agglayer_network_state_service.proto | 56 ++ .../agglayer_network_state_service_grpc.pb.go | 199 ++++++ agglayer/proto/types/bridge_exit.pb.go | 362 +++++++++++ agglayer/proto/types/bridge_exit.proto | 45 ++ agglayer/proto/types/bytes.pb.go | 276 +++++++++ agglayer/proto/types/bytes.proto | 22 + agglayer/proto/types/certificate.pb.go | 461 ++++++++++++++ agglayer/proto/types/certificate.proto | 48 ++ agglayer/proto/types/certificate_header.pb.go | 439 ++++++++++++++ agglayer/proto/types/certificate_header.proto | 54 ++ agglayer/proto/types/claim.pb.go | 570 ++++++++++++++++++ agglayer/proto/types/claim.proto | 57 ++ .../proto/types/epoch_configuration.pb.go | 161 +++++ .../proto/types/epoch_configuration.proto | 12 + .../proto/types/imported_bridge_exit.pb.go | 240 ++++++++ .../proto/types/imported_bridge_exit.proto | 28 + .../src/proto/datastream/v1/datastream.proto | 2 +- types/epoch_configuration.pb.go | 159 +++++ 26 files changed, 4546 insertions(+), 2 deletions(-) create mode 100644 agglayer/proto/node/agglayer_certificate_submission_service.pb.go create mode 100644 agglayer/proto/node/agglayer_certificate_submission_service.proto create mode 100644 agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go create mode 100644 agglayer/proto/node/agglayer_configuration_service.pb.go create mode 100644 agglayer/proto/node/agglayer_configuration_service.proto create mode 100644 agglayer/proto/node/agglayer_configuration_service_grpc.pb.go create mode 100644 agglayer/proto/node/agglayer_network_state_service.pb.go create mode 100644 agglayer/proto/node/agglayer_network_state_service.proto create mode 100644 agglayer/proto/node/agglayer_network_state_service_grpc.pb.go create mode 100644 agglayer/proto/types/bridge_exit.pb.go create mode 100644 agglayer/proto/types/bridge_exit.proto create mode 100644 agglayer/proto/types/bytes.pb.go create mode 100644 agglayer/proto/types/bytes.proto create mode 100644 agglayer/proto/types/certificate.pb.go create mode 100644 agglayer/proto/types/certificate.proto create mode 100644 agglayer/proto/types/certificate_header.pb.go create mode 100644 agglayer/proto/types/certificate_header.proto create mode 100644 agglayer/proto/types/claim.pb.go create mode 100644 agglayer/proto/types/claim.proto create mode 100644 agglayer/proto/types/epoch_configuration.pb.go create mode 100644 agglayer/proto/types/epoch_configuration.proto create mode 100644 agglayer/proto/types/imported_bridge_exit.pb.go create mode 100644 agglayer/proto/types/imported_bridge_exit.proto create mode 100644 types/epoch_configuration.pb.go diff --git a/Makefile b/Makefile index 8892cb15..d3fb3859 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,12 @@ lint: ## Runs the linter .PHONY: generate-code-from-proto generate-code-from-proto: ## Generates code from proto files - cd proto/src/proto/datastream/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../state/datastream --go-grpc_out=../../../../../state/datastream --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative datastream.proto + # cd proto/src/proto/datastream/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../state/datastream --go-grpc_out=../../../../../state/datastream --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative datastream.proto + protoc --proto_path=agglayer/proto \ + --go_out=agglayer/proto --go_opt=paths=source_relative \ + --go-grpc_out=agglayer/proto --go-grpc_opt=paths=source_relative \ + agglayer/proto/types/*.proto \ + agglayer/proto/node/*.proto ## Help display. diff --git a/agglayer/proto/node/agglayer_certificate_submission_service.pb.go b/agglayer/proto/node/agglayer_certificate_submission_service.pb.go new file mode 100644 index 00000000..19ca0e71 --- /dev/null +++ b/agglayer/proto/node/agglayer_certificate_submission_service.pb.go @@ -0,0 +1,295 @@ +// Proto definition for Agglayer Certificate Submition Service + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: node/agglayer_certificate_submission_service.proto + +package node + +import ( + types "github.com/agglayer/aggkit/agglayer/proto/types" + 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) +) + +// The kind of error that occurred and that are reported by the service. +type ErrorKind int32 + +const ( + // Unspecified error. + ErrorKind_ERROR_KIND_UNSPECIFIED ErrorKind = 0 + // The signature verification failed. + ErrorKind_ERROR_KIND_SIGNATURE_VERIFICATION ErrorKind = 1 +) + +// Enum value maps for ErrorKind. +var ( + ErrorKind_name = map[int32]string{ + 0: "ERROR_KIND_UNSPECIFIED", + 1: "ERROR_KIND_SIGNATURE_VERIFICATION", + } + ErrorKind_value = map[string]int32{ + "ERROR_KIND_UNSPECIFIED": 0, + "ERROR_KIND_SIGNATURE_VERIFICATION": 1, + } +) + +func (x ErrorKind) Enum() *ErrorKind { + p := new(ErrorKind) + *p = x + return p +} + +func (x ErrorKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ErrorKind) Descriptor() protoreflect.EnumDescriptor { + return file_node_agglayer_certificate_submission_service_proto_enumTypes[0].Descriptor() +} + +func (ErrorKind) Type() protoreflect.EnumType { + return &file_node_agglayer_certificate_submission_service_proto_enumTypes[0] +} + +func (x ErrorKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ErrorKind.Descriptor instead. +func (ErrorKind) EnumDescriptor() ([]byte, []int) { + return file_node_agglayer_certificate_submission_service_proto_rawDescGZIP(), []int{0} +} + +// Type used to submit a certificate. +type SubmitCertificateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The certificate to submit. + Certificate *types.Certificate `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` +} + +func (x *SubmitCertificateRequest) Reset() { + *x = SubmitCertificateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_certificate_submission_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitCertificateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitCertificateRequest) ProtoMessage() {} + +func (x *SubmitCertificateRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_certificate_submission_service_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 SubmitCertificateRequest.ProtoReflect.Descriptor instead. +func (*SubmitCertificateRequest) Descriptor() ([]byte, []int) { + return file_node_agglayer_certificate_submission_service_proto_rawDescGZIP(), []int{0} +} + +func (x *SubmitCertificateRequest) GetCertificate() *types.Certificate { + if x != nil { + return x.Certificate + } + return nil +} + +// Type used as response to a certificate submission. +type SubmitCertificateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The certificate id of the submitted certificate. + CertificateId *types.CertificateId `protobuf:"bytes,1,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` +} + +func (x *SubmitCertificateResponse) Reset() { + *x = SubmitCertificateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_certificate_submission_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitCertificateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitCertificateResponse) ProtoMessage() {} + +func (x *SubmitCertificateResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_certificate_submission_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitCertificateResponse.ProtoReflect.Descriptor instead. +func (*SubmitCertificateResponse) Descriptor() ([]byte, []int) { + return file_node_agglayer_certificate_submission_service_proto_rawDescGZIP(), []int{1} +} + +func (x *SubmitCertificateResponse) GetCertificateId() *types.CertificateId { + if x != nil { + return x.CertificateId + } + return nil +} + +var File_node_agglayer_certificate_submission_service_proto protoreflect.FileDescriptor + +var file_node_agglayer_certificate_submission_service_proto_rawDesc = []byte{ + 0x0a, 0x32, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x18, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x3a, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, + 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x5e, 0x0a, 0x19, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x2a, 0x4e, 0x0a, 0x09, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4b, + 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, 0x45, + 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x32, 0x7e, 0x0a, 0x24, + 0x41, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, + 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_node_agglayer_certificate_submission_service_proto_rawDescOnce sync.Once + file_node_agglayer_certificate_submission_service_proto_rawDescData = file_node_agglayer_certificate_submission_service_proto_rawDesc +) + +func file_node_agglayer_certificate_submission_service_proto_rawDescGZIP() []byte { + file_node_agglayer_certificate_submission_service_proto_rawDescOnce.Do(func() { + file_node_agglayer_certificate_submission_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_node_agglayer_certificate_submission_service_proto_rawDescData) + }) + return file_node_agglayer_certificate_submission_service_proto_rawDescData +} + +var file_node_agglayer_certificate_submission_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_node_agglayer_certificate_submission_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_node_agglayer_certificate_submission_service_proto_goTypes = []interface{}{ + (ErrorKind)(0), // 0: proto.ErrorKind + (*SubmitCertificateRequest)(nil), // 1: proto.SubmitCertificateRequest + (*SubmitCertificateResponse)(nil), // 2: proto.SubmitCertificateResponse + (*types.Certificate)(nil), // 3: proto.types.Certificate + (*types.CertificateId)(nil), // 4: proto.types.CertificateId +} +var file_node_agglayer_certificate_submission_service_proto_depIdxs = []int32{ + 3, // 0: proto.SubmitCertificateRequest.certificate:type_name -> proto.types.Certificate + 4, // 1: proto.SubmitCertificateResponse.certificate_id:type_name -> proto.types.CertificateId + 1, // 2: proto.AgglayerCertificateSubmissionService.SubmitCertificate:input_type -> proto.SubmitCertificateRequest + 2, // 3: proto.AgglayerCertificateSubmissionService.SubmitCertificate:output_type -> proto.SubmitCertificateResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_node_agglayer_certificate_submission_service_proto_init() } +func file_node_agglayer_certificate_submission_service_proto_init() { + if File_node_agglayer_certificate_submission_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_node_agglayer_certificate_submission_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitCertificateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_certificate_submission_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitCertificateResponse); 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_node_agglayer_certificate_submission_service_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_node_agglayer_certificate_submission_service_proto_goTypes, + DependencyIndexes: file_node_agglayer_certificate_submission_service_proto_depIdxs, + EnumInfos: file_node_agglayer_certificate_submission_service_proto_enumTypes, + MessageInfos: file_node_agglayer_certificate_submission_service_proto_msgTypes, + }.Build() + File_node_agglayer_certificate_submission_service_proto = out.File + file_node_agglayer_certificate_submission_service_proto_rawDesc = nil + file_node_agglayer_certificate_submission_service_proto_goTypes = nil + file_node_agglayer_certificate_submission_service_proto_depIdxs = nil +} diff --git a/agglayer/proto/node/agglayer_certificate_submission_service.proto b/agglayer/proto/node/agglayer_certificate_submission_service.proto new file mode 100644 index 00000000..a050d88f --- /dev/null +++ b/agglayer/proto/node/agglayer_certificate_submission_service.proto @@ -0,0 +1,34 @@ +// Proto definition for Agglayer Certificate Submition Service + +syntax = "proto3"; + +package proto; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; +import "types/certificate.proto"; + +// Service for submitting certificate to an agglayer node. +service AgglayerCertificateSubmissionService { + // Method used to submit a certificate. + rpc SubmitCertificate(SubmitCertificateRequest) + returns (SubmitCertificateResponse); +} + +// Type used to submit a certificate. +message SubmitCertificateRequest { + // The certificate to submit. + types.Certificate certificate = 1; +} + +// Type used as response to a certificate submission. +message SubmitCertificateResponse { + // The certificate id of the submitted certificate. + types.CertificateId certificate_id = 1; +} + +// The kind of error that occurred and that are reported by the service. +enum ErrorKind { + // Unspecified error. + ERROR_KIND_UNSPECIFIED = 0; + // The signature verification failed. + ERROR_KIND_SIGNATURE_VERIFICATION = 1; +} diff --git a/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go b/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go new file mode 100644 index 00000000..7cccb1d7 --- /dev/null +++ b/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go @@ -0,0 +1,119 @@ +// Proto definition for Agglayer Certificate Submition Service + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.29.3 +// source: node/agglayer_certificate_submission_service.proto + +package node + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + AgglayerCertificateSubmissionService_SubmitCertificate_FullMethodName = "/proto.AgglayerCertificateSubmissionService/SubmitCertificate" +) + +// AgglayerCertificateSubmissionServiceClient is the client API for AgglayerCertificateSubmissionService 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. +// +// Service for submitting certificate to an agglayer node. +type AgglayerCertificateSubmissionServiceClient interface { + // Method used to submit a certificate. + SubmitCertificate(ctx context.Context, in *SubmitCertificateRequest, opts ...grpc.CallOption) (*SubmitCertificateResponse, error) +} + +type agglayerCertificateSubmissionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAgglayerCertificateSubmissionServiceClient(cc grpc.ClientConnInterface) AgglayerCertificateSubmissionServiceClient { + return &agglayerCertificateSubmissionServiceClient{cc} +} + +func (c *agglayerCertificateSubmissionServiceClient) SubmitCertificate(ctx context.Context, in *SubmitCertificateRequest, opts ...grpc.CallOption) (*SubmitCertificateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SubmitCertificateResponse) + err := c.cc.Invoke(ctx, AgglayerCertificateSubmissionService_SubmitCertificate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgglayerCertificateSubmissionServiceServer is the server API for AgglayerCertificateSubmissionService service. +// All implementations must embed UnimplementedAgglayerCertificateSubmissionServiceServer +// for forward compatibility +// +// Service for submitting certificate to an agglayer node. +type AgglayerCertificateSubmissionServiceServer interface { + // Method used to submit a certificate. + SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) + mustEmbedUnimplementedAgglayerCertificateSubmissionServiceServer() +} + +// UnimplementedAgglayerCertificateSubmissionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAgglayerCertificateSubmissionServiceServer struct { +} + +func (UnimplementedAgglayerCertificateSubmissionServiceServer) SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitCertificate not implemented") +} +func (UnimplementedAgglayerCertificateSubmissionServiceServer) mustEmbedUnimplementedAgglayerCertificateSubmissionServiceServer() { +} + +// UnsafeAgglayerCertificateSubmissionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgglayerCertificateSubmissionServiceServer will +// result in compilation errors. +type UnsafeAgglayerCertificateSubmissionServiceServer interface { + mustEmbedUnimplementedAgglayerCertificateSubmissionServiceServer() +} + +func RegisterAgglayerCertificateSubmissionServiceServer(s grpc.ServiceRegistrar, srv AgglayerCertificateSubmissionServiceServer) { + s.RegisterService(&AgglayerCertificateSubmissionService_ServiceDesc, srv) +} + +func _AgglayerCertificateSubmissionService_SubmitCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubmitCertificateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgglayerCertificateSubmissionServiceServer).SubmitCertificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgglayerCertificateSubmissionService_SubmitCertificate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgglayerCertificateSubmissionServiceServer).SubmitCertificate(ctx, req.(*SubmitCertificateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AgglayerCertificateSubmissionService_ServiceDesc is the grpc.ServiceDesc for AgglayerCertificateSubmissionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AgglayerCertificateSubmissionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.AgglayerCertificateSubmissionService", + HandlerType: (*AgglayerCertificateSubmissionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitCertificate", + Handler: _AgglayerCertificateSubmissionService_SubmitCertificate_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "node/agglayer_certificate_submission_service.proto", +} diff --git a/agglayer/proto/node/agglayer_configuration_service.pb.go b/agglayer/proto/node/agglayer_configuration_service.pb.go new file mode 100644 index 00000000..dc2dde44 --- /dev/null +++ b/agglayer/proto/node/agglayer_configuration_service.pb.go @@ -0,0 +1,224 @@ +// Proto definition for Agglayer Configuration Service + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: node/agglayer_configuration_service.proto + +package node + +import ( + types "github.com/agglayer/aggkit/agglayer/proto/types" + 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) +) + +// Request to get the current epoch configuration. +type GetEpochConfigurationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetEpochConfigurationRequest) Reset() { + *x = GetEpochConfigurationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_configuration_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEpochConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEpochConfigurationRequest) ProtoMessage() {} + +func (x *GetEpochConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_configuration_service_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 GetEpochConfigurationRequest.ProtoReflect.Descriptor instead. +func (*GetEpochConfigurationRequest) Descriptor() ([]byte, []int) { + return file_node_agglayer_configuration_service_proto_rawDescGZIP(), []int{0} +} + +// Response to the current epoch configuration request. +type GetEpochConfigurationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The epoch configuration. + EpochConfiguration *types.EpochConfiguration `protobuf:"bytes,1,opt,name=epoch_configuration,json=epochConfiguration,proto3" json:"epoch_configuration,omitempty"` +} + +func (x *GetEpochConfigurationResponse) Reset() { + *x = GetEpochConfigurationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_configuration_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEpochConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEpochConfigurationResponse) ProtoMessage() {} + +func (x *GetEpochConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_configuration_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetEpochConfigurationResponse.ProtoReflect.Descriptor instead. +func (*GetEpochConfigurationResponse) Descriptor() ([]byte, []int) { + return file_node_agglayer_configuration_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetEpochConfigurationResponse) GetEpochConfiguration() *types.EpochConfiguration { + if x != nil { + return x.EpochConfiguration + } + return nil +} + +var File_node_agglayer_configuration_service_proto protoreflect.FileDescriptor + +var file_node_agglayer_configuration_service_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x71, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x13, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x12, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x82, 0x01, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, + 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_node_agglayer_configuration_service_proto_rawDescOnce sync.Once + file_node_agglayer_configuration_service_proto_rawDescData = file_node_agglayer_configuration_service_proto_rawDesc +) + +func file_node_agglayer_configuration_service_proto_rawDescGZIP() []byte { + file_node_agglayer_configuration_service_proto_rawDescOnce.Do(func() { + file_node_agglayer_configuration_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_node_agglayer_configuration_service_proto_rawDescData) + }) + return file_node_agglayer_configuration_service_proto_rawDescData +} + +var file_node_agglayer_configuration_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_node_agglayer_configuration_service_proto_goTypes = []interface{}{ + (*GetEpochConfigurationRequest)(nil), // 0: proto.GetEpochConfigurationRequest + (*GetEpochConfigurationResponse)(nil), // 1: proto.GetEpochConfigurationResponse + (*types.EpochConfiguration)(nil), // 2: proto.types.EpochConfiguration +} +var file_node_agglayer_configuration_service_proto_depIdxs = []int32{ + 2, // 0: proto.GetEpochConfigurationResponse.epoch_configuration:type_name -> proto.types.EpochConfiguration + 0, // 1: proto.AgglayerConfigurationService.GetEpochConfiguration:input_type -> proto.GetEpochConfigurationRequest + 1, // 2: proto.AgglayerConfigurationService.GetEpochConfiguration:output_type -> proto.GetEpochConfigurationResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_node_agglayer_configuration_service_proto_init() } +func file_node_agglayer_configuration_service_proto_init() { + if File_node_agglayer_configuration_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_node_agglayer_configuration_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEpochConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_configuration_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEpochConfigurationResponse); 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_node_agglayer_configuration_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_node_agglayer_configuration_service_proto_goTypes, + DependencyIndexes: file_node_agglayer_configuration_service_proto_depIdxs, + MessageInfos: file_node_agglayer_configuration_service_proto_msgTypes, + }.Build() + File_node_agglayer_configuration_service_proto = out.File + file_node_agglayer_configuration_service_proto_rawDesc = nil + file_node_agglayer_configuration_service_proto_goTypes = nil + file_node_agglayer_configuration_service_proto_depIdxs = nil +} diff --git a/agglayer/proto/node/agglayer_configuration_service.proto b/agglayer/proto/node/agglayer_configuration_service.proto new file mode 100644 index 00000000..1057e012 --- /dev/null +++ b/agglayer/proto/node/agglayer_configuration_service.proto @@ -0,0 +1,22 @@ +// Proto definition for Agglayer Configuration Service + +syntax = "proto3"; + +package proto; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; +import "types/epoch_configuration.proto"; + +// Service for querying the current epoch configuration. +service AgglayerConfigurationService { + // Method used to get the current epoch configuration. + rpc GetEpochConfiguration(GetEpochConfigurationRequest) returns (GetEpochConfigurationResponse); +} + +// Request to get the current epoch configuration. +message GetEpochConfigurationRequest {} + +// Response to the current epoch configuration request. +message GetEpochConfigurationResponse { + // The epoch configuration. + types.EpochConfiguration epoch_configuration = 1; +} \ No newline at end of file diff --git a/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go b/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go new file mode 100644 index 00000000..18f8c022 --- /dev/null +++ b/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go @@ -0,0 +1,119 @@ +// Proto definition for Agglayer Configuration Service + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.29.3 +// source: node/agglayer_configuration_service.proto + +package node + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + AgglayerConfigurationService_GetEpochConfiguration_FullMethodName = "/proto.AgglayerConfigurationService/GetEpochConfiguration" +) + +// AgglayerConfigurationServiceClient is the client API for AgglayerConfigurationService 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. +// +// Service for querying the current epoch configuration. +type AgglayerConfigurationServiceClient interface { + // Method used to get the current epoch configuration. + GetEpochConfiguration(ctx context.Context, in *GetEpochConfigurationRequest, opts ...grpc.CallOption) (*GetEpochConfigurationResponse, error) +} + +type agglayerConfigurationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAgglayerConfigurationServiceClient(cc grpc.ClientConnInterface) AgglayerConfigurationServiceClient { + return &agglayerConfigurationServiceClient{cc} +} + +func (c *agglayerConfigurationServiceClient) GetEpochConfiguration(ctx context.Context, in *GetEpochConfigurationRequest, opts ...grpc.CallOption) (*GetEpochConfigurationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetEpochConfigurationResponse) + err := c.cc.Invoke(ctx, AgglayerConfigurationService_GetEpochConfiguration_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgglayerConfigurationServiceServer is the server API for AgglayerConfigurationService service. +// All implementations must embed UnimplementedAgglayerConfigurationServiceServer +// for forward compatibility +// +// Service for querying the current epoch configuration. +type AgglayerConfigurationServiceServer interface { + // Method used to get the current epoch configuration. + GetEpochConfiguration(context.Context, *GetEpochConfigurationRequest) (*GetEpochConfigurationResponse, error) + mustEmbedUnimplementedAgglayerConfigurationServiceServer() +} + +// UnimplementedAgglayerConfigurationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAgglayerConfigurationServiceServer struct { +} + +func (UnimplementedAgglayerConfigurationServiceServer) GetEpochConfiguration(context.Context, *GetEpochConfigurationRequest) (*GetEpochConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEpochConfiguration not implemented") +} +func (UnimplementedAgglayerConfigurationServiceServer) mustEmbedUnimplementedAgglayerConfigurationServiceServer() { +} + +// UnsafeAgglayerConfigurationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgglayerConfigurationServiceServer will +// result in compilation errors. +type UnsafeAgglayerConfigurationServiceServer interface { + mustEmbedUnimplementedAgglayerConfigurationServiceServer() +} + +func RegisterAgglayerConfigurationServiceServer(s grpc.ServiceRegistrar, srv AgglayerConfigurationServiceServer) { + s.RegisterService(&AgglayerConfigurationService_ServiceDesc, srv) +} + +func _AgglayerConfigurationService_GetEpochConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEpochConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgglayerConfigurationServiceServer).GetEpochConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgglayerConfigurationService_GetEpochConfiguration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgglayerConfigurationServiceServer).GetEpochConfiguration(ctx, req.(*GetEpochConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AgglayerConfigurationService_ServiceDesc is the grpc.ServiceDesc for AgglayerConfigurationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AgglayerConfigurationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.AgglayerConfigurationService", + HandlerType: (*AgglayerConfigurationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetEpochConfiguration", + Handler: _AgglayerConfigurationService_GetEpochConfiguration_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "node/agglayer_configuration_service.proto", +} diff --git a/agglayer/proto/node/agglayer_network_state_service.pb.go b/agglayer/proto/node/agglayer_network_state_service.pb.go new file mode 100644 index 00000000..10193213 --- /dev/null +++ b/agglayer/proto/node/agglayer_network_state_service.pb.go @@ -0,0 +1,537 @@ +// Proto definition for Agglayer Network State Service + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: node/agglayer_network_state_service.proto + +package node + +import ( + types "github.com/agglayer/aggkit/agglayer/proto/types" + 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) +) + +// Request to get the latest known certificate header for a network. +type GetLatestKnownCertificateHeaderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The network identifier. + NetworkId uint32 `protobuf:"varint,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` +} + +func (x *GetLatestKnownCertificateHeaderRequest) Reset() { + *x = GetLatestKnownCertificateHeaderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLatestKnownCertificateHeaderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLatestKnownCertificateHeaderRequest) ProtoMessage() {} + +func (x *GetLatestKnownCertificateHeaderRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_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 GetLatestKnownCertificateHeaderRequest.ProtoReflect.Descriptor instead. +func (*GetLatestKnownCertificateHeaderRequest) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{0} +} + +func (x *GetLatestKnownCertificateHeaderRequest) GetNetworkId() uint32 { + if x != nil { + return x.NetworkId + } + return 0 +} + +// Response to the latest known certificate header request. +type GetLatestKnownCertificateHeaderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The latest known certificate header. + CertificateHeader *types.CertificateHeader `protobuf:"bytes,1,opt,name=certificate_header,json=certificateHeader,proto3" json:"certificate_header,omitempty"` +} + +func (x *GetLatestKnownCertificateHeaderResponse) Reset() { + *x = GetLatestKnownCertificateHeaderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLatestKnownCertificateHeaderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLatestKnownCertificateHeaderResponse) ProtoMessage() {} + +func (x *GetLatestKnownCertificateHeaderResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetLatestKnownCertificateHeaderResponse.ProtoReflect.Descriptor instead. +func (*GetLatestKnownCertificateHeaderResponse) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetLatestKnownCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { + if x != nil { + return x.CertificateHeader + } + return nil +} + +// Request to get the latest settled certificate header for a network. +type GetLatestSettledCertificateHeaderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The network identifier. + NetworkId uint32 `protobuf:"varint,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` +} + +func (x *GetLatestSettledCertificateHeaderRequest) Reset() { + *x = GetLatestSettledCertificateHeaderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLatestSettledCertificateHeaderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLatestSettledCertificateHeaderRequest) ProtoMessage() {} + +func (x *GetLatestSettledCertificateHeaderRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[2] + 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 GetLatestSettledCertificateHeaderRequest.ProtoReflect.Descriptor instead. +func (*GetLatestSettledCertificateHeaderRequest) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{2} +} + +func (x *GetLatestSettledCertificateHeaderRequest) GetNetworkId() uint32 { + if x != nil { + return x.NetworkId + } + return 0 +} + +// Response to the latest settled certificate header request. +type GetLatestSettledCertificateHeaderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The latest settled certificate header. + CertificateHeader *types.CertificateHeader `protobuf:"bytes,1,opt,name=certificate_header,json=certificateHeader,proto3" json:"certificate_header,omitempty"` +} + +func (x *GetLatestSettledCertificateHeaderResponse) Reset() { + *x = GetLatestSettledCertificateHeaderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLatestSettledCertificateHeaderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLatestSettledCertificateHeaderResponse) ProtoMessage() {} + +func (x *GetLatestSettledCertificateHeaderResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[3] + 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 GetLatestSettledCertificateHeaderResponse.ProtoReflect.Descriptor instead. +func (*GetLatestSettledCertificateHeaderResponse) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{3} +} + +func (x *GetLatestSettledCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { + if x != nil { + return x.CertificateHeader + } + return nil +} + +// Request to get the latest pending certificate header for a network. +type GetLatestPendingCertificateHeaderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The network identifier. + NetworkId uint32 `protobuf:"varint,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` +} + +func (x *GetLatestPendingCertificateHeaderRequest) Reset() { + *x = GetLatestPendingCertificateHeaderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLatestPendingCertificateHeaderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLatestPendingCertificateHeaderRequest) ProtoMessage() {} + +func (x *GetLatestPendingCertificateHeaderRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[4] + 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 GetLatestPendingCertificateHeaderRequest.ProtoReflect.Descriptor instead. +func (*GetLatestPendingCertificateHeaderRequest) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{4} +} + +func (x *GetLatestPendingCertificateHeaderRequest) GetNetworkId() uint32 { + if x != nil { + return x.NetworkId + } + return 0 +} + +// Response to the latest pending certificate header request. +type GetLatestPendingCertificateHeaderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The latest pending certificate header. + CertificateHeader *types.CertificateHeader `protobuf:"bytes,1,opt,name=certificate_header,json=certificateHeader,proto3" json:"certificate_header,omitempty"` +} + +func (x *GetLatestPendingCertificateHeaderResponse) Reset() { + *x = GetLatestPendingCertificateHeaderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetLatestPendingCertificateHeaderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetLatestPendingCertificateHeaderResponse) ProtoMessage() {} + +func (x *GetLatestPendingCertificateHeaderResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[5] + 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 GetLatestPendingCertificateHeaderResponse.ProtoReflect.Descriptor instead. +func (*GetLatestPendingCertificateHeaderResponse) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{5} +} + +func (x *GetLatestPendingCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { + if x != nil { + return x.CertificateHeader + } + return nil +} + +var File_node_agglayer_network_state_service_proto protoreflect.FileDescriptor + +var file_node_agglayer_network_state_service_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x78, 0x0a, 0x27, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, + 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, + 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, + 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, + 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x32, 0xb2, 0x03, 0x0a, 0x1b, 0x41, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, + 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, + 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_node_agglayer_network_state_service_proto_rawDescOnce sync.Once + file_node_agglayer_network_state_service_proto_rawDescData = file_node_agglayer_network_state_service_proto_rawDesc +) + +func file_node_agglayer_network_state_service_proto_rawDescGZIP() []byte { + file_node_agglayer_network_state_service_proto_rawDescOnce.Do(func() { + file_node_agglayer_network_state_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_node_agglayer_network_state_service_proto_rawDescData) + }) + return file_node_agglayer_network_state_service_proto_rawDescData +} + +var file_node_agglayer_network_state_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_node_agglayer_network_state_service_proto_goTypes = []interface{}{ + (*GetLatestKnownCertificateHeaderRequest)(nil), // 0: proto.GetLatestKnownCertificateHeaderRequest + (*GetLatestKnownCertificateHeaderResponse)(nil), // 1: proto.GetLatestKnownCertificateHeaderResponse + (*GetLatestSettledCertificateHeaderRequest)(nil), // 2: proto.GetLatestSettledCertificateHeaderRequest + (*GetLatestSettledCertificateHeaderResponse)(nil), // 3: proto.GetLatestSettledCertificateHeaderResponse + (*GetLatestPendingCertificateHeaderRequest)(nil), // 4: proto.GetLatestPendingCertificateHeaderRequest + (*GetLatestPendingCertificateHeaderResponse)(nil), // 5: proto.GetLatestPendingCertificateHeaderResponse + (*types.CertificateHeader)(nil), // 6: proto.types.CertificateHeader +} +var file_node_agglayer_network_state_service_proto_depIdxs = []int32{ + 6, // 0: proto.GetLatestKnownCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 6, // 1: proto.GetLatestSettledCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 6, // 2: proto.GetLatestPendingCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 0, // 3: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:input_type -> proto.GetLatestKnownCertificateHeaderRequest + 2, // 4: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:input_type -> proto.GetLatestSettledCertificateHeaderRequest + 4, // 5: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:input_type -> proto.GetLatestPendingCertificateHeaderRequest + 1, // 6: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:output_type -> proto.GetLatestKnownCertificateHeaderResponse + 3, // 7: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:output_type -> proto.GetLatestSettledCertificateHeaderResponse + 5, // 8: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:output_type -> proto.GetLatestPendingCertificateHeaderResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_node_agglayer_network_state_service_proto_init() } +func file_node_agglayer_network_state_service_proto_init() { + if File_node_agglayer_network_state_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_node_agglayer_network_state_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestKnownCertificateHeaderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestKnownCertificateHeaderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestSettledCertificateHeaderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestSettledCertificateHeaderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestPendingCertificateHeaderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestPendingCertificateHeaderResponse); 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_node_agglayer_network_state_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_node_agglayer_network_state_service_proto_goTypes, + DependencyIndexes: file_node_agglayer_network_state_service_proto_depIdxs, + MessageInfos: file_node_agglayer_network_state_service_proto_msgTypes, + }.Build() + File_node_agglayer_network_state_service_proto = out.File + file_node_agglayer_network_state_service_proto_rawDesc = nil + file_node_agglayer_network_state_service_proto_goTypes = nil + file_node_agglayer_network_state_service_proto_depIdxs = nil +} diff --git a/agglayer/proto/node/agglayer_network_state_service.proto b/agglayer/proto/node/agglayer_network_state_service.proto new file mode 100644 index 00000000..346e5b09 --- /dev/null +++ b/agglayer/proto/node/agglayer_network_state_service.proto @@ -0,0 +1,56 @@ +// Proto definition for Agglayer Network State Service + +syntax = "proto3"; + +package proto; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; +import "types/certificate_header.proto"; +import "types/epoch_configuration.proto"; + +// Service for querying agglayer network state. +service AgglayerNetworkStateService { + // Method used to get the latest known certificate header for a network. + rpc GetLatestKnownCertificateHeader(GetLatestKnownCertificateHeaderRequest) returns (GetLatestKnownCertificateHeaderResponse); + + // Method used to get the latest settled certificate header for a network. + rpc GetLatestSettledCertificateHeader(GetLatestSettledCertificateHeaderRequest) returns (GetLatestSettledCertificateHeaderResponse); + + // Method used to get the latest pending certificate header for a network. + rpc GetLatestPendingCertificateHeader(GetLatestPendingCertificateHeaderRequest) returns (GetLatestPendingCertificateHeaderResponse); +} + +// Request to get the latest known certificate header for a network. +message GetLatestKnownCertificateHeaderRequest { + // The network identifier. + uint32 network_id = 1; +} + +// Response to the latest known certificate header request. +message GetLatestKnownCertificateHeaderResponse { + // The latest known certificate header. + types.CertificateHeader certificate_header = 1; +} + +// Request to get the latest settled certificate header for a network. +message GetLatestSettledCertificateHeaderRequest { + // The network identifier. + uint32 network_id = 1; +} + +// Response to the latest settled certificate header request. +message GetLatestSettledCertificateHeaderResponse { + // The latest settled certificate header. + types.CertificateHeader certificate_header = 1; +} + +// Request to get the latest pending certificate header for a network. +message GetLatestPendingCertificateHeaderRequest { + // The network identifier. + uint32 network_id = 1; +} + +// Response to the latest pending certificate header request. +message GetLatestPendingCertificateHeaderResponse { + // The latest pending certificate header. + types.CertificateHeader certificate_header = 1; +} \ No newline at end of file diff --git a/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go b/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go new file mode 100644 index 00000000..17e3c2f2 --- /dev/null +++ b/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go @@ -0,0 +1,199 @@ +// Proto definition for Agglayer Network State Service + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.29.3 +// source: node/agglayer_network_state_service.proto + +package node + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestKnownCertificateHeader" + AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestSettledCertificateHeader" + AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestPendingCertificateHeader" +) + +// AgglayerNetworkStateServiceClient is the client API for AgglayerNetworkStateService 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. +// +// Service for querying agglayer network state. +type AgglayerNetworkStateServiceClient interface { + // Method used to get the latest known certificate header for a network. + GetLatestKnownCertificateHeader(ctx context.Context, in *GetLatestKnownCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestKnownCertificateHeaderResponse, error) + // Method used to get the latest settled certificate header for a network. + GetLatestSettledCertificateHeader(ctx context.Context, in *GetLatestSettledCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestSettledCertificateHeaderResponse, error) + // Method used to get the latest pending certificate header for a network. + GetLatestPendingCertificateHeader(ctx context.Context, in *GetLatestPendingCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestPendingCertificateHeaderResponse, error) +} + +type agglayerNetworkStateServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAgglayerNetworkStateServiceClient(cc grpc.ClientConnInterface) AgglayerNetworkStateServiceClient { + return &agglayerNetworkStateServiceClient{cc} +} + +func (c *agglayerNetworkStateServiceClient) GetLatestKnownCertificateHeader(ctx context.Context, in *GetLatestKnownCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestKnownCertificateHeaderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetLatestKnownCertificateHeaderResponse) + err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agglayerNetworkStateServiceClient) GetLatestSettledCertificateHeader(ctx context.Context, in *GetLatestSettledCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestSettledCertificateHeaderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetLatestSettledCertificateHeaderResponse) + err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agglayerNetworkStateServiceClient) GetLatestPendingCertificateHeader(ctx context.Context, in *GetLatestPendingCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestPendingCertificateHeaderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetLatestPendingCertificateHeaderResponse) + err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgglayerNetworkStateServiceServer is the server API for AgglayerNetworkStateService service. +// All implementations must embed UnimplementedAgglayerNetworkStateServiceServer +// for forward compatibility +// +// Service for querying agglayer network state. +type AgglayerNetworkStateServiceServer interface { + // Method used to get the latest known certificate header for a network. + GetLatestKnownCertificateHeader(context.Context, *GetLatestKnownCertificateHeaderRequest) (*GetLatestKnownCertificateHeaderResponse, error) + // Method used to get the latest settled certificate header for a network. + GetLatestSettledCertificateHeader(context.Context, *GetLatestSettledCertificateHeaderRequest) (*GetLatestSettledCertificateHeaderResponse, error) + // Method used to get the latest pending certificate header for a network. + GetLatestPendingCertificateHeader(context.Context, *GetLatestPendingCertificateHeaderRequest) (*GetLatestPendingCertificateHeaderResponse, error) + mustEmbedUnimplementedAgglayerNetworkStateServiceServer() +} + +// UnimplementedAgglayerNetworkStateServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAgglayerNetworkStateServiceServer struct { +} + +func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestKnownCertificateHeader(context.Context, *GetLatestKnownCertificateHeaderRequest) (*GetLatestKnownCertificateHeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestKnownCertificateHeader not implemented") +} +func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestSettledCertificateHeader(context.Context, *GetLatestSettledCertificateHeaderRequest) (*GetLatestSettledCertificateHeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestSettledCertificateHeader not implemented") +} +func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestPendingCertificateHeader(context.Context, *GetLatestPendingCertificateHeaderRequest) (*GetLatestPendingCertificateHeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestPendingCertificateHeader not implemented") +} +func (UnimplementedAgglayerNetworkStateServiceServer) mustEmbedUnimplementedAgglayerNetworkStateServiceServer() { +} + +// UnsafeAgglayerNetworkStateServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AgglayerNetworkStateServiceServer will +// result in compilation errors. +type UnsafeAgglayerNetworkStateServiceServer interface { + mustEmbedUnimplementedAgglayerNetworkStateServiceServer() +} + +func RegisterAgglayerNetworkStateServiceServer(s grpc.ServiceRegistrar, srv AgglayerNetworkStateServiceServer) { + s.RegisterService(&AgglayerNetworkStateService_ServiceDesc, srv) +} + +func _AgglayerNetworkStateService_GetLatestKnownCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestKnownCertificateHeaderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgglayerNetworkStateServiceServer).GetLatestKnownCertificateHeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgglayerNetworkStateServiceServer).GetLatestKnownCertificateHeader(ctx, req.(*GetLatestKnownCertificateHeaderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgglayerNetworkStateService_GetLatestSettledCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestSettledCertificateHeaderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgglayerNetworkStateServiceServer).GetLatestSettledCertificateHeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgglayerNetworkStateServiceServer).GetLatestSettledCertificateHeader(ctx, req.(*GetLatestSettledCertificateHeaderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AgglayerNetworkStateService_GetLatestPendingCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestPendingCertificateHeaderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgglayerNetworkStateServiceServer).GetLatestPendingCertificateHeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgglayerNetworkStateServiceServer).GetLatestPendingCertificateHeader(ctx, req.(*GetLatestPendingCertificateHeaderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AgglayerNetworkStateService_ServiceDesc is the grpc.ServiceDesc for AgglayerNetworkStateService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AgglayerNetworkStateService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.AgglayerNetworkStateService", + HandlerType: (*AgglayerNetworkStateServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetLatestKnownCertificateHeader", + Handler: _AgglayerNetworkStateService_GetLatestKnownCertificateHeader_Handler, + }, + { + MethodName: "GetLatestSettledCertificateHeader", + Handler: _AgglayerNetworkStateService_GetLatestSettledCertificateHeader_Handler, + }, + { + MethodName: "GetLatestPendingCertificateHeader", + Handler: _AgglayerNetworkStateService_GetLatestPendingCertificateHeader_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "node/agglayer_network_state_service.proto", +} diff --git a/agglayer/proto/types/bridge_exit.pb.go b/agglayer/proto/types/bridge_exit.pb.go new file mode 100644 index 00000000..34d601d8 --- /dev/null +++ b/agglayer/proto/types/bridge_exit.pb.go @@ -0,0 +1,362 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/bridge_exit.proto + +package types + +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) +) + +// The type of the leaf. +type LeafType int32 + +const ( + // Unspecified leaf type. + LeafType_LEAF_TYPE_UNSPECIFIED LeafType = 0 + // Transfer leaf type. + LeafType_LEAF_TYPE_TRANSFER LeafType = 1 + // Message leaf type. + LeafType_LEAF_TYPE_MESSAGE LeafType = 2 +) + +// Enum value maps for LeafType. +var ( + LeafType_name = map[int32]string{ + 0: "LEAF_TYPE_UNSPECIFIED", + 1: "LEAF_TYPE_TRANSFER", + 2: "LEAF_TYPE_MESSAGE", + } + LeafType_value = map[string]int32{ + "LEAF_TYPE_UNSPECIFIED": 0, + "LEAF_TYPE_TRANSFER": 1, + "LEAF_TYPE_MESSAGE": 2, + } +) + +func (x LeafType) Enum() *LeafType { + p := new(LeafType) + *p = x + return p +} + +func (x LeafType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LeafType) Descriptor() protoreflect.EnumDescriptor { + return file_types_bridge_exit_proto_enumTypes[0].Descriptor() +} + +func (LeafType) Type() protoreflect.EnumType { + return &file_types_bridge_exit_proto_enumTypes[0] +} + +func (x LeafType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LeafType.Descriptor instead. +func (LeafType) EnumDescriptor() ([]byte, []int) { + return file_types_bridge_exit_proto_rawDescGZIP(), []int{0} +} + +// Represents a token bridge exit from the network. +type BridgeExit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The type of the leaf. + LeafType LeafType `protobuf:"varint,1,opt,name=leaf_type,json=leafType,proto3,enum=proto.types.LeafType" json:"leaf_type,omitempty"` + // Unique ID for the token being transferred. + TokenInfo *TokenInfo `protobuf:"bytes,2,opt,name=token_info,json=tokenInfo,proto3" json:"token_info,omitempty"` + // Network which the token is transferred to + DestNetwork uint32 `protobuf:"varint,3,opt,name=dest_network,json=destNetwork,proto3" json:"dest_network,omitempty"` + // Address which will own the received token + DestAddress *FixedBytes20 `protobuf:"bytes,4,opt,name=dest_address,json=destAddress,proto3" json:"dest_address,omitempty"` + // Token amount sent + Amount *FixedBytes32 `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` + // Metadata for the bridge exit + Metadata *FixedBytes32 `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *BridgeExit) Reset() { + *x = BridgeExit{} + if protoimpl.UnsafeEnabled { + mi := &file_types_bridge_exit_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BridgeExit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BridgeExit) ProtoMessage() {} + +func (x *BridgeExit) ProtoReflect() protoreflect.Message { + mi := &file_types_bridge_exit_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 BridgeExit.ProtoReflect.Descriptor instead. +func (*BridgeExit) Descriptor() ([]byte, []int) { + return file_types_bridge_exit_proto_rawDescGZIP(), []int{0} +} + +func (x *BridgeExit) GetLeafType() LeafType { + if x != nil { + return x.LeafType + } + return LeafType_LEAF_TYPE_UNSPECIFIED +} + +func (x *BridgeExit) GetTokenInfo() *TokenInfo { + if x != nil { + return x.TokenInfo + } + return nil +} + +func (x *BridgeExit) GetDestNetwork() uint32 { + if x != nil { + return x.DestNetwork + } + return 0 +} + +func (x *BridgeExit) GetDestAddress() *FixedBytes20 { + if x != nil { + return x.DestAddress + } + return nil +} + +func (x *BridgeExit) GetAmount() *FixedBytes32 { + if x != nil { + return x.Amount + } + return nil +} + +func (x *BridgeExit) GetMetadata() *FixedBytes32 { + if x != nil { + return x.Metadata + } + return nil +} + +// Encapsulates the information to uniquely identify a token on the origin +// network. +type TokenInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Network which the token originates from + OriginNetwork uint32 `protobuf:"varint,1,opt,name=origin_network,json=originNetwork,proto3" json:"origin_network,omitempty"` + // The address of the token on the origin network + OriginTokenAddress *FixedBytes20 `protobuf:"bytes,2,opt,name=origin_token_address,json=originTokenAddress,proto3" json:"origin_token_address,omitempty"` +} + +func (x *TokenInfo) Reset() { + *x = TokenInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_types_bridge_exit_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TokenInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenInfo) ProtoMessage() {} + +func (x *TokenInfo) ProtoReflect() protoreflect.Message { + mi := &file_types_bridge_exit_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenInfo.ProtoReflect.Descriptor instead. +func (*TokenInfo) Descriptor() ([]byte, []int) { + return file_types_bridge_exit_proto_rawDescGZIP(), []int{1} +} + +func (x *TokenInfo) GetOriginNetwork() uint32 { + if x != nil { + return x.OriginNetwork + } + return 0 +} + +func (x *TokenInfo) GetOriginTokenAddress() *FixedBytes20 { + if x != nil { + return x.OriginTokenAddress + } + return nil +} + +var File_types_bridge_exit_proto protoreflect.FileDescriptor + +var file_types_bridge_exit_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, + 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x02, 0x0a, 0x0a, 0x42, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x66, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x65, 0x61, 0x66, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x0a, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7f, + 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x12, 0x4b, 0x0a, 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x52, 0x12, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2a, + 0x54, 0x0a, 0x08, 0x4c, 0x65, 0x61, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4c, + 0x45, 0x41, 0x46, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x41, 0x46, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x01, 0x12, 0x15, + 0x0a, 0x11, 0x4c, 0x45, 0x41, 0x46, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, + 0x41, 0x47, 0x45, 0x10, 0x02, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, + 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_types_bridge_exit_proto_rawDescOnce sync.Once + file_types_bridge_exit_proto_rawDescData = file_types_bridge_exit_proto_rawDesc +) + +func file_types_bridge_exit_proto_rawDescGZIP() []byte { + file_types_bridge_exit_proto_rawDescOnce.Do(func() { + file_types_bridge_exit_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_bridge_exit_proto_rawDescData) + }) + return file_types_bridge_exit_proto_rawDescData +} + +var file_types_bridge_exit_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_types_bridge_exit_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_types_bridge_exit_proto_goTypes = []interface{}{ + (LeafType)(0), // 0: proto.types.LeafType + (*BridgeExit)(nil), // 1: proto.types.BridgeExit + (*TokenInfo)(nil), // 2: proto.types.TokenInfo + (*FixedBytes20)(nil), // 3: proto.types.FixedBytes20 + (*FixedBytes32)(nil), // 4: proto.types.FixedBytes32 +} +var file_types_bridge_exit_proto_depIdxs = []int32{ + 0, // 0: proto.types.BridgeExit.leaf_type:type_name -> proto.types.LeafType + 2, // 1: proto.types.BridgeExit.token_info:type_name -> proto.types.TokenInfo + 3, // 2: proto.types.BridgeExit.dest_address:type_name -> proto.types.FixedBytes20 + 4, // 3: proto.types.BridgeExit.amount:type_name -> proto.types.FixedBytes32 + 4, // 4: proto.types.BridgeExit.metadata:type_name -> proto.types.FixedBytes32 + 3, // 5: proto.types.TokenInfo.origin_token_address:type_name -> proto.types.FixedBytes20 + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_types_bridge_exit_proto_init() } +func file_types_bridge_exit_proto_init() { + if File_types_bridge_exit_proto != nil { + return + } + file_types_bytes_proto_init() + if !protoimpl.UnsafeEnabled { + file_types_bridge_exit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BridgeExit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_bridge_exit_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TokenInfo); 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_types_bridge_exit_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_bridge_exit_proto_goTypes, + DependencyIndexes: file_types_bridge_exit_proto_depIdxs, + EnumInfos: file_types_bridge_exit_proto_enumTypes, + MessageInfos: file_types_bridge_exit_proto_msgTypes, + }.Build() + File_types_bridge_exit_proto = out.File + file_types_bridge_exit_proto_rawDesc = nil + file_types_bridge_exit_proto_goTypes = nil + file_types_bridge_exit_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/bridge_exit.proto b/agglayer/proto/types/bridge_exit.proto new file mode 100644 index 00000000..1ce0ee2f --- /dev/null +++ b/agglayer/proto/types/bridge_exit.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; +import "types/bytes.proto"; + +// Represents a token bridge exit from the network. +message BridgeExit { + // The type of the leaf. + LeafType leaf_type = 1; + + // Unique ID for the token being transferred. + TokenInfo token_info = 2; + + // Network which the token is transferred to + uint32 dest_network = 3; + + // Address which will own the received token + FixedBytes20 dest_address = 4; + + // Token amount sent + FixedBytes32 amount = 5; + + // Metadata for the bridge exit + FixedBytes32 metadata = 6; +} + +// The type of the leaf. +enum LeafType { + // Unspecified leaf type. + LEAF_TYPE_UNSPECIFIED = 0; + // Transfer leaf type. + LEAF_TYPE_TRANSFER = 1; + // Message leaf type. + LEAF_TYPE_MESSAGE = 2; +} + +// Encapsulates the information to uniquely identify a token on the origin +// network. +message TokenInfo { + // Network which the token originates from + uint32 origin_network = 1; + // The address of the token on the origin network + FixedBytes20 origin_token_address = 2; +} diff --git a/agglayer/proto/types/bytes.pb.go b/agglayer/proto/types/bytes.pb.go new file mode 100644 index 00000000..ce00896f --- /dev/null +++ b/agglayer/proto/types/bytes.pb.go @@ -0,0 +1,276 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/bytes.proto + +package types + +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) +) + +// FixedBytes65 type. +type FixedBytes65 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bytes representation of the bytearray. + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *FixedBytes65) Reset() { + *x = FixedBytes65{} + if protoimpl.UnsafeEnabled { + mi := &file_types_bytes_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FixedBytes65) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FixedBytes65) ProtoMessage() {} + +func (x *FixedBytes65) ProtoReflect() protoreflect.Message { + mi := &file_types_bytes_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 FixedBytes65.ProtoReflect.Descriptor instead. +func (*FixedBytes65) Descriptor() ([]byte, []int) { + return file_types_bytes_proto_rawDescGZIP(), []int{0} +} + +func (x *FixedBytes65) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// FixedBytes32 type. +type FixedBytes32 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bytes representation of the bytearray. + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *FixedBytes32) Reset() { + *x = FixedBytes32{} + if protoimpl.UnsafeEnabled { + mi := &file_types_bytes_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FixedBytes32) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FixedBytes32) ProtoMessage() {} + +func (x *FixedBytes32) ProtoReflect() protoreflect.Message { + mi := &file_types_bytes_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FixedBytes32.ProtoReflect.Descriptor instead. +func (*FixedBytes32) Descriptor() ([]byte, []int) { + return file_types_bytes_proto_rawDescGZIP(), []int{1} +} + +func (x *FixedBytes32) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// FixedBytes20 type. +type FixedBytes20 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bytes representation of the bytearray. + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *FixedBytes20) Reset() { + *x = FixedBytes20{} + if protoimpl.UnsafeEnabled { + mi := &file_types_bytes_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FixedBytes20) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FixedBytes20) ProtoMessage() {} + +func (x *FixedBytes20) ProtoReflect() protoreflect.Message { + mi := &file_types_bytes_proto_msgTypes[2] + 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 FixedBytes20.ProtoReflect.Descriptor instead. +func (*FixedBytes20) Descriptor() ([]byte, []int) { + return file_types_bytes_proto_rawDescGZIP(), []int{2} +} + +func (x *FixedBytes20) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +var File_types_bytes_proto protoreflect.FileDescriptor + +var file_types_bytes_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x22, 0x24, 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x36, 0x35, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, + 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_types_bytes_proto_rawDescOnce sync.Once + file_types_bytes_proto_rawDescData = file_types_bytes_proto_rawDesc +) + +func file_types_bytes_proto_rawDescGZIP() []byte { + file_types_bytes_proto_rawDescOnce.Do(func() { + file_types_bytes_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_bytes_proto_rawDescData) + }) + return file_types_bytes_proto_rawDescData +} + +var file_types_bytes_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_types_bytes_proto_goTypes = []interface{}{ + (*FixedBytes65)(nil), // 0: proto.types.FixedBytes65 + (*FixedBytes32)(nil), // 1: proto.types.FixedBytes32 + (*FixedBytes20)(nil), // 2: proto.types.FixedBytes20 +} +var file_types_bytes_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_types_bytes_proto_init() } +func file_types_bytes_proto_init() { + if File_types_bytes_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_types_bytes_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FixedBytes65); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_bytes_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FixedBytes32); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_bytes_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FixedBytes20); 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_types_bytes_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_bytes_proto_goTypes, + DependencyIndexes: file_types_bytes_proto_depIdxs, + MessageInfos: file_types_bytes_proto_msgTypes, + }.Build() + File_types_bytes_proto = out.File + file_types_bytes_proto_rawDesc = nil + file_types_bytes_proto_goTypes = nil + file_types_bytes_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/bytes.proto b/agglayer/proto/types/bytes.proto new file mode 100644 index 00000000..c69da8e5 --- /dev/null +++ b/agglayer/proto/types/bytes.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; + +// FixedBytes65 type. +message FixedBytes65 { + // bytes representation of the bytearray. + bytes value = 1; +} + +// FixedBytes32 type. +message FixedBytes32 { + // bytes representation of the bytearray. + bytes value = 1; +} + +// FixedBytes20 type. +message FixedBytes20 { + // bytes representation of the bytearray. + bytes value = 1; +} diff --git a/agglayer/proto/types/certificate.pb.go b/agglayer/proto/types/certificate.pb.go new file mode 100644 index 00000000..48a01b88 --- /dev/null +++ b/agglayer/proto/types/certificate.pb.go @@ -0,0 +1,461 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/certificate.proto + +package types + +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) +) + +// Certificate type. +type Certificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // NetworkID of the origin network. + NetworkId uint32 `protobuf:"varint,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + // Simple increment to count the Certificate per network. + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // Previous local exit root. + PrevLocalExitRoot *FixedBytes32 `protobuf:"bytes,3,opt,name=prev_local_exit_root,json=prevLocalExitRoot,proto3" json:"prev_local_exit_root,omitempty"` + // New local exit root. + NewLocalExitRoot *FixedBytes32 `protobuf:"bytes,4,opt,name=new_local_exit_root,json=newLocalExitRoot,proto3" json:"new_local_exit_root,omitempty"` + // List of bridge exits included in this state transition. + BridgeExits []*BridgeExit `protobuf:"bytes,5,rep,name=bridge_exits,json=bridgeExits,proto3" json:"bridge_exits,omitempty"` + // List of imported bridge exits included in this state transition. + ImportedBridgeExits []*ImportedBridgeExit `protobuf:"bytes,6,rep,name=imported_bridge_exits,json=importedBridgeExits,proto3" json:"imported_bridge_exits,omitempty"` + // Fixed size field of arbitrary data for the chain needs. + Metadata *FixedBytes32 `protobuf:"bytes,7,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Aggchain params. + AggchainParams []byte `protobuf:"bytes,8,opt,name=aggchain_params,json=aggchainParams,proto3" json:"aggchain_params,omitempty"` + // Aggchain proof. + AggchainProof *AggchainProof `protobuf:"bytes,9,opt,name=aggchain_proof,json=aggchainProof,proto3" json:"aggchain_proof,omitempty"` + // custom chain data. + CustomChainData []byte `protobuf:"bytes,10,opt,name=custom_chain_data,json=customChainData,proto3" json:"custom_chain_data,omitempty"` +} + +func (x *Certificate) Reset() { + *x = Certificate{} + if protoimpl.UnsafeEnabled { + mi := &file_types_certificate_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Certificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Certificate) ProtoMessage() {} + +func (x *Certificate) ProtoReflect() protoreflect.Message { + mi := &file_types_certificate_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 Certificate.ProtoReflect.Descriptor instead. +func (*Certificate) Descriptor() ([]byte, []int) { + return file_types_certificate_proto_rawDescGZIP(), []int{0} +} + +func (x *Certificate) GetNetworkId() uint32 { + if x != nil { + return x.NetworkId + } + return 0 +} + +func (x *Certificate) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *Certificate) GetPrevLocalExitRoot() *FixedBytes32 { + if x != nil { + return x.PrevLocalExitRoot + } + return nil +} + +func (x *Certificate) GetNewLocalExitRoot() *FixedBytes32 { + if x != nil { + return x.NewLocalExitRoot + } + return nil +} + +func (x *Certificate) GetBridgeExits() []*BridgeExit { + if x != nil { + return x.BridgeExits + } + return nil +} + +func (x *Certificate) GetImportedBridgeExits() []*ImportedBridgeExit { + if x != nil { + return x.ImportedBridgeExits + } + return nil +} + +func (x *Certificate) GetMetadata() *FixedBytes32 { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Certificate) GetAggchainParams() []byte { + if x != nil { + return x.AggchainParams + } + return nil +} + +func (x *Certificate) GetAggchainProof() *AggchainProof { + if x != nil { + return x.AggchainProof + } + return nil +} + +func (x *Certificate) GetCustomChainData() []byte { + if x != nil { + return x.CustomChainData + } + return nil +} + +// Aggchain proof. +type AggchainProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The proof for the aggchain. + // + // Types that are assignable to Proof: + // + // *AggchainProof_Signature + // *AggchainProof_Sp1Stark + Proof isAggchainProof_Proof `protobuf_oneof:"proof"` +} + +func (x *AggchainProof) Reset() { + *x = AggchainProof{} + if protoimpl.UnsafeEnabled { + mi := &file_types_certificate_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AggchainProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AggchainProof) ProtoMessage() {} + +func (x *AggchainProof) ProtoReflect() protoreflect.Message { + mi := &file_types_certificate_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AggchainProof.ProtoReflect.Descriptor instead. +func (*AggchainProof) Descriptor() ([]byte, []int) { + return file_types_certificate_proto_rawDescGZIP(), []int{1} +} + +func (m *AggchainProof) GetProof() isAggchainProof_Proof { + if m != nil { + return m.Proof + } + return nil +} + +func (x *AggchainProof) GetSignature() *FixedBytes65 { + if x, ok := x.GetProof().(*AggchainProof_Signature); ok { + return x.Signature + } + return nil +} + +func (x *AggchainProof) GetSp1Stark() *FixedBytes32 { + if x, ok := x.GetProof().(*AggchainProof_Sp1Stark); ok { + return x.Sp1Stark + } + return nil +} + +type isAggchainProof_Proof interface { + isAggchainProof_Proof() +} + +type AggchainProof_Signature struct { + // Signature committed to the bridge exits and imported bridge exits. + Signature *FixedBytes65 `protobuf:"bytes,1,opt,name=signature,proto3,oneof"` +} + +type AggchainProof_Sp1Stark struct { + // SP1 stark proof. + Sp1Stark *FixedBytes32 `protobuf:"bytes,2,opt,name=sp1_stark,json=sp1Stark,proto3,oneof"` +} + +func (*AggchainProof_Signature) isAggchainProof_Proof() {} + +func (*AggchainProof_Sp1Stark) isAggchainProof_Proof() {} + +// Certificate identifier. +type CertificateId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // bytes representation of the certificate id. + Value *FixedBytes32 `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *CertificateId) Reset() { + *x = CertificateId{} + if protoimpl.UnsafeEnabled { + mi := &file_types_certificate_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertificateId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertificateId) ProtoMessage() {} + +func (x *CertificateId) ProtoReflect() protoreflect.Message { + mi := &file_types_certificate_proto_msgTypes[2] + 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 CertificateId.ProtoReflect.Descriptor instead. +func (*CertificateId) Descriptor() ([]byte, []int) { + return file_types_certificate_proto_rawDescGZIP(), []int{2} +} + +func (x *CertificateId) GetValue() *FixedBytes32 { + if x != nil { + return x.Value + } + return nil +} + +var File_types_certificate_proto protoreflect.FileDescriptor + +var file_types_certificate_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x04, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x4a, 0x0a, 0x14, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x33, 0x32, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, + 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x13, 0x6e, 0x65, 0x77, 0x5f, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, + 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x3a, 0x0a, 0x0c, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, + 0x52, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x53, 0x0a, + 0x15, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x13, 0x69, + 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, + 0x74, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0e, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x0e, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x22, 0x8d, 0x01, 0x0a, 0x0d, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x12, 0x39, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x36, + 0x35, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x38, + 0x0a, 0x09, 0x73, 0x70, 0x31, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x48, 0x00, 0x52, 0x08, + 0x73, 0x70, 0x31, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x22, 0x40, 0x0a, 0x0d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, + 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_types_certificate_proto_rawDescOnce sync.Once + file_types_certificate_proto_rawDescData = file_types_certificate_proto_rawDesc +) + +func file_types_certificate_proto_rawDescGZIP() []byte { + file_types_certificate_proto_rawDescOnce.Do(func() { + file_types_certificate_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_certificate_proto_rawDescData) + }) + return file_types_certificate_proto_rawDescData +} + +var file_types_certificate_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_types_certificate_proto_goTypes = []interface{}{ + (*Certificate)(nil), // 0: proto.types.Certificate + (*AggchainProof)(nil), // 1: proto.types.AggchainProof + (*CertificateId)(nil), // 2: proto.types.CertificateId + (*FixedBytes32)(nil), // 3: proto.types.FixedBytes32 + (*BridgeExit)(nil), // 4: proto.types.BridgeExit + (*ImportedBridgeExit)(nil), // 5: proto.types.ImportedBridgeExit + (*FixedBytes65)(nil), // 6: proto.types.FixedBytes65 +} +var file_types_certificate_proto_depIdxs = []int32{ + 3, // 0: proto.types.Certificate.prev_local_exit_root:type_name -> proto.types.FixedBytes32 + 3, // 1: proto.types.Certificate.new_local_exit_root:type_name -> proto.types.FixedBytes32 + 4, // 2: proto.types.Certificate.bridge_exits:type_name -> proto.types.BridgeExit + 5, // 3: proto.types.Certificate.imported_bridge_exits:type_name -> proto.types.ImportedBridgeExit + 3, // 4: proto.types.Certificate.metadata:type_name -> proto.types.FixedBytes32 + 1, // 5: proto.types.Certificate.aggchain_proof:type_name -> proto.types.AggchainProof + 6, // 6: proto.types.AggchainProof.signature:type_name -> proto.types.FixedBytes65 + 3, // 7: proto.types.AggchainProof.sp1_stark:type_name -> proto.types.FixedBytes32 + 3, // 8: proto.types.CertificateId.value:type_name -> proto.types.FixedBytes32 + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_types_certificate_proto_init() } +func file_types_certificate_proto_init() { + if File_types_certificate_proto != nil { + return + } + file_types_bytes_proto_init() + file_types_bridge_exit_proto_init() + file_types_imported_bridge_exit_proto_init() + if !protoimpl.UnsafeEnabled { + file_types_certificate_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Certificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_certificate_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AggchainProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_certificate_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertificateId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_types_certificate_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*AggchainProof_Signature)(nil), + (*AggchainProof_Sp1Stark)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_types_certificate_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_certificate_proto_goTypes, + DependencyIndexes: file_types_certificate_proto_depIdxs, + MessageInfos: file_types_certificate_proto_msgTypes, + }.Build() + File_types_certificate_proto = out.File + file_types_certificate_proto_rawDesc = nil + file_types_certificate_proto_goTypes = nil + file_types_certificate_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/certificate.proto b/agglayer/proto/types/certificate.proto new file mode 100644 index 00000000..acc7ea91 --- /dev/null +++ b/agglayer/proto/types/certificate.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; +import "types/bytes.proto"; +import "types/bridge_exit.proto"; +import "types/imported_bridge_exit.proto"; + +// Certificate type. +message Certificate { + // NetworkID of the origin network. + uint32 network_id = 1; + // Simple increment to count the Certificate per network. + uint64 height = 2; + // Previous local exit root. + FixedBytes32 prev_local_exit_root = 3; + // New local exit root. + FixedBytes32 new_local_exit_root = 4; + // List of bridge exits included in this state transition. + repeated BridgeExit bridge_exits = 5; + // List of imported bridge exits included in this state transition. + repeated ImportedBridgeExit imported_bridge_exits = 6; + // Fixed size field of arbitrary data for the chain needs. + FixedBytes32 metadata = 7; + // Aggchain params. + bytes aggchain_params = 8; + // Aggchain proof. + AggchainProof aggchain_proof = 9; + // custom chain data. + bytes custom_chain_data = 10; +} + +// Aggchain proof. +message AggchainProof { + // The proof for the aggchain. + oneof proof { + // Signature committed to the bridge exits and imported bridge exits. + FixedBytes65 signature = 1; + // SP1 stark proof. + FixedBytes32 sp1_stark = 2; + } +} + +// Certificate identifier. +message CertificateId { + // bytes representation of the certificate id. + FixedBytes32 value = 1; +} \ No newline at end of file diff --git a/agglayer/proto/types/certificate_header.pb.go b/agglayer/proto/types/certificate_header.pb.go new file mode 100644 index 00000000..d5b8165b --- /dev/null +++ b/agglayer/proto/types/certificate_header.pb.go @@ -0,0 +1,439 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/certificate_header.proto + +package types + +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) +) + +// Certificate status type. +type CertificateStatus int32 + +const ( + // Unspecified certificate status. + CertificateStatus_CERTIFICATE_STATUS_UNSPECIFIED CertificateStatus = 0 + // Certificate is pending. + CertificateStatus_CERTIFICATE_STATUS_PENDING CertificateStatus = 1 + // Certificate is proven. + CertificateStatus_CERTIFICATE_STATUS_PROVEN CertificateStatus = 2 + // Certificate is candidate. + CertificateStatus_CERTIFICATE_STATUS_CANDIDATE CertificateStatus = 3 + // Certificate is in error. + CertificateStatus_CERTIFICATE_STATUS_IN_ERROR CertificateStatus = 4 + // Certificate is settled. + CertificateStatus_CERTIFICATE_STATUS_SETTLED CertificateStatus = 5 +) + +// Enum value maps for CertificateStatus. +var ( + CertificateStatus_name = map[int32]string{ + 0: "CERTIFICATE_STATUS_UNSPECIFIED", + 1: "CERTIFICATE_STATUS_PENDING", + 2: "CERTIFICATE_STATUS_PROVEN", + 3: "CERTIFICATE_STATUS_CANDIDATE", + 4: "CERTIFICATE_STATUS_IN_ERROR", + 5: "CERTIFICATE_STATUS_SETTLED", + } + CertificateStatus_value = map[string]int32{ + "CERTIFICATE_STATUS_UNSPECIFIED": 0, + "CERTIFICATE_STATUS_PENDING": 1, + "CERTIFICATE_STATUS_PROVEN": 2, + "CERTIFICATE_STATUS_CANDIDATE": 3, + "CERTIFICATE_STATUS_IN_ERROR": 4, + "CERTIFICATE_STATUS_SETTLED": 5, + } +) + +func (x CertificateStatus) Enum() *CertificateStatus { + p := new(CertificateStatus) + *p = x + return p +} + +func (x CertificateStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CertificateStatus) Descriptor() protoreflect.EnumDescriptor { + return file_types_certificate_header_proto_enumTypes[0].Descriptor() +} + +func (CertificateStatus) Type() protoreflect.EnumType { + return &file_types_certificate_header_proto_enumTypes[0] +} + +func (x CertificateStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CertificateStatus.Descriptor instead. +func (CertificateStatus) EnumDescriptor() ([]byte, []int) { + return file_types_certificate_header_proto_rawDescGZIP(), []int{0} +} + +// Certificate header type. +type CertificateHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // NetworkID for the certificate. + NetworkId uint32 `protobuf:"varint,1,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"` + // Height of the certificate. + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // Epoch number where the certificate was settled. + EpochNumber *uint64 `protobuf:"varint,3,opt,name=epoch_number,json=epochNumber,proto3,oneof" json:"epoch_number,omitempty"` + // Certificate index in the epoch. + CertificateIndex *uint64 `protobuf:"varint,4,opt,name=certificate_index,json=certificateIndex,proto3,oneof" json:"certificate_index,omitempty"` + // Certificate ID. + CertificateId *CertificateId `protobuf:"bytes,5,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` + // Previous local exit root. + PrevLocalExitRoot *FixedBytes32 `protobuf:"bytes,6,opt,name=prev_local_exit_root,json=prevLocalExitRoot,proto3" json:"prev_local_exit_root,omitempty"` + // New local exit root. + NewLocalExitRoot *FixedBytes32 `protobuf:"bytes,7,opt,name=new_local_exit_root,json=newLocalExitRoot,proto3" json:"new_local_exit_root,omitempty"` + // Fixed size field of arbitrary data for the chain needs. + Metadata *FixedBytes32 `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Certificate status. + Status CertificateStatus `protobuf:"varint,9,opt,name=status,proto3,enum=proto.types.CertificateStatus" json:"status,omitempty"` + // Certificate status error details. + Error *CertificateStatusError `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"` + // Settlement transaction hash. + SettlementTxHash *FixedBytes32 `protobuf:"bytes,11,opt,name=settlement_tx_hash,json=settlementTxHash,proto3" json:"settlement_tx_hash,omitempty"` +} + +func (x *CertificateHeader) Reset() { + *x = CertificateHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_types_certificate_header_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertificateHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertificateHeader) ProtoMessage() {} + +func (x *CertificateHeader) ProtoReflect() protoreflect.Message { + mi := &file_types_certificate_header_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 CertificateHeader.ProtoReflect.Descriptor instead. +func (*CertificateHeader) Descriptor() ([]byte, []int) { + return file_types_certificate_header_proto_rawDescGZIP(), []int{0} +} + +func (x *CertificateHeader) GetNetworkId() uint32 { + if x != nil { + return x.NetworkId + } + return 0 +} + +func (x *CertificateHeader) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *CertificateHeader) GetEpochNumber() uint64 { + if x != nil && x.EpochNumber != nil { + return *x.EpochNumber + } + return 0 +} + +func (x *CertificateHeader) GetCertificateIndex() uint64 { + if x != nil && x.CertificateIndex != nil { + return *x.CertificateIndex + } + return 0 +} + +func (x *CertificateHeader) GetCertificateId() *CertificateId { + if x != nil { + return x.CertificateId + } + return nil +} + +func (x *CertificateHeader) GetPrevLocalExitRoot() *FixedBytes32 { + if x != nil { + return x.PrevLocalExitRoot + } + return nil +} + +func (x *CertificateHeader) GetNewLocalExitRoot() *FixedBytes32 { + if x != nil { + return x.NewLocalExitRoot + } + return nil +} + +func (x *CertificateHeader) GetMetadata() *FixedBytes32 { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *CertificateHeader) GetStatus() CertificateStatus { + if x != nil { + return x.Status + } + return CertificateStatus_CERTIFICATE_STATUS_UNSPECIFIED +} + +func (x *CertificateHeader) GetError() *CertificateStatusError { + if x != nil { + return x.Error + } + return nil +} + +func (x *CertificateHeader) GetSettlementTxHash() *FixedBytes32 { + if x != nil { + return x.SettlementTxHash + } + return nil +} + +// Certificate status error type. +type CertificateStatusError struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Error message. + Message []byte `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *CertificateStatusError) Reset() { + *x = CertificateStatusError{} + if protoimpl.UnsafeEnabled { + mi := &file_types_certificate_header_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CertificateStatusError) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CertificateStatusError) ProtoMessage() {} + +func (x *CertificateStatusError) ProtoReflect() protoreflect.Message { + mi := &file_types_certificate_header_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CertificateStatusError.ProtoReflect.Descriptor instead. +func (*CertificateStatusError) Descriptor() ([]byte, []int) { + return file_types_certificate_header_proto_rawDescGZIP(), []int{1} +} + +func (x *CertificateStatusError) GetMessage() []byte { + if x != nil { + return x.Message + } + return nil +} + +var File_types_certificate_header_proto protoreflect.FileDescriptor + +var file_types_certificate_header_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x11, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x05, 0x0a, 0x11, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x30, + 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x10, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01, + 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x11, 0x70, 0x72, + 0x65, 0x76, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, + 0x48, 0x0a, 0x13, 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, + 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, + 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x47, 0x0a, 0x12, 0x73, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, + 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x10, 0x73, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x42, 0x0f, 0x0a, 0x0d, + 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x14, 0x0a, + 0x12, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x22, 0x32, 0x0a, 0x16, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0xd9, 0x01, 0x0a, 0x11, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, + 0x1e, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, + 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x10, 0x02, + 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x44, 0x49, 0x44, 0x41, 0x54, 0x45, + 0x10, 0x03, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, + 0x44, 0x10, 0x05, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, + 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_types_certificate_header_proto_rawDescOnce sync.Once + file_types_certificate_header_proto_rawDescData = file_types_certificate_header_proto_rawDesc +) + +func file_types_certificate_header_proto_rawDescGZIP() []byte { + file_types_certificate_header_proto_rawDescOnce.Do(func() { + file_types_certificate_header_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_certificate_header_proto_rawDescData) + }) + return file_types_certificate_header_proto_rawDescData +} + +var file_types_certificate_header_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_types_certificate_header_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_types_certificate_header_proto_goTypes = []interface{}{ + (CertificateStatus)(0), // 0: proto.types.CertificateStatus + (*CertificateHeader)(nil), // 1: proto.types.CertificateHeader + (*CertificateStatusError)(nil), // 2: proto.types.CertificateStatusError + (*CertificateId)(nil), // 3: proto.types.CertificateId + (*FixedBytes32)(nil), // 4: proto.types.FixedBytes32 +} +var file_types_certificate_header_proto_depIdxs = []int32{ + 3, // 0: proto.types.CertificateHeader.certificate_id:type_name -> proto.types.CertificateId + 4, // 1: proto.types.CertificateHeader.prev_local_exit_root:type_name -> proto.types.FixedBytes32 + 4, // 2: proto.types.CertificateHeader.new_local_exit_root:type_name -> proto.types.FixedBytes32 + 4, // 3: proto.types.CertificateHeader.metadata:type_name -> proto.types.FixedBytes32 + 0, // 4: proto.types.CertificateHeader.status:type_name -> proto.types.CertificateStatus + 2, // 5: proto.types.CertificateHeader.error:type_name -> proto.types.CertificateStatusError + 4, // 6: proto.types.CertificateHeader.settlement_tx_hash:type_name -> proto.types.FixedBytes32 + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] 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 +} + +func init() { file_types_certificate_header_proto_init() } +func file_types_certificate_header_proto_init() { + if File_types_certificate_header_proto != nil { + return + } + file_types_bytes_proto_init() + file_types_certificate_proto_init() + if !protoimpl.UnsafeEnabled { + file_types_certificate_header_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertificateHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_certificate_header_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertificateStatusError); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_types_certificate_header_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_types_certificate_header_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_certificate_header_proto_goTypes, + DependencyIndexes: file_types_certificate_header_proto_depIdxs, + EnumInfos: file_types_certificate_header_proto_enumTypes, + MessageInfos: file_types_certificate_header_proto_msgTypes, + }.Build() + File_types_certificate_header_proto = out.File + file_types_certificate_header_proto_rawDesc = nil + file_types_certificate_header_proto_goTypes = nil + file_types_certificate_header_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/certificate_header.proto b/agglayer/proto/types/certificate_header.proto new file mode 100644 index 00000000..ca104e7f --- /dev/null +++ b/agglayer/proto/types/certificate_header.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; +import "types/bytes.proto"; +import "types/certificate.proto"; + +// Certificate header type. +message CertificateHeader { + // NetworkID for the certificate. + uint32 network_id = 1; + // Height of the certificate. + uint64 height = 2; + // Epoch number where the certificate was settled. + optional uint64 epoch_number = 3; + // Certificate index in the epoch. + optional uint64 certificate_index = 4; + // Certificate ID. + CertificateId certificate_id = 5; + // Previous local exit root. + FixedBytes32 prev_local_exit_root = 6; + // New local exit root. + FixedBytes32 new_local_exit_root = 7; + // Fixed size field of arbitrary data for the chain needs. + FixedBytes32 metadata = 8; + // Certificate status. + CertificateStatus status = 9; + // Certificate status error details. + CertificateStatusError error = 10; + // Settlement transaction hash. + FixedBytes32 settlement_tx_hash = 11; +} + +// Certificate status type. +enum CertificateStatus { + // Unspecified certificate status. + CERTIFICATE_STATUS_UNSPECIFIED = 0; + // Certificate is pending. + CERTIFICATE_STATUS_PENDING = 1; + // Certificate is proven. + CERTIFICATE_STATUS_PROVEN = 2; + // Certificate is candidate. + CERTIFICATE_STATUS_CANDIDATE = 3; + // Certificate is in error. + CERTIFICATE_STATUS_IN_ERROR = 4; + // Certificate is settled. + CERTIFICATE_STATUS_SETTLED = 5; +} + +// Certificate status error type. +message CertificateStatusError { + // Error message. + bytes message = 1; +} \ No newline at end of file diff --git a/agglayer/proto/types/claim.pb.go b/agglayer/proto/types/claim.pb.go new file mode 100644 index 00000000..051ea3a0 --- /dev/null +++ b/agglayer/proto/types/claim.pb.go @@ -0,0 +1,570 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/claim.proto + +package types + +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) +) + +// Represents a claim from the mainnet. +type ClaimFromMainnet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Proof from bridge exit leaf to MER + ProofLeafMer *MerkleProof `protobuf:"bytes,1,opt,name=proof_leaf_mer,json=proofLeafMer,proto3" json:"proof_leaf_mer,omitempty"` + // Proof from GER to L1Root + ProofGerL1Root *MerkleProof `protobuf:"bytes,2,opt,name=proof_ger_l1root,json=proofGerL1root,proto3" json:"proof_ger_l1root,omitempty"` + // L1InfoTree leaf + L1Leaf *L1InfoTreeLeaf `protobuf:"bytes,3,opt,name=l1_leaf,json=l1Leaf,proto3" json:"l1_leaf,omitempty"` +} + +func (x *ClaimFromMainnet) Reset() { + *x = ClaimFromMainnet{} + if protoimpl.UnsafeEnabled { + mi := &file_types_claim_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClaimFromMainnet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimFromMainnet) ProtoMessage() {} + +func (x *ClaimFromMainnet) ProtoReflect() protoreflect.Message { + mi := &file_types_claim_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 ClaimFromMainnet.ProtoReflect.Descriptor instead. +func (*ClaimFromMainnet) Descriptor() ([]byte, []int) { + return file_types_claim_proto_rawDescGZIP(), []int{0} +} + +func (x *ClaimFromMainnet) GetProofLeafMer() *MerkleProof { + if x != nil { + return x.ProofLeafMer + } + return nil +} + +func (x *ClaimFromMainnet) GetProofGerL1Root() *MerkleProof { + if x != nil { + return x.ProofGerL1Root + } + return nil +} + +func (x *ClaimFromMainnet) GetL1Leaf() *L1InfoTreeLeaf { + if x != nil { + return x.L1Leaf + } + return nil +} + +// Represents a leaf in the L1InfoTree. +type L1InfoTreeLeaf struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // l1 info tree leaf index + L1InfoTreeIndex uint32 `protobuf:"varint,1,opt,name=l1_info_tree_index,json=l1InfoTreeIndex,proto3" json:"l1_info_tree_index,omitempty"` + // Rollup exit root + Rer *FixedBytes32 `protobuf:"bytes,2,opt,name=rer,proto3" json:"rer,omitempty"` + // Mainnet exit root + Mer *FixedBytes32 `protobuf:"bytes,3,opt,name=mer,proto3" json:"mer,omitempty"` + // Inner leaf + Inner *L1InfoTreeLeafInner `protobuf:"bytes,4,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *L1InfoTreeLeaf) Reset() { + *x = L1InfoTreeLeaf{} + if protoimpl.UnsafeEnabled { + mi := &file_types_claim_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *L1InfoTreeLeaf) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*L1InfoTreeLeaf) ProtoMessage() {} + +func (x *L1InfoTreeLeaf) ProtoReflect() protoreflect.Message { + mi := &file_types_claim_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use L1InfoTreeLeaf.ProtoReflect.Descriptor instead. +func (*L1InfoTreeLeaf) Descriptor() ([]byte, []int) { + return file_types_claim_proto_rawDescGZIP(), []int{1} +} + +func (x *L1InfoTreeLeaf) GetL1InfoTreeIndex() uint32 { + if x != nil { + return x.L1InfoTreeIndex + } + return 0 +} + +func (x *L1InfoTreeLeaf) GetRer() *FixedBytes32 { + if x != nil { + return x.Rer + } + return nil +} + +func (x *L1InfoTreeLeaf) GetMer() *FixedBytes32 { + if x != nil { + return x.Mer + } + return nil +} + +func (x *L1InfoTreeLeaf) GetInner() *L1InfoTreeLeafInner { + if x != nil { + return x.Inner + } + return nil +} + +// Represents the inner part of a leaf in the L1InfoTree. +type L1InfoTreeLeafInner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The global exit root. + GlobalExitRoot *FixedBytes32 `protobuf:"bytes,1,opt,name=global_exit_root,json=globalExitRoot,proto3" json:"global_exit_root,omitempty"` + // Block hash. + BlockHash *FixedBytes32 `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // Timestamp. + Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *L1InfoTreeLeafInner) Reset() { + *x = L1InfoTreeLeafInner{} + if protoimpl.UnsafeEnabled { + mi := &file_types_claim_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *L1InfoTreeLeafInner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*L1InfoTreeLeafInner) ProtoMessage() {} + +func (x *L1InfoTreeLeafInner) ProtoReflect() protoreflect.Message { + mi := &file_types_claim_proto_msgTypes[2] + 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 L1InfoTreeLeafInner.ProtoReflect.Descriptor instead. +func (*L1InfoTreeLeafInner) Descriptor() ([]byte, []int) { + return file_types_claim_proto_rawDescGZIP(), []int{2} +} + +func (x *L1InfoTreeLeafInner) GetGlobalExitRoot() *FixedBytes32 { + if x != nil { + return x.GlobalExitRoot + } + return nil +} + +func (x *L1InfoTreeLeafInner) GetBlockHash() *FixedBytes32 { + if x != nil { + return x.BlockHash + } + return nil +} + +func (x *L1InfoTreeLeafInner) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +// Represents a Merkle proof. +type MerkleProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The root of the Merkle tree. + Root *FixedBytes32 `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` + // The path from the leaf to the root. + Siblings []*FixedBytes32 `protobuf:"bytes,2,rep,name=siblings,proto3" json:"siblings,omitempty"` +} + +func (x *MerkleProof) Reset() { + *x = MerkleProof{} + if protoimpl.UnsafeEnabled { + mi := &file_types_claim_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MerkleProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MerkleProof) ProtoMessage() {} + +func (x *MerkleProof) ProtoReflect() protoreflect.Message { + mi := &file_types_claim_proto_msgTypes[3] + 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 MerkleProof.ProtoReflect.Descriptor instead. +func (*MerkleProof) Descriptor() ([]byte, []int) { + return file_types_claim_proto_rawDescGZIP(), []int{3} +} + +func (x *MerkleProof) GetRoot() *FixedBytes32 { + if x != nil { + return x.Root + } + return nil +} + +func (x *MerkleProof) GetSiblings() []*FixedBytes32 { + if x != nil { + return x.Siblings + } + return nil +} + +// Represents a claim from the rollup. +type ClaimFromRollup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Proof from bridge exit leaf to LER + ProofLeafLer *MerkleProof `protobuf:"bytes,1,opt,name=proof_leaf_ler,json=proofLeafLer,proto3" json:"proof_leaf_ler,omitempty"` + // Proof from LER to RER + ProofLerRer *MerkleProof `protobuf:"bytes,2,opt,name=proof_ler_rer,json=proofLerRer,proto3" json:"proof_ler_rer,omitempty"` + // Proof from GER to L1Root + ProofGerL1Root *MerkleProof `protobuf:"bytes,3,opt,name=proof_ger_l1root,json=proofGerL1root,proto3" json:"proof_ger_l1root,omitempty"` + // L1InfoTree leaf + L1Leaf *L1InfoTreeLeaf `protobuf:"bytes,4,opt,name=l1_leaf,json=l1Leaf,proto3" json:"l1_leaf,omitempty"` +} + +func (x *ClaimFromRollup) Reset() { + *x = ClaimFromRollup{} + if protoimpl.UnsafeEnabled { + mi := &file_types_claim_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClaimFromRollup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimFromRollup) ProtoMessage() {} + +func (x *ClaimFromRollup) ProtoReflect() protoreflect.Message { + mi := &file_types_claim_proto_msgTypes[4] + 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 ClaimFromRollup.ProtoReflect.Descriptor instead. +func (*ClaimFromRollup) Descriptor() ([]byte, []int) { + return file_types_claim_proto_rawDescGZIP(), []int{4} +} + +func (x *ClaimFromRollup) GetProofLeafLer() *MerkleProof { + if x != nil { + return x.ProofLeafLer + } + return nil +} + +func (x *ClaimFromRollup) GetProofLerRer() *MerkleProof { + if x != nil { + return x.ProofLerRer + } + return nil +} + +func (x *ClaimFromRollup) GetProofGerL1Root() *MerkleProof { + if x != nil { + return x.ProofGerL1Root + } + return nil +} + +func (x *ClaimFromRollup) GetL1Leaf() *L1InfoTreeLeaf { + if x != nil { + return x.L1Leaf + } + return nil +} + +var File_types_claim_proto protoreflect.FileDescriptor + +var file_types_claim_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x01, 0x0a, 0x10, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, + 0x6d, 0x4d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x12, 0x3e, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x6d, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, + 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x4c, 0x65, 0x61, 0x66, 0x4d, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x5f, 0x67, 0x65, 0x72, 0x5f, 0x6c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x47, 0x65, 0x72, 0x4c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x07, + 0x6c, 0x31, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x31, 0x49, 0x6e, + 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x06, 0x6c, 0x31, 0x4c, 0x65, + 0x61, 0x66, 0x22, 0xcf, 0x01, 0x0a, 0x0e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, + 0x65, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x2b, 0x0a, 0x12, 0x6c, 0x31, 0x5f, 0x69, 0x6e, 0x66, 0x6f, + 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0f, 0x6c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, + 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x03, 0x72, 0x65, 0x72, 0x12, + 0x2b, 0x0a, 0x03, 0x6d, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x03, 0x6d, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x05, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, + 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, + 0x6e, 0x6e, 0x65, 0x72, 0x22, 0xb2, 0x01, 0x0a, 0x13, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, + 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x10, + 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, + 0x32, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x73, 0x0a, 0x0b, 0x4d, 0x65, 0x72, + 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, + 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, + 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x89, + 0x02, 0x0a, 0x0f, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x6f, 0x6c, 0x6c, + 0x75, 0x70, 0x12, 0x3e, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6c, 0x65, 0x61, 0x66, + 0x5f, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4c, 0x65, 0x61, 0x66, 0x4c, + 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6c, 0x65, 0x72, 0x5f, + 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4c, 0x65, 0x72, 0x52, 0x65, 0x72, + 0x12, 0x42, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x67, 0x65, 0x72, 0x5f, 0x6c, 0x31, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x47, 0x65, 0x72, 0x4c, 0x31, + 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x6c, 0x31, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, + 0x61, 0x66, 0x52, 0x06, 0x6c, 0x31, 0x4c, 0x65, 0x61, 0x66, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_types_claim_proto_rawDescOnce sync.Once + file_types_claim_proto_rawDescData = file_types_claim_proto_rawDesc +) + +func file_types_claim_proto_rawDescGZIP() []byte { + file_types_claim_proto_rawDescOnce.Do(func() { + file_types_claim_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_claim_proto_rawDescData) + }) + return file_types_claim_proto_rawDescData +} + +var file_types_claim_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_types_claim_proto_goTypes = []interface{}{ + (*ClaimFromMainnet)(nil), // 0: proto.types.ClaimFromMainnet + (*L1InfoTreeLeaf)(nil), // 1: proto.types.L1InfoTreeLeaf + (*L1InfoTreeLeafInner)(nil), // 2: proto.types.L1InfoTreeLeafInner + (*MerkleProof)(nil), // 3: proto.types.MerkleProof + (*ClaimFromRollup)(nil), // 4: proto.types.ClaimFromRollup + (*FixedBytes32)(nil), // 5: proto.types.FixedBytes32 +} +var file_types_claim_proto_depIdxs = []int32{ + 3, // 0: proto.types.ClaimFromMainnet.proof_leaf_mer:type_name -> proto.types.MerkleProof + 3, // 1: proto.types.ClaimFromMainnet.proof_ger_l1root:type_name -> proto.types.MerkleProof + 1, // 2: proto.types.ClaimFromMainnet.l1_leaf:type_name -> proto.types.L1InfoTreeLeaf + 5, // 3: proto.types.L1InfoTreeLeaf.rer:type_name -> proto.types.FixedBytes32 + 5, // 4: proto.types.L1InfoTreeLeaf.mer:type_name -> proto.types.FixedBytes32 + 2, // 5: proto.types.L1InfoTreeLeaf.inner:type_name -> proto.types.L1InfoTreeLeafInner + 5, // 6: proto.types.L1InfoTreeLeafInner.global_exit_root:type_name -> proto.types.FixedBytes32 + 5, // 7: proto.types.L1InfoTreeLeafInner.block_hash:type_name -> proto.types.FixedBytes32 + 5, // 8: proto.types.MerkleProof.root:type_name -> proto.types.FixedBytes32 + 5, // 9: proto.types.MerkleProof.siblings:type_name -> proto.types.FixedBytes32 + 3, // 10: proto.types.ClaimFromRollup.proof_leaf_ler:type_name -> proto.types.MerkleProof + 3, // 11: proto.types.ClaimFromRollup.proof_ler_rer:type_name -> proto.types.MerkleProof + 3, // 12: proto.types.ClaimFromRollup.proof_ger_l1root:type_name -> proto.types.MerkleProof + 1, // 13: proto.types.ClaimFromRollup.l1_leaf:type_name -> proto.types.L1InfoTreeLeaf + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] 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_types_claim_proto_init() } +func file_types_claim_proto_init() { + if File_types_claim_proto != nil { + return + } + file_types_bytes_proto_init() + if !protoimpl.UnsafeEnabled { + file_types_claim_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClaimFromMainnet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_claim_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*L1InfoTreeLeaf); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_claim_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*L1InfoTreeLeafInner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_claim_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MerkleProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_claim_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClaimFromRollup); 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_types_claim_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_claim_proto_goTypes, + DependencyIndexes: file_types_claim_proto_depIdxs, + MessageInfos: file_types_claim_proto_msgTypes, + }.Build() + File_types_claim_proto = out.File + file_types_claim_proto_rawDesc = nil + file_types_claim_proto_goTypes = nil + file_types_claim_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/claim.proto b/agglayer/proto/types/claim.proto new file mode 100644 index 00000000..c4226c49 --- /dev/null +++ b/agglayer/proto/types/claim.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; +import "types/bytes.proto"; + +// Represents a claim from the mainnet. +message ClaimFromMainnet { + // Proof from bridge exit leaf to MER + MerkleProof proof_leaf_mer = 1; + // Proof from GER to L1Root + MerkleProof proof_ger_l1root = 2; + // L1InfoTree leaf + L1InfoTreeLeaf l1_leaf = 3; +} + +// Represents a leaf in the L1InfoTree. +message L1InfoTreeLeaf { + // l1 info tree leaf index + uint32 l1_info_tree_index = 1; + // Rollup exit root + FixedBytes32 rer = 2; + // Mainnet exit root + FixedBytes32 mer = 3; + // Inner leaf + L1InfoTreeLeafInner inner = 4; +} + +// Represents the inner part of a leaf in the L1InfoTree. +message L1InfoTreeLeafInner { + // The global exit root. + FixedBytes32 global_exit_root = 1; + // Block hash. + FixedBytes32 block_hash = 2; + // Timestamp. + uint64 timestamp = 3; +} + +// Represents a Merkle proof. +message MerkleProof { + // The root of the Merkle tree. + FixedBytes32 root = 1; + // The path from the leaf to the root. + repeated FixedBytes32 siblings = 2; +} + +// Represents a claim from the rollup. +message ClaimFromRollup { + // Proof from bridge exit leaf to LER + MerkleProof proof_leaf_ler = 1; + // Proof from LER to RER + MerkleProof proof_ler_rer = 2; + // Proof from GER to L1Root + MerkleProof proof_ger_l1root = 3; + // L1InfoTree leaf + L1InfoTreeLeaf l1_leaf = 4; +} diff --git a/agglayer/proto/types/epoch_configuration.pb.go b/agglayer/proto/types/epoch_configuration.pb.go new file mode 100644 index 00000000..1710ce7f --- /dev/null +++ b/agglayer/proto/types/epoch_configuration.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/epoch_configuration.proto + +package types + +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) +) + +// Epoch configuration type. +type EpochConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The genesis block of the epoch. + GenesisBlock uint64 `protobuf:"varint,1,opt,name=genesis_block,json=genesisBlock,proto3" json:"genesis_block,omitempty"` + // The epoch duration. + EpochDuration uint64 `protobuf:"varint,2,opt,name=epoch_duration,json=epochDuration,proto3" json:"epoch_duration,omitempty"` +} + +func (x *EpochConfiguration) Reset() { + *x = EpochConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_types_epoch_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EpochConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EpochConfiguration) ProtoMessage() {} + +func (x *EpochConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_types_epoch_configuration_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 EpochConfiguration.ProtoReflect.Descriptor instead. +func (*EpochConfiguration) Descriptor() ([]byte, []int) { + return file_types_epoch_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *EpochConfiguration) GetGenesisBlock() uint64 { + if x != nil { + return x.GenesisBlock + } + return 0 +} + +func (x *EpochConfiguration) GetEpochDuration() uint64 { + if x != nil { + return x.EpochDuration + } + return 0 +} + +var File_types_epoch_configuration_proto protoreflect.FileDescriptor + +var file_types_epoch_configuration_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x60, + 0x0a, 0x12, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0d, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, + 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, + 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_types_epoch_configuration_proto_rawDescOnce sync.Once + file_types_epoch_configuration_proto_rawDescData = file_types_epoch_configuration_proto_rawDesc +) + +func file_types_epoch_configuration_proto_rawDescGZIP() []byte { + file_types_epoch_configuration_proto_rawDescOnce.Do(func() { + file_types_epoch_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_epoch_configuration_proto_rawDescData) + }) + return file_types_epoch_configuration_proto_rawDescData +} + +var file_types_epoch_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_types_epoch_configuration_proto_goTypes = []interface{}{ + (*EpochConfiguration)(nil), // 0: proto.types.EpochConfiguration +} +var file_types_epoch_configuration_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_types_epoch_configuration_proto_init() } +func file_types_epoch_configuration_proto_init() { + if File_types_epoch_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_types_epoch_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EpochConfiguration); 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_types_epoch_configuration_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_epoch_configuration_proto_goTypes, + DependencyIndexes: file_types_epoch_configuration_proto_depIdxs, + MessageInfos: file_types_epoch_configuration_proto_msgTypes, + }.Build() + File_types_epoch_configuration_proto = out.File + file_types_epoch_configuration_proto_rawDesc = nil + file_types_epoch_configuration_proto_goTypes = nil + file_types_epoch_configuration_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/epoch_configuration.proto b/agglayer/proto/types/epoch_configuration.proto new file mode 100644 index 00000000..4c7d4a63 --- /dev/null +++ b/agglayer/proto/types/epoch_configuration.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; + +// Epoch configuration type. +message EpochConfiguration { + // The genesis block of the epoch. + uint64 genesis_block = 1; + // The epoch duration. + uint64 epoch_duration = 2; +} diff --git a/agglayer/proto/types/imported_bridge_exit.pb.go b/agglayer/proto/types/imported_bridge_exit.pb.go new file mode 100644 index 00000000..38d71b79 --- /dev/null +++ b/agglayer/proto/types/imported_bridge_exit.pb.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: types/imported_bridge_exit.proto + +package types + +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) +) + +// Represents a token bridge exit originating on another network but claimed on +// the current network. +type ImportedBridgeExit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // / The bridge exit initiated on another network, called the "sending" + // / network. Need to verify that the destination network matches the + // / current network, and that the bridge exit is included in an imported + // / LER + BridgeExit *BridgeExit `protobuf:"bytes,1,opt,name=bridge_exit,json=bridgeExit,proto3" json:"bridge_exit,omitempty"` + // / The global index of the imported bridge exit. + GlobalIndex *FixedBytes32 `protobuf:"bytes,2,opt,name=global_index,json=globalIndex,proto3" json:"global_index,omitempty"` + // Which type of claim the imported bridge exit is from. + // + // Types that are assignable to Claim: + // + // *ImportedBridgeExit_Mainnet + // *ImportedBridgeExit_Rollup + Claim isImportedBridgeExit_Claim `protobuf_oneof:"claim"` +} + +func (x *ImportedBridgeExit) Reset() { + *x = ImportedBridgeExit{} + if protoimpl.UnsafeEnabled { + mi := &file_types_imported_bridge_exit_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportedBridgeExit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportedBridgeExit) ProtoMessage() {} + +func (x *ImportedBridgeExit) ProtoReflect() protoreflect.Message { + mi := &file_types_imported_bridge_exit_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 ImportedBridgeExit.ProtoReflect.Descriptor instead. +func (*ImportedBridgeExit) Descriptor() ([]byte, []int) { + return file_types_imported_bridge_exit_proto_rawDescGZIP(), []int{0} +} + +func (x *ImportedBridgeExit) GetBridgeExit() *BridgeExit { + if x != nil { + return x.BridgeExit + } + return nil +} + +func (x *ImportedBridgeExit) GetGlobalIndex() *FixedBytes32 { + if x != nil { + return x.GlobalIndex + } + return nil +} + +func (m *ImportedBridgeExit) GetClaim() isImportedBridgeExit_Claim { + if m != nil { + return m.Claim + } + return nil +} + +func (x *ImportedBridgeExit) GetMainnet() *ClaimFromMainnet { + if x, ok := x.GetClaim().(*ImportedBridgeExit_Mainnet); ok { + return x.Mainnet + } + return nil +} + +func (x *ImportedBridgeExit) GetRollup() *ClaimFromRollup { + if x, ok := x.GetClaim().(*ImportedBridgeExit_Rollup); ok { + return x.Rollup + } + return nil +} + +type isImportedBridgeExit_Claim interface { + isImportedBridgeExit_Claim() +} + +type ImportedBridgeExit_Mainnet struct { + // / The claim originated from the mainnet. + Mainnet *ClaimFromMainnet `protobuf:"bytes,3,opt,name=mainnet,proto3,oneof"` +} + +type ImportedBridgeExit_Rollup struct { + // / The claim originated from the rollup. + Rollup *ClaimFromRollup `protobuf:"bytes,4,opt,name=rollup,proto3,oneof"` +} + +func (*ImportedBridgeExit_Mainnet) isImportedBridgeExit_Claim() {} + +func (*ImportedBridgeExit_Rollup) isImportedBridgeExit_Claim() {} + +var File_types_imported_bridge_exit_proto protoreflect.FileDescriptor + +var file_types_imported_bridge_exit_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, + 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, + 0x02, 0x0a, 0x12, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, + 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, + 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, + 0x78, 0x69, 0x74, 0x52, 0x0a, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, + 0x3c, 0x0a, 0x0c, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, + 0x52, 0x0b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x39, 0x0a, + 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x4d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x48, 0x00, 0x52, + 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x6f, 0x6c, 0x6c, + 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, + 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x00, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x6c, 0x75, 0x70, + 0x42, 0x07, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_types_imported_bridge_exit_proto_rawDescOnce sync.Once + file_types_imported_bridge_exit_proto_rawDescData = file_types_imported_bridge_exit_proto_rawDesc +) + +func file_types_imported_bridge_exit_proto_rawDescGZIP() []byte { + file_types_imported_bridge_exit_proto_rawDescOnce.Do(func() { + file_types_imported_bridge_exit_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_imported_bridge_exit_proto_rawDescData) + }) + return file_types_imported_bridge_exit_proto_rawDescData +} + +var file_types_imported_bridge_exit_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_types_imported_bridge_exit_proto_goTypes = []interface{}{ + (*ImportedBridgeExit)(nil), // 0: proto.types.ImportedBridgeExit + (*BridgeExit)(nil), // 1: proto.types.BridgeExit + (*FixedBytes32)(nil), // 2: proto.types.FixedBytes32 + (*ClaimFromMainnet)(nil), // 3: proto.types.ClaimFromMainnet + (*ClaimFromRollup)(nil), // 4: proto.types.ClaimFromRollup +} +var file_types_imported_bridge_exit_proto_depIdxs = []int32{ + 1, // 0: proto.types.ImportedBridgeExit.bridge_exit:type_name -> proto.types.BridgeExit + 2, // 1: proto.types.ImportedBridgeExit.global_index:type_name -> proto.types.FixedBytes32 + 3, // 2: proto.types.ImportedBridgeExit.mainnet:type_name -> proto.types.ClaimFromMainnet + 4, // 3: proto.types.ImportedBridgeExit.rollup:type_name -> proto.types.ClaimFromRollup + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_types_imported_bridge_exit_proto_init() } +func file_types_imported_bridge_exit_proto_init() { + if File_types_imported_bridge_exit_proto != nil { + return + } + file_types_bytes_proto_init() + file_types_bridge_exit_proto_init() + file_types_claim_proto_init() + if !protoimpl.UnsafeEnabled { + file_types_imported_bridge_exit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportedBridgeExit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_types_imported_bridge_exit_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*ImportedBridgeExit_Mainnet)(nil), + (*ImportedBridgeExit_Rollup)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_types_imported_bridge_exit_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_imported_bridge_exit_proto_goTypes, + DependencyIndexes: file_types_imported_bridge_exit_proto_depIdxs, + MessageInfos: file_types_imported_bridge_exit_proto_msgTypes, + }.Build() + File_types_imported_bridge_exit_proto = out.File + file_types_imported_bridge_exit_proto_rawDesc = nil + file_types_imported_bridge_exit_proto_goTypes = nil + file_types_imported_bridge_exit_proto_depIdxs = nil +} diff --git a/agglayer/proto/types/imported_bridge_exit.proto b/agglayer/proto/types/imported_bridge_exit.proto new file mode 100644 index 00000000..eea00c5d --- /dev/null +++ b/agglayer/proto/types/imported_bridge_exit.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package proto.types; +option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; +import "types/bytes.proto"; +import "types/bridge_exit.proto"; +import "types/claim.proto"; + +// Represents a token bridge exit originating on another network but claimed on +// the current network. +message ImportedBridgeExit { + /// The bridge exit initiated on another network, called the "sending" + /// network. Need to verify that the destination network matches the + /// current network, and that the bridge exit is included in an imported + /// LER + BridgeExit bridge_exit = 1; + + /// The global index of the imported bridge exit. + FixedBytes32 global_index = 2; + + // Which type of claim the imported bridge exit is from. + oneof claim { + /// The claim originated from the mainnet. + ClaimFromMainnet mainnet = 3; + /// The claim originated from the rollup. + ClaimFromRollup rollup = 4; + } +} \ No newline at end of file diff --git a/proto/src/proto/datastream/v1/datastream.proto b/proto/src/proto/datastream/v1/datastream.proto index 827c81e6..11daaff8 100644 --- a/proto/src/proto/datastream/v1/datastream.proto +++ b/proto/src/proto/datastream/v1/datastream.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package datastream.v1; -option go_package = "github.com/agglayer/aggkit"state/datastream"; +option go_package = "github.com/agglayer/aggkit/state/datastream"; message BatchStart { uint64 number = 1; diff --git a/types/epoch_configuration.pb.go b/types/epoch_configuration.pb.go new file mode 100644 index 00000000..2cf60993 --- /dev/null +++ b/types/epoch_configuration.pb.go @@ -0,0 +1,159 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v3.12.4 +// source: types/epoch_configuration.proto + +package types + +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) +) + +// Epoch configuration type. +type EpochConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The genesis block of the epoch. + GenesisBlock uint64 `protobuf:"varint,1,opt,name=genesis_block,json=genesisBlock,proto3" json:"genesis_block,omitempty"` + // The epoch duration. + EpochDuration uint64 `protobuf:"varint,2,opt,name=epoch_duration,json=epochDuration,proto3" json:"epoch_duration,omitempty"` +} + +func (x *EpochConfiguration) Reset() { + *x = EpochConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_types_epoch_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EpochConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EpochConfiguration) ProtoMessage() {} + +func (x *EpochConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_types_epoch_configuration_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 EpochConfiguration.ProtoReflect.Descriptor instead. +func (*EpochConfiguration) Descriptor() ([]byte, []int) { + return file_types_epoch_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *EpochConfiguration) GetGenesisBlock() uint64 { + if x != nil { + return x.GenesisBlock + } + return 0 +} + +func (x *EpochConfiguration) GetEpochDuration() uint64 { + if x != nil { + return x.EpochDuration + } + return 0 +} + +var File_types_epoch_configuration_proto protoreflect.FileDescriptor + +var file_types_epoch_configuration_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x60, + 0x0a, 0x12, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0d, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x17, 0x5a, 0x15, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_types_epoch_configuration_proto_rawDescOnce sync.Once + file_types_epoch_configuration_proto_rawDescData = file_types_epoch_configuration_proto_rawDesc +) + +func file_types_epoch_configuration_proto_rawDescGZIP() []byte { + file_types_epoch_configuration_proto_rawDescOnce.Do(func() { + file_types_epoch_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_epoch_configuration_proto_rawDescData) + }) + return file_types_epoch_configuration_proto_rawDescData +} + +var file_types_epoch_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_types_epoch_configuration_proto_goTypes = []interface{}{ + (*EpochConfiguration)(nil), // 0: proto.types.EpochConfiguration +} +var file_types_epoch_configuration_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_types_epoch_configuration_proto_init() } +func file_types_epoch_configuration_proto_init() { + if File_types_epoch_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_types_epoch_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EpochConfiguration); 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_types_epoch_configuration_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_types_epoch_configuration_proto_goTypes, + DependencyIndexes: file_types_epoch_configuration_proto_depIdxs, + MessageInfos: file_types_epoch_configuration_proto_msgTypes, + }.Build() + File_types_epoch_configuration_proto = out.File + file_types_epoch_configuration_proto_rawDesc = nil + file_types_epoch_configuration_proto_goTypes = nil + file_types_epoch_configuration_proto_depIdxs = nil +} From 974b81689bdf5f40f8b8b70d6cb56ad88e5f4813 Mon Sep 17 00:00:00 2001 From: Goran Rojovic Date: Wed, 19 Feb 2025 13:17:33 +0100 Subject: [PATCH 2/9] feat: agglayer grpc client --- agglayer/grpc/agglayer_grpc_client.go | 25 +++++++++++++++++++ aggsender/grpc/aggchain_proof_client.go | 5 ++-- .../grpc/client.go => common/grpc_client.go | 7 +++++- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 agglayer/grpc/agglayer_grpc_client.go rename aggsender/grpc/client.go => common/grpc_client.go (85%) diff --git a/agglayer/grpc/agglayer_grpc_client.go b/agglayer/grpc/agglayer_grpc_client.go new file mode 100644 index 00000000..224184c4 --- /dev/null +++ b/agglayer/grpc/agglayer_grpc_client.go @@ -0,0 +1,25 @@ +package grpc + +import ( + "github.com/agglayer/aggkit/agglayer/proto/node" + "github.com/agglayer/aggkit/common" +) + +type AgglayerGRPCClient struct { + cfgService node.AgglayerConfigurationServiceClient + networkStateService node.AgglayerNetworkStateServiceClient + submissionService node.AgglayerCertificateSubmissionServiceClient +} + +// NewAggchainProofClient initializes a new AggchainProof instance +func NewAgglayerGRPCClient(serverAddr string) (*AgglayerGRPCClient, error) { + grpcClient, err := common.NewClient(serverAddr) + if err != nil { + return nil, err + } + return &AgglayerGRPCClient{ + cfgService: node.NewAgglayerConfigurationServiceClient(grpcClient.Conn()), + networkStateService: node.NewAgglayerNetworkStateServiceClient(grpcClient.Conn()), + submissionService: node.NewAgglayerCertificateSubmissionServiceClient(grpcClient.Conn()), + }, nil +} diff --git a/aggsender/grpc/aggchain_proof_client.go b/aggsender/grpc/aggchain_proof_client.go index 831e0201..0d2bcf04 100644 --- a/aggsender/grpc/aggchain_proof_client.go +++ b/aggsender/grpc/aggchain_proof_client.go @@ -6,6 +6,7 @@ import ( agglayer "github.com/agglayer/aggkit/agglayer" "github.com/agglayer/aggkit/aggsender/types" + aggkitCommon "github.com/agglayer/aggkit/common" "github.com/agglayer/aggkit/l1infotreesync" treeTypes "github.com/agglayer/aggkit/tree/types" "github.com/ethereum/go-ethereum/common" @@ -33,12 +34,12 @@ type AggchainProofClient struct { // NewAggchainProofClient initializes a new AggchainProof instance func NewAggchainProofClient(serverAddr string) (*AggchainProofClient, error) { - grpcClient, err := NewClient(serverAddr) + grpcClient, err := aggkitCommon.NewClient(serverAddr) if err != nil { return nil, err } return &AggchainProofClient{ - client: types.NewAggchainProofServiceClient(grpcClient.conn), + client: types.NewAggchainProofServiceClient(grpcClient.Conn()), }, nil } diff --git a/aggsender/grpc/client.go b/common/grpc_client.go similarity index 85% rename from aggsender/grpc/client.go rename to common/grpc_client.go index d92e8513..2cb37aed 100644 --- a/aggsender/grpc/client.go +++ b/common/grpc_client.go @@ -1,4 +1,4 @@ -package grpc +package common import ( "google.golang.org/grpc" @@ -23,6 +23,11 @@ func NewClient(serverAddr string) (*Client, error) { return &Client{conn: conn}, nil } +// Conn returns the gRPC connection +func (c *Client) Conn() *grpc.ClientConn { + return c.conn +} + // Close closes the gRPC connection func (c *Client) Close() error { return c.conn.Close() From 574f0f228fdf4b4d2fc4641e51ddf80f9bd47e5b Mon Sep 17 00:00:00 2001 From: Goran Rojovic Date: Wed, 19 Feb 2025 15:36:43 +0100 Subject: [PATCH 3/9] feat: packages reorganization --- agglayer/client.go | 35 ++-- agglayer/client_test.go | 3 +- agglayer/mock_agglayer_client.go | 76 ++++---- agglayer/{ => types}/errors_test.go | 2 +- agglayer/{ => types}/types.go | 2 +- agglayer/{ => types}/types_helpers_test.go | 2 +- agglayer/{ => types}/types_test.go | 2 +- aggsender/aggsender.go | 17 +- aggsender/aggsender_initial_state.go | 9 +- aggsender/aggsender_initial_state_test.go | 108 +++++------ aggsender/aggsender_test.go | 103 +++++----- aggsender/db/aggsender_db_storage.go | 6 +- aggsender/db/aggsender_db_storage_test.go | 60 +++--- aggsender/epoch_notifier_per_block_test.go | 3 +- aggsender/flow_aggchain_prover.go | 8 +- aggsender/flow_aggchain_prover_test.go | 58 +++--- aggsender/flow_base.go | 62 +++--- aggsender/flow_pp_test.go | 182 +++++++++--------- aggsender/grpc/aggchain_proof_client.go | 6 +- aggsender/grpc/aggchain_proof_client_test.go | 14 +- aggsender/mocks/mock_agg_sender_storage.go | 20 +- .../mock_aggchain_proof_client_interface.go | 18 +- .../mock_aggchain_proof_service_server.go | 4 +- aggsender/mocks/mock_aggsender_flow.go | 16 +- aggsender/types/types.go | 25 +-- .../aggsender_find_imported_bridge.go | 10 +- 26 files changed, 431 insertions(+), 420 deletions(-) rename agglayer/{ => types}/errors_test.go (99%) rename agglayer/{ => types}/types.go (99%) rename agglayer/{ => types}/types_helpers_test.go (98%) rename agglayer/{ => types}/types_test.go (99%) diff --git a/agglayer/client.go b/agglayer/client.go index 01f52ae7..87f624ea 100644 --- a/agglayer/client.go +++ b/agglayer/client.go @@ -9,7 +9,8 @@ import ( "time" "github.com/0xPolygon/cdk-rpc/rpc" - "github.com/0xPolygon/cdk-rpc/types" + rpcTypes "github.com/0xPolygon/cdk-rpc/types" + "github.com/agglayer/aggkit/agglayer/types" "github.com/ethereum/go-ethereum/common" ) @@ -21,20 +22,20 @@ var ( ) type AggLayerClientGetEpochConfiguration interface { - GetEpochConfiguration() (*ClockConfiguration, error) + GetEpochConfiguration() (*types.ClockConfiguration, error) } type AggLayerClientRecoveryQuerier interface { - GetLatestSettledCertificateHeader(networkID uint32) (*CertificateHeader, error) - GetLatestPendingCertificateHeader(networkID uint32) (*CertificateHeader, error) + GetLatestSettledCertificateHeader(networkID uint32) (*types.CertificateHeader, error) + GetLatestPendingCertificateHeader(networkID uint32) (*types.CertificateHeader, error) } // AgglayerClientInterface is the interface that defines the methods that the AggLayerClient will implement type AgglayerClientInterface interface { SendTx(signedTx SignedTx) (common.Hash, error) WaitTxToBeMined(hash common.Hash, ctx context.Context) error - SendCertificate(certificate *SignedCertificate) (common.Hash, error) - GetCertificateHeader(certificateHash common.Hash) (*CertificateHeader, error) + SendCertificate(certificate *types.SignedCertificate) (common.Hash, error) + GetCertificateHeader(certificateHash common.Hash) (*types.CertificateHeader, error) AggLayerClientGetEpochConfiguration AggLayerClientRecoveryQuerier } @@ -65,7 +66,7 @@ func (c *AggLayerClient) SendTx(signedTx SignedTx) (common.Hash, error) { return common.Hash{}, fmt.Errorf("%v %v", response.Error.Code, response.Error.Message) } - var result types.ArgHash + var result rpcTypes.ArgHash err = json.Unmarshal(response.Result, &result) if err != nil { return common.Hash{}, err @@ -104,7 +105,7 @@ func (c *AggLayerClient) WaitTxToBeMined(hash common.Hash, ctx context.Context) } // SendCertificate sends a certificate to the AggLayer -func (c *AggLayerClient) SendCertificate(certificate *SignedCertificate) (common.Hash, error) { +func (c *AggLayerClient) SendCertificate(certificate *types.SignedCertificate) (common.Hash, error) { certificateToSend := certificate.CopyWithDefaulting() response, err := rpc.JSONRPCCall(c.url, "interop_sendCertificate", certificateToSend) @@ -116,7 +117,7 @@ func (c *AggLayerClient) SendCertificate(certificate *SignedCertificate) (common return common.Hash{}, fmt.Errorf("%d %s", response.Error.Code, response.Error.Message) } - var result types.ArgHash + var result rpcTypes.ArgHash err = json.Unmarshal(response.Result, &result) if err != nil { return common.Hash{}, err @@ -126,7 +127,7 @@ func (c *AggLayerClient) SendCertificate(certificate *SignedCertificate) (common } // GetCertificateHeader returns the certificate header associated to the hash -func (c *AggLayerClient) GetCertificateHeader(certificateHash common.Hash) (*CertificateHeader, error) { +func (c *AggLayerClient) GetCertificateHeader(certificateHash common.Hash) (*types.CertificateHeader, error) { response, err := rpc.JSONRPCCall(c.url, "interop_getCertificateHeader", certificateHash) if err != nil { return nil, err @@ -136,7 +137,7 @@ func (c *AggLayerClient) GetCertificateHeader(certificateHash common.Hash) (*Cer return nil, fmt.Errorf("%d %s", response.Error.Code, response.Error.Message) } - var result *CertificateHeader + var result *types.CertificateHeader err = json.Unmarshal(response.Result, &result) if err != nil { return nil, err @@ -146,7 +147,7 @@ func (c *AggLayerClient) GetCertificateHeader(certificateHash common.Hash) (*Cer } // GetEpochConfiguration returns the clock configuration of AggLayer -func (c *AggLayerClient) GetEpochConfiguration() (*ClockConfiguration, error) { +func (c *AggLayerClient) GetEpochConfiguration() (*types.ClockConfiguration, error) { response, err := jSONRPCCall(c.url, "interop_getEpochConfiguration") if err != nil { return nil, err @@ -156,7 +157,7 @@ func (c *AggLayerClient) GetEpochConfiguration() (*ClockConfiguration, error) { return nil, fmt.Errorf("GetEpochConfiguration code=%d msg=%s", response.Error.Code, response.Error.Message) } - var result *ClockConfiguration + var result *types.ClockConfiguration err = json.Unmarshal(response.Result, &result) if err != nil { return nil, err @@ -165,7 +166,7 @@ func (c *AggLayerClient) GetEpochConfiguration() (*ClockConfiguration, error) { return result, nil } -func (c *AggLayerClient) GetLatestSettledCertificateHeader(networkID uint32) (*CertificateHeader, error) { +func (c *AggLayerClient) GetLatestSettledCertificateHeader(networkID uint32) (*types.CertificateHeader, error) { response, err := jSONRPCCall(c.url, "interop_getLatestSettledCertificateHeader", networkID) if err != nil { return nil, fmt.Errorf("interop_getLatestSettledCertificateHeader rpc call failed: %w", err) @@ -176,7 +177,7 @@ func (c *AggLayerClient) GetLatestSettledCertificateHeader(networkID uint32) (*C response.Error.Code, response.Error.Message) } - var result *CertificateHeader + var result *types.CertificateHeader err = json.Unmarshal(response.Result, &result) if err != nil { return nil, fmt.Errorf("GetLatestSettledCertificateHeader error Unmashal. Err: %w", err) @@ -185,7 +186,7 @@ func (c *AggLayerClient) GetLatestSettledCertificateHeader(networkID uint32) (*C return result, nil } -func (c *AggLayerClient) GetLatestPendingCertificateHeader(networkID uint32) (*CertificateHeader, error) { +func (c *AggLayerClient) GetLatestPendingCertificateHeader(networkID uint32) (*types.CertificateHeader, error) { response, err := jSONRPCCall(c.url, "interop_getLatestPendingCertificateHeader", networkID) if err != nil { return nil, fmt.Errorf("interop_getLatestPendingCertificateHeader rpc call failed: %w", err) @@ -196,7 +197,7 @@ func (c *AggLayerClient) GetLatestPendingCertificateHeader(networkID uint32) (*C response.Error.Code, response.Error.Message) } - var result *CertificateHeader + var result *types.CertificateHeader err = json.Unmarshal(response.Result, &result) if err != nil { return nil, fmt.Errorf("GetLatestPendingCertificateHeader error Unmashal. Err: %w", err) diff --git a/agglayer/client_test.go b/agglayer/client_test.go index 40586248..ffa60424 100644 --- a/agglayer/client_test.go +++ b/agglayer/client_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/0xPolygon/cdk-rpc/rpc" + "github.com/agglayer/aggkit/agglayer/types" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ) @@ -100,7 +101,7 @@ func TestGetEpochConfigurationOkResponse(t *testing.T) { clockConfig, err := sut.GetEpochConfiguration() require.NotNil(t, clockConfig) require.NoError(t, err) - require.Equal(t, ClockConfiguration{ + require.Equal(t, types.ClockConfiguration{ EpochDuration: 1, GenesisBlock: 1, }, *clockConfig) diff --git a/agglayer/mock_agglayer_client.go b/agglayer/mock_agglayer_client.go index 1497cc24..56adc5a0 100644 --- a/agglayer/mock_agglayer_client.go +++ b/agglayer/mock_agglayer_client.go @@ -8,6 +8,8 @@ import ( common "github.com/ethereum/go-ethereum/common" mock "github.com/stretchr/testify/mock" + + types "github.com/agglayer/aggkit/agglayer/types" ) // AgglayerClientMock is an autogenerated mock type for the AgglayerClientInterface type @@ -24,23 +26,23 @@ func (_m *AgglayerClientMock) EXPECT() *AgglayerClientMock_Expecter { } // GetCertificateHeader provides a mock function with given fields: certificateHash -func (_m *AgglayerClientMock) GetCertificateHeader(certificateHash common.Hash) (*CertificateHeader, error) { +func (_m *AgglayerClientMock) GetCertificateHeader(certificateHash common.Hash) (*types.CertificateHeader, error) { ret := _m.Called(certificateHash) if len(ret) == 0 { panic("no return value specified for GetCertificateHeader") } - var r0 *CertificateHeader + var r0 *types.CertificateHeader var r1 error - if rf, ok := ret.Get(0).(func(common.Hash) (*CertificateHeader, error)); ok { + if rf, ok := ret.Get(0).(func(common.Hash) (*types.CertificateHeader, error)); ok { return rf(certificateHash) } - if rf, ok := ret.Get(0).(func(common.Hash) *CertificateHeader); ok { + if rf, ok := ret.Get(0).(func(common.Hash) *types.CertificateHeader); ok { r0 = rf(certificateHash) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*CertificateHeader) + r0 = ret.Get(0).(*types.CertificateHeader) } } @@ -71,34 +73,34 @@ func (_c *AgglayerClientMock_GetCertificateHeader_Call) Run(run func(certificate return _c } -func (_c *AgglayerClientMock_GetCertificateHeader_Call) Return(_a0 *CertificateHeader, _a1 error) *AgglayerClientMock_GetCertificateHeader_Call { +func (_c *AgglayerClientMock_GetCertificateHeader_Call) Return(_a0 *types.CertificateHeader, _a1 error) *AgglayerClientMock_GetCertificateHeader_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AgglayerClientMock_GetCertificateHeader_Call) RunAndReturn(run func(common.Hash) (*CertificateHeader, error)) *AgglayerClientMock_GetCertificateHeader_Call { +func (_c *AgglayerClientMock_GetCertificateHeader_Call) RunAndReturn(run func(common.Hash) (*types.CertificateHeader, error)) *AgglayerClientMock_GetCertificateHeader_Call { _c.Call.Return(run) return _c } -// GetEpochConfiguration provides a mock function with no fields -func (_m *AgglayerClientMock) GetEpochConfiguration() (*ClockConfiguration, error) { +// GetEpochConfiguration provides a mock function with given fields: +func (_m *AgglayerClientMock) GetEpochConfiguration() (*types.ClockConfiguration, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetEpochConfiguration") } - var r0 *ClockConfiguration + var r0 *types.ClockConfiguration var r1 error - if rf, ok := ret.Get(0).(func() (*ClockConfiguration, error)); ok { + if rf, ok := ret.Get(0).(func() (*types.ClockConfiguration, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() *ClockConfiguration); ok { + if rf, ok := ret.Get(0).(func() *types.ClockConfiguration); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*ClockConfiguration) + r0 = ret.Get(0).(*types.ClockConfiguration) } } @@ -128,34 +130,34 @@ func (_c *AgglayerClientMock_GetEpochConfiguration_Call) Run(run func()) *Agglay return _c } -func (_c *AgglayerClientMock_GetEpochConfiguration_Call) Return(_a0 *ClockConfiguration, _a1 error) *AgglayerClientMock_GetEpochConfiguration_Call { +func (_c *AgglayerClientMock_GetEpochConfiguration_Call) Return(_a0 *types.ClockConfiguration, _a1 error) *AgglayerClientMock_GetEpochConfiguration_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AgglayerClientMock_GetEpochConfiguration_Call) RunAndReturn(run func() (*ClockConfiguration, error)) *AgglayerClientMock_GetEpochConfiguration_Call { +func (_c *AgglayerClientMock_GetEpochConfiguration_Call) RunAndReturn(run func() (*types.ClockConfiguration, error)) *AgglayerClientMock_GetEpochConfiguration_Call { _c.Call.Return(run) return _c } // GetLatestPendingCertificateHeader provides a mock function with given fields: networkID -func (_m *AgglayerClientMock) GetLatestPendingCertificateHeader(networkID uint32) (*CertificateHeader, error) { +func (_m *AgglayerClientMock) GetLatestPendingCertificateHeader(networkID uint32) (*types.CertificateHeader, error) { ret := _m.Called(networkID) if len(ret) == 0 { panic("no return value specified for GetLatestPendingCertificateHeader") } - var r0 *CertificateHeader + var r0 *types.CertificateHeader var r1 error - if rf, ok := ret.Get(0).(func(uint32) (*CertificateHeader, error)); ok { + if rf, ok := ret.Get(0).(func(uint32) (*types.CertificateHeader, error)); ok { return rf(networkID) } - if rf, ok := ret.Get(0).(func(uint32) *CertificateHeader); ok { + if rf, ok := ret.Get(0).(func(uint32) *types.CertificateHeader); ok { r0 = rf(networkID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*CertificateHeader) + r0 = ret.Get(0).(*types.CertificateHeader) } } @@ -186,34 +188,34 @@ func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Run(run fun return _c } -func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Return(_a0 *CertificateHeader, _a1 error) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Return(_a0 *types.CertificateHeader, _a1 error) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) RunAndReturn(run func(uint32) (*CertificateHeader, error)) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) RunAndReturn(run func(uint32) (*types.CertificateHeader, error)) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { _c.Call.Return(run) return _c } // GetLatestSettledCertificateHeader provides a mock function with given fields: networkID -func (_m *AgglayerClientMock) GetLatestSettledCertificateHeader(networkID uint32) (*CertificateHeader, error) { +func (_m *AgglayerClientMock) GetLatestSettledCertificateHeader(networkID uint32) (*types.CertificateHeader, error) { ret := _m.Called(networkID) if len(ret) == 0 { panic("no return value specified for GetLatestSettledCertificateHeader") } - var r0 *CertificateHeader + var r0 *types.CertificateHeader var r1 error - if rf, ok := ret.Get(0).(func(uint32) (*CertificateHeader, error)); ok { + if rf, ok := ret.Get(0).(func(uint32) (*types.CertificateHeader, error)); ok { return rf(networkID) } - if rf, ok := ret.Get(0).(func(uint32) *CertificateHeader); ok { + if rf, ok := ret.Get(0).(func(uint32) *types.CertificateHeader); ok { r0 = rf(networkID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*CertificateHeader) + r0 = ret.Get(0).(*types.CertificateHeader) } } @@ -244,18 +246,18 @@ func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Run(run fun return _c } -func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Return(_a0 *CertificateHeader, _a1 error) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Return(_a0 *types.CertificateHeader, _a1 error) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) RunAndReturn(run func(uint32) (*CertificateHeader, error)) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) RunAndReturn(run func(uint32) (*types.CertificateHeader, error)) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { _c.Call.Return(run) return _c } // SendCertificate provides a mock function with given fields: certificate -func (_m *AgglayerClientMock) SendCertificate(certificate *SignedCertificate) (common.Hash, error) { +func (_m *AgglayerClientMock) SendCertificate(certificate *types.SignedCertificate) (common.Hash, error) { ret := _m.Called(certificate) if len(ret) == 0 { @@ -264,10 +266,10 @@ func (_m *AgglayerClientMock) SendCertificate(certificate *SignedCertificate) (c var r0 common.Hash var r1 error - if rf, ok := ret.Get(0).(func(*SignedCertificate) (common.Hash, error)); ok { + if rf, ok := ret.Get(0).(func(*types.SignedCertificate) (common.Hash, error)); ok { return rf(certificate) } - if rf, ok := ret.Get(0).(func(*SignedCertificate) common.Hash); ok { + if rf, ok := ret.Get(0).(func(*types.SignedCertificate) common.Hash); ok { r0 = rf(certificate) } else { if ret.Get(0) != nil { @@ -275,7 +277,7 @@ func (_m *AgglayerClientMock) SendCertificate(certificate *SignedCertificate) (c } } - if rf, ok := ret.Get(1).(func(*SignedCertificate) error); ok { + if rf, ok := ret.Get(1).(func(*types.SignedCertificate) error); ok { r1 = rf(certificate) } else { r1 = ret.Error(1) @@ -290,14 +292,14 @@ type AgglayerClientMock_SendCertificate_Call struct { } // SendCertificate is a helper method to define mock.On call -// - certificate *SignedCertificate +// - certificate *types.SignedCertificate func (_e *AgglayerClientMock_Expecter) SendCertificate(certificate interface{}) *AgglayerClientMock_SendCertificate_Call { return &AgglayerClientMock_SendCertificate_Call{Call: _e.mock.On("SendCertificate", certificate)} } -func (_c *AgglayerClientMock_SendCertificate_Call) Run(run func(certificate *SignedCertificate)) *AgglayerClientMock_SendCertificate_Call { +func (_c *AgglayerClientMock_SendCertificate_Call) Run(run func(certificate *types.SignedCertificate)) *AgglayerClientMock_SendCertificate_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*SignedCertificate)) + run(args[0].(*types.SignedCertificate)) }) return _c } @@ -307,7 +309,7 @@ func (_c *AgglayerClientMock_SendCertificate_Call) Return(_a0 common.Hash, _a1 e return _c } -func (_c *AgglayerClientMock_SendCertificate_Call) RunAndReturn(run func(*SignedCertificate) (common.Hash, error)) *AgglayerClientMock_SendCertificate_Call { +func (_c *AgglayerClientMock_SendCertificate_Call) RunAndReturn(run func(*types.SignedCertificate) (common.Hash, error)) *AgglayerClientMock_SendCertificate_Call { _c.Call.Return(run) return _c } diff --git a/agglayer/errors_test.go b/agglayer/types/errors_test.go similarity index 99% rename from agglayer/errors_test.go rename to agglayer/types/errors_test.go index 14293026..61afc537 100644 --- a/agglayer/errors_test.go +++ b/agglayer/types/errors_test.go @@ -1,4 +1,4 @@ -package agglayer +package types import ( "testing" diff --git a/agglayer/types.go b/agglayer/types/types.go similarity index 99% rename from agglayer/types.go rename to agglayer/types/types.go index ba089097..2acbc707 100644 --- a/agglayer/types.go +++ b/agglayer/types/types.go @@ -1,4 +1,4 @@ -package agglayer +package types import ( "encoding/json" diff --git a/agglayer/types_helpers_test.go b/agglayer/types/types_helpers_test.go similarity index 98% rename from agglayer/types_helpers_test.go rename to agglayer/types/types_helpers_test.go index 843033a8..0949f280 100644 --- a/agglayer/types_helpers_test.go +++ b/agglayer/types/types_helpers_test.go @@ -1,4 +1,4 @@ -package agglayer +package types import ( "fmt" diff --git a/agglayer/types_test.go b/agglayer/types/types_test.go similarity index 99% rename from agglayer/types_test.go rename to agglayer/types/types_test.go index 9ca54c13..7c6e1664 100644 --- a/agglayer/types_test.go +++ b/agglayer/types/types_test.go @@ -1,4 +1,4 @@ -package agglayer +package types import ( "bytes" diff --git a/aggsender/aggsender.go b/aggsender/aggsender.go index 7225c637..0daff131 100644 --- a/aggsender/aggsender.go +++ b/aggsender/aggsender.go @@ -11,6 +11,7 @@ import ( jRPC "github.com/0xPolygon/cdk-rpc/rpc" zkevm "github.com/agglayer/aggkit" "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/db" "github.com/agglayer/aggkit/aggsender/grpc" aggsenderrpc "github.com/agglayer/aggkit/aggsender/rpc" @@ -244,7 +245,7 @@ func (a *AggSender) sendCertificates(ctx context.Context, returnAfterNIterations } // sendCertificate sends certificate for a network -func (a *AggSender) sendCertificate(ctx context.Context) (*agglayer.SignedCertificate, error) { +func (a *AggSender) sendCertificate(ctx context.Context) (*agglayerTypes.SignedCertificate, error) { a.log.Infof("trying to send a new certificate...") certificateParams, err := a.flow.GetCertificateBuildParams(ctx) @@ -359,7 +360,7 @@ func (a *AggSender) saveCertificateToStorage(ctx context.Context, cert types.Cer } // signCertificate signs a certificate with the sequencer key -func (a *AggSender) signCertificate(certificate *agglayer.Certificate) (*agglayer.SignedCertificate, error) { +func (a *AggSender) signCertificate(certificate *agglayerTypes.Certificate) (*agglayerTypes.SignedCertificate, error) { hashToSign := certificate.HashToSign() sig, err := crypto.Sign(hashToSign.Bytes(), a.aggsenderKey) @@ -378,9 +379,9 @@ func (a *AggSender) signCertificate(certificate *agglayer.Certificate) (*agglaye return nil, err } - return &agglayer.SignedCertificate{ + return &agglayerTypes.SignedCertificate{ Certificate: certificate, - Signature: &agglayer.Signature{ + Signature: &agglayerTypes.Signature{ R: r, S: s, OddParity: isOddParity, @@ -400,7 +401,7 @@ type checkCertResult struct { // It returns: // bool -> if there are pending certificates func (a *AggSender) checkPendingCertificatesStatus(ctx context.Context) checkCertResult { - pendingCertificates, err := a.storage.GetCertificatesByStatus(agglayer.NonSettledStatuses) + pendingCertificates, err := a.storage.GetCertificatesByStatus(agglayerTypes.NonSettledStatuses) if err != nil { a.log.Errorf("error getting pending certificates: %w", err) return checkCertResult{existPendingCerts: true, existNewInErrorCert: false} @@ -441,7 +442,7 @@ func (a *AggSender) checkPendingCertificatesStatus(ctx context.Context) checkCer // updateCertificate updates the certificate status in the storage func (a *AggSender) updateCertificateStatus(ctx context.Context, localCert *types.CertificateInfo, - agglayerCert *agglayer.CertificateHeader) error { + agglayerCert *agglayerTypes.CertificateHeader) error { if localCert.Status == agglayerCert.Status { return nil } @@ -501,7 +502,7 @@ func (a *AggSender) executeInitialStatusAction(ctx context.Context, // updateLocalStorageWithAggLayerCert updates the local storage with the certificate from the AggLayer func (a *AggSender) updateLocalStorageWithAggLayerCert(ctx context.Context, - aggLayerCert *agglayer.CertificateHeader) (*types.CertificateInfo, error) { + aggLayerCert *agglayerTypes.CertificateHeader) (*types.CertificateInfo, error) { certInfo := NewCertificateInfoFromAgglayerCertHeader(aggLayerCert) a.log.Infof("setting initial certificate from AggLayer: %s", certInfo.String()) return certInfo, a.storage.SaveLastSentCertificate(ctx, *certInfo) @@ -521,7 +522,7 @@ func extractSignatureData(signature []byte) (r, s common.Hash, isOddParity bool, return } -func NewCertificateInfoFromAgglayerCertHeader(c *agglayer.CertificateHeader) *types.CertificateInfo { +func NewCertificateInfoFromAgglayerCertHeader(c *agglayerTypes.CertificateHeader) *types.CertificateInfo { if c == nil { return nil } diff --git a/aggsender/aggsender_initial_state.go b/aggsender/aggsender_initial_state.go index 78ab79d8..5bc59a70 100644 --- a/aggsender/aggsender_initial_state.go +++ b/aggsender/aggsender_initial_state.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/db" "github.com/agglayer/aggkit/aggsender/types" ) @@ -20,8 +21,8 @@ const ( var ErrAgglayerInconsistence = errors.New("recovery: agglayer inconsistence") type InitialStatus struct { - SettledCert *agglayer.CertificateHeader - PendingCert *agglayer.CertificateHeader + SettledCert *agglayerTypes.CertificateHeader + PendingCert *agglayerTypes.CertificateHeader LocalCert *types.CertificateInfo log types.Logger } @@ -36,7 +37,7 @@ func (i InitialStatusAction) String() string { type InitialStatusResult struct { Action InitialStatusAction Message string - Cert *agglayer.CertificateHeader + Cert *agglayerTypes.CertificateHeader } func (i *InitialStatusResult) String() string { @@ -196,7 +197,7 @@ func (i *InitialStatus) checkAgglayerConsistenceCerts() error { return nil } -func (i *InitialStatus) getLatestAggLayerCert() *agglayer.CertificateHeader { +func (i *InitialStatus) getLatestAggLayerCert() *agglayerTypes.CertificateHeader { if i.PendingCert == nil { return i.SettledCert } diff --git a/aggsender/aggsender_initial_state_test.go b/aggsender/aggsender_initial_state_test.go index b5f397c7..ff8113ba 100644 --- a/aggsender/aggsender_initial_state_test.go +++ b/aggsender/aggsender_initial_state_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/log" "github.com/ethereum/go-ethereum/common" @@ -14,7 +14,7 @@ import ( type certTestData struct { CertificateID common.Hash Height uint64 - Status agglayer.CertificateStatus + Status agglayerTypes.CertificateStatus } type initialStateResultTest struct { @@ -56,71 +56,71 @@ func TestInitialStateInconsistence(t *testing.T) { { name: "1|N/A | ID1, h1 , NA | ID2, h1 , !=inError | Agglayer incosistence", localCert: nil, - agglayerSettled: &certTestData{hash1, 1, agglayer.Proven}, - agglayerPending: &certTestData{hash2, 1, agglayer.Pending}, + agglayerSettled: &certTestData{hash1, 1, agglayerTypes.Proven}, + agglayerPending: &certTestData{hash2, 1, agglayerTypes.Pending}, resultError: true, }, { name: "2|N/A | ID1, h2 , NA | ID2, h1 , !=inError | Agglayer incosistence", localCert: nil, - agglayerSettled: &certTestData{hash1, 2, agglayer.Proven}, - agglayerPending: &certTestData{hash2, 1, agglayer.Pending}, + agglayerSettled: &certTestData{hash1, 2, agglayerTypes.Proven}, + agglayerPending: &certTestData{hash2, 1, agglayerTypes.Pending}, resultError: true, }, { name: "3|nil | nil | ID1, >h0 , !=inError | Agglayer incosistence", localCert: nil, agglayerSettled: nil, - agglayerPending: &certTestData{hash1, 1, agglayer.Pending}, + agglayerPending: &certTestData{hash1, 1, agglayerTypes.Pending}, resultError: true, }, { name: "4|ID1, h1 , Inerror | nil | nil | AggSender incosistence", - localCert: &certTestData{hash1, 2, agglayer.InError}, + localCert: &certTestData{hash1, 2, agglayerTypes.InError}, agglayerSettled: nil, agglayerPending: nil, resultError: true, }, { name: "5|ID1, h1 , Settled | nil | nil | AggSender incosistence", - localCert: &certTestData{hash1, 2, agglayer.Settled}, + localCert: &certTestData{hash1, 2, agglayerTypes.Settled}, agglayerSettled: nil, agglayerPending: nil, resultError: true, }, { name: "6|ID1, h1 , !=closed | nil | nil | incosistence", - localCert: &certTestData{hash1, 0, agglayer.Proven}, + localCert: &certTestData{hash1, 0, agglayerTypes.Proven}, agglayerSettled: nil, agglayerPending: nil, resultError: true, }, { name: "7|ID1, h3 , NA | NA | ID2, h2 , !=InError | AggSender incosistence", - localCert: &certTestData{hash1, 3, agglayer.Proven}, + localCert: &certTestData{hash1, 3, agglayerTypes.Proven}, agglayerSettled: nil, - agglayerPending: &certTestData{hash2, 2, agglayer.Proven}, + agglayerPending: &certTestData{hash2, 2, agglayerTypes.Proven}, resultError: true, }, { name: "8|ID1, h3 , NA | ID2, h2 ,NA | NA | AggSender incosistence", - localCert: &certTestData{hash1, 3, agglayer.Proven}, - agglayerSettled: &certTestData{hash2, 2, agglayer.Proven}, + localCert: &certTestData{hash1, 3, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash2, 2, agglayerTypes.Proven}, agglayerPending: nil, resultError: true, }, { name: "9|ID2, h2 , NA | ID1, h3 , N/A | ID3, h4 , !=inError | AggSender incosistence (2cert jump)", - localCert: &certTestData{hash1, 2, agglayer.Proven}, - agglayerSettled: &certTestData{hash2, 3, agglayer.Settled}, - agglayerPending: &certTestData{hash2, 4, agglayer.Proven}, + localCert: &certTestData{hash1, 2, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash2, 3, agglayerTypes.Settled}, + agglayerPending: &certTestData{hash2, 4, agglayerTypes.Proven}, resultError: true, }, { name: "10|ID2, h2 , NA | ID1, h3 , N/A | ID3, h4 , inError | AggSender incosistence (2cert jump)", - localCert: &certTestData{hash1, 2, agglayer.Proven}, - agglayerSettled: &certTestData{hash2, 3, agglayer.Settled}, - agglayerPending: &certTestData{hash2, 4, agglayer.InError}, + localCert: &certTestData{hash1, 2, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash2, 3, agglayerTypes.Settled}, + agglayerPending: &certTestData{hash2, 4, agglayerTypes.InError}, resultError: true, }, } @@ -161,86 +161,86 @@ func TestRegularCases(t *testing.T) { name: "02| nil | nil | ID1, h0 , inError |store(PENDING) h0 so is next cert", localCert: nil, agglayerSettled: nil, - agglayerPending: &certTestData{hash1, 0, agglayer.InError}, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 0, agglayer.InError}}, + agglayerPending: &certTestData{hash1, 0, agglayerTypes.InError}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 0, agglayerTypes.InError}}, }, { name: "03| nil | nil | ID1, h1 , inError |none", localCert: nil, agglayerSettled: nil, - agglayerPending: &certTestData{hash1, 1, agglayer.InError}, + agglayerPending: &certTestData{hash1, 1, agglayerTypes.InError}, resultActions: &initialStateResultTest{InitialStatusActionNone, "", nil}, }, { name: "04| nil | nil | ID1, h0 , !=inError | store(PENDING) h0 so is next cert", localCert: nil, agglayerSettled: nil, - agglayerPending: &certTestData{hash1, 0, agglayer.Proven}, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 0, agglayer.Proven}}, + agglayerPending: &certTestData{hash1, 0, agglayerTypes.Proven}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 0, agglayerTypes.Proven}}, }, { name: "05| nil | nil | ID1, h1 , !=inError | wait, h1 is not next cert but we wait until pass to inError", localCert: nil, agglayerSettled: nil, - agglayerPending: &certTestData{hash1, 1, agglayer.Proven}, + agglayerPending: &certTestData{hash1, 1, agglayerTypes.Proven}, resultError: true, }, { name: "06| nil | ID1, h1 , NA | nil | store(SETTLE)", localCert: nil, - agglayerSettled: &certTestData{hash1, 1, agglayer.Proven}, + agglayerSettled: &certTestData{hash1, 1, agglayerTypes.Proven}, agglayerPending: nil, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 1, agglayer.Proven}}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 1, agglayerTypes.Proven}}, }, { name: "07| nil | ID1, h1 , NA | ID2, h2 , inError | store(PENDING)", localCert: nil, - agglayerSettled: &certTestData{hash1, 1, agglayer.Proven}, - agglayerPending: &certTestData{hash2, 2, agglayer.InError}, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash2, 2, agglayer.InError}}, + agglayerSettled: &certTestData{hash1, 1, agglayerTypes.Proven}, + agglayerPending: &certTestData{hash2, 2, agglayerTypes.InError}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash2, 2, agglayerTypes.InError}}, }, { name: "08| nil | ID1, h1 , NA | ID2, h2 , !=inError | store(PENDING) h2 is next to h1", localCert: nil, - agglayerSettled: &certTestData{hash1, 1, agglayer.Settled}, - agglayerPending: &certTestData{hash2, 2, agglayer.Pending}, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash2, 2, agglayer.Pending}}, + agglayerSettled: &certTestData{hash1, 1, agglayerTypes.Settled}, + agglayerPending: &certTestData{hash2, 2, agglayerTypes.Pending}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash2, 2, agglayerTypes.Pending}}, }, { name: "09|ID1, h1 , NA | nil | ID1, h1 , inError | update(PENDING)", - localCert: &certTestData{hash1, 1, agglayer.Proven}, + localCert: &certTestData{hash1, 1, agglayerTypes.Proven}, agglayerSettled: nil, - agglayerPending: &certTestData{hash1, 1, agglayer.InError}, - resultActions: &initialStateResultTest{InitialStatusActionUpdateCurrentCert, "", &certTestData{hash1, 1, agglayer.InError}}, + agglayerPending: &certTestData{hash1, 1, agglayerTypes.InError}, + resultActions: &initialStateResultTest{InitialStatusActionUpdateCurrentCert, "", &certTestData{hash1, 1, agglayerTypes.InError}}, }, { name: "10|ID2, h2 , NA | ID1, h1 , N/A | ID2, h2 , N/A | update(PENDING)", - localCert: &certTestData{hash2, 2, agglayer.Proven}, - agglayerSettled: &certTestData{hash1, 1, agglayer.Settled}, - agglayerPending: &certTestData{hash2, 2, agglayer.InError}, - resultActions: &initialStateResultTest{InitialStatusActionUpdateCurrentCert, "", &certTestData{hash2, 2, agglayer.InError}}, + localCert: &certTestData{hash2, 2, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash1, 1, agglayerTypes.Settled}, + agglayerPending: &certTestData{hash2, 2, agglayerTypes.InError}, + resultActions: &initialStateResultTest{InitialStatusActionUpdateCurrentCert, "", &certTestData{hash2, 2, agglayerTypes.InError}}, }, { name: "11|ID2, h2 , NA | ID1, h3 , N/A | nil | store(SETTLED)", - localCert: &certTestData{hash2, 2, agglayer.Proven}, - agglayerSettled: &certTestData{hash1, 3, agglayer.Proven}, + localCert: &certTestData{hash2, 2, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash1, 3, agglayerTypes.Proven}, agglayerPending: nil, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 3, agglayer.Proven}}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 3, agglayerTypes.Proven}}, }, { name: "12|ID2, h2 , NA | ID1, h2 , settled | ID1, h3 , !=inError | store(PENDING)", - localCert: &certTestData{hash2, 2, agglayer.Proven}, - agglayerSettled: &certTestData{hash1, 2, agglayer.Settled}, - agglayerPending: &certTestData{hash1, 3, agglayer.Proven}, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 3, agglayer.Proven}}, + localCert: &certTestData{hash2, 2, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash1, 2, agglayerTypes.Settled}, + agglayerPending: &certTestData{hash1, 3, agglayerTypes.Proven}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 3, agglayerTypes.Proven}}, }, { name: "13|ID2, h2 , NA | ID1, h2 , settled | ID1, h3 , inError | store(PENDING)", - localCert: &certTestData{hash2, 2, agglayer.Proven}, - agglayerSettled: &certTestData{hash1, 2, agglayer.Settled}, - agglayerPending: &certTestData{hash1, 3, agglayer.InError}, - resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 3, agglayer.InError}}, + localCert: &certTestData{hash2, 2, agglayerTypes.Proven}, + agglayerSettled: &certTestData{hash1, 2, agglayerTypes.Settled}, + agglayerPending: &certTestData{hash1, 3, agglayerTypes.InError}, + resultActions: &initialStateResultTest{InitialStatusActionInsertNewCert, "", &certTestData{hash1, 3, agglayerTypes.InError}}, }, } runTestCases(t, tests) @@ -260,14 +260,14 @@ func runTestCases(t *testing.T, tests []testCaseData) { } } if tt.agglayerSettled != nil { - sut.SettledCert = &agglayer.CertificateHeader{ + sut.SettledCert = &agglayerTypes.CertificateHeader{ CertificateID: tt.agglayerSettled.CertificateID, Height: tt.agglayerSettled.Height, Status: tt.agglayerSettled.Status, } } if tt.agglayerPending != nil { - sut.PendingCert = &agglayer.CertificateHeader{ + sut.PendingCert = &agglayerTypes.CertificateHeader{ CertificateID: tt.agglayerPending.CertificateID, Height: tt.agglayerPending.Height, Status: tt.agglayerPending.Status, diff --git a/aggsender/aggsender_test.go b/aggsender/aggsender_test.go index 1f9b8171..bec2443b 100644 --- a/aggsender/aggsender_test.go +++ b/aggsender/aggsender_test.go @@ -14,6 +14,7 @@ import ( "time" "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/db" "github.com/agglayer/aggkit/aggsender/mocks" aggsendertypes "github.com/agglayer/aggkit/aggsender/types" @@ -126,11 +127,11 @@ func TestAggSenderSendCertificates(t *testing.T) { epochNotifierMock.EXPECT().Subscribe("aggsender").Return(ch).Once() err = aggSender.storage.SaveLastSentCertificate(ctx, aggsendertypes.CertificateInfo{ Height: 1, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, }) require.NoError(t, err) - AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything).Return(&agglayer.CertificateHeader{ - Status: agglayer.Pending, + AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything).Return(&agglayerTypes.CertificateHeader{ + Status: agglayerTypes.Pending, }, nil).Once() aggSender.sendCertificates(ctx, 1) @@ -156,10 +157,10 @@ func TestAggSenderSendCertificates(t *testing.T) { epochNotifierMock.EXPECT().Subscribe("aggsender").Return(ch) err = aggSender.storage.SaveLastSentCertificate(ctx, aggsendertypes.CertificateInfo{ Height: 1, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, }) - AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything).Return(&agglayer.CertificateHeader{ - Status: agglayer.InError, + AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything).Return(&agglayerTypes.CertificateHeader{ + Status: agglayerTypes.InError, }, nil).Once() require.NoError(t, err) ch <- aggsendertypes.EpochEvent{ @@ -176,7 +177,7 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { tests := []struct { name string pendingCertificates []*aggsendertypes.CertificateInfo - certificateHeaders map[common.Hash]*agglayer.CertificateHeader + certificateHeaders map[common.Hash]*agglayerTypes.CertificateHeader getFromDBError error clientError error updateDBError error @@ -190,9 +191,9 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { {CertificateID: common.HexToHash("0x1"), Height: 1}, {CertificateID: common.HexToHash("0x2"), Height: 2}, }, - certificateHeaders: map[common.Hash]*agglayer.CertificateHeader{ - common.HexToHash("0x1"): {Status: agglayer.Settled}, - common.HexToHash("0x2"): {Status: agglayer.Settled}, + certificateHeaders: map[common.Hash]*agglayerTypes.CertificateHeader{ + common.HexToHash("0x1"): {Status: agglayerTypes.Settled}, + common.HexToHash("0x2"): {Status: agglayerTypes.Settled}, }, expectedInfoMessages: []string{ "certificate %s changed status to %s", @@ -204,9 +205,9 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { {CertificateID: common.HexToHash("0x1"), Height: 1}, {CertificateID: common.HexToHash("0x2"), Height: 2}, }, - certificateHeaders: map[common.Hash]*agglayer.CertificateHeader{ - common.HexToHash("0x1"): {Status: agglayer.InError}, - common.HexToHash("0x2"): {Status: agglayer.Settled}, + certificateHeaders: map[common.Hash]*agglayerTypes.CertificateHeader{ + common.HexToHash("0x1"): {Status: agglayerTypes.InError}, + common.HexToHash("0x2"): {Status: agglayerTypes.Settled}, }, expectedInfoMessages: []string{ "certificate %s changed status to %s", @@ -225,8 +226,8 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { pendingCertificates: []*aggsendertypes.CertificateInfo{ {CertificateID: common.HexToHash("0x1"), Height: 1}, }, - certificateHeaders: map[common.Hash]*agglayer.CertificateHeader{ - common.HexToHash("0x1"): {Status: agglayer.InError}, + certificateHeaders: map[common.Hash]*agglayerTypes.CertificateHeader{ + common.HexToHash("0x1"): {Status: agglayerTypes.InError}, }, clientError: fmt.Errorf("client error"), expectedErrorLogMessages: []string{ @@ -239,8 +240,8 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { pendingCertificates: []*aggsendertypes.CertificateInfo{ {CertificateID: common.HexToHash("0x1"), Height: 1}, }, - certificateHeaders: map[common.Hash]*agglayer.CertificateHeader{ - common.HexToHash("0x1"): {Status: agglayer.Settled}, + certificateHeaders: map[common.Hash]*agglayerTypes.CertificateHeader{ + common.HexToHash("0x1"): {Status: agglayerTypes.Settled}, }, updateDBError: fmt.Errorf("update error"), expectedErrorLogMessages: []string{ @@ -261,7 +262,7 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { mockAggLayerClient := agglayer.NewAgglayerClientMock(t) mockLogger := log.WithFields("test", "unittest") - mockStorage.On("GetCertificatesByStatus", agglayer.NonSettledStatuses).Return( + mockStorage.On("GetCertificatesByStatus", agglayerTypes.NonSettledStatuses).Return( tt.pendingCertificates, tt.getFromDBError) for certID, header := range tt.certificateHeaders { mockAggLayerClient.On("GetCertificateHeader", certID).Return(header, tt.clientError) @@ -358,16 +359,16 @@ func TestExploratoryGenerateCert(t *testing.T) { r, s, v, err := extractSignatureData(signature) require.NoError(t, err) - certificate := &agglayer.SignedCertificate{ - Certificate: &agglayer.Certificate{ + certificate := &agglayerTypes.SignedCertificate{ + Certificate: &agglayerTypes.Certificate{ NetworkID: 1, Height: 1, PrevLocalExitRoot: common.HexToHash("0x1"), NewLocalExitRoot: common.HexToHash("0x2"), - BridgeExits: []*agglayer.BridgeExit{ + BridgeExits: []*agglayerTypes.BridgeExit{ { - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x11"), }, @@ -377,16 +378,16 @@ func TestExploratoryGenerateCert(t *testing.T) { Metadata: []byte("metadata"), }, }, - ImportedBridgeExits: []*agglayer.ImportedBridgeExit{ + ImportedBridgeExits: []*agglayerTypes.ImportedBridgeExit{ { - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 1, LeafIndex: 11, }, - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x11"), }, @@ -395,20 +396,20 @@ func TestExploratoryGenerateCert(t *testing.T) { Amount: big.NewInt(100), Metadata: []byte("metadata"), }, - ClaimData: &agglayer.ClaimFromMainnnet{ - ProofLeafMER: &agglayer.MerkleProof{ + ClaimData: &agglayerTypes.ClaimFromMainnnet{ + ProofLeafMER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x1"), Proof: [32]common.Hash{}, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x3"), Proof: [32]common.Hash{}, }, - L1Leaf: &agglayer.L1InfoTreeLeaf{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: 1, RollupExitRoot: common.HexToHash("0x4"), MainnetExitRoot: common.HexToHash("0x5"), - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: common.HexToHash("0x6"), BlockHash: common.HexToHash("0x7"), Timestamp: 1231, @@ -418,7 +419,7 @@ func TestExploratoryGenerateCert(t *testing.T) { }, }, }, - Signature: &agglayer.Signature{ + Signature: &agglayerTypes.Signature{ R: r, S: s, OddParity: v, @@ -463,7 +464,7 @@ func TestSendCertificate_NoClaims(t *testing.T) { Height: 1, FromBlock: 0, ToBlock: 10, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, }, nil).Once() mockStorage.On("SaveLastSentCertificate", mock.Anything, mock.Anything).Return(nil).Once() mockL2Syncer.On("GetLastProcessedBlock", mock.Anything).Return(uint64(50), nil) @@ -471,7 +472,7 @@ func TestSendCertificate_NoClaims(t *testing.T) { { BlockNum: 30, BlockPos: 0, - LeafType: agglayer.LeafTypeAsset.Uint8(), + LeafType: agglayerTypes.LeafTypeAsset.Uint8(), OriginNetwork: 1, OriginAddress: common.HexToAddress("0x1"), DestinationNetwork: 2, @@ -699,7 +700,7 @@ func setupCase5Expectations(t *testing.T, testData *aggsenderTestData) { t.Helper() testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest) aggLayerCert := certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest) - aggLayerCert.Status = agglayer.Settled + aggLayerCert.Status = agglayerTypes.Settled testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest).Return(aggLayerCert, nil) @@ -782,11 +783,11 @@ func TestSendCertificate(t *testing.T) { mockFlow.On("GetCertificateBuildParams", mock.Anything).Return(&aggsendertypes.CertificateBuildParams{ Bridges: []bridgesync.Bridge{{}}, }, nil).Once() - mockFlow.On("BuildCertificate", mock.Anything, mock.Anything).Return(&agglayer.Certificate{ + mockFlow.On("BuildCertificate", mock.Anything, mock.Anything).Return(&agglayerTypes.Certificate{ NetworkID: 1, Height: 0, NewLocalExitRoot: common.HexToHash("0x1"), - BridgeExits: []*agglayer.BridgeExit{{}}, + BridgeExits: []*agglayerTypes.BridgeExit{{}}, }, nil).Once() mockAgglayerClient.On("SendCertificate", mock.Anything).Return(common.Hash{}, errors.New("some error")).Once() }, @@ -801,11 +802,11 @@ func TestSendCertificate(t *testing.T) { mockFlow.On("GetCertificateBuildParams", mock.Anything).Return(&aggsendertypes.CertificateBuildParams{ Bridges: []bridgesync.Bridge{{}}, }, nil).Once() - mockFlow.On("BuildCertificate", mock.Anything, mock.Anything).Return(&agglayer.Certificate{ + mockFlow.On("BuildCertificate", mock.Anything, mock.Anything).Return(&agglayerTypes.Certificate{ NetworkID: 11, Height: 0, NewLocalExitRoot: common.HexToHash("0x11"), - BridgeExits: []*agglayer.BridgeExit{{}}, + BridgeExits: []*agglayerTypes.BridgeExit{{}}, }, nil).Once() mockAgglayerClient.On("SendCertificate", mock.Anything).Return(common.HexToHash("0x22"), nil).Once() mockStorage.On("SaveLastSentCertificate", mock.Anything, mock.Anything).Return(errors.New("some error")).Once() @@ -821,11 +822,11 @@ func TestSendCertificate(t *testing.T) { mockFlow.On("GetCertificateBuildParams", mock.Anything).Return(&aggsendertypes.CertificateBuildParams{ Bridges: []bridgesync.Bridge{{}}, }, nil).Once() - mockFlow.On("BuildCertificate", mock.Anything, mock.Anything).Return(&agglayer.Certificate{ + mockFlow.On("BuildCertificate", mock.Anything, mock.Anything).Return(&agglayerTypes.Certificate{ NetworkID: 11, Height: 0, NewLocalExitRoot: common.HexToHash("0x11"), - BridgeExits: []*agglayer.BridgeExit{{}}, + BridgeExits: []*agglayerTypes.BridgeExit{{}}, }, nil).Once() mockAgglayerClient.On("SendCertificate", mock.Anything).Return(common.HexToHash("0x22"), nil).Once() mockStorage.On("SaveLastSentCertificate", mock.Anything, mock.Anything).Return(nil).Once() @@ -883,7 +884,7 @@ func TestLimitEpochPercent_Greater(t *testing.T) { testData.storageMock.EXPECT().GetLastSentCertificate().Return(&aggsendertypes.CertificateInfo{ FromBlock: 1, ToBlock: 20, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, }, nil).Once() testData.l2syncerMock.EXPECT().GetBridgesPublished(ctx, uint64(21), uint64(100)).Return(NewBridgesData(t, 0, []uint64{21, 21, 21, 22, 22, 22}), nil).Once() testData.l2syncerMock.EXPECT().GetClaims(ctx, uint64(21), uint64(100)).Return(nil, nil).Once() @@ -933,7 +934,7 @@ func NewBridgesData(t *testing.T, num int, blockNum []uint64) []bridgesync.Bridg res = append(res, bridgesync.Bridge{ BlockNum: blockNum[i%len(blockNum)], BlockPos: 0, - LeafType: agglayer.LeafTypeAsset.Uint8(), + LeafType: agglayerTypes.LeafTypeAsset.Uint8(), OriginNetwork: 1, }) } @@ -955,17 +956,19 @@ func NewClaimData(t *testing.T, num int, blockNum []uint64) []bridgesync.Claim { return res } -func certInfoToCertHeader(t *testing.T, certInfo *aggsendertypes.CertificateInfo, networkID uint32) *agglayer.CertificateHeader { +func certInfoToCertHeader(t *testing.T, + certInfo *aggsendertypes.CertificateInfo, + networkID uint32) *agglayerTypes.CertificateHeader { t.Helper() if certInfo == nil { return nil } - return &agglayer.CertificateHeader{ + return &agglayerTypes.CertificateHeader{ Height: certInfo.Height, NetworkID: networkID, CertificateID: certInfo.CertificateID, NewLocalExitRoot: certInfo.NewLocalExitRoot, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, Metadata: aggsendertypes.NewCertificateMetadata( certInfo.FromBlock, uint32(certInfo.FromBlock-certInfo.ToBlock), @@ -1019,13 +1022,13 @@ func newAggsenderTestData(t *testing.T, creationFlags testDataFlags) *aggsenderT Height: 0, CertificateID: common.HexToHash("0x1"), NewLocalExitRoot: common.HexToHash("0x2"), - Status: agglayer.Pending, + Status: agglayerTypes.Pending, }, { Height: 1, CertificateID: common.HexToHash("0x1a111"), NewLocalExitRoot: common.HexToHash("0x2a2"), - Status: agglayer.Pending, + Status: agglayerTypes.Pending, }, } diff --git a/aggsender/db/aggsender_db_storage.go b/aggsender/db/aggsender_db_storage.go index fb63b81d..dc22c63c 100644 --- a/aggsender/db/aggsender_db_storage.go +++ b/aggsender/db/aggsender_db_storage.go @@ -7,7 +7,7 @@ import ( "fmt" "strings" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/db/migrations" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/db" @@ -29,7 +29,7 @@ type AggSenderStorage interface { // DeleteCertificate deletes a certificate from the storage DeleteCertificate(ctx context.Context, certificateID common.Hash) error // GetCertificatesByStatus returns a list of certificates by their status - GetCertificatesByStatus(status []agglayer.CertificateStatus) ([]*types.CertificateInfo, error) + GetCertificatesByStatus(status []agglayerTypes.CertificateStatus) ([]*types.CertificateInfo, error) // UpdateCertificate updates certificate in db UpdateCertificate(ctx context.Context, certificate types.CertificateInfo) error } @@ -67,7 +67,7 @@ func NewAggSenderSQLStorage(logger *log.Logger, cfg AggSenderSQLStorageConfig) ( } func (a *AggSenderSQLStorage) GetCertificatesByStatus( - statuses []agglayer.CertificateStatus) ([]*types.CertificateInfo, error) { + statuses []agglayerTypes.CertificateStatus) ([]*types.CertificateInfo, error) { query := "SELECT * FROM certificate_info" args := make([]interface{}, len(statuses)) diff --git a/aggsender/db/aggsender_db_storage_test.go b/aggsender/db/aggsender_db_storage_test.go index e403ed03..ba193abc 100644 --- a/aggsender/db/aggsender_db_storage_test.go +++ b/aggsender/db/aggsender_db_storage_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/db" "github.com/agglayer/aggkit/log" @@ -38,7 +38,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x2"), FromBlock: 1, ToBlock: 2, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -58,7 +58,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x4"), FromBlock: 3, ToBlock: 4, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -85,7 +85,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x6"), FromBlock: 5, ToBlock: 6, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -116,7 +116,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x18"), FromBlock: 17, ToBlock: 18, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -138,7 +138,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x8"), FromBlock: 7, ToBlock: 8, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, CreatedAt: updateTime, UpdatedAt: updateTime, }, @@ -148,7 +148,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0xA"), FromBlock: 9, ToBlock: 10, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, CreatedAt: updateTime, UpdatedAt: updateTime, }, @@ -158,7 +158,7 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0xC"), FromBlock: 11, ToBlock: 12, - Status: agglayer.InError, + Status: agglayerTypes.InError, CreatedAt: updateTime, UpdatedAt: updateTime, }, @@ -169,28 +169,28 @@ func Test_Storage(t *testing.T) { } // Test fetching certificates with status Settled - statuses := []agglayer.CertificateStatus{agglayer.Settled} + statuses := []agglayerTypes.CertificateStatus{agglayerTypes.Settled} certificatesFromDB, err := storage.GetCertificatesByStatus(statuses) require.NoError(t, err) require.Len(t, certificatesFromDB, 1) require.ElementsMatch(t, []*types.CertificateInfo{certificates[0]}, certificatesFromDB) // Test fetching certificates with status Pending - statuses = []agglayer.CertificateStatus{agglayer.Pending} + statuses = []agglayerTypes.CertificateStatus{agglayerTypes.Pending} certificatesFromDB, err = storage.GetCertificatesByStatus(statuses) require.NoError(t, err) require.Len(t, certificatesFromDB, 1) require.ElementsMatch(t, []*types.CertificateInfo{certificates[1]}, certificatesFromDB) // Test fetching certificates with status InError - statuses = []agglayer.CertificateStatus{agglayer.InError} + statuses = []agglayerTypes.CertificateStatus{agglayerTypes.InError} certificatesFromDB, err = storage.GetCertificatesByStatus(statuses) require.NoError(t, err) require.Len(t, certificatesFromDB, 1) require.ElementsMatch(t, []*types.CertificateInfo{certificates[2]}, certificatesFromDB) // Test fetching certificates with status InError and Pending - statuses = []agglayer.CertificateStatus{agglayer.InError, agglayer.Pending} + statuses = []agglayerTypes.CertificateStatus{agglayerTypes.InError, agglayerTypes.Pending} certificatesFromDB, err = storage.GetCertificatesByStatus(statuses) require.NoError(t, err) require.Len(t, certificatesFromDB, 2) @@ -208,14 +208,14 @@ func Test_Storage(t *testing.T) { NewLocalExitRoot: common.HexToHash("0xE"), FromBlock: 13, ToBlock: 14, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, CreatedAt: updateTime, UpdatedAt: updateTime, } require.NoError(t, storage.SaveLastSentCertificate(ctx, certificate)) // Update the status of the certificate - certificate.Status = agglayer.Settled + certificate.Status = agglayerTypes.Settled certificate.UpdatedAt = updateTime + 1 require.NoError(t, storage.UpdateCertificate(ctx, certificate)) @@ -251,7 +251,7 @@ func Test_SaveLastSentCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x2"), FromBlock: 1, ToBlock: 2, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -270,7 +270,7 @@ func Test_SaveLastSentCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x4"), FromBlock: 3, ToBlock: 4, - Status: agglayer.InError, + Status: agglayerTypes.InError, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -283,7 +283,7 @@ func Test_SaveLastSentCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x6"), FromBlock: 3, ToBlock: 6, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, } require.NoError(t, storage.SaveLastSentCertificate(ctx, updatedCertificate)) @@ -301,7 +301,7 @@ func Test_SaveLastSentCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x8"), FromBlock: 7, ToBlock: 8, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, CreatedAt: updateTime, UpdatedAt: updateTime, } @@ -323,17 +323,17 @@ func Test_SaveLastSentCertificate(t *testing.T) { }) t.Run("SaveCertificate with raw data", func(t *testing.T) { - certfiicate := &agglayer.SignedCertificate{ - Certificate: &agglayer.Certificate{ + certfiicate := &agglayerTypes.SignedCertificate{ + Certificate: &agglayerTypes.Certificate{ NetworkID: 1, Height: 1, PrevLocalExitRoot: common.HexToHash("0x1"), NewLocalExitRoot: common.HexToHash("0x2"), Metadata: common.HexToHash("0x3"), - BridgeExits: []*agglayer.BridgeExit{ + BridgeExits: []*agglayerTypes.BridgeExit{ { - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x1"), }, @@ -343,9 +343,9 @@ func Test_SaveLastSentCertificate(t *testing.T) { Metadata: []byte("metadata"), }, }, - ImportedBridgeExits: []*agglayer.ImportedBridgeExit{}, + ImportedBridgeExits: []*agglayerTypes.ImportedBridgeExit{}, }, - Signature: &agglayer.Signature{ + Signature: &agglayerTypes.Signature{ R: common.HexToHash("0x4"), S: common.HexToHash("0x5"), OddParity: false, @@ -361,7 +361,7 @@ func Test_SaveLastSentCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x2"), FromBlock: 1, ToBlock: 10, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, CreatedAt: updateTime, UpdatedAt: updateTime, SignedCertificate: string(raw), @@ -399,7 +399,7 @@ func Test_StoragePreviousLER(t *testing.T) { certNoLER := types.CertificateInfo{ Height: 0, CertificateID: common.HexToHash("0x1"), - Status: agglayer.InError, + Status: agglayerTypes.InError, NewLocalExitRoot: common.HexToHash("0x2"), } err = storage.SaveLastSentCertificate(ctx, certNoLER) @@ -413,7 +413,7 @@ func Test_StoragePreviousLER(t *testing.T) { certLER := types.CertificateInfo{ Height: 1, CertificateID: common.HexToHash("0x2"), - Status: agglayer.InError, + Status: agglayerTypes.InError, NewLocalExitRoot: common.HexToHash("0x2"), PreviousLocalExitRoot: &common.Hash{}, } @@ -440,7 +440,7 @@ func Test_StorageFinalizedL1InfoRoot(t *testing.T) { certNoL1Root := types.CertificateInfo{ Height: 0, CertificateID: common.HexToHash("0x11"), - Status: agglayer.Settled, + Status: agglayerTypes.Settled, NewLocalExitRoot: common.HexToHash("0x22"), } require.NoError(t, storage.SaveLastSentCertificate(ctx, certNoL1Root)) @@ -453,7 +453,7 @@ func Test_StorageFinalizedL1InfoRoot(t *testing.T) { certWithL1Root := types.CertificateInfo{ Height: 1, CertificateID: common.HexToHash("0x22"), - Status: agglayer.Settled, + Status: agglayerTypes.Settled, NewLocalExitRoot: common.HexToHash("0x23"), FinalizedL1InfoTreeRoot: &common.Hash{}, } diff --git a/aggsender/epoch_notifier_per_block_test.go b/aggsender/epoch_notifier_per_block_test.go index b75d4cd8..b8d79fd5 100644 --- a/aggsender/epoch_notifier_per_block_test.go +++ b/aggsender/epoch_notifier_per_block_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/mocks" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/etherman" @@ -120,7 +121,7 @@ func TestNewConfigEpochNotifierPerBlock(t *testing.T) { aggLayerMock.On("GetEpochConfiguration").Return(nil, fmt.Errorf("error")).Once() _, err = NewConfigEpochNotifierPerBlock(aggLayerMock, 1) require.Error(t, err) - cfgAggLayer := &agglayer.ClockConfiguration{ + cfgAggLayer := &agglayerTypes.ClockConfiguration{ GenesisBlock: 123, EpochDuration: 456, } diff --git a/aggsender/flow_aggchain_prover.go b/aggsender/flow_aggchain_prover.go index 19d5c4b7..6ce0226f 100644 --- a/aggsender/flow_aggchain_prover.go +++ b/aggsender/flow_aggchain_prover.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggoracle/chaingerreader" "github.com/agglayer/aggkit/aggsender/db" "github.com/agglayer/aggkit/aggsender/grpc" @@ -71,7 +71,7 @@ func (a *aggchainProverFlow) GetCertificateBuildParams(ctx context.Context) (*ty buildParams *types.CertificateBuildParams ) - if lastSentCertificateInfo != nil && lastSentCertificateInfo.Status == agglayer.InError { + if lastSentCertificateInfo != nil && lastSentCertificateInfo.Status == agglayerTypes.InError { // if the last certificate was in error, we need to resend it a.log.Infof("resending the same InError certificate: %s", lastSentCertificateInfo.String()) @@ -308,8 +308,8 @@ func (a *aggchainProverFlow) getLatestProcessedFinalizedBlock(ctx context.Contex // getImportedBridgeExitsForProver converts the claims to imported bridge exits // so that the aggchain prover can use them to generate the aggchain proof func (a *aggchainProverFlow) getImportedBridgeExitsForProver( - claims []bridgesync.Claim) ([]*agglayer.ImportedBridgeExit, error) { - importedBridgeExits := make([]*agglayer.ImportedBridgeExit, 0, len(claims)) + claims []bridgesync.Claim) ([]*agglayerTypes.ImportedBridgeExit, error) { + importedBridgeExits := make([]*agglayerTypes.ImportedBridgeExit, 0, len(claims)) for _, claim := range claims { // we do not need claim data and proofs here, only imported bridge exit data like: // - bridge exit diff --git a/aggsender/flow_aggchain_prover_test.go b/aggsender/flow_aggchain_prover_test.go index 2211376e..572fbc7f 100644 --- a/aggsender/flow_aggchain_prover_test.go +++ b/aggsender/flow_aggchain_prover_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/mocks" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/bridgesync" @@ -25,22 +25,22 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { ctx := context.Background() - ibe1 := &agglayer.ImportedBridgeExit{ - BridgeExit: &agglayer.BridgeExit{ + ibe1 := &agglayerTypes.ImportedBridgeExit{ + BridgeExit: &agglayerTypes.BridgeExit{ LeafType: 0, - TokenInfo: &agglayer.TokenInfo{}, + TokenInfo: &agglayerTypes.TokenInfo{}, }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ LeafIndex: 1, }, } - ibe2 := &agglayer.ImportedBridgeExit{ - BridgeExit: &agglayer.BridgeExit{ + ibe2 := &agglayerTypes.ImportedBridgeExit{ + BridgeExit: &agglayerTypes.BridgeExit{ LeafType: 0, - TokenInfo: &agglayer.TokenInfo{}, + TokenInfo: &agglayerTypes.TokenInfo{}, }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ LeafIndex: 2, }, } @@ -80,7 +80,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { mockStorage.On("GetLastSentCertificate").Return(&types.CertificateInfo{ FromBlock: 1, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, }, nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(1), uint64(10)).Return([]bridgesync.Bridge{}, nil) }, @@ -98,7 +98,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { mockStorage.On("GetLastSentCertificate").Return(&types.CertificateInfo{ FromBlock: 1, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, }, nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(1), uint64(10)).Return([]bridgesync.Bridge{{}}, nil) mockL2Syncer.On("GetClaims", ctx, uint64(1), uint64(10)).Return([]bridgesync.Claim{{GlobalIndex: big.NewInt(1)}}, nil) @@ -118,7 +118,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { Hash: common.HexToHash("0x2"), }, treeTypes.Proof{}, make(map[common.Hash]treeTypes.Proof, 0), - []*agglayer.ImportedBridgeExit{ibe1}).Return(&types.AggchainProof{ + []*agglayerTypes.ImportedBridgeExit{ibe1}).Return(&types.AggchainProof{ Proof: []byte("some-proof"), StartBlock: 1, EndBlock: 10}, nil) }, expectedParams: &types.CertificateBuildParams{ @@ -132,7 +132,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { LastSentCertificate: &types.CertificateInfo{ FromBlock: 1, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, }, }, }, @@ -148,7 +148,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { mockStorage.On("GetLastSentCertificate").Return(&types.CertificateInfo{ FromBlock: 1, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, }, nil) mockL2Syncer.On("GetBridgesPublished", ctx, uint64(1), uint64(10)).Return([]bridgesync.Bridge{ {BlockNum: 5}, {BlockNum: 10}}, nil) @@ -170,7 +170,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { Hash: common.HexToHash("0x2"), }, treeTypes.Proof{}, make(map[common.Hash]treeTypes.Proof, 0), - []*agglayer.ImportedBridgeExit{ibe1, ibe2}).Return(&types.AggchainProof{ + []*agglayerTypes.ImportedBridgeExit{ibe1, ibe2}).Return(&types.AggchainProof{ Proof: []byte("some-proof"), StartBlock: 1, EndBlock: 8}, nil) }, expectedParams: &types.CertificateBuildParams{ @@ -184,7 +184,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { LastSentCertificate: &types.CertificateInfo{ FromBlock: 1, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, }, }, }, @@ -217,7 +217,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { Hash: common.HexToHash("0x2"), }, treeTypes.Proof{}, make(map[common.Hash]treeTypes.Proof, 0), - []*agglayer.ImportedBridgeExit{ibe1}).Return(nil, errors.New("some error")) + []*agglayerTypes.ImportedBridgeExit{ibe1}).Return(nil, errors.New("some error")) }, expectedError: "error fetching aggchain proof for block range 1 : 10 : some error", }, @@ -249,7 +249,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { BlockNumber: l1Header.Number.Uint64(), Hash: common.HexToHash("0x2"), }, treeTypes.Proof{}, make(map[common.Hash]treeTypes.Proof, 0), - []*agglayer.ImportedBridgeExit{ibe1}).Return(&types.AggchainProof{ + []*agglayerTypes.ImportedBridgeExit{ibe1}).Return(&types.AggchainProof{ Proof: []byte("some-proof"), StartBlock: 6, EndBlock: 10}, nil) }, expectedParams: &types.CertificateBuildParams{ @@ -294,7 +294,7 @@ func Test_AggchainProverFlow_GetCertificateBuildParams(t *testing.T) { BlockNumber: l1Header.Number.Uint64(), Hash: common.HexToHash("0x2"), }, treeTypes.Proof{}, make(map[common.Hash]treeTypes.Proof, 0), - []*agglayer.ImportedBridgeExit{ibe1, ibe2}).Return(&types.AggchainProof{ + []*agglayerTypes.ImportedBridgeExit{ibe1, ibe2}).Return(&types.AggchainProof{ Proof: []byte("some-proof"), StartBlock: 6, EndBlock: 8}, nil) }, expectedParams: &types.CertificateBuildParams{ @@ -652,7 +652,7 @@ func TestGetImportedBridgeExitsForProver(t *testing.T) { testCases := []struct { name string claims []bridgesync.Claim - expectedExits []*agglayer.ImportedBridgeExit + expectedExits []*agglayerTypes.ImportedBridgeExit expectedError string }{ { @@ -695,11 +695,11 @@ func TestGetImportedBridgeExitsForProver(t *testing.T) { GlobalIndex: big.NewInt(2), }, }, - expectedExits: []*agglayer.ImportedBridgeExit{ + expectedExits: []*agglayerTypes.ImportedBridgeExit{ { - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -708,16 +708,16 @@ func TestGetImportedBridgeExitsForProver(t *testing.T) { Amount: big.NewInt(100), Metadata: []byte("metadata"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 0, LeafIndex: 1, }, }, { - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeMessage, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeMessage, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -726,7 +726,7 @@ func TestGetImportedBridgeExitsForProver(t *testing.T) { Amount: big.NewInt(100), Metadata: []byte("metadata"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 0, LeafIndex: 2, diff --git a/aggsender/flow_base.go b/aggsender/flow_base.go index 61f22f7b..b523fa17 100644 --- a/aggsender/flow_base.go +++ b/aggsender/flow_base.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/db" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/bridgesync" @@ -103,7 +103,7 @@ func (f *baseFlow) getCertificateBuildParamsInternal(ctx context.Context) (*type // BuildCertificate builds a certificate based on the buildParams // this function is the implementation of the FlowManager interface func (f *baseFlow) BuildCertificate(ctx context.Context, - buildParams *types.CertificateBuildParams) (*agglayer.Certificate, error) { + buildParams *types.CertificateBuildParams) (*agglayerTypes.Certificate, error) { f.log.Infof("building certificate for %s estimatedSize=%d", buildParams.String(), buildParams.EstimatedSize()) @@ -144,7 +144,7 @@ func (f *baseFlow) limitCertSize(fullCert *types.CertificateBuildParams) (*types func (f *baseFlow) buildCertificate(ctx context.Context, certParams *types.CertificateBuildParams, - lastSentCertificateInfo *types.CertificateInfo) (*agglayer.Certificate, error) { + lastSentCertificateInfo *types.CertificateInfo) (*agglayerTypes.Certificate, error) { if certParams.IsEmpty() { return nil, errNoBridgesAndClaims } @@ -173,7 +173,7 @@ func (f *baseFlow) buildCertificate(ctx context.Context, certParams.CreatedAt, ) - return &agglayer.Certificate{ + return &agglayerTypes.Certificate{ NetworkID: f.l2Syncer.OriginNetwork(), PrevLocalExitRoot: previousLER, NewLocalExitRoot: exitRoot.Hash, @@ -205,16 +205,16 @@ func convertBridgeMetadata(metadata []byte, importedBridgeMetadataAsHash bool) ( } // convertClaimToImportedBridgeExit converts a claim to an ImportedBridgeExit object -func (f *baseFlow) convertClaimToImportedBridgeExit(claim bridgesync.Claim) (*agglayer.ImportedBridgeExit, error) { - leafType := agglayer.LeafTypeAsset +func (f *baseFlow) convertClaimToImportedBridgeExit(claim bridgesync.Claim) (*agglayerTypes.ImportedBridgeExit, error) { + leafType := agglayerTypes.LeafTypeAsset if claim.IsMessage { - leafType = agglayer.LeafTypeMessage + leafType = agglayerTypes.LeafTypeMessage } metaData, isMetadataIsHashed := convertBridgeMetadata(claim.Metadata, f.cfg.BridgeMetadataAsHash) - bridgeExit := &agglayer.BridgeExit{ + bridgeExit := &agglayerTypes.BridgeExit{ LeafType: leafType, - TokenInfo: &agglayer.TokenInfo{ + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: claim.OriginNetwork, OriginTokenAddress: claim.OriginAddress, }, @@ -230,9 +230,9 @@ func (f *baseFlow) convertClaimToImportedBridgeExit(claim bridgesync.Claim) (*ag return nil, fmt.Errorf("error decoding global index: %w", err) } - return &agglayer.ImportedBridgeExit{ + return &agglayerTypes.ImportedBridgeExit{ BridgeExit: bridgeExit, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: mainnetFlag, RollupIndex: rollupIndex, LeafIndex: leafIndex, @@ -241,14 +241,14 @@ func (f *baseFlow) convertClaimToImportedBridgeExit(claim bridgesync.Claim) (*ag } // getBridgeExits converts bridges to agglayer.BridgeExit objects -func (f *baseFlow) getBridgeExits(bridges []bridgesync.Bridge) []*agglayer.BridgeExit { - bridgeExits := make([]*agglayer.BridgeExit, 0, len(bridges)) +func (f *baseFlow) getBridgeExits(bridges []bridgesync.Bridge) []*agglayerTypes.BridgeExit { + bridgeExits := make([]*agglayerTypes.BridgeExit, 0, len(bridges)) for _, bridge := range bridges { metaData, isMetadataHashed := convertBridgeMetadata(bridge.Metadata, f.cfg.BridgeMetadataAsHash) - bridgeExits = append(bridgeExits, &agglayer.BridgeExit{ - LeafType: agglayer.LeafType(bridge.LeafType), - TokenInfo: &agglayer.TokenInfo{ + bridgeExits = append(bridgeExits, &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafType(bridge.LeafType), + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: bridge.OriginNetwork, OriginTokenAddress: bridge.OriginAddress, }, @@ -267,14 +267,14 @@ func (f *baseFlow) getBridgeExits(bridges []bridgesync.Bridge) []*agglayer.Bridg func (f *baseFlow) getImportedBridgeExits( ctx context.Context, claims []bridgesync.Claim, rootFromWhichToProove *treeTypes.Root, -) ([]*agglayer.ImportedBridgeExit, error) { +) ([]*agglayerTypes.ImportedBridgeExit, error) { if len(claims) == 0 { // no claims to convert - return []*agglayer.ImportedBridgeExit{}, nil + return []*agglayerTypes.ImportedBridgeExit{}, nil } var ( - importedBridgeExits = make([]*agglayer.ImportedBridgeExit, 0, len(claims)) + importedBridgeExits = make([]*agglayerTypes.ImportedBridgeExit, 0, len(claims)) rootToProve = rootFromWhichToProove ) @@ -305,48 +305,48 @@ func (f *baseFlow) getImportedBridgeExits( } if ibe.GlobalIndex.MainnetFlag { - ibe.ClaimData = &agglayer.ClaimFromMainnnet{ - L1Leaf: &agglayer.L1InfoTreeLeaf{ + ibe.ClaimData = &agglayerTypes.ClaimFromMainnnet{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: l1Info.L1InfoTreeIndex, RollupExitRoot: claim.RollupExitRoot, MainnetExitRoot: claim.MainnetExitRoot, - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: l1Info.GlobalExitRoot, Timestamp: l1Info.Timestamp, BlockHash: l1Info.PreviousBlockHash, }, }, - ProofLeafMER: &agglayer.MerkleProof{ + ProofLeafMER: &agglayerTypes.MerkleProof{ Root: claim.MainnetExitRoot, Proof: claim.ProofLocalExitRoot, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: rootToProve.Hash, Proof: gerToL1Proof, }, } } else { - ibe.ClaimData = &agglayer.ClaimFromRollup{ - L1Leaf: &agglayer.L1InfoTreeLeaf{ + ibe.ClaimData = &agglayerTypes.ClaimFromRollup{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: l1Info.L1InfoTreeIndex, RollupExitRoot: claim.RollupExitRoot, MainnetExitRoot: claim.MainnetExitRoot, - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: l1Info.GlobalExitRoot, Timestamp: l1Info.Timestamp, BlockHash: l1Info.PreviousBlockHash, }, }, - ProofLeafLER: &agglayer.MerkleProof{ + ProofLeafLER: &agglayerTypes.MerkleProof{ Root: tree.CalculateRoot(ibe.BridgeExit.Hash(), claim.ProofLocalExitRoot, ibe.GlobalIndex.LeafIndex), Proof: claim.ProofLocalExitRoot, }, - ProofLERToRER: &agglayer.MerkleProof{ + ProofLERToRER: &agglayerTypes.MerkleProof{ Root: claim.RollupExitRoot, Proof: claim.ProofRollupExitRoot, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: rootToProve.Hash, Proof: gerToL1Proof, }, @@ -411,7 +411,7 @@ func getLastSentBlockAndRetryCount(lastSentCertificateInfo *types.CertificateInf retryCount := 0 lastSentBlock := lastSentCertificateInfo.ToBlock - if lastSentCertificateInfo.Status == agglayer.InError { + if lastSentCertificateInfo.Status == agglayerTypes.InError { // if the last certificate was in error, we need to resend it // from the block before the error if lastSentCertificateInfo.FromBlock > 0 { diff --git a/aggsender/flow_pp_test.go b/aggsender/flow_pp_test.go index 3b1568fb..ccbdb193 100644 --- a/aggsender/flow_pp_test.go +++ b/aggsender/flow_pp_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/mocks" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/bridgesync" @@ -27,7 +27,7 @@ func TestConvertClaimToImportedBridgeExit(t *testing.T) { name string claim bridgesync.Claim expectedError bool - expectedExit *agglayer.ImportedBridgeExit + expectedExit *agglayerTypes.ImportedBridgeExit }{ { name: "Asset claim", @@ -42,10 +42,10 @@ func TestConvertClaimToImportedBridgeExit(t *testing.T) { GlobalIndex: big.NewInt(1), }, expectedError: false, - expectedExit: &agglayer.ImportedBridgeExit{ - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + expectedExit: &agglayerTypes.ImportedBridgeExit{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -54,7 +54,7 @@ func TestConvertClaimToImportedBridgeExit(t *testing.T) { Amount: big.NewInt(100), Metadata: []byte("metadata"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 0, LeafIndex: 1, @@ -74,10 +74,10 @@ func TestConvertClaimToImportedBridgeExit(t *testing.T) { GlobalIndex: big.NewInt(2), }, expectedError: false, - expectedExit: &agglayer.ImportedBridgeExit{ - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeMessage, - TokenInfo: &agglayer.TokenInfo{ + expectedExit: &agglayerTypes.ImportedBridgeExit{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeMessage, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -86,7 +86,7 @@ func TestConvertClaimToImportedBridgeExit(t *testing.T) { Amount: big.NewInt(100), Metadata: []byte("metadata"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 0, LeafIndex: 2, @@ -135,13 +135,13 @@ func TestGetBridgeExits(t *testing.T) { tests := []struct { name string bridges []bridgesync.Bridge - expectedExits []*agglayer.BridgeExit + expectedExits []*agglayerTypes.BridgeExit }{ { name: "Single bridge", bridges: []bridgesync.Bridge{ { - LeafType: agglayer.LeafTypeAsset.Uint8(), + LeafType: agglayerTypes.LeafTypeAsset.Uint8(), OriginNetwork: 1, OriginAddress: common.HexToAddress("0x123"), DestinationNetwork: 2, @@ -150,10 +150,10 @@ func TestGetBridgeExits(t *testing.T) { Metadata: []byte("metadata"), }, }, - expectedExits: []*agglayer.BridgeExit{ + expectedExits: []*agglayerTypes.BridgeExit{ { - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -168,7 +168,7 @@ func TestGetBridgeExits(t *testing.T) { name: "Multiple bridges", bridges: []bridgesync.Bridge{ { - LeafType: agglayer.LeafTypeAsset.Uint8(), + LeafType: agglayerTypes.LeafTypeAsset.Uint8(), OriginNetwork: 1, OriginAddress: common.HexToAddress("0x123"), DestinationNetwork: 2, @@ -177,7 +177,7 @@ func TestGetBridgeExits(t *testing.T) { Metadata: []byte("metadata"), }, { - LeafType: agglayer.LeafTypeMessage.Uint8(), + LeafType: agglayerTypes.LeafTypeMessage.Uint8(), OriginNetwork: 3, OriginAddress: common.HexToAddress("0x789"), DestinationNetwork: 4, @@ -186,10 +186,10 @@ func TestGetBridgeExits(t *testing.T) { Metadata: []byte("data"), }, }, - expectedExits: []*agglayer.BridgeExit{ + expectedExits: []*agglayerTypes.BridgeExit{ { - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -199,8 +199,8 @@ func TestGetBridgeExits(t *testing.T) { Metadata: []byte("metadata"), }, { - LeafType: agglayer.LeafTypeMessage, - TokenInfo: &agglayer.TokenInfo{ + LeafType: agglayerTypes.LeafTypeMessage, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 3, OriginTokenAddress: common.HexToAddress("0x789"), }, @@ -214,7 +214,7 @@ func TestGetBridgeExits(t *testing.T) { { name: "No bridges", bridges: []bridgesync.Bridge{}, - expectedExits: []*agglayer.BridgeExit{}, + expectedExits: []*agglayerTypes.BridgeExit{}, }, } @@ -252,7 +252,7 @@ func TestGetImportedBridgeExits(t *testing.T) { name string claims []bridgesync.Claim expectedError bool - expectedExits []*agglayer.ImportedBridgeExit + expectedExits []*agglayerTypes.ImportedBridgeExit }{ { name: "Single claim", @@ -274,11 +274,11 @@ func TestGetImportedBridgeExits(t *testing.T) { }, }, expectedError: false, - expectedExits: []*agglayer.ImportedBridgeExit{ + expectedExits: []*agglayerTypes.ImportedBridgeExit{ { - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x1234"), }, @@ -287,31 +287,31 @@ func TestGetImportedBridgeExits(t *testing.T) { Amount: big.NewInt(111), Metadata: []byte("metadata1"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 1, LeafIndex: 1, }, - ClaimData: &agglayer.ClaimFromRollup{ - L1Leaf: &agglayer.L1InfoTreeLeaf{ + ClaimData: &agglayerTypes.ClaimFromRollup{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: 1, RollupExitRoot: common.HexToHash("0xaaab"), MainnetExitRoot: common.HexToHash("0xbbba"), - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: common.HexToHash("0x7891"), Timestamp: 123456789, BlockHash: common.HexToHash("0xabc"), }, }, - ProofLeafLER: &agglayer.MerkleProof{ + ProofLeafLER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0xc52019815b51acf67a715cae6794a20083d63fd9af45783b7adf69123dae92c8"), Proof: mockProof, }, - ProofLERToRER: &agglayer.MerkleProof{ + ProofLERToRER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0xaaab"), Proof: mockProof, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x7891"), Proof: mockProof, }, @@ -354,11 +354,11 @@ func TestGetImportedBridgeExits(t *testing.T) { }, }, expectedError: false, - expectedExits: []*agglayer.ImportedBridgeExit{ + expectedExits: []*agglayerTypes.ImportedBridgeExit{ { - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -367,40 +367,40 @@ func TestGetImportedBridgeExits(t *testing.T) { Amount: big.NewInt(100), Metadata: []byte("metadata"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 0, LeafIndex: 1, }, - ClaimData: &agglayer.ClaimFromRollup{ - L1Leaf: &agglayer.L1InfoTreeLeaf{ + ClaimData: &agglayerTypes.ClaimFromRollup{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: 1, RollupExitRoot: common.HexToHash("0xaaa"), MainnetExitRoot: common.HexToHash("0xbbb"), - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: common.HexToHash("0x7891"), Timestamp: 123456789, BlockHash: common.HexToHash("0xabc"), }, }, - ProofLeafLER: &agglayer.MerkleProof{ + ProofLeafLER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x105e0f1144e57f6fb63f1dfc5083b1f59be3512be7cf5e63523779ad14a4d987"), Proof: mockProof, }, - ProofLERToRER: &agglayer.MerkleProof{ + ProofLERToRER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0xaaa"), Proof: mockProof, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x7891"), Proof: mockProof, }, }, }, { - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeMessage, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeMessage, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 3, OriginTokenAddress: common.HexToAddress("0x789"), }, @@ -409,27 +409,27 @@ func TestGetImportedBridgeExits(t *testing.T) { Amount: big.NewInt(200), Metadata: []byte("data"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: true, RollupIndex: 0, LeafIndex: 2, }, - ClaimData: &agglayer.ClaimFromMainnnet{ - L1Leaf: &agglayer.L1InfoTreeLeaf{ + ClaimData: &agglayerTypes.ClaimFromMainnnet{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: 1, RollupExitRoot: common.HexToHash("0xbbb"), MainnetExitRoot: common.HexToHash("0xccc"), - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: common.HexToHash("0x7891"), Timestamp: 123456789, BlockHash: common.HexToHash("0xabc"), }, }, - ProofLeafMER: &agglayer.MerkleProof{ + ProofLeafMER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0xccc"), Proof: mockProof, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x7891"), Proof: mockProof, }, @@ -441,7 +441,7 @@ func TestGetImportedBridgeExits(t *testing.T) { name: "No claims", claims: []bridgesync.Claim{}, expectedError: false, - expectedExits: []*agglayer.ImportedBridgeExit{}, + expectedExits: []*agglayerTypes.ImportedBridgeExit{}, }, } @@ -481,14 +481,14 @@ func TestBuildCertificate(t *testing.T) { fromBlock uint64 toBlock uint64 mockFn func() - expectedCert *agglayer.Certificate + expectedCert *agglayerTypes.Certificate expectedError bool }{ { name: "Valid certificate with bridges and claims", bridges: []bridgesync.Bridge{ { - LeafType: agglayer.LeafTypeAsset.Uint8(), + LeafType: agglayerTypes.LeafTypeAsset.Uint8(), OriginNetwork: 1, OriginAddress: common.HexToAddress("0x123"), DestinationNetwork: 2, @@ -518,19 +518,19 @@ func TestBuildCertificate(t *testing.T) { lastSentCertificateInfo: types.CertificateInfo{ NewLocalExitRoot: common.HexToHash("0x123"), Height: 1, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, }, fromBlock: 0, toBlock: 10, - expectedCert: &agglayer.Certificate{ + expectedCert: &agglayerTypes.Certificate{ NetworkID: 1, PrevLocalExitRoot: common.HexToHash("0x123"), NewLocalExitRoot: common.HexToHash("0x789"), Metadata: types.NewCertificateMetadata(0, 10, 0).ToHash(), - BridgeExits: []*agglayer.BridgeExit{ + BridgeExits: []*agglayerTypes.BridgeExit{ { - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x123"), }, @@ -540,11 +540,11 @@ func TestBuildCertificate(t *testing.T) { Metadata: []byte("metadata"), }, }, - ImportedBridgeExits: []*agglayer.ImportedBridgeExit{ + ImportedBridgeExits: []*agglayerTypes.ImportedBridgeExit{ { - BridgeExit: &agglayer.BridgeExit{ - LeafType: agglayer.LeafTypeAsset, - TokenInfo: &agglayer.TokenInfo{ + BridgeExit: &agglayerTypes.BridgeExit{ + LeafType: agglayerTypes.LeafTypeAsset, + TokenInfo: &agglayerTypes.TokenInfo{ OriginNetwork: 1, OriginTokenAddress: common.HexToAddress("0x1234"), }, @@ -553,31 +553,31 @@ func TestBuildCertificate(t *testing.T) { Amount: big.NewInt(111), Metadata: []byte("metadata1"), }, - GlobalIndex: &agglayer.GlobalIndex{ + GlobalIndex: &agglayerTypes.GlobalIndex{ MainnetFlag: false, RollupIndex: 0, LeafIndex: 1, }, - ClaimData: &agglayer.ClaimFromRollup{ - L1Leaf: &agglayer.L1InfoTreeLeaf{ + ClaimData: &agglayerTypes.ClaimFromRollup{ + L1Leaf: &agglayerTypes.L1InfoTreeLeaf{ L1InfoTreeIndex: 1, RollupExitRoot: common.HexToHash("0xaaab"), MainnetExitRoot: common.HexToHash("0xbbba"), - Inner: &agglayer.L1InfoTreeLeafInner{ + Inner: &agglayerTypes.L1InfoTreeLeafInner{ GlobalExitRoot: common.HexToHash("0x7891"), Timestamp: 123456789, BlockHash: common.HexToHash("0xabc"), }, }, - ProofLeafLER: &agglayer.MerkleProof{ + ProofLeafLER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0xc52019815b51acf67a715cae6794a20083d63fd9af45783b7adf69123dae92c8"), Proof: mockProof, }, - ProofLERToRER: &agglayer.MerkleProof{ + ProofLERToRER: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0xaaab"), Proof: mockProof, }, - ProofGERToL1Root: &agglayer.MerkleProof{ + ProofGERToL1Root: &agglayerTypes.MerkleProof{ Root: common.HexToHash("0x7891"), Proof: mockProof, }, @@ -615,7 +615,7 @@ func TestBuildCertificate(t *testing.T) { name: "Error getting imported bridge exits", bridges: []bridgesync.Bridge{ { - LeafType: agglayer.LeafTypeAsset.Uint8(), + LeafType: agglayerTypes.LeafTypeAsset.Uint8(), OriginNetwork: 1, OriginAddress: common.HexToAddress("0x123"), DestinationNetwork: 2, @@ -724,7 +724,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.Settled, + Status: agglayerTypes.Settled, }, expectedHeight: 11, expectedPreviousLER: common.HexToHash("0x123"), @@ -740,7 +740,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 0, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.InError, + Status: agglayerTypes.InError, PreviousLocalExitRoot: &ler1, }, expectedHeight: 0, @@ -751,7 +751,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 0, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.InError, + Status: agglayerTypes.InError, }, expectedHeight: 0, expectedPreviousLER: zeroLER, @@ -762,7 +762,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), PreviousLocalExitRoot: &ler1, - Status: agglayer.InError, + Status: agglayerTypes.InError, }, expectedHeight: 10, expectedPreviousLER: ler1, @@ -773,7 +773,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), PreviousLocalExitRoot: &ler1, - Status: agglayer.Pending, + Status: agglayerTypes.Pending, }, expectedHeight: 10, expectedPreviousLER: ler1, @@ -784,12 +784,12 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.InError, + Status: agglayerTypes.InError, }, lastSettleCertificateInfo: &types.CertificateInfo{ Height: 9, NewLocalExitRoot: common.HexToHash("0x3456"), - Status: agglayer.Settled, + Status: agglayerTypes.Settled, }, expectedHeight: 10, expectedPreviousLER: common.HexToHash("0x3456"), @@ -799,7 +799,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.InError, + Status: agglayerTypes.InError, }, lastSettleCertificateInfo: nil, lastSettleCertificateInfoError: errors.New("error getting last settle certificate"), @@ -810,7 +810,7 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.InError, + Status: agglayerTypes.InError, }, lastSettleCertificateInfoCall: true, lastSettleCertificateInfo: nil, @@ -822,12 +822,12 @@ func TestGetNextHeightAndPreviousLER(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ Height: 10, NewLocalExitRoot: common.HexToHash("0x123"), - Status: agglayer.InError, + Status: agglayerTypes.InError, }, lastSettleCertificateInfo: &types.CertificateInfo{ Height: 9, NewLocalExitRoot: common.HexToHash("0x3456"), - Status: agglayer.InError, + Status: agglayerTypes.InError, }, lastSettleCertificateInfoError: nil, expectedError: true, @@ -1096,7 +1096,7 @@ func TestGetLastSentBlockAndRetryCount(t *testing.T) { name: "Last sent certificate with no error", lastSentCertificateInfo: &types.CertificateInfo{ ToBlock: 10, - Status: agglayer.Settled, + Status: agglayerTypes.Settled, }, expectedBlock: 10, expectedRetryCount: 0, @@ -1106,7 +1106,7 @@ func TestGetLastSentBlockAndRetryCount(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ FromBlock: 5, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, RetryCount: 1, }, expectedBlock: 4, @@ -1117,7 +1117,7 @@ func TestGetLastSentBlockAndRetryCount(t *testing.T) { lastSentCertificateInfo: &types.CertificateInfo{ FromBlock: 0, ToBlock: 10, - Status: agglayer.InError, + Status: agglayerTypes.InError, RetryCount: 1, }, expectedBlock: 10, diff --git a/aggsender/grpc/aggchain_proof_client.go b/aggsender/grpc/aggchain_proof_client.go index 0d2bcf04..45447057 100644 --- a/aggsender/grpc/aggchain_proof_client.go +++ b/aggsender/grpc/aggchain_proof_client.go @@ -4,7 +4,7 @@ import ( "context" "time" - agglayer "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/types" aggkitCommon "github.com/agglayer/aggkit/common" "github.com/agglayer/aggkit/l1infotreesync" @@ -23,7 +23,7 @@ type AggchainProofClientInterface interface { l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf, l1InfoTreeMerkleProof treeTypes.Proof, gerInclusionProofs map[common.Hash]treeTypes.Proof, - importedBridgeExits []*agglayer.ImportedBridgeExit, + importedBridgeExits []*agglayerTypes.ImportedBridgeExit, ) (*types.AggchainProof, error) } @@ -50,7 +50,7 @@ func (c *AggchainProofClient) GenerateAggchainProof( l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf, l1InfoTreeMerkleProof treeTypes.Proof, gerInclusionProofs map[common.Hash]treeTypes.Proof, - importedBridgeExits []*agglayer.ImportedBridgeExit, + importedBridgeExits []*agglayerTypes.ImportedBridgeExit, ) (*types.AggchainProof, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute*TIMEOUT) defer cancel() diff --git a/aggsender/grpc/aggchain_proof_client_test.go b/aggsender/grpc/aggchain_proof_client_test.go index 535f72c0..a9b83a07 100644 --- a/aggsender/grpc/aggchain_proof_client_test.go +++ b/aggsender/grpc/aggchain_proof_client_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - agglayer "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/mocks" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/l1infotreesync" @@ -13,11 +13,6 @@ import ( "github.com/stretchr/testify/mock" ) -// MockAggchainProofServiceClient is a mock implementation of the AggchainProofServiceClient -type MockAggchainProofServiceClient struct { - mock.Mock -} - func TestGenerateAggchainProof_Success(t *testing.T) { mockClient := mocks.NewAggchainProofServiceClient(t) client := &AggchainProofClient{client: mockClient} @@ -51,7 +46,12 @@ func TestGenerateAggchainProof_Error(t *testing.T) { mockClient.On("GenerateAggchainProof", mock.Anything, mock.Anything).Return((*types.GenerateAggchainProofResponse)(nil), expectedError) - result, err := client.GenerateAggchainProof(300, 400, common.Hash{}, l1infotreesync.L1InfoTreeLeaf{}, [32]common.Hash{}, nil, make([]*agglayer.ImportedBridgeExit, 0)) + result, err := client.GenerateAggchainProof(300, 400, + common.Hash{}, + l1infotreesync.L1InfoTreeLeaf{}, + [32]common.Hash{}, nil, + make([]*agglayerTypes.ImportedBridgeExit, 0), + ) assert.Error(t, err) assert.Nil(t, result) diff --git a/aggsender/mocks/mock_agg_sender_storage.go b/aggsender/mocks/mock_agg_sender_storage.go index 93ca8563..c4d5320c 100644 --- a/aggsender/mocks/mock_agg_sender_storage.go +++ b/aggsender/mocks/mock_agg_sender_storage.go @@ -3,7 +3,7 @@ package mocks import ( - agglayer "github.com/agglayer/aggkit/agglayer" + agglayertypes "github.com/agglayer/aggkit/agglayer/types" common "github.com/ethereum/go-ethereum/common" context "context" @@ -132,7 +132,7 @@ func (_c *AggSenderStorage_GetCertificateByHeight_Call) RunAndReturn(run func(ui } // GetCertificatesByStatus provides a mock function with given fields: status -func (_m *AggSenderStorage) GetCertificatesByStatus(status []agglayer.CertificateStatus) ([]*types.CertificateInfo, error) { +func (_m *AggSenderStorage) GetCertificatesByStatus(status []agglayertypes.CertificateStatus) ([]*types.CertificateInfo, error) { ret := _m.Called(status) if len(ret) == 0 { @@ -141,10 +141,10 @@ func (_m *AggSenderStorage) GetCertificatesByStatus(status []agglayer.Certificat var r0 []*types.CertificateInfo var r1 error - if rf, ok := ret.Get(0).(func([]agglayer.CertificateStatus) ([]*types.CertificateInfo, error)); ok { + if rf, ok := ret.Get(0).(func([]agglayertypes.CertificateStatus) ([]*types.CertificateInfo, error)); ok { return rf(status) } - if rf, ok := ret.Get(0).(func([]agglayer.CertificateStatus) []*types.CertificateInfo); ok { + if rf, ok := ret.Get(0).(func([]agglayertypes.CertificateStatus) []*types.CertificateInfo); ok { r0 = rf(status) } else { if ret.Get(0) != nil { @@ -152,7 +152,7 @@ func (_m *AggSenderStorage) GetCertificatesByStatus(status []agglayer.Certificat } } - if rf, ok := ret.Get(1).(func([]agglayer.CertificateStatus) error); ok { + if rf, ok := ret.Get(1).(func([]agglayertypes.CertificateStatus) error); ok { r1 = rf(status) } else { r1 = ret.Error(1) @@ -167,14 +167,14 @@ type AggSenderStorage_GetCertificatesByStatus_Call struct { } // GetCertificatesByStatus is a helper method to define mock.On call -// - status []agglayer.CertificateStatus +// - status []agglayertypes.CertificateStatus func (_e *AggSenderStorage_Expecter) GetCertificatesByStatus(status interface{}) *AggSenderStorage_GetCertificatesByStatus_Call { return &AggSenderStorage_GetCertificatesByStatus_Call{Call: _e.mock.On("GetCertificatesByStatus", status)} } -func (_c *AggSenderStorage_GetCertificatesByStatus_Call) Run(run func(status []agglayer.CertificateStatus)) *AggSenderStorage_GetCertificatesByStatus_Call { +func (_c *AggSenderStorage_GetCertificatesByStatus_Call) Run(run func(status []agglayertypes.CertificateStatus)) *AggSenderStorage_GetCertificatesByStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]agglayer.CertificateStatus)) + run(args[0].([]agglayertypes.CertificateStatus)) }) return _c } @@ -184,12 +184,12 @@ func (_c *AggSenderStorage_GetCertificatesByStatus_Call) Return(_a0 []*types.Cer return _c } -func (_c *AggSenderStorage_GetCertificatesByStatus_Call) RunAndReturn(run func([]agglayer.CertificateStatus) ([]*types.CertificateInfo, error)) *AggSenderStorage_GetCertificatesByStatus_Call { +func (_c *AggSenderStorage_GetCertificatesByStatus_Call) RunAndReturn(run func([]agglayertypes.CertificateStatus) ([]*types.CertificateInfo, error)) *AggSenderStorage_GetCertificatesByStatus_Call { _c.Call.Return(run) return _c } -// GetLastSentCertificate provides a mock function with no fields +// GetLastSentCertificate provides a mock function with given fields: func (_m *AggSenderStorage) GetLastSentCertificate() (*types.CertificateInfo, error) { ret := _m.Called() diff --git a/aggsender/mocks/mock_aggchain_proof_client_interface.go b/aggsender/mocks/mock_aggchain_proof_client_interface.go index b8af0f2d..83fb663e 100644 --- a/aggsender/mocks/mock_aggchain_proof_client_interface.go +++ b/aggsender/mocks/mock_aggchain_proof_client_interface.go @@ -3,7 +3,7 @@ package mocks import ( - agglayer "github.com/agglayer/aggkit/agglayer" + agglayertypes "github.com/agglayer/aggkit/agglayer/types" aggsendertypes "github.com/agglayer/aggkit/aggsender/types" common "github.com/ethereum/go-ethereum/common" @@ -29,7 +29,7 @@ func (_m *AggchainProofClientInterface) EXPECT() *AggchainProofClientInterface_E } // GenerateAggchainProof provides a mock function with given fields: startBlock, maxEndBlock, l1InfoTreeRootHash, l1InfoTreeLeaf, l1InfoTreeMerkleProof, gerInclusionProofs, importedBridgeExits -func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, maxEndBlock uint64, l1InfoTreeRootHash common.Hash, l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf, l1InfoTreeMerkleProof types.Proof, gerInclusionProofs map[common.Hash]types.Proof, importedBridgeExits []*agglayer.ImportedBridgeExit) (*aggsendertypes.AggchainProof, error) { +func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, maxEndBlock uint64, l1InfoTreeRootHash common.Hash, l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf, l1InfoTreeMerkleProof types.Proof, gerInclusionProofs map[common.Hash]types.Proof, importedBridgeExits []*agglayertypes.ImportedBridgeExit) (*aggsendertypes.AggchainProof, error) { ret := _m.Called(startBlock, maxEndBlock, l1InfoTreeRootHash, l1InfoTreeLeaf, l1InfoTreeMerkleProof, gerInclusionProofs, importedBridgeExits) if len(ret) == 0 { @@ -38,10 +38,10 @@ func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, var r0 *aggsendertypes.AggchainProof var r1 error - if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayer.ImportedBridgeExit) (*aggsendertypes.AggchainProof, error)); ok { + if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayertypes.ImportedBridgeExit) (*aggsendertypes.AggchainProof, error)); ok { return rf(startBlock, maxEndBlock, l1InfoTreeRootHash, l1InfoTreeLeaf, l1InfoTreeMerkleProof, gerInclusionProofs, importedBridgeExits) } - if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayer.ImportedBridgeExit) *aggsendertypes.AggchainProof); ok { + if rf, ok := ret.Get(0).(func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayertypes.ImportedBridgeExit) *aggsendertypes.AggchainProof); ok { r0 = rf(startBlock, maxEndBlock, l1InfoTreeRootHash, l1InfoTreeLeaf, l1InfoTreeMerkleProof, gerInclusionProofs, importedBridgeExits) } else { if ret.Get(0) != nil { @@ -49,7 +49,7 @@ func (_m *AggchainProofClientInterface) GenerateAggchainProof(startBlock uint64, } } - if rf, ok := ret.Get(1).(func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayer.ImportedBridgeExit) error); ok { + if rf, ok := ret.Get(1).(func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayertypes.ImportedBridgeExit) error); ok { r1 = rf(startBlock, maxEndBlock, l1InfoTreeRootHash, l1InfoTreeLeaf, l1InfoTreeMerkleProof, gerInclusionProofs, importedBridgeExits) } else { r1 = ret.Error(1) @@ -70,14 +70,14 @@ type AggchainProofClientInterface_GenerateAggchainProof_Call struct { // - l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf // - l1InfoTreeMerkleProof types.Proof // - gerInclusionProofs map[common.Hash]types.Proof -// - importedBridgeExits []*agglayer.ImportedBridgeExit +// - importedBridgeExits []*agglayertypes.ImportedBridgeExit func (_e *AggchainProofClientInterface_Expecter) GenerateAggchainProof(startBlock interface{}, maxEndBlock interface{}, l1InfoTreeRootHash interface{}, l1InfoTreeLeaf interface{}, l1InfoTreeMerkleProof interface{}, gerInclusionProofs interface{}, importedBridgeExits interface{}) *AggchainProofClientInterface_GenerateAggchainProof_Call { return &AggchainProofClientInterface_GenerateAggchainProof_Call{Call: _e.mock.On("GenerateAggchainProof", startBlock, maxEndBlock, l1InfoTreeRootHash, l1InfoTreeLeaf, l1InfoTreeMerkleProof, gerInclusionProofs, importedBridgeExits)} } -func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) Run(run func(startBlock uint64, maxEndBlock uint64, l1InfoTreeRootHash common.Hash, l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf, l1InfoTreeMerkleProof types.Proof, gerInclusionProofs map[common.Hash]types.Proof, importedBridgeExits []*agglayer.ImportedBridgeExit)) *AggchainProofClientInterface_GenerateAggchainProof_Call { +func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) Run(run func(startBlock uint64, maxEndBlock uint64, l1InfoTreeRootHash common.Hash, l1InfoTreeLeaf l1infotreesync.L1InfoTreeLeaf, l1InfoTreeMerkleProof types.Proof, gerInclusionProofs map[common.Hash]types.Proof, importedBridgeExits []*agglayertypes.ImportedBridgeExit)) *AggchainProofClientInterface_GenerateAggchainProof_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(uint64), args[2].(common.Hash), args[3].(l1infotreesync.L1InfoTreeLeaf), args[4].(types.Proof), args[5].(map[common.Hash]types.Proof), args[6].([]*agglayer.ImportedBridgeExit)) + run(args[0].(uint64), args[1].(uint64), args[2].(common.Hash), args[3].(l1infotreesync.L1InfoTreeLeaf), args[4].(types.Proof), args[5].(map[common.Hash]types.Proof), args[6].([]*agglayertypes.ImportedBridgeExit)) }) return _c } @@ -87,7 +87,7 @@ func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) Return(_a0 *a return _c } -func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) RunAndReturn(run func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayer.ImportedBridgeExit) (*aggsendertypes.AggchainProof, error)) *AggchainProofClientInterface_GenerateAggchainProof_Call { +func (_c *AggchainProofClientInterface_GenerateAggchainProof_Call) RunAndReturn(run func(uint64, uint64, common.Hash, l1infotreesync.L1InfoTreeLeaf, types.Proof, map[common.Hash]types.Proof, []*agglayertypes.ImportedBridgeExit) (*aggsendertypes.AggchainProof, error)) *AggchainProofClientInterface_GenerateAggchainProof_Call { _c.Call.Return(run) return _c } diff --git a/aggsender/mocks/mock_aggchain_proof_service_server.go b/aggsender/mocks/mock_aggchain_proof_service_server.go index add0644d..bf04711d 100644 --- a/aggsender/mocks/mock_aggchain_proof_service_server.go +++ b/aggsender/mocks/mock_aggchain_proof_service_server.go @@ -81,7 +81,7 @@ func (_c *AggchainProofServiceServer_GenerateAggchainProof_Call) RunAndReturn(ru return _c } -// mustEmbedUnimplementedAggchainProofServiceServer provides a mock function with no fields +// mustEmbedUnimplementedAggchainProofServiceServer provides a mock function with given fields: func (_m *AggchainProofServiceServer) mustEmbedUnimplementedAggchainProofServiceServer() { _m.Called() } @@ -109,7 +109,7 @@ func (_c *AggchainProofServiceServer_mustEmbedUnimplementedAggchainProofServiceS } func (_c *AggchainProofServiceServer_mustEmbedUnimplementedAggchainProofServiceServer_Call) RunAndReturn(run func()) *AggchainProofServiceServer_mustEmbedUnimplementedAggchainProofServiceServer_Call { - _c.Run(run) + _c.Call.Return(run) return _c } diff --git a/aggsender/mocks/mock_aggsender_flow.go b/aggsender/mocks/mock_aggsender_flow.go index 0b7c6192..a2241837 100644 --- a/aggsender/mocks/mock_aggsender_flow.go +++ b/aggsender/mocks/mock_aggsender_flow.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - agglayer "github.com/agglayer/aggkit/agglayer" + agglayertypes "github.com/agglayer/aggkit/agglayer/types" mock "github.com/stretchr/testify/mock" @@ -26,23 +26,23 @@ func (_m *AggsenderFlow) EXPECT() *AggsenderFlow_Expecter { } // BuildCertificate provides a mock function with given fields: ctx, buildParams -func (_m *AggsenderFlow) BuildCertificate(ctx context.Context, buildParams *types.CertificateBuildParams) (*agglayer.Certificate, error) { +func (_m *AggsenderFlow) BuildCertificate(ctx context.Context, buildParams *types.CertificateBuildParams) (*agglayertypes.Certificate, error) { ret := _m.Called(ctx, buildParams) if len(ret) == 0 { panic("no return value specified for BuildCertificate") } - var r0 *agglayer.Certificate + var r0 *agglayertypes.Certificate var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.CertificateBuildParams) (*agglayer.Certificate, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.CertificateBuildParams) (*agglayertypes.Certificate, error)); ok { return rf(ctx, buildParams) } - if rf, ok := ret.Get(0).(func(context.Context, *types.CertificateBuildParams) *agglayer.Certificate); ok { + if rf, ok := ret.Get(0).(func(context.Context, *types.CertificateBuildParams) *agglayertypes.Certificate); ok { r0 = rf(ctx, buildParams) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*agglayer.Certificate) + r0 = ret.Get(0).(*agglayertypes.Certificate) } } @@ -74,12 +74,12 @@ func (_c *AggsenderFlow_BuildCertificate_Call) Run(run func(ctx context.Context, return _c } -func (_c *AggsenderFlow_BuildCertificate_Call) Return(_a0 *agglayer.Certificate, _a1 error) *AggsenderFlow_BuildCertificate_Call { +func (_c *AggsenderFlow_BuildCertificate_Call) Return(_a0 *agglayertypes.Certificate, _a1 error) *AggsenderFlow_BuildCertificate_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AggsenderFlow_BuildCertificate_Call) RunAndReturn(run func(context.Context, *types.CertificateBuildParams) (*agglayer.Certificate, error)) *AggsenderFlow_BuildCertificate_Call { +func (_c *AggsenderFlow_BuildCertificate_Call) RunAndReturn(run func(context.Context, *types.CertificateBuildParams) (*agglayertypes.Certificate, error)) *AggsenderFlow_BuildCertificate_Call { _c.Call.Return(run) return _c } diff --git a/aggsender/types/types.go b/aggsender/types/types.go index 0c4d134f..c802444a 100644 --- a/aggsender/types/types.go +++ b/aggsender/types/types.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/bridgesync" "github.com/agglayer/aggkit/etherman" "github.com/agglayer/aggkit/l1infotreesync" @@ -29,7 +29,8 @@ type AggsenderFlow interface { // GetCertificateBuildParams returns the parameters to build a certificate GetCertificateBuildParams(ctx context.Context) (*CertificateBuildParams, error) // BuildCertificate builds a certificate based on the buildParams - BuildCertificate(ctx context.Context, buildParams *CertificateBuildParams) (*agglayer.Certificate, error) + BuildCertificate(ctx context.Context, + buildParams *CertificateBuildParams) (*agglayerTypes.Certificate, error) } // L1InfoTreeSyncer is an interface defining functions that an L1InfoTreeSyncer should implement @@ -95,16 +96,16 @@ type CertificateInfo struct { RetryCount int `meddler:"retry_count"` CertificateID common.Hash `meddler:"certificate_id,hash"` // PreviousLocalExitRoot if it's nil means no reported - PreviousLocalExitRoot *common.Hash `meddler:"previous_local_exit_root,hash"` - NewLocalExitRoot common.Hash `meddler:"new_local_exit_root,hash"` - FromBlock uint64 `meddler:"from_block"` - ToBlock uint64 `meddler:"to_block"` - Status agglayer.CertificateStatus `meddler:"status"` - CreatedAt uint32 `meddler:"created_at"` - UpdatedAt uint32 `meddler:"updated_at"` - SignedCertificate string `meddler:"signed_certificate"` - AggchainProof []byte `meddler:"aggchain_proof"` - FinalizedL1InfoTreeRoot *common.Hash `meddler:"finalized_l1_info_tree_root,hash"` + PreviousLocalExitRoot *common.Hash `meddler:"previous_local_exit_root,hash"` + NewLocalExitRoot common.Hash `meddler:"new_local_exit_root,hash"` + FromBlock uint64 `meddler:"from_block"` + ToBlock uint64 `meddler:"to_block"` + Status agglayerTypes.CertificateStatus `meddler:"status"` + CreatedAt uint32 `meddler:"created_at"` + UpdatedAt uint32 `meddler:"updated_at"` + SignedCertificate string `meddler:"signed_certificate"` + AggchainProof []byte `meddler:"aggchain_proof"` + FinalizedL1InfoTreeRoot *common.Hash `meddler:"finalized_l1_info_tree_root,hash"` } func (c *CertificateInfo) String() string { diff --git a/tools/aggsender_find_imported_bridge/aggsender_find_imported_bridge.go b/tools/aggsender_find_imported_bridge/aggsender_find_imported_bridge.go index 4ceabb80..8de0abea 100644 --- a/tools/aggsender_find_imported_bridge/aggsender_find_imported_bridge.go +++ b/tools/aggsender_find_imported_bridge/aggsender_find_imported_bridge.go @@ -6,7 +6,7 @@ import ( "math/big" "os" - "github.com/agglayer/aggkit/agglayer" + agglayerTypes "github.com/agglayer/aggkit/agglayer/types" "github.com/agglayer/aggkit/aggsender/rpcclient" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/bridgesync" @@ -24,8 +24,8 @@ const ( minimumNumArgs = 3 ) -func unmarshalGlobalIndex(globalIndex string) (*agglayer.GlobalIndex, error) { - var globalIndexParsed agglayer.GlobalIndex +func unmarshalGlobalIndex(globalIndex string) (*agglayerTypes.GlobalIndex, error) { + var globalIndexParsed agglayerTypes.GlobalIndex // First try if it's already decomposed err := json.Unmarshal([]byte(globalIndex), &globalIndexParsed) if err != nil { @@ -47,11 +47,11 @@ func unmarshalGlobalIndex(globalIndex string) (*agglayer.GlobalIndex, error) { // This function find out the certificate for a deposit // It use the aggsender RPC -func certContainsGlobalIndex(cert *types.CertificateInfo, globalIndex *agglayer.GlobalIndex) (bool, error) { +func certContainsGlobalIndex(cert *types.CertificateInfo, globalIndex *agglayerTypes.GlobalIndex) (bool, error) { if cert == nil { return false, nil } - var certSigned agglayer.SignedCertificate + var certSigned agglayerTypes.SignedCertificate err := json.Unmarshal([]byte(cert.SignedCertificate), &certSigned) if err != nil { log.Debugf("cert: %v", cert.SignedCertificate) From 45cab15cedb9f3135a02045f85eab11a427783fa Mon Sep 17 00:00:00 2001 From: Goran Rojovic Date: Mon, 24 Feb 2025 11:01:02 +0100 Subject: [PATCH 4/9] feat: agglayer grpc client --- agglayer/client.go | 12 +- agglayer/grpc/agglayer_grpc_client.go | 112 +++++- agglayer/mock_agglayer_client.go | 250 ++++--------- .../node/agglayer_network_state_service.pb.go | 344 +++++++++++++----- .../node/agglayer_network_state_service.proto | 17 +- .../agglayer_network_state_service_grpc.pb.go | 40 ++ aggsender/aggsender.go | 6 +- aggsender/aggsender_initial_state.go | 8 +- aggsender/aggsender_test.go | 64 ++-- aggsender/epoch_notifier_per_block.go | 5 +- aggsender/epoch_notifier_per_block_test.go | 11 +- cmd/run.go | 13 +- 12 files changed, 550 insertions(+), 332 deletions(-) diff --git a/agglayer/client.go b/agglayer/client.go index 87f624ea..2a73f929 100644 --- a/agglayer/client.go +++ b/agglayer/client.go @@ -22,20 +22,18 @@ var ( ) type AggLayerClientGetEpochConfiguration interface { - GetEpochConfiguration() (*types.ClockConfiguration, error) + GetEpochConfiguration(ctx context.Context) (*types.ClockConfiguration, error) } type AggLayerClientRecoveryQuerier interface { - GetLatestSettledCertificateHeader(networkID uint32) (*types.CertificateHeader, error) - GetLatestPendingCertificateHeader(networkID uint32) (*types.CertificateHeader, error) + GetLatestSettledCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error) + GetLatestPendingCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error) } // AgglayerClientInterface is the interface that defines the methods that the AggLayerClient will implement type AgglayerClientInterface interface { - SendTx(signedTx SignedTx) (common.Hash, error) - WaitTxToBeMined(hash common.Hash, ctx context.Context) error - SendCertificate(certificate *types.SignedCertificate) (common.Hash, error) - GetCertificateHeader(certificateHash common.Hash) (*types.CertificateHeader, error) + SendCertificate(ctx context.Context, certificate *types.SignedCertificate) (common.Hash, error) + GetCertificateHeader(ctx context.Context, certificateHash common.Hash) (*types.CertificateHeader, error) AggLayerClientGetEpochConfiguration AggLayerClientRecoveryQuerier } diff --git a/agglayer/grpc/agglayer_grpc_client.go b/agglayer/grpc/agglayer_grpc_client.go index 224184c4..01f00ac4 100644 --- a/agglayer/grpc/agglayer_grpc_client.go +++ b/agglayer/grpc/agglayer_grpc_client.go @@ -1,8 +1,14 @@ package grpc import ( + "context" + "errors" + "github.com/agglayer/aggkit/agglayer/proto/node" - "github.com/agglayer/aggkit/common" + protoTypes "github.com/agglayer/aggkit/agglayer/proto/types" + "github.com/agglayer/aggkit/agglayer/types" + aggkitCommon "github.com/agglayer/aggkit/common" + "github.com/ethereum/go-ethereum/common" ) type AgglayerGRPCClient struct { @@ -13,7 +19,7 @@ type AgglayerGRPCClient struct { // NewAggchainProofClient initializes a new AggchainProof instance func NewAgglayerGRPCClient(serverAddr string) (*AgglayerGRPCClient, error) { - grpcClient, err := common.NewClient(serverAddr) + grpcClient, err := aggkitCommon.NewClient(serverAddr) if err != nil { return nil, err } @@ -23,3 +29,105 @@ func NewAgglayerGRPCClient(serverAddr string) (*AgglayerGRPCClient, error) { submissionService: node.NewAgglayerCertificateSubmissionServiceClient(grpcClient.Conn()), }, nil } + +// GetEpochConfiguration returns the epoch configuration from the AggLayer +func (a *AgglayerGRPCClient) GetEpochConfiguration(ctx context.Context) (*types.ClockConfiguration, error) { + response, err := a.cfgService.GetEpochConfiguration(ctx, &node.GetEpochConfigurationRequest{}) + if err != nil { + return nil, err + } + + return &types.ClockConfiguration{ + EpochDuration: response.EpochConfiguration.EpochDuration, + GenesisBlock: response.EpochConfiguration.GenesisBlock, + }, nil +} + +func (a *AgglayerGRPCClient) SendCertificate(ctx context.Context, + certificate *types.SignedCertificate) (common.Hash, error) { + response, err := a.submissionService.SubmitCertificate(ctx, &node.SubmitCertificateRequest{ + Certificate: &protoTypes.Certificate{ + NetworkId: certificate.NetworkID, + Height: certificate.Height, + }, + }) + + if err != nil { + return common.Hash{}, err + } + + return common.BytesToHash(response.CertificateId.Value.Value), nil +} + +// GetCertificateHeader returns the certificate header from the AggLayer for the given certificate ID +func (a *AgglayerGRPCClient) GetCertificateHeader(ctx context.Context, + certificateID common.Hash) (*types.CertificateHeader, error) { + response, err := a.networkStateService.GetCertificateHeader(ctx, + &node.GetCertificateHeaderRequest{CertificateId: &protoTypes.CertificateId{ + Value: &protoTypes.FixedBytes32{ + Value: certificateID.Bytes(), + }, + }, + }) + if err != nil { + return nil, err + } + + return convertProtoCertificateHeader(response.CertificateHeader), nil +} + +// GetLatestPendingCertificateHeader returns the latest pending certificate header from the AggLayer +func (a *AgglayerGRPCClient) GetLatestSettledCertificateHeader( + ctx context.Context, networkID uint32) (*types.CertificateHeader, error) { + response, err := a.networkStateService.GetLatestSettledCertificateHeader(ctx, + &node.GetLatestSettledCertificateHeaderRequest{NetworkId: networkID}) + if err != nil { + return nil, err + } + + return convertProtoCertificateHeader(response.CertificateHeader), nil +} + +// GetLatestPendingCertificateHeader returns the latest pending certificate header from the AggLayer +func (a *AgglayerGRPCClient) GetLatestPendingCertificateHeader( + ctx context.Context, networkID uint32) (*types.CertificateHeader, error) { + response, err := a.networkStateService.GetLatestPendingCertificateHeader(ctx, + &node.GetLatestPendingCertificateHeaderRequest{NetworkId: networkID}) + if err != nil { + return nil, err + } + + return convertProtoCertificateHeader(response.CertificateHeader), nil +} + +// convertProtoCertificateHeader converts a proto certificate header to a types certificate header +func convertProtoCertificateHeader(response *protoTypes.CertificateHeader) *types.CertificateHeader { + header := &types.CertificateHeader{ + NetworkID: response.NetworkId, + Height: response.Height, + EpochNumber: response.EpochNumber, + CertificateIndex: response.CertificateIndex, + CertificateID: common.BytesToHash(response.CertificateId.Value.Value), + PreviousLocalExitRoot: nullableBytesToHash(response.PrevLocalExitRoot.Value), + NewLocalExitRoot: common.BytesToHash(response.NewLocalExitRoot.Value), + Status: types.CertificateStatus(response.Status), + Metadata: common.BytesToHash(response.Metadata.Value), + // AggchainProof - TODO + } + + if response.Error != nil && response.Error.Message != nil { + header.Error = errors.New(string(response.Error.Message)) + } + + return header +} + +// nullableBytesToHash converts a nullable byte slice to a hash pointer +func nullableBytesToHash(b []byte) *common.Hash { + if len(b) == 0 { + return nil + } + + hash := common.BytesToHash(b) + return &hash +} diff --git a/agglayer/mock_agglayer_client.go b/agglayer/mock_agglayer_client.go index 56adc5a0..9bfa0863 100644 --- a/agglayer/mock_agglayer_client.go +++ b/agglayer/mock_agglayer_client.go @@ -25,9 +25,9 @@ func (_m *AgglayerClientMock) EXPECT() *AgglayerClientMock_Expecter { return &AgglayerClientMock_Expecter{mock: &_m.Mock} } -// GetCertificateHeader provides a mock function with given fields: certificateHash -func (_m *AgglayerClientMock) GetCertificateHeader(certificateHash common.Hash) (*types.CertificateHeader, error) { - ret := _m.Called(certificateHash) +// GetCertificateHeader provides a mock function with given fields: ctx, certificateHash +func (_m *AgglayerClientMock) GetCertificateHeader(ctx context.Context, certificateHash common.Hash) (*types.CertificateHeader, error) { + ret := _m.Called(ctx, certificateHash) if len(ret) == 0 { panic("no return value specified for GetCertificateHeader") @@ -35,19 +35,19 @@ func (_m *AgglayerClientMock) GetCertificateHeader(certificateHash common.Hash) var r0 *types.CertificateHeader var r1 error - if rf, ok := ret.Get(0).(func(common.Hash) (*types.CertificateHeader, error)); ok { - return rf(certificateHash) + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (*types.CertificateHeader, error)); ok { + return rf(ctx, certificateHash) } - if rf, ok := ret.Get(0).(func(common.Hash) *types.CertificateHeader); ok { - r0 = rf(certificateHash) + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) *types.CertificateHeader); ok { + r0 = rf(ctx, certificateHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.CertificateHeader) } } - if rf, ok := ret.Get(1).(func(common.Hash) error); ok { - r1 = rf(certificateHash) + if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok { + r1 = rf(ctx, certificateHash) } else { r1 = ret.Error(1) } @@ -61,14 +61,15 @@ type AgglayerClientMock_GetCertificateHeader_Call struct { } // GetCertificateHeader is a helper method to define mock.On call +// - ctx context.Context // - certificateHash common.Hash -func (_e *AgglayerClientMock_Expecter) GetCertificateHeader(certificateHash interface{}) *AgglayerClientMock_GetCertificateHeader_Call { - return &AgglayerClientMock_GetCertificateHeader_Call{Call: _e.mock.On("GetCertificateHeader", certificateHash)} +func (_e *AgglayerClientMock_Expecter) GetCertificateHeader(ctx interface{}, certificateHash interface{}) *AgglayerClientMock_GetCertificateHeader_Call { + return &AgglayerClientMock_GetCertificateHeader_Call{Call: _e.mock.On("GetCertificateHeader", ctx, certificateHash)} } -func (_c *AgglayerClientMock_GetCertificateHeader_Call) Run(run func(certificateHash common.Hash)) *AgglayerClientMock_GetCertificateHeader_Call { +func (_c *AgglayerClientMock_GetCertificateHeader_Call) Run(run func(ctx context.Context, certificateHash common.Hash)) *AgglayerClientMock_GetCertificateHeader_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Hash)) + run(args[0].(context.Context), args[1].(common.Hash)) }) return _c } @@ -78,14 +79,14 @@ func (_c *AgglayerClientMock_GetCertificateHeader_Call) Return(_a0 *types.Certif return _c } -func (_c *AgglayerClientMock_GetCertificateHeader_Call) RunAndReturn(run func(common.Hash) (*types.CertificateHeader, error)) *AgglayerClientMock_GetCertificateHeader_Call { +func (_c *AgglayerClientMock_GetCertificateHeader_Call) RunAndReturn(run func(context.Context, common.Hash) (*types.CertificateHeader, error)) *AgglayerClientMock_GetCertificateHeader_Call { _c.Call.Return(run) return _c } -// GetEpochConfiguration provides a mock function with given fields: -func (_m *AgglayerClientMock) GetEpochConfiguration() (*types.ClockConfiguration, error) { - ret := _m.Called() +// GetEpochConfiguration provides a mock function with given fields: ctx +func (_m *AgglayerClientMock) GetEpochConfiguration(ctx context.Context) (*types.ClockConfiguration, error) { + ret := _m.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetEpochConfiguration") @@ -93,19 +94,19 @@ func (_m *AgglayerClientMock) GetEpochConfiguration() (*types.ClockConfiguration var r0 *types.ClockConfiguration var r1 error - if rf, ok := ret.Get(0).(func() (*types.ClockConfiguration, error)); ok { - return rf() + if rf, ok := ret.Get(0).(func(context.Context) (*types.ClockConfiguration, error)); ok { + return rf(ctx) } - if rf, ok := ret.Get(0).(func() *types.ClockConfiguration); ok { - r0 = rf() + if rf, ok := ret.Get(0).(func(context.Context) *types.ClockConfiguration); ok { + r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ClockConfiguration) } } - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) } else { r1 = ret.Error(1) } @@ -119,13 +120,14 @@ type AgglayerClientMock_GetEpochConfiguration_Call struct { } // GetEpochConfiguration is a helper method to define mock.On call -func (_e *AgglayerClientMock_Expecter) GetEpochConfiguration() *AgglayerClientMock_GetEpochConfiguration_Call { - return &AgglayerClientMock_GetEpochConfiguration_Call{Call: _e.mock.On("GetEpochConfiguration")} +// - ctx context.Context +func (_e *AgglayerClientMock_Expecter) GetEpochConfiguration(ctx interface{}) *AgglayerClientMock_GetEpochConfiguration_Call { + return &AgglayerClientMock_GetEpochConfiguration_Call{Call: _e.mock.On("GetEpochConfiguration", ctx)} } -func (_c *AgglayerClientMock_GetEpochConfiguration_Call) Run(run func()) *AgglayerClientMock_GetEpochConfiguration_Call { +func (_c *AgglayerClientMock_GetEpochConfiguration_Call) Run(run func(ctx context.Context)) *AgglayerClientMock_GetEpochConfiguration_Call { _c.Call.Run(func(args mock.Arguments) { - run() + run(args[0].(context.Context)) }) return _c } @@ -135,14 +137,14 @@ func (_c *AgglayerClientMock_GetEpochConfiguration_Call) Return(_a0 *types.Clock return _c } -func (_c *AgglayerClientMock_GetEpochConfiguration_Call) RunAndReturn(run func() (*types.ClockConfiguration, error)) *AgglayerClientMock_GetEpochConfiguration_Call { +func (_c *AgglayerClientMock_GetEpochConfiguration_Call) RunAndReturn(run func(context.Context) (*types.ClockConfiguration, error)) *AgglayerClientMock_GetEpochConfiguration_Call { _c.Call.Return(run) return _c } -// GetLatestPendingCertificateHeader provides a mock function with given fields: networkID -func (_m *AgglayerClientMock) GetLatestPendingCertificateHeader(networkID uint32) (*types.CertificateHeader, error) { - ret := _m.Called(networkID) +// GetLatestPendingCertificateHeader provides a mock function with given fields: ctx, networkID +func (_m *AgglayerClientMock) GetLatestPendingCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error) { + ret := _m.Called(ctx, networkID) if len(ret) == 0 { panic("no return value specified for GetLatestPendingCertificateHeader") @@ -150,19 +152,19 @@ func (_m *AgglayerClientMock) GetLatestPendingCertificateHeader(networkID uint32 var r0 *types.CertificateHeader var r1 error - if rf, ok := ret.Get(0).(func(uint32) (*types.CertificateHeader, error)); ok { - return rf(networkID) + if rf, ok := ret.Get(0).(func(context.Context, uint32) (*types.CertificateHeader, error)); ok { + return rf(ctx, networkID) } - if rf, ok := ret.Get(0).(func(uint32) *types.CertificateHeader); ok { - r0 = rf(networkID) + if rf, ok := ret.Get(0).(func(context.Context, uint32) *types.CertificateHeader); ok { + r0 = rf(ctx, networkID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.CertificateHeader) } } - if rf, ok := ret.Get(1).(func(uint32) error); ok { - r1 = rf(networkID) + if rf, ok := ret.Get(1).(func(context.Context, uint32) error); ok { + r1 = rf(ctx, networkID) } else { r1 = ret.Error(1) } @@ -176,14 +178,15 @@ type AgglayerClientMock_GetLatestPendingCertificateHeader_Call struct { } // GetLatestPendingCertificateHeader is a helper method to define mock.On call +// - ctx context.Context // - networkID uint32 -func (_e *AgglayerClientMock_Expecter) GetLatestPendingCertificateHeader(networkID interface{}) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { - return &AgglayerClientMock_GetLatestPendingCertificateHeader_Call{Call: _e.mock.On("GetLatestPendingCertificateHeader", networkID)} +func (_e *AgglayerClientMock_Expecter) GetLatestPendingCertificateHeader(ctx interface{}, networkID interface{}) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { + return &AgglayerClientMock_GetLatestPendingCertificateHeader_Call{Call: _e.mock.On("GetLatestPendingCertificateHeader", ctx, networkID)} } -func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Run(run func(networkID uint32)) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Run(run func(ctx context.Context, networkID uint32)) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint32)) + run(args[0].(context.Context), args[1].(uint32)) }) return _c } @@ -193,14 +196,14 @@ func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) Return(_a0 return _c } -func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) RunAndReturn(run func(uint32) (*types.CertificateHeader, error)) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestPendingCertificateHeader_Call) RunAndReturn(run func(context.Context, uint32) (*types.CertificateHeader, error)) *AgglayerClientMock_GetLatestPendingCertificateHeader_Call { _c.Call.Return(run) return _c } -// GetLatestSettledCertificateHeader provides a mock function with given fields: networkID -func (_m *AgglayerClientMock) GetLatestSettledCertificateHeader(networkID uint32) (*types.CertificateHeader, error) { - ret := _m.Called(networkID) +// GetLatestSettledCertificateHeader provides a mock function with given fields: ctx, networkID +func (_m *AgglayerClientMock) GetLatestSettledCertificateHeader(ctx context.Context, networkID uint32) (*types.CertificateHeader, error) { + ret := _m.Called(ctx, networkID) if len(ret) == 0 { panic("no return value specified for GetLatestSettledCertificateHeader") @@ -208,19 +211,19 @@ func (_m *AgglayerClientMock) GetLatestSettledCertificateHeader(networkID uint32 var r0 *types.CertificateHeader var r1 error - if rf, ok := ret.Get(0).(func(uint32) (*types.CertificateHeader, error)); ok { - return rf(networkID) + if rf, ok := ret.Get(0).(func(context.Context, uint32) (*types.CertificateHeader, error)); ok { + return rf(ctx, networkID) } - if rf, ok := ret.Get(0).(func(uint32) *types.CertificateHeader); ok { - r0 = rf(networkID) + if rf, ok := ret.Get(0).(func(context.Context, uint32) *types.CertificateHeader); ok { + r0 = rf(ctx, networkID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.CertificateHeader) } } - if rf, ok := ret.Get(1).(func(uint32) error); ok { - r1 = rf(networkID) + if rf, ok := ret.Get(1).(func(context.Context, uint32) error); ok { + r1 = rf(ctx, networkID) } else { r1 = ret.Error(1) } @@ -234,14 +237,15 @@ type AgglayerClientMock_GetLatestSettledCertificateHeader_Call struct { } // GetLatestSettledCertificateHeader is a helper method to define mock.On call +// - ctx context.Context // - networkID uint32 -func (_e *AgglayerClientMock_Expecter) GetLatestSettledCertificateHeader(networkID interface{}) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { - return &AgglayerClientMock_GetLatestSettledCertificateHeader_Call{Call: _e.mock.On("GetLatestSettledCertificateHeader", networkID)} +func (_e *AgglayerClientMock_Expecter) GetLatestSettledCertificateHeader(ctx interface{}, networkID interface{}) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { + return &AgglayerClientMock_GetLatestSettledCertificateHeader_Call{Call: _e.mock.On("GetLatestSettledCertificateHeader", ctx, networkID)} } -func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Run(run func(networkID uint32)) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Run(run func(ctx context.Context, networkID uint32)) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint32)) + run(args[0].(context.Context), args[1].(uint32)) }) return _c } @@ -251,14 +255,14 @@ func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) Return(_a0 return _c } -func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) RunAndReturn(run func(uint32) (*types.CertificateHeader, error)) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { +func (_c *AgglayerClientMock_GetLatestSettledCertificateHeader_Call) RunAndReturn(run func(context.Context, uint32) (*types.CertificateHeader, error)) *AgglayerClientMock_GetLatestSettledCertificateHeader_Call { _c.Call.Return(run) return _c } -// SendCertificate provides a mock function with given fields: certificate -func (_m *AgglayerClientMock) SendCertificate(certificate *types.SignedCertificate) (common.Hash, error) { - ret := _m.Called(certificate) +// SendCertificate provides a mock function with given fields: ctx, certificate +func (_m *AgglayerClientMock) SendCertificate(ctx context.Context, certificate *types.SignedCertificate) (common.Hash, error) { + ret := _m.Called(ctx, certificate) if len(ret) == 0 { panic("no return value specified for SendCertificate") @@ -266,19 +270,19 @@ func (_m *AgglayerClientMock) SendCertificate(certificate *types.SignedCertifica var r0 common.Hash var r1 error - if rf, ok := ret.Get(0).(func(*types.SignedCertificate) (common.Hash, error)); ok { - return rf(certificate) + if rf, ok := ret.Get(0).(func(context.Context, *types.SignedCertificate) (common.Hash, error)); ok { + return rf(ctx, certificate) } - if rf, ok := ret.Get(0).(func(*types.SignedCertificate) common.Hash); ok { - r0 = rf(certificate) + if rf, ok := ret.Get(0).(func(context.Context, *types.SignedCertificate) common.Hash); ok { + r0 = rf(ctx, certificate) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(common.Hash) } } - if rf, ok := ret.Get(1).(func(*types.SignedCertificate) error); ok { - r1 = rf(certificate) + if rf, ok := ret.Get(1).(func(context.Context, *types.SignedCertificate) error); ok { + r1 = rf(ctx, certificate) } else { r1 = ret.Error(1) } @@ -292,14 +296,15 @@ type AgglayerClientMock_SendCertificate_Call struct { } // SendCertificate is a helper method to define mock.On call +// - ctx context.Context // - certificate *types.SignedCertificate -func (_e *AgglayerClientMock_Expecter) SendCertificate(certificate interface{}) *AgglayerClientMock_SendCertificate_Call { - return &AgglayerClientMock_SendCertificate_Call{Call: _e.mock.On("SendCertificate", certificate)} +func (_e *AgglayerClientMock_Expecter) SendCertificate(ctx interface{}, certificate interface{}) *AgglayerClientMock_SendCertificate_Call { + return &AgglayerClientMock_SendCertificate_Call{Call: _e.mock.On("SendCertificate", ctx, certificate)} } -func (_c *AgglayerClientMock_SendCertificate_Call) Run(run func(certificate *types.SignedCertificate)) *AgglayerClientMock_SendCertificate_Call { +func (_c *AgglayerClientMock_SendCertificate_Call) Run(run func(ctx context.Context, certificate *types.SignedCertificate)) *AgglayerClientMock_SendCertificate_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*types.SignedCertificate)) + run(args[0].(context.Context), args[1].(*types.SignedCertificate)) }) return _c } @@ -309,112 +314,7 @@ func (_c *AgglayerClientMock_SendCertificate_Call) Return(_a0 common.Hash, _a1 e return _c } -func (_c *AgglayerClientMock_SendCertificate_Call) RunAndReturn(run func(*types.SignedCertificate) (common.Hash, error)) *AgglayerClientMock_SendCertificate_Call { - _c.Call.Return(run) - return _c -} - -// SendTx provides a mock function with given fields: signedTx -func (_m *AgglayerClientMock) SendTx(signedTx SignedTx) (common.Hash, error) { - ret := _m.Called(signedTx) - - if len(ret) == 0 { - panic("no return value specified for SendTx") - } - - var r0 common.Hash - var r1 error - if rf, ok := ret.Get(0).(func(SignedTx) (common.Hash, error)); ok { - return rf(signedTx) - } - if rf, ok := ret.Get(0).(func(SignedTx) common.Hash); ok { - r0 = rf(signedTx) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Hash) - } - } - - if rf, ok := ret.Get(1).(func(SignedTx) error); ok { - r1 = rf(signedTx) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AgglayerClientMock_SendTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTx' -type AgglayerClientMock_SendTx_Call struct { - *mock.Call -} - -// SendTx is a helper method to define mock.On call -// - signedTx SignedTx -func (_e *AgglayerClientMock_Expecter) SendTx(signedTx interface{}) *AgglayerClientMock_SendTx_Call { - return &AgglayerClientMock_SendTx_Call{Call: _e.mock.On("SendTx", signedTx)} -} - -func (_c *AgglayerClientMock_SendTx_Call) Run(run func(signedTx SignedTx)) *AgglayerClientMock_SendTx_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(SignedTx)) - }) - return _c -} - -func (_c *AgglayerClientMock_SendTx_Call) Return(_a0 common.Hash, _a1 error) *AgglayerClientMock_SendTx_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *AgglayerClientMock_SendTx_Call) RunAndReturn(run func(SignedTx) (common.Hash, error)) *AgglayerClientMock_SendTx_Call { - _c.Call.Return(run) - return _c -} - -// WaitTxToBeMined provides a mock function with given fields: hash, ctx -func (_m *AgglayerClientMock) WaitTxToBeMined(hash common.Hash, ctx context.Context) error { - ret := _m.Called(hash, ctx) - - if len(ret) == 0 { - panic("no return value specified for WaitTxToBeMined") - } - - var r0 error - if rf, ok := ret.Get(0).(func(common.Hash, context.Context) error); ok { - r0 = rf(hash, ctx) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// AgglayerClientMock_WaitTxToBeMined_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitTxToBeMined' -type AgglayerClientMock_WaitTxToBeMined_Call struct { - *mock.Call -} - -// WaitTxToBeMined is a helper method to define mock.On call -// - hash common.Hash -// - ctx context.Context -func (_e *AgglayerClientMock_Expecter) WaitTxToBeMined(hash interface{}, ctx interface{}) *AgglayerClientMock_WaitTxToBeMined_Call { - return &AgglayerClientMock_WaitTxToBeMined_Call{Call: _e.mock.On("WaitTxToBeMined", hash, ctx)} -} - -func (_c *AgglayerClientMock_WaitTxToBeMined_Call) Run(run func(hash common.Hash, ctx context.Context)) *AgglayerClientMock_WaitTxToBeMined_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Hash), args[1].(context.Context)) - }) - return _c -} - -func (_c *AgglayerClientMock_WaitTxToBeMined_Call) Return(_a0 error) *AgglayerClientMock_WaitTxToBeMined_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *AgglayerClientMock_WaitTxToBeMined_Call) RunAndReturn(run func(common.Hash, context.Context) error) *AgglayerClientMock_WaitTxToBeMined_Call { +func (_c *AgglayerClientMock_SendCertificate_Call) RunAndReturn(run func(context.Context, *types.SignedCertificate) (common.Hash, error)) *AgglayerClientMock_SendCertificate_Call { _c.Call.Return(run) return _c } diff --git a/agglayer/proto/node/agglayer_network_state_service.pb.go b/agglayer/proto/node/agglayer_network_state_service.pb.go index 10193213..c74181df 100644 --- a/agglayer/proto/node/agglayer_network_state_service.pb.go +++ b/agglayer/proto/node/agglayer_network_state_service.pb.go @@ -23,6 +23,104 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Request to get a CertificateHeader for a particular CertificateId. +type GetCertificateHeaderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The certificate identifier. + CertificateId *types.CertificateId `protobuf:"bytes,1,opt,name=certificate_id,json=certificateId,proto3" json:"certificate_id,omitempty"` +} + +func (x *GetCertificateHeaderRequest) Reset() { + *x = GetCertificateHeaderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCertificateHeaderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCertificateHeaderRequest) ProtoMessage() {} + +func (x *GetCertificateHeaderRequest) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_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 GetCertificateHeaderRequest.ProtoReflect.Descriptor instead. +func (*GetCertificateHeaderRequest) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{0} +} + +func (x *GetCertificateHeaderRequest) GetCertificateId() *types.CertificateId { + if x != nil { + return x.CertificateId + } + return nil +} + +// Response to the CertificateHeader request. +type GetCertificateHeaderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The certificate header. + CertificateHeader *types.CertificateHeader `protobuf:"bytes,1,opt,name=certificate_header,json=certificateHeader,proto3" json:"certificate_header,omitempty"` +} + +func (x *GetCertificateHeaderResponse) Reset() { + *x = GetCertificateHeaderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCertificateHeaderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCertificateHeaderResponse) ProtoMessage() {} + +func (x *GetCertificateHeaderResponse) ProtoReflect() protoreflect.Message { + mi := &file_node_agglayer_network_state_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCertificateHeaderResponse.ProtoReflect.Descriptor instead. +func (*GetCertificateHeaderResponse) Descriptor() ([]byte, []int) { + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{1} +} + +func (x *GetCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { + if x != nil { + return x.CertificateHeader + } + return nil +} + // Request to get the latest known certificate header for a network. type GetLatestKnownCertificateHeaderRequest struct { state protoimpl.MessageState @@ -36,7 +134,7 @@ type GetLatestKnownCertificateHeaderRequest struct { func (x *GetLatestKnownCertificateHeaderRequest) Reset() { *x = GetLatestKnownCertificateHeaderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[0] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +147,7 @@ func (x *GetLatestKnownCertificateHeaderRequest) String() string { func (*GetLatestKnownCertificateHeaderRequest) ProtoMessage() {} func (x *GetLatestKnownCertificateHeaderRequest) ProtoReflect() protoreflect.Message { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[0] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +160,7 @@ func (x *GetLatestKnownCertificateHeaderRequest) ProtoReflect() protoreflect.Mes // Deprecated: Use GetLatestKnownCertificateHeaderRequest.ProtoReflect.Descriptor instead. func (*GetLatestKnownCertificateHeaderRequest) Descriptor() ([]byte, []int) { - return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{0} + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{2} } func (x *GetLatestKnownCertificateHeaderRequest) GetNetworkId() uint32 { @@ -85,7 +183,7 @@ type GetLatestKnownCertificateHeaderResponse struct { func (x *GetLatestKnownCertificateHeaderResponse) Reset() { *x = GetLatestKnownCertificateHeaderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[1] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -98,7 +196,7 @@ func (x *GetLatestKnownCertificateHeaderResponse) String() string { func (*GetLatestKnownCertificateHeaderResponse) ProtoMessage() {} func (x *GetLatestKnownCertificateHeaderResponse) ProtoReflect() protoreflect.Message { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[1] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -111,7 +209,7 @@ func (x *GetLatestKnownCertificateHeaderResponse) ProtoReflect() protoreflect.Me // Deprecated: Use GetLatestKnownCertificateHeaderResponse.ProtoReflect.Descriptor instead. func (*GetLatestKnownCertificateHeaderResponse) Descriptor() ([]byte, []int) { - return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{1} + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{3} } func (x *GetLatestKnownCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { @@ -134,7 +232,7 @@ type GetLatestSettledCertificateHeaderRequest struct { func (x *GetLatestSettledCertificateHeaderRequest) Reset() { *x = GetLatestSettledCertificateHeaderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[2] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -147,7 +245,7 @@ func (x *GetLatestSettledCertificateHeaderRequest) String() string { func (*GetLatestSettledCertificateHeaderRequest) ProtoMessage() {} func (x *GetLatestSettledCertificateHeaderRequest) ProtoReflect() protoreflect.Message { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[2] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -160,7 +258,7 @@ func (x *GetLatestSettledCertificateHeaderRequest) ProtoReflect() protoreflect.M // Deprecated: Use GetLatestSettledCertificateHeaderRequest.ProtoReflect.Descriptor instead. func (*GetLatestSettledCertificateHeaderRequest) Descriptor() ([]byte, []int) { - return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{2} + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{4} } func (x *GetLatestSettledCertificateHeaderRequest) GetNetworkId() uint32 { @@ -183,7 +281,7 @@ type GetLatestSettledCertificateHeaderResponse struct { func (x *GetLatestSettledCertificateHeaderResponse) Reset() { *x = GetLatestSettledCertificateHeaderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[3] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -196,7 +294,7 @@ func (x *GetLatestSettledCertificateHeaderResponse) String() string { func (*GetLatestSettledCertificateHeaderResponse) ProtoMessage() {} func (x *GetLatestSettledCertificateHeaderResponse) ProtoReflect() protoreflect.Message { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[3] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -209,7 +307,7 @@ func (x *GetLatestSettledCertificateHeaderResponse) ProtoReflect() protoreflect. // Deprecated: Use GetLatestSettledCertificateHeaderResponse.ProtoReflect.Descriptor instead. func (*GetLatestSettledCertificateHeaderResponse) Descriptor() ([]byte, []int) { - return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{3} + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{5} } func (x *GetLatestSettledCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { @@ -232,7 +330,7 @@ type GetLatestPendingCertificateHeaderRequest struct { func (x *GetLatestPendingCertificateHeaderRequest) Reset() { *x = GetLatestPendingCertificateHeaderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[4] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -245,7 +343,7 @@ func (x *GetLatestPendingCertificateHeaderRequest) String() string { func (*GetLatestPendingCertificateHeaderRequest) ProtoMessage() {} func (x *GetLatestPendingCertificateHeaderRequest) ProtoReflect() protoreflect.Message { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[4] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -258,7 +356,7 @@ func (x *GetLatestPendingCertificateHeaderRequest) ProtoReflect() protoreflect.M // Deprecated: Use GetLatestPendingCertificateHeaderRequest.ProtoReflect.Descriptor instead. func (*GetLatestPendingCertificateHeaderRequest) Descriptor() ([]byte, []int) { - return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{4} + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{6} } func (x *GetLatestPendingCertificateHeaderRequest) GetNetworkId() uint32 { @@ -281,7 +379,7 @@ type GetLatestPendingCertificateHeaderResponse struct { func (x *GetLatestPendingCertificateHeaderResponse) Reset() { *x = GetLatestPendingCertificateHeaderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[5] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -294,7 +392,7 @@ func (x *GetLatestPendingCertificateHeaderResponse) String() string { func (*GetLatestPendingCertificateHeaderResponse) ProtoMessage() {} func (x *GetLatestPendingCertificateHeaderResponse) ProtoReflect() protoreflect.Message { - mi := &file_node_agglayer_network_state_service_proto_msgTypes[5] + mi := &file_node_agglayer_network_state_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -307,7 +405,7 @@ func (x *GetLatestPendingCertificateHeaderResponse) ProtoReflect() protoreflect. // Deprecated: Use GetLatestPendingCertificateHeaderResponse.ProtoReflect.Descriptor instead. func (*GetLatestPendingCertificateHeaderResponse) Descriptor() ([]byte, []int) { - return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{5} + return file_node_agglayer_network_state_service_proto_rawDescGZIP(), []int{7} } func (x *GetLatestPendingCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { @@ -325,77 +423,96 @@ var file_node_agglayer_network_state_service_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, - 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x78, 0x0a, 0x27, + 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x1b, 0x47, + 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0x6d, 0x0a, + 0x1c, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, + 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x78, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, + 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, + 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, - 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, - 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, - 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x32, 0xb2, 0x03, 0x0a, 0x1b, 0x41, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x93, 0x04, + 0x0a, 0x1b, 0x41, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, + 0x14, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, + 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, + 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, + 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, + 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, + 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -410,31 +527,38 @@ func file_node_agglayer_network_state_service_proto_rawDescGZIP() []byte { return file_node_agglayer_network_state_service_proto_rawDescData } -var file_node_agglayer_network_state_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_node_agglayer_network_state_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_node_agglayer_network_state_service_proto_goTypes = []interface{}{ - (*GetLatestKnownCertificateHeaderRequest)(nil), // 0: proto.GetLatestKnownCertificateHeaderRequest - (*GetLatestKnownCertificateHeaderResponse)(nil), // 1: proto.GetLatestKnownCertificateHeaderResponse - (*GetLatestSettledCertificateHeaderRequest)(nil), // 2: proto.GetLatestSettledCertificateHeaderRequest - (*GetLatestSettledCertificateHeaderResponse)(nil), // 3: proto.GetLatestSettledCertificateHeaderResponse - (*GetLatestPendingCertificateHeaderRequest)(nil), // 4: proto.GetLatestPendingCertificateHeaderRequest - (*GetLatestPendingCertificateHeaderResponse)(nil), // 5: proto.GetLatestPendingCertificateHeaderResponse - (*types.CertificateHeader)(nil), // 6: proto.types.CertificateHeader + (*GetCertificateHeaderRequest)(nil), // 0: proto.GetCertificateHeaderRequest + (*GetCertificateHeaderResponse)(nil), // 1: proto.GetCertificateHeaderResponse + (*GetLatestKnownCertificateHeaderRequest)(nil), // 2: proto.GetLatestKnownCertificateHeaderRequest + (*GetLatestKnownCertificateHeaderResponse)(nil), // 3: proto.GetLatestKnownCertificateHeaderResponse + (*GetLatestSettledCertificateHeaderRequest)(nil), // 4: proto.GetLatestSettledCertificateHeaderRequest + (*GetLatestSettledCertificateHeaderResponse)(nil), // 5: proto.GetLatestSettledCertificateHeaderResponse + (*GetLatestPendingCertificateHeaderRequest)(nil), // 6: proto.GetLatestPendingCertificateHeaderRequest + (*GetLatestPendingCertificateHeaderResponse)(nil), // 7: proto.GetLatestPendingCertificateHeaderResponse + (*types.CertificateId)(nil), // 8: proto.types.CertificateId + (*types.CertificateHeader)(nil), // 9: proto.types.CertificateHeader } var file_node_agglayer_network_state_service_proto_depIdxs = []int32{ - 6, // 0: proto.GetLatestKnownCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 6, // 1: proto.GetLatestSettledCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 6, // 2: proto.GetLatestPendingCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 0, // 3: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:input_type -> proto.GetLatestKnownCertificateHeaderRequest - 2, // 4: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:input_type -> proto.GetLatestSettledCertificateHeaderRequest - 4, // 5: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:input_type -> proto.GetLatestPendingCertificateHeaderRequest - 1, // 6: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:output_type -> proto.GetLatestKnownCertificateHeaderResponse - 3, // 7: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:output_type -> proto.GetLatestSettledCertificateHeaderResponse - 5, // 8: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:output_type -> proto.GetLatestPendingCertificateHeaderResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 8, // 0: proto.GetCertificateHeaderRequest.certificate_id:type_name -> proto.types.CertificateId + 9, // 1: proto.GetCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 9, // 2: proto.GetLatestKnownCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 9, // 3: proto.GetLatestSettledCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 9, // 4: proto.GetLatestPendingCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader + 0, // 5: proto.AgglayerNetworkStateService.GetCertificateHeader:input_type -> proto.GetCertificateHeaderRequest + 2, // 6: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:input_type -> proto.GetLatestKnownCertificateHeaderRequest + 4, // 7: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:input_type -> proto.GetLatestSettledCertificateHeaderRequest + 6, // 8: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:input_type -> proto.GetLatestPendingCertificateHeaderRequest + 1, // 9: proto.AgglayerNetworkStateService.GetCertificateHeader:output_type -> proto.GetCertificateHeaderResponse + 3, // 10: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:output_type -> proto.GetLatestKnownCertificateHeaderResponse + 5, // 11: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:output_type -> proto.GetLatestSettledCertificateHeaderResponse + 7, // 12: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:output_type -> proto.GetLatestPendingCertificateHeaderResponse + 9, // [9:13] is the sub-list for method output_type + 5, // [5:9] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_node_agglayer_network_state_service_proto_init() } @@ -444,7 +568,7 @@ func file_node_agglayer_network_state_service_proto_init() { } if !protoimpl.UnsafeEnabled { file_node_agglayer_network_state_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestKnownCertificateHeaderRequest); i { + switch v := v.(*GetCertificateHeaderRequest); i { case 0: return &v.state case 1: @@ -456,7 +580,7 @@ func file_node_agglayer_network_state_service_proto_init() { } } file_node_agglayer_network_state_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestKnownCertificateHeaderResponse); i { + switch v := v.(*GetCertificateHeaderResponse); i { case 0: return &v.state case 1: @@ -468,7 +592,7 @@ func file_node_agglayer_network_state_service_proto_init() { } } file_node_agglayer_network_state_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestSettledCertificateHeaderRequest); i { + switch v := v.(*GetLatestKnownCertificateHeaderRequest); i { case 0: return &v.state case 1: @@ -480,7 +604,7 @@ func file_node_agglayer_network_state_service_proto_init() { } } file_node_agglayer_network_state_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestSettledCertificateHeaderResponse); i { + switch v := v.(*GetLatestKnownCertificateHeaderResponse); i { case 0: return &v.state case 1: @@ -492,7 +616,7 @@ func file_node_agglayer_network_state_service_proto_init() { } } file_node_agglayer_network_state_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestPendingCertificateHeaderRequest); i { + switch v := v.(*GetLatestSettledCertificateHeaderRequest); i { case 0: return &v.state case 1: @@ -504,6 +628,30 @@ func file_node_agglayer_network_state_service_proto_init() { } } file_node_agglayer_network_state_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestSettledCertificateHeaderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetLatestPendingCertificateHeaderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_agglayer_network_state_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetLatestPendingCertificateHeaderResponse); i { case 0: return &v.state @@ -522,7 +670,7 @@ func file_node_agglayer_network_state_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_node_agglayer_network_state_service_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/agglayer/proto/node/agglayer_network_state_service.proto b/agglayer/proto/node/agglayer_network_state_service.proto index 346e5b09..b6292874 100644 --- a/agglayer/proto/node/agglayer_network_state_service.proto +++ b/agglayer/proto/node/agglayer_network_state_service.proto @@ -5,10 +5,13 @@ syntax = "proto3"; package proto; option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; import "types/certificate_header.proto"; -import "types/epoch_configuration.proto"; +import "types/certificate.proto"; // Service for querying agglayer network state. service AgglayerNetworkStateService { + // Method used to get a CertificateHeader for a particular CertificateId. + rpc GetCertificateHeader(GetCertificateHeaderRequest) returns (GetCertificateHeaderResponse); + // Method used to get the latest known certificate header for a network. rpc GetLatestKnownCertificateHeader(GetLatestKnownCertificateHeaderRequest) returns (GetLatestKnownCertificateHeaderResponse); @@ -19,6 +22,18 @@ service AgglayerNetworkStateService { rpc GetLatestPendingCertificateHeader(GetLatestPendingCertificateHeaderRequest) returns (GetLatestPendingCertificateHeaderResponse); } +// Request to get a CertificateHeader for a particular CertificateId. +message GetCertificateHeaderRequest { + // The certificate identifier. + types.CertificateId certificate_id = 1; +} + +// Response to the CertificateHeader request. +message GetCertificateHeaderResponse { + // The certificate header. + types.CertificateHeader certificate_header = 1; +} + // Request to get the latest known certificate header for a network. message GetLatestKnownCertificateHeaderRequest { // The network identifier. diff --git a/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go b/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go index 17e3c2f2..b3a4a6df 100644 --- a/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go +++ b/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go @@ -21,6 +21,7 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( + AgglayerNetworkStateService_GetCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetCertificateHeader" AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestKnownCertificateHeader" AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestSettledCertificateHeader" AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestPendingCertificateHeader" @@ -32,6 +33,8 @@ const ( // // Service for querying agglayer network state. type AgglayerNetworkStateServiceClient interface { + // Method used to get a CertificateHeader for a particular CertificateId. + GetCertificateHeader(ctx context.Context, in *GetCertificateHeaderRequest, opts ...grpc.CallOption) (*GetCertificateHeaderResponse, error) // Method used to get the latest known certificate header for a network. GetLatestKnownCertificateHeader(ctx context.Context, in *GetLatestKnownCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestKnownCertificateHeaderResponse, error) // Method used to get the latest settled certificate header for a network. @@ -48,6 +51,16 @@ func NewAgglayerNetworkStateServiceClient(cc grpc.ClientConnInterface) AgglayerN return &agglayerNetworkStateServiceClient{cc} } +func (c *agglayerNetworkStateServiceClient) GetCertificateHeader(ctx context.Context, in *GetCertificateHeaderRequest, opts ...grpc.CallOption) (*GetCertificateHeaderResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetCertificateHeaderResponse) + err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetCertificateHeader_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *agglayerNetworkStateServiceClient) GetLatestKnownCertificateHeader(ctx context.Context, in *GetLatestKnownCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestKnownCertificateHeaderResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestKnownCertificateHeaderResponse) @@ -84,6 +97,8 @@ func (c *agglayerNetworkStateServiceClient) GetLatestPendingCertificateHeader(ct // // Service for querying agglayer network state. type AgglayerNetworkStateServiceServer interface { + // Method used to get a CertificateHeader for a particular CertificateId. + GetCertificateHeader(context.Context, *GetCertificateHeaderRequest) (*GetCertificateHeaderResponse, error) // Method used to get the latest known certificate header for a network. GetLatestKnownCertificateHeader(context.Context, *GetLatestKnownCertificateHeaderRequest) (*GetLatestKnownCertificateHeaderResponse, error) // Method used to get the latest settled certificate header for a network. @@ -97,6 +112,9 @@ type AgglayerNetworkStateServiceServer interface { type UnimplementedAgglayerNetworkStateServiceServer struct { } +func (UnimplementedAgglayerNetworkStateServiceServer) GetCertificateHeader(context.Context, *GetCertificateHeaderRequest) (*GetCertificateHeaderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCertificateHeader not implemented") +} func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestKnownCertificateHeader(context.Context, *GetLatestKnownCertificateHeaderRequest) (*GetLatestKnownCertificateHeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestKnownCertificateHeader not implemented") } @@ -120,6 +138,24 @@ func RegisterAgglayerNetworkStateServiceServer(s grpc.ServiceRegistrar, srv Aggl s.RegisterService(&AgglayerNetworkStateService_ServiceDesc, srv) } +func _AgglayerNetworkStateService_GetCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCertificateHeaderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgglayerNetworkStateServiceServer).GetCertificateHeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AgglayerNetworkStateService_GetCertificateHeader_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgglayerNetworkStateServiceServer).GetCertificateHeader(ctx, req.(*GetCertificateHeaderRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _AgglayerNetworkStateService_GetLatestKnownCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetLatestKnownCertificateHeaderRequest) if err := dec(in); err != nil { @@ -181,6 +217,10 @@ var AgglayerNetworkStateService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.AgglayerNetworkStateService", HandlerType: (*AgglayerNetworkStateServiceServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "GetCertificateHeader", + Handler: _AgglayerNetworkStateService_GetCertificateHeader_Handler, + }, { MethodName: "GetLatestKnownCertificateHeader", Handler: _AgglayerNetworkStateService_GetLatestKnownCertificateHeader_Handler, diff --git a/aggsender/aggsender.go b/aggsender/aggsender.go index 0daff131..66606411 100644 --- a/aggsender/aggsender.go +++ b/aggsender/aggsender.go @@ -282,7 +282,7 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayerTypes.SignedC a.log.Warn("dry run mode enabled, skipping sending certificate") return signedCertificate, nil } - certificateHash, err := a.aggLayerClient.SendCertificate(signedCertificate) + certificateHash, err := a.aggLayerClient.SendCertificate(ctx, signedCertificate) if err != nil { return nil, fmt.Errorf("error sending certificate: %w", err) } @@ -411,7 +411,7 @@ func (a *AggSender) checkPendingCertificatesStatus(ctx context.Context) checkCer thereArePendingCerts := false appearsNewInErrorCert := false for _, certificateLocal := range pendingCertificates { - certificateHeader, err := a.aggLayerClient.GetCertificateHeader(certificateLocal.CertificateID) + certificateHeader, err := a.aggLayerClient.GetCertificateHeader(ctx, certificateLocal.CertificateID) if err != nil { a.log.Errorf("error getting certificate header of %s from agglayer: %w", certificateLocal.ID(), err) @@ -468,7 +468,7 @@ func (a *AggSender) updateCertificateStatus(ctx context.Context, // checkLastCertificateFromAgglayer checks the last certificate from agglayer func (a *AggSender) checkLastCertificateFromAgglayer(ctx context.Context) error { networkID := a.l2Syncer.OriginNetwork() - initialStatus, err := NewInitialStatus(a.log, networkID, a.storage, a.aggLayerClient) + initialStatus, err := NewInitialStatus(ctx, a.log, networkID, a.storage, a.aggLayerClient) if err != nil { return fmt.Errorf("recovery: error retrieving initial status: %w", err) } diff --git a/aggsender/aggsender_initial_state.go b/aggsender/aggsender_initial_state.go index 5bc59a70..27c88e58 100644 --- a/aggsender/aggsender_initial_state.go +++ b/aggsender/aggsender_initial_state.go @@ -1,6 +1,7 @@ package aggsender import ( + "context" "errors" "fmt" @@ -55,17 +56,18 @@ func (i *InitialStatusResult) String() string { } // NewInitialStatus creates a new InitialStatus object, get the data from AggLayer and local storage -func NewInitialStatus(log types.Logger, networkID uint32, +func NewInitialStatus(ctx context.Context, + log types.Logger, networkID uint32, storage db.AggSenderStorage, aggLayerClient agglayer.AggLayerClientRecoveryQuerier) (*InitialStatus, error) { log.Infof("recovery: checking last settled certificate from AggLayer for network %d", networkID) - aggLayerLastSettledCert, err := aggLayerClient.GetLatestSettledCertificateHeader(networkID) + aggLayerLastSettledCert, err := aggLayerClient.GetLatestSettledCertificateHeader(ctx, networkID) if err != nil { return nil, fmt.Errorf("recovery: error getting GetLatestSettledCertificateHeader from agglayer: %w", err) } log.Infof("recovery: checking last pending certificate from AggLayer for network %d", networkID) - aggLayerLastPendingCert, err := aggLayerClient.GetLatestPendingCertificateHeader(networkID) + aggLayerLastPendingCert, err := aggLayerClient.GetLatestPendingCertificateHeader(ctx, networkID) if err != nil { return nil, fmt.Errorf("recovery: error getting GetLatestPendingCertificateHeader from agglayer: %w", err) } diff --git a/aggsender/aggsender_test.go b/aggsender/aggsender_test.go index bec2443b..c763f187 100644 --- a/aggsender/aggsender_test.go +++ b/aggsender/aggsender_test.go @@ -90,8 +90,8 @@ func TestAggSenderStart(t *testing.T) { epochNotifierMock.EXPECT().Subscribe("aggsender").Return(ch) bridgeL2SyncerMock.EXPECT().OriginNetwork().Return(uint32(1)) bridgeL2SyncerMock.EXPECT().GetLastProcessedBlock(mock.Anything).Return(uint64(0), nil) - aggLayerMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything).Return(nil, nil) - aggLayerMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) + aggLayerMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + aggLayerMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) go aggSender.Start(ctx) ch <- aggsendertypes.EpochEvent{ @@ -130,7 +130,7 @@ func TestAggSenderSendCertificates(t *testing.T) { Status: agglayerTypes.Pending, }) require.NoError(t, err) - AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything).Return(&agglayerTypes.CertificateHeader{ + AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything, mock.Anything).Return(&agglayerTypes.CertificateHeader{ Status: agglayerTypes.Pending, }, nil).Once() @@ -159,7 +159,7 @@ func TestAggSenderSendCertificates(t *testing.T) { Height: 1, Status: agglayerTypes.Pending, }) - AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything).Return(&agglayerTypes.CertificateHeader{ + AggLayerMock.EXPECT().GetCertificateHeader(mock.Anything, mock.Anything).Return(&agglayerTypes.CertificateHeader{ Status: agglayerTypes.InError, }, nil).Once() require.NoError(t, err) @@ -265,7 +265,7 @@ func TestCheckIfCertificatesAreSettled(t *testing.T) { mockStorage.On("GetCertificatesByStatus", agglayerTypes.NonSettledStatuses).Return( tt.pendingCertificates, tt.getFromDBError) for certID, header := range tt.certificateHeaders { - mockAggLayerClient.On("GetCertificateHeader", certID).Return(header, tt.clientError) + mockAggLayerClient.On("GetCertificateHeader", mock.Anything, certID).Return(header, tt.clientError) } if tt.updateDBError != nil { mockStorage.On("UpdateCertificate", mock.Anything, mock.Anything).Return(tt.updateDBError) @@ -485,7 +485,7 @@ func TestSendCertificate_NoClaims(t *testing.T) { mockL2Syncer.On("GetClaims", mock.Anything, uint64(11), uint64(50)).Return([]bridgesync.Claim{}, nil) mockL2Syncer.On("GetExitRootByIndex", mock.Anything, uint32(1)).Return(treeTypes.Root{}, nil).Once() mockL2Syncer.On("OriginNetwork").Return(uint32(1), nil).Once() - mockAggLayerClient.On("SendCertificate", mock.Anything).Return(common.Hash{}, nil).Once() + mockAggLayerClient.On("SendCertificate", mock.Anything, mock.Anything).Return(common.Hash{}, nil).Once() signedCertificate, err := aggSender.sendCertificate(ctx) require.NoError(t, err) @@ -548,14 +548,14 @@ func TestCheckLastCertificateFromAgglayer_ErrorAggLayer(t *testing.T) { t.Run("error getting last settled cert", func(t *testing.T) { testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Maybe() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(networkIDTest).Return(nil, fmt.Errorf("unittest error")).Once() + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, networkIDTest).Return(nil, fmt.Errorf("unittest error")).Once() err := testData.sut.checkLastCertificateFromAgglayer(testData.ctx) require.Error(t, err) }) t.Run("error getting last pending cert", func(t *testing.T) { testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Maybe() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(networkIDTest).Return(nil, nil).Once() - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest).Return(nil, fmt.Errorf("unittest error")).Maybe() + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, networkIDTest).Return(nil, nil).Once() + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest).Return(nil, fmt.Errorf("unittest error")).Maybe() err := testData.sut.checkLastCertificateFromAgglayer(testData.ctx) require.Error(t, err) }) @@ -564,8 +564,8 @@ func TestCheckLastCertificateFromAgglayer_ErrorAggLayer(t *testing.T) { func TestCheckLastCertificateFromAgglayer_ErrorStorageGetLastSentCertificate(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Maybe() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(networkIDTest).Return(nil, nil).Maybe() - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest).Return(nil, nil).Maybe() + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, networkIDTest).Return(nil, nil).Maybe() + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest).Return(nil, nil).Maybe() testData.storageMock.EXPECT().GetLastSentCertificate().Return(nil, fmt.Errorf("unittest error")) err := testData.sut.checkLastCertificateFromAgglayer(testData.ctx) @@ -579,8 +579,8 @@ func TestCheckLastCertificateFromAgglayer_ErrorStorageGetLastSentCertificate(t * func TestCheckLastCertificateFromAgglayer_Case1NoCerts(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagNone) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(networkIDTest).Return(nil, nil).Maybe() - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest).Return(nil, nil).Maybe() + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, networkIDTest).Return(nil, nil).Maybe() + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest).Return(nil, nil).Maybe() err := testData.sut.checkLastCertificateFromAgglayer(testData.ctx) @@ -593,8 +593,8 @@ func TestCheckLastCertificateFromAgglayer_Case1NoCerts(t *testing.T) { func TestCheckLastCertificateFromAgglayer_Case2NoCertLocalCertRemote(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagNone) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest). + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest). Return(certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest), nil).Once() err := testData.sut.checkLastCertificateFromAgglayer(testData.ctx) @@ -610,8 +610,8 @@ func TestCheckLastCertificateFromAgglayer_Case2NoCertLocalCertRemote(t *testing. func TestCheckLastCertificateFromAgglayer_Case2NoCertLocalCertRemoteErrorStorage(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest). + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest). Return(certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest), nil).Once() testData.storageMock.EXPECT().GetLastSentCertificate().Return(nil, nil) @@ -626,8 +626,8 @@ func TestCheckLastCertificateFromAgglayer_Case2NoCertLocalCertRemoteErrorStorage func TestCheckLastCertificateFromAgglayer_Case2_1NoCertRemoteButCertLocal(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) testData.storageMock.EXPECT().GetLastSentCertificate().Return(&testData.testCerts[0], nil) err := testData.sut.checkLastCertificateFromAgglayer(testData.ctx) @@ -639,8 +639,8 @@ func TestCheckLastCertificateFromAgglayer_Case2_1NoCertRemoteButCertLocal(t *tes func TestCheckLastCertificateFromAgglayer_Case3_1LessHeight(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest). + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest). Return(certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest), nil).Once() testData.storageMock.EXPECT().GetLastSentCertificate().Return(&testData.testCerts[1], nil) @@ -654,9 +654,9 @@ func TestCheckLastCertificateFromAgglayer_Case3_1LessHeight(t *testing.T) { func TestCheckLastCertificateFromAgglayer_Case3_2Mismatch(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything). + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything). Return(certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest), nil).Once() - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest). + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest). Return(certInfoToCertHeader(t, &testData.testCerts[1], networkIDTest), nil).Once() testData.storageMock.EXPECT().GetLastSentCertificate().Return(&testData.testCerts[0], nil) testData.storageMock.EXPECT().SaveLastSentCertificate(mock.Anything, mock.Anything).Return(nil).Once() @@ -671,8 +671,8 @@ func TestCheckLastCertificateFromAgglayer_Case3_2Mismatch(t *testing.T) { func TestCheckLastCertificateFromAgglayer_Case4Mismatch(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest). + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest). Return(certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest), nil).Once() testData.storageMock.EXPECT().GetLastSentCertificate().Return(&testData.testCerts[1], nil) @@ -686,8 +686,8 @@ func TestCheckLastCertificateFromAgglayer_Case4Mismatch(t *testing.T) { func TestCheckLastCertificateFromAgglayer_Case5SameStatus(t *testing.T) { testData := newAggsenderTestData(t, testDataFlagMockStorage) testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest).Once() - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest). + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest). Return(certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest), nil).Once() testData.storageMock.EXPECT().GetLastSentCertificate().Return(&testData.testCerts[0], nil) @@ -701,8 +701,8 @@ func setupCase5Expectations(t *testing.T, testData *aggsenderTestData) { testData.l2syncerMock.EXPECT().OriginNetwork().Return(networkIDTest) aggLayerCert := certInfoToCertHeader(t, &testData.testCerts[0], networkIDTest) aggLayerCert.Status = agglayerTypes.Settled - testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything).Return(nil, nil) - testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(networkIDTest).Return(aggLayerCert, nil) + testData.agglayerClientMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil) + testData.agglayerClientMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, networkIDTest).Return(aggLayerCert, nil) testData.storageMock.EXPECT().GetLastSentCertificate().Return(&testData.testCerts[0], nil) } @@ -789,7 +789,7 @@ func TestSendCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x1"), BridgeExits: []*agglayerTypes.BridgeExit{{}}, }, nil).Once() - mockAgglayerClient.On("SendCertificate", mock.Anything).Return(common.Hash{}, errors.New("some error")).Once() + mockAgglayerClient.On("SendCertificate", mock.Anything, mock.Anything).Return(common.Hash{}, errors.New("some error")).Once() }, expectedError: "error sending certificate", }, @@ -808,7 +808,7 @@ func TestSendCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x11"), BridgeExits: []*agglayerTypes.BridgeExit{{}}, }, nil).Once() - mockAgglayerClient.On("SendCertificate", mock.Anything).Return(common.HexToHash("0x22"), nil).Once() + mockAgglayerClient.On("SendCertificate", mock.Anything, mock.Anything).Return(common.HexToHash("0x22"), nil).Once() mockStorage.On("SaveLastSentCertificate", mock.Anything, mock.Anything).Return(errors.New("some error")).Once() }, expectedError: "error saving last sent certificate", @@ -828,7 +828,7 @@ func TestSendCertificate(t *testing.T) { NewLocalExitRoot: common.HexToHash("0x11"), BridgeExits: []*agglayerTypes.BridgeExit{{}}, }, nil).Once() - mockAgglayerClient.On("SendCertificate", mock.Anything).Return(common.HexToHash("0x22"), nil).Once() + mockAgglayerClient.On("SendCertificate", mock.Anything, mock.Anything).Return(common.HexToHash("0x22"), nil).Once() mockStorage.On("SaveLastSentCertificate", mock.Anything, mock.Anything).Return(nil).Once() }, }, diff --git a/aggsender/epoch_notifier_per_block.go b/aggsender/epoch_notifier_per_block.go index 2f06dea6..5c44b62e 100644 --- a/aggsender/epoch_notifier_per_block.go +++ b/aggsender/epoch_notifier_per_block.go @@ -39,12 +39,13 @@ func (c *ConfigEpochNotifierPerBlock) String() string { c.StartingEpochBlock, c.NumBlockPerEpoch, c.EpochNotificationPercentage) } -func NewConfigEpochNotifierPerBlock(aggLayer agglayer.AggLayerClientGetEpochConfiguration, +func NewConfigEpochNotifierPerBlock(ctx context.Context, + aggLayer agglayer.AggLayerClientGetEpochConfiguration, epochNotificationPercentage uint) (*ConfigEpochNotifierPerBlock, error) { if aggLayer == nil { return nil, fmt.Errorf("newConfigEpochNotifierPerBlock: aggLayerClient is required") } - clockConfig, err := aggLayer.GetEpochConfiguration() + clockConfig, err := aggLayer.GetEpochConfiguration(ctx) if err != nil { return nil, fmt.Errorf("newConfigEpochNotifierPerBlock: error getting clock configuration from AggLayer: %w", err) } diff --git a/aggsender/epoch_notifier_per_block_test.go b/aggsender/epoch_notifier_per_block_test.go index b8d79fd5..e1f19049 100644 --- a/aggsender/epoch_notifier_per_block_test.go +++ b/aggsender/epoch_notifier_per_block_test.go @@ -115,18 +115,19 @@ func TestEpochStep(t *testing.T) { } func TestNewConfigEpochNotifierPerBlock(t *testing.T) { - _, err := NewConfigEpochNotifierPerBlock(nil, 1) + ctx := context.Background() + _, err := NewConfigEpochNotifierPerBlock(ctx, nil, 1) require.Error(t, err) aggLayerMock := agglayer.NewAgglayerClientMock(t) - aggLayerMock.On("GetEpochConfiguration").Return(nil, fmt.Errorf("error")).Once() - _, err = NewConfigEpochNotifierPerBlock(aggLayerMock, 1) + aggLayerMock.On("GetEpochConfiguration", mock.Anything).Return(nil, fmt.Errorf("error")).Once() + _, err = NewConfigEpochNotifierPerBlock(ctx, aggLayerMock, 1) require.Error(t, err) cfgAggLayer := &agglayerTypes.ClockConfiguration{ GenesisBlock: 123, EpochDuration: 456, } - aggLayerMock.On("GetEpochConfiguration").Return(cfgAggLayer, nil).Once() - cfg, err := NewConfigEpochNotifierPerBlock(aggLayerMock, 1) + aggLayerMock.On("GetEpochConfiguration", mock.Anything).Return(cfgAggLayer, nil).Once() + cfg, err := NewConfigEpochNotifierPerBlock(ctx, aggLayerMock, 1) require.NoError(t, err) require.Equal(t, uint64(123), cfg.StartingEpochBlock) require.Equal(t, uint(456), cfg.NumBlockPerEpoch) diff --git a/cmd/run.go b/cmd/run.go index 9a8b4a12..76e549fd 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -11,7 +11,7 @@ import ( "github.com/0xPolygon/zkevm-ethtx-manager/ethtxmanager" ethtxlog "github.com/0xPolygon/zkevm-ethtx-manager/log" "github.com/agglayer/aggkit" - "github.com/agglayer/aggkit/agglayer" + agglayer "github.com/agglayer/aggkit/agglayer/grpc" "github.com/agglayer/aggkit/aggoracle" "github.com/agglayer/aggkit/aggoracle/chaingersender" "github.com/agglayer/aggkit/aggsender" @@ -128,16 +128,21 @@ func createAggSender( l2Syncer *bridgesync.BridgeSync, l2Client *ethclient.Client) (*aggsender.AggSender, error) { logger := log.WithFields("module", aggkitcommon.AGGSENDER) - agglayerClient := agglayer.NewAggLayerClient(cfg.AggLayerURL) + agglayerClient, err := agglayer.NewAgglayerGRPCClient(cfg.AggLayerURL) + if err != nil { + return nil, fmt.Errorf("failed to create agglayer grpc client: %w", err) + } + blockNotifier, err := aggsender.NewBlockNotifierPolling(l1EthClient, aggsender.ConfigBlockNotifierPolling{ BlockFinalityType: etherman.NewBlockNumberFinality(cfg.BlockFinality), CheckNewBlockInterval: aggsender.AutomaticBlockInterval, }, logger, nil) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to initialize block notifier: %w", err) } - notifierCfg, err := aggsender.NewConfigEpochNotifierPerBlock(agglayerClient, cfg.EpochNotificationPercentage) + notifierCfg, err := aggsender.NewConfigEpochNotifierPerBlock(ctx, + agglayerClient, cfg.EpochNotificationPercentage) if err != nil { return nil, fmt.Errorf("cant generate config for Epoch Notifier because: %w", err) } From 47b49455c8ab50952f23b829ba5a9482481030d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= <58293609+ToniRamirezM@users.noreply.github.com> Date: Mon, 24 Feb 2025 13:38:00 +0100 Subject: [PATCH 5/9] feat: prometheus (#201) --- aggsender/aggsender.go | 16 +- aggsender/metrics/metrics.go | 79 ++++ cmd/run.go | 43 +++ config/config.go | 4 + config/default.go | 5 +- docs/aggsender.md | 24 ++ go.mod | 5 +- prometheus/api.go | 16 + prometheus/config.go | 11 + prometheus/prometheus.go | 677 ++++++++++++++++++++++++++++++++++ prometheus/prometheus_test.go | 375 +++++++++++++++++++ test/run-e2e-multi_pp.sh | 2 +- 12 files changed, 1252 insertions(+), 5 deletions(-) create mode 100644 aggsender/metrics/metrics.go create mode 100644 prometheus/api.go create mode 100644 prometheus/config.go create mode 100644 prometheus/prometheus.go create mode 100644 prometheus/prometheus_test.go diff --git a/aggsender/aggsender.go b/aggsender/aggsender.go index 5fc46e09..a9cc82e5 100644 --- a/aggsender/aggsender.go +++ b/aggsender/aggsender.go @@ -13,6 +13,7 @@ import ( zkevm "github.com/agglayer/aggkit" "github.com/agglayer/aggkit/agglayer" "github.com/agglayer/aggkit/aggsender/db" + "github.com/agglayer/aggkit/aggsender/metrics" aggsenderrpc "github.com/agglayer/aggkit/aggsender/rpc" "github.com/agglayer/aggkit/aggsender/types" "github.com/agglayer/aggkit/bridgesync" @@ -125,6 +126,7 @@ func (a *AggSender) GetRPCServices() []jRPC.Service { // Start starts the AggSender func (a *AggSender) Start(ctx context.Context) { a.log.Info("AggSender started") + metrics.Register() a.status.Start(time.Now().UTC()) a.checkInitialStatus(ctx) a.sendCertificates(ctx, 0) @@ -231,6 +233,7 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayer.SignedCertif return nil, nil } + start := time.Now() lastL2BlockSynced, err := a.l2Syncer.GetLastProcessedBlock(ctx) if err != nil { return nil, fmt.Errorf("error getting last processed block from l2: %w", err) @@ -301,6 +304,8 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayer.SignedCertif return nil, fmt.Errorf("forbidden to send certificate due epoch percentage") } + metrics.CertificateBuildTime(time.Since(start).Seconds()) + a.saveCertificateToFile(signedCertificate) a.log.Infof("certificate ready to be sent to AggLayer: %s", signedCertificate.Brief()) if a.cfg.DryRun { @@ -312,7 +317,8 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayer.SignedCertif return nil, fmt.Errorf("error sending certificate: %w", err) } - a.log.Debugf("certificate sent: Height: %d cert: %s", signedCertificate.Height, signedCertificate.Brief()) + metrics.CertificateSent() + a.log.Debugf("certificate send: Height: %d cert: %s", signedCertificate.Height, signedCertificate.Brief()) raw, err := json.Marshal(signedCertificate) if err != nil { @@ -787,6 +793,13 @@ func (a *AggSender) updateCertificateStatus(ctx context.Context, localCert.ID(), localCert.Status, agglayerCert.Status, localCert.ElapsedTimeSinceCreation(), agglayerCert.String()) + switch agglayerCert.Status { + case agglayer.Settled: + metrics.Settled() + case agglayer.InError: + metrics.InError() + } + // That is a strange situation if agglayerCert.Status.IsOpen() && localCert.Status.IsClosed() { a.log.Warnf("certificate %s is reopened! from [%s] to [%s]", @@ -919,6 +932,7 @@ func getLastSentBlockAndRetryCount(lastSentCertificateInfo *types.CertificateInf } retryCount = lastSentCertificateInfo.RetryCount + 1 + metrics.SendingRetry() } return lastSentBlock, retryCount diff --git a/aggsender/metrics/metrics.go b/aggsender/metrics/metrics.go new file mode 100644 index 00000000..4313d000 --- /dev/null +++ b/aggsender/metrics/metrics.go @@ -0,0 +1,79 @@ +package metrics + +import ( + "github.com/agglayer/aggkit/log" + "github.com/agglayer/aggkit/prometheus" + prometheusClient "github.com/prometheus/client_golang/prometheus" +) + +const ( + prefix = "aggsender_" + numberOfCertificatesSent = prefix + "number_of_certificates_sent" + numberOfCertificatesInError = prefix + "number_of_certificates_in_error" + numberOfSendingRetries = prefix + "number_of_sending_retries" + numberOfCertificatesSettled = prefix + "number_of_sending_settled" + certificateBuildTime = prefix + "certificate_build_time" + proverTime = prefix + "prover_time" +) + +// Register the metrics for the aggsender package +func Register() { + gauges := []prometheusClient.GaugeOpts{ + { + Name: numberOfCertificatesSent, + Help: "[AGGSENDER] number of certificates sent", + }, + { + Name: numberOfCertificatesInError, + Help: "[AGGSENDER] number of certificates in error", + }, + { + Name: numberOfSendingRetries, + Help: "[AGGSENDER] number of sending retries", + }, + { + Name: numberOfCertificatesSettled, + Help: "[AGGSENDER] number of certificates settled", + }, + { + Name: certificateBuildTime, + Help: "[AGGSENDER] certificate build time", + }, + { + Name: proverTime, + Help: "[AGGSENDER] prover time", + }, + } + prometheus.RegisterGauges(gauges...) + log.Info("Registered prometheus aggsender metrics") +} + +// CertificateSent increments the gauge for the number of certificates sent +func CertificateSent() { + prometheus.GaugeInc(numberOfCertificatesSent) +} + +// InError increments the gauge for the number of certificates in error +func InError() { + prometheus.GaugeInc(numberOfCertificatesInError) +} + +// SendingRetry increments the gauge for the number of sending retries +func SendingRetry() { + prometheus.GaugeInc(numberOfSendingRetries) +} + +// Settled increments the gauge for the number of certificates settled +func Settled() { + prometheus.GaugeInc(numberOfCertificatesSettled) +} + +// CertificateBuildTime sets the gauge for the certificate build time +func CertificateBuildTime(value float64) { + prometheus.GaugeSet(certificateBuildTime, value) +} + +// ProverTime sets the gauge for the prover time +func ProverTime(value float64) { + prometheus.GaugeSet(proverTime, value) +} diff --git a/cmd/run.go b/cmd/run.go index 8b31b5ff..a7d69e8e 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -3,9 +3,12 @@ package main import ( "context" "fmt" + "net" + "net/http" "os" "os/signal" "runtime" + "time" jRPC "github.com/0xPolygon/cdk-rpc/rpc" "github.com/0xPolygon/zkevm-ethtx-manager/ethtxmanager" @@ -24,9 +27,11 @@ import ( "github.com/agglayer/aggkit/l1infotreesync" "github.com/agglayer/aggkit/lastgersync" "github.com/agglayer/aggkit/log" + "github.com/agglayer/aggkit/prometheus" "github.com/agglayer/aggkit/reorgdetector" "github.com/agglayer/aggkit/rpc" "github.com/ethereum/go-ethereum/ethclient" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/urfave/cli/v2" ) @@ -45,6 +50,10 @@ func start(cliCtx *cli.Context) error { logVersion() } + if cfg.Prometheus.Enabled { + prometheus.Init() + } + components := cliCtx.StringSlice(config.FlagComponents) l1Client := runL1ClientIfNeeded(components, cfg.Etherman.URL) l2Client := runL2ClientIfNeeded(components, getL2RPCUrl(cfg)) @@ -114,6 +123,13 @@ func start(cliCtx *cli.Context) error { } }() } + + if cfg.Prometheus.Enabled { + go startPrometheusHTTPServer(cfg.Prometheus) + } else { + log.Info("Prometheus metrics server is disabled") + } + waitSignal(nil) return nil @@ -588,3 +604,30 @@ func getL2RPCUrl(c *config.Config) string { return c.AggOracle.EVMSender.URLRPCL2 } + +func startPrometheusHTTPServer(c prometheus.Config) { + const ten = 10 + mux := http.NewServeMux() + address := fmt.Sprintf("%s:%d", c.Host, c.Port) + lis, err := net.Listen("tcp", address) + if err != nil { + log.Errorf("failed to create tcp listener for metrics: %v", err) + return + } + mux.Handle(prometheus.Endpoint, promhttp.Handler()) + + metricsServer := &http.Server{ + Handler: mux, + ReadHeaderTimeout: ten * time.Second, + ReadTimeout: ten * time.Second, + } + log.Infof("prometheus server listening on port %d", c.Port) + if err := metricsServer.Serve(lis); err != nil { + if err == http.ErrServerClosed { + log.Warnf("prometheus http server stopped") + return + } + log.Errorf("closed http connection for prometheus server: %v", err) + return + } +} diff --git a/config/config.go b/config/config.go index 184cb96a..80cf6551 100644 --- a/config/config.go +++ b/config/config.go @@ -17,6 +17,7 @@ import ( "github.com/agglayer/aggkit/l1infotreesync" "github.com/agglayer/aggkit/lastgersync" "github.com/agglayer/aggkit/log" + "github.com/agglayer/aggkit/prometheus" "github.com/agglayer/aggkit/reorgdetector" "github.com/mitchellh/mapstructure" "github.com/pelletier/go-toml/v2" @@ -130,6 +131,9 @@ type Config struct { // AggSender is the configuration of the agg sender service AggSender aggsender.Config + + // Prometheus is the configuration of the prometheus service + Prometheus prometheus.Config } // Load loads the configuration diff --git a/config/default.go b/config/default.go index 0d916019..a8e27496 100644 --- a/config/default.go +++ b/config/default.go @@ -228,5 +228,8 @@ MaxEpochPercentageAllowedToSendCertificate=80 [AggSender.MaxSubmitCertificateRate] NumRequests = 20 Interval = "1h" - +[Prometheus] +Enabled = true +Host = "localhost" +Port = 9091 ` diff --git a/docs/aggsender.md b/docs/aggsender.md index da1452d6..8e3bb85c 100644 --- a/docs/aggsender.md +++ b/docs/aggsender.md @@ -155,6 +155,30 @@ This paragraph explains different use cases with outcomes. 6. Navigate to the `test/bats/pp` folder (`cd test/bats/pp`). 7. Run a test in `bridge-e2e.bats` file: `bats -f "Native gas token deposit to WETH" bridge-e2e.bats`. This will build a new certificate after it is done, and you can debug the whole process. +## Prometheus Endpoint + +If enabled in the configuration, Aggsender exposes the following Prometheus metrics: + +- Total number of certificates sent +- Number of sending errors +- Number of successful sends +- Certificate build time +- Prover execution time + +### Configuration Example + +To enable Prometheus metrics, configure Aggsender as follows: + +```ini +[Prometheus] +Enabled = true +Host = "localhost" +Port = 9091 +``` + +With this configuration, the metrics will be available at: +http://localhost:9091/metrics + ## Additional Documentation [1] https://potential-couscous-4gw6qyo.pages.github.io/protocol/workflow_centralized.html [2] https://agglayer.github.io/agglayer/pessimistic_proof/index.html diff --git a/go.mod b/go.mod index 62d11eb3..922efa1a 100644 --- a/go.mod +++ b/go.mod @@ -18,6 +18,8 @@ require ( github.com/mattn/go-sqlite3 v1.14.24 github.com/mitchellh/mapstructure v1.5.0 github.com/pelletier/go-toml/v2 v2.2.3 + github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/client_model v0.6.1 github.com/rubenv/sql-migrate v1.7.1 github.com/russross/meddler v1.0.1 github.com/spf13/viper v1.19.0 @@ -91,6 +93,7 @@ require ( github.com/knadh/koanf/maps v0.1.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/logrusorgru/aurora v2.0.3+incompatible // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -108,8 +111,6 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect - github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect diff --git a/prometheus/api.go b/prometheus/api.go new file mode 100644 index 00000000..c830bced --- /dev/null +++ b/prometheus/api.go @@ -0,0 +1,16 @@ +package prometheus + +const ( + // Endpoint the endpoint for exposing the metrics + Endpoint = "/metrics" + // ProfilingIndexEndpoint the endpoint for exposing the profiling metrics + ProfilingIndexEndpoint = "/debug/pprof/" + // ProfileEndpoint the endpoint for exposing the profile of the profiling metrics + ProfileEndpoint = "/debug/pprof/profile" + // ProfilingCmdEndpoint the endpoint for exposing the command-line of profiling metrics + ProfilingCmdEndpoint = "/debug/pprof/cmdline" + // ProfilingSymbolEndpoint the endpoint for exposing the symbol of profiling metrics + ProfilingSymbolEndpoint = "/debug/pprof/symbol" + // ProfilingTraceEndpoint the endpoint for exposing the trace of profiling metrics + ProfilingTraceEndpoint = "/debug/pprof/trace" +) diff --git a/prometheus/config.go b/prometheus/config.go new file mode 100644 index 00000000..04f42b94 --- /dev/null +++ b/prometheus/config.go @@ -0,0 +1,11 @@ +package prometheus + +// Config represents the configuration of the metrics +type Config struct { + // Enabled is the flag to enable/disable the metrics server + Enabled bool `mapstructure:"Enabled"` + // Host is the address to bind the metrics server + Host string `mapstructure:"Host"` + // Port is the port to bind the metrics server + Port int `mapstructure:"Port"` +} diff --git a/prometheus/prometheus.go b/prometheus/prometheus.go new file mode 100644 index 00000000..84fbcb59 --- /dev/null +++ b/prometheus/prometheus.go @@ -0,0 +1,677 @@ +package prometheus + +import ( + "net/http" + "sync" + + "github.com/agglayer/aggkit/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" +) + +var ( + storageMutex sync.RWMutex + registerer prometheus.Registerer + gauges map[string]prometheus.Gauge + counters map[string]prometheus.Counter + counterVecs map[string]*prometheus.CounterVec + histograms map[string]prometheus.Histogram + histogramVecs map[string]*prometheus.HistogramVec + summaries map[string]prometheus.Summary + initialized bool + initOnce sync.Once +) + +// CounterVecOpts holds options for the CounterVec type. +type CounterVecOpts struct { + prometheus.CounterOpts + Labels []string +} + +// HistogramVecOpts holds options for the HistogramVec type. +type HistogramVecOpts struct { + prometheus.HistogramOpts + Labels []string +} + +// Init initializes the package variables. +func Init() { + initOnce.Do(func() { + storageMutex = sync.RWMutex{} + registerer = prometheus.DefaultRegisterer + gauges = make(map[string]prometheus.Gauge) + counters = make(map[string]prometheus.Counter) + counterVecs = make(map[string]*prometheus.CounterVec) + histograms = make(map[string]prometheus.Histogram) + histogramVecs = make(map[string]*prometheus.HistogramVec) + summaries = make(map[string]prometheus.Summary) + initialized = true + }) +} + +// Handler returns the Prometheus http handler. +func Handler() http.Handler { + return promhttp.Handler() +} + +// RegisterGauges registers the provided gauge metrics to the Prometheus +// registerer. +func RegisterGauges(opts ...prometheus.GaugeOpts) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, options := range opts { + registerGaugeIfNotExists(options) + } +} + +// UnregisterGauges unregisters the provided gauge metrics from the Prometheus +// registerer. +func UnregisterGauges(names ...string) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, name := range names { + unregisterGaugeIfExists(name) + } +} + +// Gauge retrieves gauge metric by name +func Gauge(name string) (gauge prometheus.Gauge, exist bool) { + if !initialized { + return + } + + storageMutex.RLock() + defer storageMutex.RUnlock() + + if gauge, exist = gauges[name]; !exist { + return nil, exist + } + + return gauge, exist +} + +// GaugeSet sets the value for gauge with the given name. +func GaugeSet(name string, value float64) { + if !initialized { + return + } + + if c, ok := Gauge(name); ok { + c.Set(value) + } +} + +// GaugeInc increments the gauge with the given name. +func GaugeInc(name string) { + if !initialized { + return + } + + if g, ok := Gauge(name); ok { + g.Inc() + } +} + +// GaugeDec decrements the gauge with the given name. +func GaugeDec(name string) { + if !initialized { + return + } + + if g, ok := Gauge(name); ok { + g.Dec() + } +} + +// RegisterCounters registers the provided counter metrics to the Prometheus +// registerer. +func RegisterCounters(opts ...prometheus.CounterOpts) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, options := range opts { + registerCounterIfNotExists(options) + } +} + +// Counter retrieves counter metric by name +func Counter(name string) (counter prometheus.Counter, exist bool) { + if !initialized { + return + } + + storageMutex.RLock() + defer storageMutex.RUnlock() + + if counter, exist = counters[name]; !exist { + return nil, exist + } + + return counter, exist +} + +// CounterInc increments the counter with the given name. +func CounterInc(name string) { + if !initialized { + return + } + + if c, ok := Counter(name); ok { + c.Inc() + } +} + +// CounterAdd increments the counter with the given name. +func CounterAdd(name string, value float64) { + if !initialized { + return + } + + if c, ok := Counter(name); ok { + c.Add(value) + } +} + +// UnregisterCounters unregisters the provided counter metrics from the +// Prometheus registerer. +func UnregisterCounters(names ...string) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, name := range names { + unregisterCounterIfExists(name) + } +} + +// RegisterCounterVecs registers the provided counter vec metrics to the +// Prometheus registerer. +func RegisterCounterVecs(opts ...CounterVecOpts) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, options := range opts { + registerCounterVecIfNotExists(options) + } +} + +// CounterVec retrieves counter ver metric by name +func CounterVec(name string) (counterVec *prometheus.CounterVec, exist bool) { + if !initialized { + return + } + + storageMutex.RLock() + defer storageMutex.RUnlock() + + counterVec, exist = counterVecs[name] + + return counterVec, exist +} + +// CounterVecInc increments the counter vec with the given name and label. +func CounterVecInc(name string, label string) { + if !initialized { + return + } + + if cv, ok := CounterVec(name); ok { + cv.WithLabelValues(label).Inc() + } +} + +// CounterVecAdd increments the counter vec by the given value, with the given +// name and label. +func CounterVecAdd(name string, label string, value float64) { + if !initialized { + return + } + + if cv, ok := CounterVec(name); ok { + cv.WithLabelValues(label).Add(value) + } +} + +// UnregisterCounterVecs unregisters the provided counter vec metrics from the +// Prometheus registerer. +func UnregisterCounterVecs(names ...string) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, name := range names { + unregisterCounterVecIfExists(name) + } +} + +// RegisterHistograms registers the provided histogram metrics to the +// Prometheus registerer. +func RegisterHistograms(opts ...prometheus.HistogramOpts) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, options := range opts { + registerHistogramIfNotExists(options) + } +} + +// Histogram retrieves histogram metric by name +func Histogram(name string) (histogram prometheus.Histogram, exist bool) { + if !initialized { + return + } + + storageMutex.RLock() + defer storageMutex.RUnlock() + + if histogram, exist = histograms[name]; !exist { + return nil, exist + } + + return histogram, exist +} + +// HistogramObserve observes the histogram from the given start time. +func HistogramObserve(name string, value float64) { + if !initialized { + return + } + + if histo, ok := Histogram(name); ok { + histo.Observe(value) + } +} + +// UnregisterHistogram unregisters the provided histogram metrics from the +// Prometheus registerer. +func UnregisterHistogram(names ...string) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, name := range names { + unregisterHistogramIfExists(name) + } +} + +// RegisterHistogramVecs registers the provided histogram vec metrics to the +// Prometheus registerer. +func RegisterHistogramVecs(opts ...HistogramVecOpts) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, options := range opts { + registerHistogramVecIfNotExists(options) + } +} + +// HistogramVec retrieves histogram ver metric by name +func HistogramVec(name string) (histgramVec *prometheus.HistogramVec, exist bool) { + if !initialized { + return + } + + storageMutex.RLock() + defer storageMutex.RUnlock() + + histgramVec, exist = histogramVecs[name] + + return histgramVec, exist +} + +// HistogramVecObserve observes the histogram vec with the given name, label and value. +func HistogramVecObserve(name string, label string, value float64) { + if !initialized { + return + } + + if cv, ok := HistogramVec(name); ok { + cv.WithLabelValues(label).Observe(value) + } +} + +// UnregisterHistogramVecs unregisters the provided histogram vec metrics from the +// Prometheus registerer. +func UnregisterHistogramVecs(names ...string) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, name := range names { + unregisterHistogramVecIfExists(name) + } +} + +// RegisterSummaries registers the provided summary metrics to the Prometheus +// registerer. +func RegisterSummaries(opts ...prometheus.SummaryOpts) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, options := range opts { + registerSummaryIfNotExists(options) + } +} + +// Summary retrieves summary metric by name +func Summary(name string) (summary prometheus.Summary, exist bool) { + if !initialized { + return + } + + storageMutex.RLock() + defer storageMutex.RUnlock() + + if summary, exist = summaries[name]; !exist { + return nil, exist + } + + return summary, exist +} + +// UnregisterSummaries unregisters the provided summary metrics from the +// Prometheus registerer. +func UnregisterSummaries(names ...string) { + if !initialized { + return + } + + storageMutex.Lock() + defer storageMutex.Unlock() + + for _, name := range names { + unregisterSummaryIfExists(name) + } +} + +// registerGaugeIfNotExists registers single gauge metric if not exists +func registerGaugeIfNotExists(opts prometheus.GaugeOpts) { + log := log.WithFields("metricName", opts.Name) + if _, exist := gauges[opts.Name]; exist { + log.Warn("Gauge metric already exists.") + return + } + + log.Debug("Creating Gauge Metric...") + gauge := prometheus.NewGauge(opts) + log.Debugf("Gauge Metric successfully created! Labels: %p", opts.ConstLabels) + + log.Debug("Registering Gauge Metric...") + registerer.MustRegister(gauge) + log.Debug("Gauge Metric successfully registered!") + + gauges[opts.Name] = gauge +} + +// unregisterGaugeIfExists unregisters single gauge metric if exists +func unregisterGaugeIfExists(name string) { + var ( + gauge prometheus.Gauge + ok bool + ) + + log := log.WithFields("metricName", name) + if gauge, ok = gauges[name]; !ok { + log.Warn("Trying to delete non-existing Gauge metrics.") + return + } + + log.Debug("Unregistering Gauge Metric...") + ok = registerer.Unregister(gauge) + if !ok { + log.Error("Failed to unregister Gauge Metric.") + return + } + delete(gauges, name) + log.Debug("Gauge Metric successfully unregistered!") +} + +// registerCounterIfNotExists registers single counter metric if not exists +func registerCounterIfNotExists(opts prometheus.CounterOpts) { + log := log.WithFields("metricName", opts.Name) + if _, exist := counters[opts.Name]; exist { + log.Infof("Counter metric already exists. %s", opts.Name) + return + } + + log.Debug("Creating Counter Metric...") + counter := prometheus.NewCounter(opts) + log.Debugf("Counter Metric successfully created! Labels: %p", opts.ConstLabels) + + log.Debug("Registering Counter Metric...") + registerer.MustRegister(counter) + log.Debug("Counter Metric successfully registered!") + + counters[opts.Name] = counter +} + +// unregisterCounterIfExists unregisters single counter metric if exists +func unregisterCounterIfExists(name string) { + var ( + counter prometheus.Counter + ok bool + ) + + log := log.WithFields("metricName", name) + if counter, ok = counters[name]; !ok { + log.Warn("Trying to delete non-existing Counter counter.") + return + } + + log.Debug("Unregistering Counter Metric...") + ok = registerer.Unregister(counter) + if !ok { + log.Error("Failed to unregister Counter Metric.") + return + } + delete(counters, name) + log.Debugf("Counter Metric '%v' successfully unregistered!", name) +} + +// registerCounterVecIfNotExists registers single counter vec metric if not exists +func registerCounterVecIfNotExists(opts CounterVecOpts) { + log := log.WithFields("metricName", opts.Name) + if _, exist := counterVecs[opts.Name]; exist { + log.Warn("Counter vec metric already exists.") + return + } + + log.Debug("Creating Counter Vec Metric...") + counterVec := prometheus.NewCounterVec(opts.CounterOpts, opts.Labels) + log.Debugf("Counter Vec Metric successfully created! Labels: %p", opts.ConstLabels) + + log.Debug("Registering Counter Vec Metric...") + registerer.MustRegister(counterVec) + log.Debug("Counter Vec Metric successfully registered!") + + counterVecs[opts.Name] = counterVec +} + +// unregisterCounterVecIfExists unregisters single counter metric if exists +func unregisterCounterVecIfExists(name string) { + var ( + counterVec *prometheus.CounterVec + ok bool + ) + + log := log.WithFields("metricName", name) + if counterVec, ok = counterVecs[name]; !ok { + log.Warn("Trying to delete non-existing Counter Vec counter.") + return + } + + log.Debug("Unregistering Counter Vec Metric...") + ok = registerer.Unregister(counterVec) + if !ok { + log.Error("Failed to unregister Counter Vec Metric.") + return + } + delete(counterVecs, name) + log.Debug("Counter Vec Metric successfully unregistered!") +} + +// registerHistogramIfNotExists registers single histogram metric if not exists +func registerHistogramIfNotExists(opts prometheus.HistogramOpts) { + log := log.WithFields("metricName", opts.Name) + if _, exist := histograms[opts.Name]; exist { + log.Infof("Histogram metric already exists. %s", opts.Name) + return + } + + log.Debug("Creating Histogram Metric...") + histogram := prometheus.NewHistogram(opts) + log.Debugf("Histogram Metric successfully created! Labels: %p", opts.ConstLabels) + + log.Debug("Registering Histogram Metric...") + registerer.MustRegister(histogram) + log.Debug("Histogram Metric successfully registered!") + + histograms[opts.Name] = histogram +} + +// unregisterHistogramIfExists unregisters single histogram metric if exists +func unregisterHistogramIfExists(name string) { + var ( + histogram prometheus.Histogram + ok bool + ) + + log := log.WithFields("metricName", name) + if histogram, ok = histograms[name]; !ok { + log.Warn("Trying to delete non-existing Histogram histogram.") + return + } + + log.Debug("Unregistering Histogram Metric...") + ok = registerer.Unregister(histogram) + if !ok { + log.Error("Failed to unregister Histogram Metric.") + return + } + delete(histograms, name) + log.Debug("Histogram Metric successfully unregistered!") +} + +// registerHistogramVecIfNotExists unregisters single counter metric if exists +func registerHistogramVecIfNotExists(opts HistogramVecOpts) { + if _, exist := histogramVecs[opts.Name]; exist { + log.Warnf("Histogram vec metric '%v' already exists.", opts.Name) + return + } + + log.Infof("Creating Histogram Vec Metric '%v' ...", opts.Name) + histogramVec := prometheus.NewHistogramVec(opts.HistogramOpts, opts.Labels) + log.Infof("Histogram Vec Metric '%v' successfully created! Labels: %p", opts.Name, opts.ConstLabels) + + log.Infof("Registering Histogram Vec Metric '%v' ...", opts.Name) + registerer.MustRegister(histogramVec) + log.Infof("Histogram Vec Metric '%v' successfully registered!", opts.Name) + + histogramVecs[opts.Name] = histogramVec +} + +// unregisterHistogramVecIfExists unregisters single histogram metric if exists +func unregisterHistogramVecIfExists(name string) { + var ( + histogramVec *prometheus.HistogramVec + ok bool + ) + + if histogramVec, ok = histogramVecs[name]; !ok { + log.Warnf("Trying to delete non-existing Histogram Vec '%v'.", name) + return + } + + log.Infof("Unregistering Histogram Vec Metric '%v' ...", name) + ok = registerer.Unregister(histogramVec) + if !ok { + log.Errorf("Failed to unregister Histogram Vec Metric '%v'.", name) + return + } + delete(histogramVecs, name) + log.Infof("Histogram Vec Metric '%v' successfully unregistered!", name) +} + +// registerSummaryIfNotExists registers single summary metric if not exists +func registerSummaryIfNotExists(opts prometheus.SummaryOpts) { + log := log.WithFields("metricName", opts.Name) + if _, exist := summaries[opts.Name]; exist { + log.Warn("Summary metric already exists.") + return + } + + log.Debug("Creating Summary Metric...") + summary := prometheus.NewSummary(opts) + log.Debugf("Summary Metric successfully created! Labels: %p", opts.ConstLabels) + + log.Debug("Registering Summary Metric...") + registerer.MustRegister(summary) + log.Debug("Summary Metric successfully registered!") + + summaries[opts.Name] = summary +} + +// unregisterSummaryIfExists unregisters single summary metric if exists +func unregisterSummaryIfExists(name string) { + var ( + summary prometheus.Summary + ok bool + ) + + log := log.WithFields("metricName", name) + if summary, ok = summaries[name]; !ok { + log.Warn("Trying to delete non-existing Summary summary.") + return + } + + log.Debug("Unregistering Summary Metric...") + ok = registerer.Unregister(summary) + if !ok { + log.Error("Failed to unregister Summary Metric.") + return + } + delete(summaries, name) + log.Debug("Summary Metric successfully unregistered!") +} diff --git a/prometheus/prometheus_test.go b/prometheus/prometheus_test.go new file mode 100644 index 00000000..865eee01 --- /dev/null +++ b/prometheus/prometheus_test.go @@ -0,0 +1,375 @@ +package prometheus + +import ( + "sync" + "testing" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" + dto "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + gaugeName = "gaugeName" + gaugeOpts = prometheus.GaugeOpts{Name: gaugeName} + gauge prometheus.Gauge + counterName = "counterName" + counterOpts = prometheus.CounterOpts{Name: counterName} + counter prometheus.Counter + counterVecName = "counterVecName" + counterVecLabelName = "counterVecLabelName" + counterVecLabelVal = "counterVecLabelVal" + counterVecOpts = CounterVecOpts{prometheus.CounterOpts{Name: counterVecName}, []string{counterVecLabelName}} + counterVec *prometheus.CounterVec + histogramName = "histogramName" + histogramOpts = prometheus.HistogramOpts{Name: histogramName, Buckets: []float64{0.5, 10, 20}} + histogram prometheus.Histogram + histogramVecName = "histogramVecName" + histogramVecLabelName = "histogramVecLabelName" + histogramVecLabelVal = "histogramVecLabelVal" + histogramVecOpts = HistogramVecOpts{prometheus.HistogramOpts{Name: histogramVecName}, []string{histogramVecLabelName}} + histogramVec *prometheus.HistogramVec + summaryName = "summaryName" + summaryOpts = prometheus.SummaryOpts{Name: summaryName} + summary = prometheus.NewSummary(summaryOpts) +) + +func setup() { + Init() + gauge = prometheus.NewGauge(gaugeOpts) + counter = prometheus.NewCounter(counterOpts) + counterVec = prometheus.NewCounterVec(counterVecOpts.CounterOpts, counterVecOpts.Labels) + histogram = prometheus.NewHistogram(histogramOpts) + histogramVec = prometheus.NewHistogramVec(histogramVecOpts.HistogramOpts, histogramVecOpts.Labels) + summary = prometheus.NewSummary(summaryOpts) + + // Overriding registerer to be able to do the unit tests independently + registerer = prometheus.NewRegistry() +} + +func cleanup() { + initialized = false + initOnce = sync.Once{} +} + +func TestHandler(t *testing.T) { + setup() + defer cleanup() + + actual := Handler() + + assert.NotNil(t, actual) +} + +func TestRegisterGauges(t *testing.T) { + setup() + defer cleanup() + gaugesOpts := []prometheus.GaugeOpts{gaugeOpts} + + RegisterGauges(gaugesOpts...) + + assert.Len(t, gauges, 1) +} + +func TestGauge(t *testing.T) { + setup() + defer cleanup() + gauges[gaugeName] = gauge + + actual, exist := Gauge(gaugeName) + + assert.True(t, exist) + assert.Equal(t, gauge, actual) +} + +func TestGaugeSet(t *testing.T) { + setup() + defer cleanup() + gauges[gaugeName] = gauge + expected := float64(2) + + GaugeSet(gaugeName, expected) + actual := testutil.ToFloat64(gauge) + + assert.Equal(t, expected, actual) +} + +func TestGaugeInc(t *testing.T) { + setup() + defer cleanup() + gauges[gaugeName] = gauge + expected := float64(1) + + GaugeInc(gaugeName) + actual := testutil.ToFloat64(gauge) + + assert.Equal(t, expected, actual) +} + +func TestGaugeDec(t *testing.T) { + setup() + defer cleanup() + gauges[gaugeName] = gauge + gauge.Set(2) + expected := float64(1) + + GaugeDec(gaugeName) + actual := testutil.ToFloat64(gauge) + + assert.Equal(t, expected, actual) +} + +func TestUnregisterGauges(t *testing.T) { + setup() + defer cleanup() + RegisterGauges(gaugeOpts) + + UnregisterGauges(gaugeName) + + assert.Len(t, gauges, 0) +} + +func TestRegisterCounters(t *testing.T) { + setup() + defer cleanup() + countersOpts := []prometheus.CounterOpts{counterOpts} + + RegisterCounters(countersOpts...) + + assert.Len(t, counters, 1) +} + +func TestCounter(t *testing.T) { + setup() + defer cleanup() + counters[counterName] = counter + + actual, exist := Counter(counterName) + + assert.True(t, exist) + assert.Equal(t, counter, actual) +} + +func TestCounterInc(t *testing.T) { + setup() + defer cleanup() + counters[counterName] = counter + expected := float64(1) + + CounterInc(counterName) + actual := testutil.ToFloat64(counter) + + assert.Equal(t, expected, actual) +} + +func TestCounterAdd(t *testing.T) { + setup() + defer cleanup() + counters[counterName] = counter + expected := float64(2) + + CounterAdd(counterName, expected) + actual := testutil.ToFloat64(counter) + + assert.Equal(t, expected, actual) +} + +func TestUnregisterCounters(t *testing.T) { + setup() + defer cleanup() + RegisterCounters(counterOpts) + + UnregisterCounters(counterName) + + assert.Len(t, counters, 0) +} + +func TestRegisterCounterVecs(t *testing.T) { + setup() + defer cleanup() + counterVecsOpts := []CounterVecOpts{counterVecOpts} + + RegisterCounterVecs(counterVecsOpts...) + + assert.Len(t, counterVecs, 1) +} + +func TestCounterVec(t *testing.T) { + setup() + defer cleanup() + counterVecs[counterVecName] = counterVec + + actual, exist := CounterVec(counterVecName) + + assert.True(t, exist) + assert.Equal(t, counterVec, actual) +} + +func TestCounterVecInc(t *testing.T) { + setup() + defer cleanup() + counterVecs[counterVecName] = counterVec + expected := float64(1) + + CounterVecInc(counterVecName, counterVecLabelVal) + currCounterVec, err := counterVec.GetMetricWithLabelValues(counterVecLabelVal) + require.NoError(t, err) + actual := testutil.ToFloat64(currCounterVec) + + assert.Equal(t, expected, actual) +} + +func TestCounterVecAdd(t *testing.T) { + setup() + defer cleanup() + counterVecs[counterVecName] = counterVec + expected := float64(2) + + CounterVecAdd(counterVecName, counterVecLabelVal, expected) + currCounterVec, err := counterVec.GetMetricWithLabelValues(counterVecLabelVal) + require.NoError(t, err) + actual := testutil.ToFloat64(currCounterVec) + + assert.Equal(t, expected, actual) +} + +func TestUnregisterCounterVecs(t *testing.T) { + setup() + defer cleanup() + RegisterCounterVecs(counterVecOpts) + + UnregisterCounterVecs(counterVecName) + + assert.Len(t, counterVecs, 0) +} + +func TestRegisterHistograms(t *testing.T) { + setup() + defer cleanup() + histogramsOpts := []prometheus.HistogramOpts{histogramOpts} + + RegisterHistograms(histogramsOpts...) + + assert.Len(t, histograms, 1) +} + +func TestHistogram(t *testing.T) { + setup() + defer cleanup() + histograms[histogramName] = histogram + + actual, exist := Histogram(histogramName) + + assert.True(t, exist) + assert.Equal(t, histogram, actual) +} + +func TestHistogramObserve(t *testing.T) { + setup() + defer cleanup() + histograms[histogramName] = histogram + + expected := 42.0 + + HistogramObserve(histogramName, expected) + + m := &dto.Metric{} + require.NoError(t, histogram.Write(m)) + h := m.GetHistogram() + actual := h.GetSampleSum() + assert.Equal(t, expected, actual) +} + +func TestUnregisterHistograms(t *testing.T) { + setup() + defer cleanup() + RegisterHistograms(histogramOpts) + + UnregisterHistogram(histogramName) + + assert.Len(t, histograms, 0) +} + +func TestRegisterHistogramVecs(t *testing.T) { + setup() + defer cleanup() + histogramVecsOpts := []HistogramVecOpts{histogramVecOpts} + + RegisterHistogramVecs(histogramVecsOpts...) + + assert.Len(t, histogramVecs, 1) +} + +func TestHistogramVec(t *testing.T) { + setup() + defer cleanup() + histogramVecs[histogramVecName] = histogramVec + + actual, exist := HistogramVec(histogramVecName) + + assert.True(t, exist) + assert.Equal(t, histogramVec, actual) +} + +func TestHistogramVecObserve(t *testing.T) { + setup() + defer cleanup() + histogramVecs[histogramVecName] = histogramVec + expected := float64(2) + + HistogramVecObserve(histogramVecName, histogramVecLabelVal, expected) + + currHistogramVec := histogramVec.WithLabelValues(histogramVecLabelVal) + m := &dto.Metric{} + + histogram, ok := currHistogramVec.(prometheus.Histogram) + require.True(t, ok, "currHistogramVec is not a prometheus.Histogram") + + require.NoError(t, histogram.Write(m)) + h := m.GetHistogram() + actual := h.GetSampleSum() + assert.Equal(t, expected, actual) +} + +func TestUnregisterHistogramVecs(t *testing.T) { + setup() + defer cleanup() + RegisterHistogramVecs(histogramVecOpts) + + UnregisterHistogramVecs(histogramVecName) + + assert.Len(t, histogramVecs, 0) +} + +func TestRegisterSummaries(t *testing.T) { + setup() + defer cleanup() + summariesOpts := []prometheus.SummaryOpts{summaryOpts} + + RegisterSummaries(summariesOpts...) + + assert.Len(t, summaries, 1) +} + +func TestSummary(t *testing.T) { + setup() + defer cleanup() + summaries[summaryName] = summary + + actual, exist := Summary(summaryName) + + assert.True(t, exist) + assert.Equal(t, summary, actual) +} + +func TestUnregisterSummaries(t *testing.T) { + setup() + defer cleanup() + RegisterSummaries(summaryOpts) + + UnregisterSummaries(summaryName) + + assert.Len(t, summaries, 0) +} diff --git a/test/run-e2e-multi_pp.sh b/test/run-e2e-multi_pp.sh index d8f60286..6be114e6 100755 --- a/test/run-e2e-multi_pp.sh +++ b/test/run-e2e-multi_pp.sh @@ -32,7 +32,7 @@ function build_docker_if_required(){ function resolve_template(){ local _TEMPLATE_FILE="$1" local _RESULT_VARNAME="$2" - local _TEMP_FILE=$(mktemp --suffix ".yml") + local _TEMP_FILE=$(mktemp)".yml" echo "rendering $_TEMPLATE_FILE to temp file $_TEMP_FILE" go run ../scripts/run_template.go $_TEMPLATE_FILE > $_TEMP_FILE ok_or_fatal "Failed to render template $_TEMPLATE_FILE" From 156b4aa653c371de42043af36666b7d2e99f9b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Negovanovi=C4=87?= <93934272+Stefan-Ethernal@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:19:07 +0100 Subject: [PATCH 6/9] fix: upgrade kurtosis config and pass e2e tests (#235) --- .../fork12-pessimistic-multi-attach-second-cdk.yml | 4 ++-- test/combinations/fork12-pessimistic-multi.yml | 7 +++++-- test/combinations/fork12-pessimistic.yml | 8 ++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml b/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml index 959483fd..9b4418f1 100644 --- a/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml +++ b/test/combinations/fork12-pessimistic-multi-attach-second-cdk.yml @@ -27,8 +27,8 @@ args: cdk_node_image: aggkit:latest - cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1 - zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.16-RC1 + zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12 additional_services: [] consensus_contract_type: pessimistic sequencer_type: erigon diff --git a/test/combinations/fork12-pessimistic-multi.yml b/test/combinations/fork12-pessimistic-multi.yml index 23bb2c5e..642706e3 100644 --- a/test/combinations/fork12-pessimistic-multi.yml +++ b/test/combinations/fork12-pessimistic-multi.yml @@ -1,8 +1,11 @@ +deployment_stages: + deploy_l2_contracts: true + args: cdk_node_image: aggkit:latest agglayer_image: ghcr.io/agglayer/agglayer:main - cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1 - zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.16-RC1 + zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12 additional_services: [] consensus_contract_type: pessimistic sequencer_type: erigon diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml index 197f6e4c..1d304b7e 100644 --- a/test/combinations/fork12-pessimistic.yml +++ b/test/combinations/fork12-pessimistic.yml @@ -1,12 +1,16 @@ +deployment_stages: + deploy_l2_contracts: true + args: cdk_node_image: aggkit:latest agglayer_image: ghcr.io/agglayer/agglayer:main - cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.9-RC1 - zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12 + cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.16-RC1 + zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12 additional_services: [] consensus_contract_type: pessimistic sequencer_type: erigon erigon_strict_mode: false gas_token_enabled: true + gas_token_address: "" agglayer_prover_sp1_key: {{.AGGLAYER_PROVER_SP1_KEY}} enable_normalcy: true From d89a6d0c8dddd1356a0d41d3d203734ced879525 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 18:33:56 +0100 Subject: [PATCH 7/9] chore(deps): bump github.com/prometheus/client_golang from 1.20.4 to 1.21.0 (#230) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 922efa1a..0e0368eb 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.24 github.com/mitchellh/mapstructure v1.5.0 github.com/pelletier/go-toml/v2 v2.2.3 - github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/client_golang v1.21.0 github.com/prometheus/client_model v0.6.1 github.com/rubenv/sql-migrate v1.7.1 github.com/russross/meddler v1.0.1 @@ -89,7 +89,7 @@ require ( github.com/huin/goupnp v1.3.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmoiron/sqlx v1.2.0 // indirect - github.com/klauspost/compress v1.17.9 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -111,7 +111,7 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.2.0 // indirect diff --git a/go.sum b/go.sum index b426ea3b..18ff5644 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,8 @@ github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhB github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/parsers/json v0.1.0 h1:dzSZl5pf5bBcW0Acnu20Djleto19T0CfHcvZ14NJ6fU= @@ -269,12 +269,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.21.0 h1:DIsaGmiaBkSangBgMtWdNfxbMNdku5IK6iNhrEqWvdA= +github.com/prometheus/client_golang v1.21.0/go.mod h1:U9NM32ykUErtVBxdvD3zfi+EuFkkaBvMb09mIfe0Zgg= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= +github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= From ce86aa66f55f2a4d828ec547d9bd2411116eccc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Negovanovi=C4=87?= Date: Mon, 24 Feb 2025 20:38:41 +0100 Subject: [PATCH 8/9] fix: update zkevm_contracts_image version and modify agglayer prover configuration --- test/combinations/fork12-pessimistic.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/combinations/fork12-pessimistic.yml b/test/combinations/fork12-pessimistic.yml index 1d304b7e..c7126d90 100644 --- a/test/combinations/fork12-pessimistic.yml +++ b/test/combinations/fork12-pessimistic.yml @@ -5,12 +5,13 @@ args: cdk_node_image: aggkit:latest agglayer_image: ghcr.io/agglayer/agglayer:main cdk_erigon_node_image: hermeznetwork/cdk-erigon:v2.61.16-RC1 - zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.6-pp-fork.12 + zkevm_contracts_image: leovct/zkevm-contracts:v9.0.0-rc.5-pp-fork.12 additional_services: [] consensus_contract_type: pessimistic sequencer_type: erigon erigon_strict_mode: false gas_token_enabled: true gas_token_address: "" - agglayer_prover_sp1_key: {{.AGGLAYER_PROVER_SP1_KEY}} + agglayer_prover_sp1_key: "" + agglayer_prover_primary_prover: mock-prover enable_normalcy: true From 7be9ce9dc7c4b65bbd378ad37a58744cecf04b77 Mon Sep 17 00:00:00 2001 From: Goran Rojovic Date: Tue, 25 Feb 2025 11:37:15 +0100 Subject: [PATCH 9/9] fix: change package names in proto --- agglayer/grpc/agglayer_grpc_client.go | 13 +- ...layer_certificate_submission_service.pb.go | 84 +++---- ...layer_certificate_submission_service.proto | 8 +- ..._certificate_submission_service_grpc.pb.go | 62 ++--- .../node/agglayer_configuration_service.pb.go | 61 ++--- .../node/agglayer_configuration_service.proto | 6 +- .../agglayer_configuration_service_grpc.pb.go | 63 +++--- .../node/agglayer_network_state_service.pb.go | 214 +++++++++--------- .../node/agglayer_network_state_service.proto | 18 +- .../agglayer_network_state_service_grpc.pb.go | 123 +++++----- agglayer/proto/types/bridge_exit.pb.go | 112 ++++----- agglayer/proto/types/bridge_exit.proto | 2 +- agglayer/proto/types/bytes.pb.go | 33 +-- agglayer/proto/types/bytes.proto | 2 +- agglayer/proto/types/certificate.pb.go | 161 ++++++------- agglayer/proto/types/certificate.proto | 2 +- agglayer/proto/types/certificate_header.pb.go | 165 +++++++------- agglayer/proto/types/certificate_header.proto | 2 +- agglayer/proto/types/claim.pb.go | 190 +++++++++------- agglayer/proto/types/claim.proto | 2 +- .../proto/types/epoch_configuration.pb.go | 26 +-- .../proto/types/epoch_configuration.proto | 2 +- .../proto/types/imported_bridge_exit.pb.go | 75 +++--- .../proto/types/imported_bridge_exit.proto | 2 +- cmd/run.go | 4 +- 25 files changed, 746 insertions(+), 686 deletions(-) diff --git a/agglayer/grpc/agglayer_grpc_client.go b/agglayer/grpc/agglayer_grpc_client.go index 01f00ac4..4291368d 100644 --- a/agglayer/grpc/agglayer_grpc_client.go +++ b/agglayer/grpc/agglayer_grpc_client.go @@ -12,9 +12,9 @@ import ( ) type AgglayerGRPCClient struct { - cfgService node.AgglayerConfigurationServiceClient - networkStateService node.AgglayerNetworkStateServiceClient - submissionService node.AgglayerCertificateSubmissionServiceClient + networkStateService node.NodeStateServiceClient + cfgService node.ConfigurationServiceClient + submissionService node.CertificateSubmissionServiceClient } // NewAggchainProofClient initializes a new AggchainProof instance @@ -23,10 +23,11 @@ func NewAgglayerGRPCClient(serverAddr string) (*AgglayerGRPCClient, error) { if err != nil { return nil, err } + return &AgglayerGRPCClient{ - cfgService: node.NewAgglayerConfigurationServiceClient(grpcClient.Conn()), - networkStateService: node.NewAgglayerNetworkStateServiceClient(grpcClient.Conn()), - submissionService: node.NewAgglayerCertificateSubmissionServiceClient(grpcClient.Conn()), + networkStateService: node.NewNodeStateServiceClient(grpcClient.Conn()), + cfgService: node.NewConfigurationServiceClient(grpcClient.Conn()), + submissionService: node.NewCertificateSubmissionServiceClient(grpcClient.Conn()), }, nil } diff --git a/agglayer/proto/node/agglayer_certificate_submission_service.pb.go b/agglayer/proto/node/agglayer_certificate_submission_service.pb.go index 19ca0e71..8e2150cc 100644 --- a/agglayer/proto/node/agglayer_certificate_submission_service.pb.go +++ b/agglayer/proto/node/agglayer_certificate_submission_service.pb.go @@ -176,37 +176,41 @@ var file_node_agglayer_certificate_submission_service_proto_rawDesc = []byte{ 0x0a, 0x32, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x18, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3a, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, - 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x5e, 0x0a, 0x19, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, 0x63, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x2a, 0x4e, 0x0a, 0x09, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x25, 0x0a, 0x21, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4b, - 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, 0x45, - 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x32, 0x7e, 0x0a, 0x24, - 0x41, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x56, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, - 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x65, 0x0a, 0x18, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x0b, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x6d, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x49, 0x64, 0x2a, 0x4e, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4b, 0x69, + 0x6e, 0x64, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x25, + 0x0a, 0x21, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x49, 0x47, + 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x32, 0x8c, 0x01, 0x0a, 0x1c, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x11, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, + 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -224,17 +228,17 @@ func file_node_agglayer_certificate_submission_service_proto_rawDescGZIP() []byt var file_node_agglayer_certificate_submission_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_node_agglayer_certificate_submission_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_node_agglayer_certificate_submission_service_proto_goTypes = []interface{}{ - (ErrorKind)(0), // 0: proto.ErrorKind - (*SubmitCertificateRequest)(nil), // 1: proto.SubmitCertificateRequest - (*SubmitCertificateResponse)(nil), // 2: proto.SubmitCertificateResponse - (*types.Certificate)(nil), // 3: proto.types.Certificate - (*types.CertificateId)(nil), // 4: proto.types.CertificateId + (ErrorKind)(0), // 0: agglayer.node.v1.ErrorKind + (*SubmitCertificateRequest)(nil), // 1: agglayer.node.v1.SubmitCertificateRequest + (*SubmitCertificateResponse)(nil), // 2: agglayer.node.v1.SubmitCertificateResponse + (*types.Certificate)(nil), // 3: agglayer.protocol.types.v1.Certificate + (*types.CertificateId)(nil), // 4: agglayer.protocol.types.v1.CertificateId } var file_node_agglayer_certificate_submission_service_proto_depIdxs = []int32{ - 3, // 0: proto.SubmitCertificateRequest.certificate:type_name -> proto.types.Certificate - 4, // 1: proto.SubmitCertificateResponse.certificate_id:type_name -> proto.types.CertificateId - 1, // 2: proto.AgglayerCertificateSubmissionService.SubmitCertificate:input_type -> proto.SubmitCertificateRequest - 2, // 3: proto.AgglayerCertificateSubmissionService.SubmitCertificate:output_type -> proto.SubmitCertificateResponse + 3, // 0: agglayer.node.v1.SubmitCertificateRequest.certificate:type_name -> agglayer.protocol.types.v1.Certificate + 4, // 1: agglayer.node.v1.SubmitCertificateResponse.certificate_id:type_name -> agglayer.protocol.types.v1.CertificateId + 1, // 2: agglayer.node.v1.CertificateSubmissionService.SubmitCertificate:input_type -> agglayer.node.v1.SubmitCertificateRequest + 2, // 3: agglayer.node.v1.CertificateSubmissionService.SubmitCertificate:output_type -> agglayer.node.v1.SubmitCertificateResponse 3, // [3:4] is the sub-list for method output_type 2, // [2:3] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name diff --git a/agglayer/proto/node/agglayer_certificate_submission_service.proto b/agglayer/proto/node/agglayer_certificate_submission_service.proto index a050d88f..4684d7de 100644 --- a/agglayer/proto/node/agglayer_certificate_submission_service.proto +++ b/agglayer/proto/node/agglayer_certificate_submission_service.proto @@ -2,12 +2,12 @@ syntax = "proto3"; -package proto; +package agglayer.node.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; import "types/certificate.proto"; // Service for submitting certificate to an agglayer node. -service AgglayerCertificateSubmissionService { +service CertificateSubmissionService { // Method used to submit a certificate. rpc SubmitCertificate(SubmitCertificateRequest) returns (SubmitCertificateResponse); @@ -16,13 +16,13 @@ service AgglayerCertificateSubmissionService { // Type used to submit a certificate. message SubmitCertificateRequest { // The certificate to submit. - types.Certificate certificate = 1; + protocol.types.v1.Certificate certificate = 1; } // Type used as response to a certificate submission. message SubmitCertificateResponse { // The certificate id of the submitted certificate. - types.CertificateId certificate_id = 1; + protocol.types.v1.CertificateId certificate_id = 1; } // The kind of error that occurred and that are reported by the service. diff --git a/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go b/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go index 7cccb1d7..c75dd325 100644 --- a/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go +++ b/agglayer/proto/node/agglayer_certificate_submission_service_grpc.pb.go @@ -21,97 +21,97 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - AgglayerCertificateSubmissionService_SubmitCertificate_FullMethodName = "/proto.AgglayerCertificateSubmissionService/SubmitCertificate" + CertificateSubmissionService_SubmitCertificate_FullMethodName = "/agglayer.node.v1.CertificateSubmissionService/SubmitCertificate" ) -// AgglayerCertificateSubmissionServiceClient is the client API for AgglayerCertificateSubmissionService service. +// CertificateSubmissionServiceClient is the client API for CertificateSubmissionService 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. // // Service for submitting certificate to an agglayer node. -type AgglayerCertificateSubmissionServiceClient interface { +type CertificateSubmissionServiceClient interface { // Method used to submit a certificate. SubmitCertificate(ctx context.Context, in *SubmitCertificateRequest, opts ...grpc.CallOption) (*SubmitCertificateResponse, error) } -type agglayerCertificateSubmissionServiceClient struct { +type certificateSubmissionServiceClient struct { cc grpc.ClientConnInterface } -func NewAgglayerCertificateSubmissionServiceClient(cc grpc.ClientConnInterface) AgglayerCertificateSubmissionServiceClient { - return &agglayerCertificateSubmissionServiceClient{cc} +func NewCertificateSubmissionServiceClient(cc grpc.ClientConnInterface) CertificateSubmissionServiceClient { + return &certificateSubmissionServiceClient{cc} } -func (c *agglayerCertificateSubmissionServiceClient) SubmitCertificate(ctx context.Context, in *SubmitCertificateRequest, opts ...grpc.CallOption) (*SubmitCertificateResponse, error) { +func (c *certificateSubmissionServiceClient) SubmitCertificate(ctx context.Context, in *SubmitCertificateRequest, opts ...grpc.CallOption) (*SubmitCertificateResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SubmitCertificateResponse) - err := c.cc.Invoke(ctx, AgglayerCertificateSubmissionService_SubmitCertificate_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, CertificateSubmissionService_SubmitCertificate_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// AgglayerCertificateSubmissionServiceServer is the server API for AgglayerCertificateSubmissionService service. -// All implementations must embed UnimplementedAgglayerCertificateSubmissionServiceServer +// CertificateSubmissionServiceServer is the server API for CertificateSubmissionService service. +// All implementations must embed UnimplementedCertificateSubmissionServiceServer // for forward compatibility // // Service for submitting certificate to an agglayer node. -type AgglayerCertificateSubmissionServiceServer interface { +type CertificateSubmissionServiceServer interface { // Method used to submit a certificate. SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) - mustEmbedUnimplementedAgglayerCertificateSubmissionServiceServer() + mustEmbedUnimplementedCertificateSubmissionServiceServer() } -// UnimplementedAgglayerCertificateSubmissionServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAgglayerCertificateSubmissionServiceServer struct { +// UnimplementedCertificateSubmissionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCertificateSubmissionServiceServer struct { } -func (UnimplementedAgglayerCertificateSubmissionServiceServer) SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) { +func (UnimplementedCertificateSubmissionServiceServer) SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitCertificate not implemented") } -func (UnimplementedAgglayerCertificateSubmissionServiceServer) mustEmbedUnimplementedAgglayerCertificateSubmissionServiceServer() { +func (UnimplementedCertificateSubmissionServiceServer) mustEmbedUnimplementedCertificateSubmissionServiceServer() { } -// UnsafeAgglayerCertificateSubmissionServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgglayerCertificateSubmissionServiceServer will +// UnsafeCertificateSubmissionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CertificateSubmissionServiceServer will // result in compilation errors. -type UnsafeAgglayerCertificateSubmissionServiceServer interface { - mustEmbedUnimplementedAgglayerCertificateSubmissionServiceServer() +type UnsafeCertificateSubmissionServiceServer interface { + mustEmbedUnimplementedCertificateSubmissionServiceServer() } -func RegisterAgglayerCertificateSubmissionServiceServer(s grpc.ServiceRegistrar, srv AgglayerCertificateSubmissionServiceServer) { - s.RegisterService(&AgglayerCertificateSubmissionService_ServiceDesc, srv) +func RegisterCertificateSubmissionServiceServer(s grpc.ServiceRegistrar, srv CertificateSubmissionServiceServer) { + s.RegisterService(&CertificateSubmissionService_ServiceDesc, srv) } -func _AgglayerCertificateSubmissionService_SubmitCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _CertificateSubmissionService_SubmitCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SubmitCertificateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AgglayerCertificateSubmissionServiceServer).SubmitCertificate(ctx, in) + return srv.(CertificateSubmissionServiceServer).SubmitCertificate(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AgglayerCertificateSubmissionService_SubmitCertificate_FullMethodName, + FullMethod: CertificateSubmissionService_SubmitCertificate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgglayerCertificateSubmissionServiceServer).SubmitCertificate(ctx, req.(*SubmitCertificateRequest)) + return srv.(CertificateSubmissionServiceServer).SubmitCertificate(ctx, req.(*SubmitCertificateRequest)) } return interceptor(ctx, in, info, handler) } -// AgglayerCertificateSubmissionService_ServiceDesc is the grpc.ServiceDesc for AgglayerCertificateSubmissionService service. +// CertificateSubmissionService_ServiceDesc is the grpc.ServiceDesc for CertificateSubmissionService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var AgglayerCertificateSubmissionService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "proto.AgglayerCertificateSubmissionService", - HandlerType: (*AgglayerCertificateSubmissionServiceServer)(nil), +var CertificateSubmissionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "agglayer.node.v1.CertificateSubmissionService", + HandlerType: (*CertificateSubmissionServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SubmitCertificate", - Handler: _AgglayerCertificateSubmissionService_SubmitCertificate_Handler, + Handler: _CertificateSubmissionService_SubmitCertificate_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/agglayer/proto/node/agglayer_configuration_service.pb.go b/agglayer/proto/node/agglayer_configuration_service.pb.go index dc2dde44..fb937526 100644 --- a/agglayer/proto/node/agglayer_configuration_service.pb.go +++ b/agglayer/proto/node/agglayer_configuration_service.pb.go @@ -116,31 +116,34 @@ var File_node_agglayer_configuration_service_proto protoreflect.FileDescriptor var file_node_agglayer_configuration_service_proto_rawDesc = []byte{ 0x0a, 0x29, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x67, 0x67, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, + 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x80, + 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5f, 0x0a, 0x13, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x12, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x32, 0x90, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x15, 0x47, 0x65, + 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x71, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, + 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x13, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x12, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x82, 0x01, 0x0a, 0x1c, 0x41, 0x67, 0x67, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x62, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x70, - 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, - 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, - 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, + 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -157,14 +160,14 @@ func file_node_agglayer_configuration_service_proto_rawDescGZIP() []byte { var file_node_agglayer_configuration_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_node_agglayer_configuration_service_proto_goTypes = []interface{}{ - (*GetEpochConfigurationRequest)(nil), // 0: proto.GetEpochConfigurationRequest - (*GetEpochConfigurationResponse)(nil), // 1: proto.GetEpochConfigurationResponse - (*types.EpochConfiguration)(nil), // 2: proto.types.EpochConfiguration + (*GetEpochConfigurationRequest)(nil), // 0: agglayer.node.v1.GetEpochConfigurationRequest + (*GetEpochConfigurationResponse)(nil), // 1: agglayer.node.v1.GetEpochConfigurationResponse + (*types.EpochConfiguration)(nil), // 2: agglayer.protocol.types.v1.EpochConfiguration } var file_node_agglayer_configuration_service_proto_depIdxs = []int32{ - 2, // 0: proto.GetEpochConfigurationResponse.epoch_configuration:type_name -> proto.types.EpochConfiguration - 0, // 1: proto.AgglayerConfigurationService.GetEpochConfiguration:input_type -> proto.GetEpochConfigurationRequest - 1, // 2: proto.AgglayerConfigurationService.GetEpochConfiguration:output_type -> proto.GetEpochConfigurationResponse + 2, // 0: agglayer.node.v1.GetEpochConfigurationResponse.epoch_configuration:type_name -> agglayer.protocol.types.v1.EpochConfiguration + 0, // 1: agglayer.node.v1.ConfigurationService.GetEpochConfiguration:input_type -> agglayer.node.v1.GetEpochConfigurationRequest + 1, // 2: agglayer.node.v1.ConfigurationService.GetEpochConfiguration:output_type -> agglayer.node.v1.GetEpochConfigurationResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/agglayer/proto/node/agglayer_configuration_service.proto b/agglayer/proto/node/agglayer_configuration_service.proto index 1057e012..6bf42776 100644 --- a/agglayer/proto/node/agglayer_configuration_service.proto +++ b/agglayer/proto/node/agglayer_configuration_service.proto @@ -2,12 +2,12 @@ syntax = "proto3"; -package proto; +package agglayer.node.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; import "types/epoch_configuration.proto"; // Service for querying the current epoch configuration. -service AgglayerConfigurationService { +service ConfigurationService { // Method used to get the current epoch configuration. rpc GetEpochConfiguration(GetEpochConfigurationRequest) returns (GetEpochConfigurationResponse); } @@ -18,5 +18,5 @@ message GetEpochConfigurationRequest {} // Response to the current epoch configuration request. message GetEpochConfigurationResponse { // The epoch configuration. - types.EpochConfiguration epoch_configuration = 1; + protocol.types.v1.EpochConfiguration epoch_configuration = 1; } \ No newline at end of file diff --git a/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go b/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go index 18f8c022..6aaa0e23 100644 --- a/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go +++ b/agglayer/proto/node/agglayer_configuration_service_grpc.pb.go @@ -21,97 +21,96 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - AgglayerConfigurationService_GetEpochConfiguration_FullMethodName = "/proto.AgglayerConfigurationService/GetEpochConfiguration" + ConfigurationService_GetEpochConfiguration_FullMethodName = "/agglayer.node.v1.ConfigurationService/GetEpochConfiguration" ) -// AgglayerConfigurationServiceClient is the client API for AgglayerConfigurationService service. +// ConfigurationServiceClient is the client API for ConfigurationService 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. // // Service for querying the current epoch configuration. -type AgglayerConfigurationServiceClient interface { +type ConfigurationServiceClient interface { // Method used to get the current epoch configuration. GetEpochConfiguration(ctx context.Context, in *GetEpochConfigurationRequest, opts ...grpc.CallOption) (*GetEpochConfigurationResponse, error) } -type agglayerConfigurationServiceClient struct { +type configurationServiceClient struct { cc grpc.ClientConnInterface } -func NewAgglayerConfigurationServiceClient(cc grpc.ClientConnInterface) AgglayerConfigurationServiceClient { - return &agglayerConfigurationServiceClient{cc} +func NewConfigurationServiceClient(cc grpc.ClientConnInterface) ConfigurationServiceClient { + return &configurationServiceClient{cc} } -func (c *agglayerConfigurationServiceClient) GetEpochConfiguration(ctx context.Context, in *GetEpochConfigurationRequest, opts ...grpc.CallOption) (*GetEpochConfigurationResponse, error) { +func (c *configurationServiceClient) GetEpochConfiguration(ctx context.Context, in *GetEpochConfigurationRequest, opts ...grpc.CallOption) (*GetEpochConfigurationResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetEpochConfigurationResponse) - err := c.cc.Invoke(ctx, AgglayerConfigurationService_GetEpochConfiguration_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, ConfigurationService_GetEpochConfiguration_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// AgglayerConfigurationServiceServer is the server API for AgglayerConfigurationService service. -// All implementations must embed UnimplementedAgglayerConfigurationServiceServer +// ConfigurationServiceServer is the server API for ConfigurationService service. +// All implementations must embed UnimplementedConfigurationServiceServer // for forward compatibility // // Service for querying the current epoch configuration. -type AgglayerConfigurationServiceServer interface { +type ConfigurationServiceServer interface { // Method used to get the current epoch configuration. GetEpochConfiguration(context.Context, *GetEpochConfigurationRequest) (*GetEpochConfigurationResponse, error) - mustEmbedUnimplementedAgglayerConfigurationServiceServer() + mustEmbedUnimplementedConfigurationServiceServer() } -// UnimplementedAgglayerConfigurationServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAgglayerConfigurationServiceServer struct { +// UnimplementedConfigurationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedConfigurationServiceServer struct { } -func (UnimplementedAgglayerConfigurationServiceServer) GetEpochConfiguration(context.Context, *GetEpochConfigurationRequest) (*GetEpochConfigurationResponse, error) { +func (UnimplementedConfigurationServiceServer) GetEpochConfiguration(context.Context, *GetEpochConfigurationRequest) (*GetEpochConfigurationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetEpochConfiguration not implemented") } -func (UnimplementedAgglayerConfigurationServiceServer) mustEmbedUnimplementedAgglayerConfigurationServiceServer() { -} +func (UnimplementedConfigurationServiceServer) mustEmbedUnimplementedConfigurationServiceServer() {} -// UnsafeAgglayerConfigurationServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgglayerConfigurationServiceServer will +// UnsafeConfigurationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ConfigurationServiceServer will // result in compilation errors. -type UnsafeAgglayerConfigurationServiceServer interface { - mustEmbedUnimplementedAgglayerConfigurationServiceServer() +type UnsafeConfigurationServiceServer interface { + mustEmbedUnimplementedConfigurationServiceServer() } -func RegisterAgglayerConfigurationServiceServer(s grpc.ServiceRegistrar, srv AgglayerConfigurationServiceServer) { - s.RegisterService(&AgglayerConfigurationService_ServiceDesc, srv) +func RegisterConfigurationServiceServer(s grpc.ServiceRegistrar, srv ConfigurationServiceServer) { + s.RegisterService(&ConfigurationService_ServiceDesc, srv) } -func _AgglayerConfigurationService_GetEpochConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _ConfigurationService_GetEpochConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetEpochConfigurationRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AgglayerConfigurationServiceServer).GetEpochConfiguration(ctx, in) + return srv.(ConfigurationServiceServer).GetEpochConfiguration(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AgglayerConfigurationService_GetEpochConfiguration_FullMethodName, + FullMethod: ConfigurationService_GetEpochConfiguration_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgglayerConfigurationServiceServer).GetEpochConfiguration(ctx, req.(*GetEpochConfigurationRequest)) + return srv.(ConfigurationServiceServer).GetEpochConfiguration(ctx, req.(*GetEpochConfigurationRequest)) } return interceptor(ctx, in, info, handler) } -// AgglayerConfigurationService_ServiceDesc is the grpc.ServiceDesc for AgglayerConfigurationService service. +// ConfigurationService_ServiceDesc is the grpc.ServiceDesc for ConfigurationService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var AgglayerConfigurationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "proto.AgglayerConfigurationService", - HandlerType: (*AgglayerConfigurationServiceServer)(nil), +var ConfigurationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "agglayer.node.v1.ConfigurationService", + HandlerType: (*ConfigurationServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetEpochConfiguration", - Handler: _AgglayerConfigurationService_GetEpochConfiguration_Handler, + Handler: _ConfigurationService_GetEpochConfiguration_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/agglayer/proto/node/agglayer_network_state_service.pb.go b/agglayer/proto/node/agglayer_network_state_service.pb.go index c74181df..b3ebc6fa 100644 --- a/agglayer/proto/node/agglayer_network_state_service.pb.go +++ b/agglayer/proto/node/agglayer_network_state_service.pb.go @@ -1,4 +1,4 @@ -// Proto definition for Agglayer Network State Service +// Proto definition for Agglayer Node State Service // Code generated by protoc-gen-go. DO NOT EDIT. // versions: @@ -420,99 +420,109 @@ var File_node_agglayer_network_state_service_proto protoreflect.FileDescriptor var file_node_agglayer_network_state_service_proto_rawDesc = []byte{ 0x0a, 0x29, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x0a, 0x1b, 0x47, - 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, - 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0x6d, 0x0a, - 0x1c, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, - 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x26, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x61, 0x67, 0x67, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6f, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x22, 0x7c, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x78, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x87, + 0x01, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, + 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, - 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, - 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, + 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, - 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, + 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x29, 0x47, + 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x49, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0xe0, 0x04, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, - 0x64, 0x22, 0x7a, 0x0a, 0x29, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, - 0x0a, 0x12, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x63, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x32, 0x93, 0x04, - 0x0a, 0x1b, 0x41, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, - 0x14, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, - 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x80, - 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, - 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x2d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, + 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x96, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x38, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, - 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x39, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x4b, 0x6e, 0x6f, + 0x77, 0x6e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x72, 0x12, 0x3a, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, + 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, 0x0a, 0x21, 0x47, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, - 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x12, 0x3a, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x61, + 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x6f, 0x64, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -529,31 +539,31 @@ func file_node_agglayer_network_state_service_proto_rawDescGZIP() []byte { var file_node_agglayer_network_state_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_node_agglayer_network_state_service_proto_goTypes = []interface{}{ - (*GetCertificateHeaderRequest)(nil), // 0: proto.GetCertificateHeaderRequest - (*GetCertificateHeaderResponse)(nil), // 1: proto.GetCertificateHeaderResponse - (*GetLatestKnownCertificateHeaderRequest)(nil), // 2: proto.GetLatestKnownCertificateHeaderRequest - (*GetLatestKnownCertificateHeaderResponse)(nil), // 3: proto.GetLatestKnownCertificateHeaderResponse - (*GetLatestSettledCertificateHeaderRequest)(nil), // 4: proto.GetLatestSettledCertificateHeaderRequest - (*GetLatestSettledCertificateHeaderResponse)(nil), // 5: proto.GetLatestSettledCertificateHeaderResponse - (*GetLatestPendingCertificateHeaderRequest)(nil), // 6: proto.GetLatestPendingCertificateHeaderRequest - (*GetLatestPendingCertificateHeaderResponse)(nil), // 7: proto.GetLatestPendingCertificateHeaderResponse - (*types.CertificateId)(nil), // 8: proto.types.CertificateId - (*types.CertificateHeader)(nil), // 9: proto.types.CertificateHeader + (*GetCertificateHeaderRequest)(nil), // 0: agglayer.node.v1.GetCertificateHeaderRequest + (*GetCertificateHeaderResponse)(nil), // 1: agglayer.node.v1.GetCertificateHeaderResponse + (*GetLatestKnownCertificateHeaderRequest)(nil), // 2: agglayer.node.v1.GetLatestKnownCertificateHeaderRequest + (*GetLatestKnownCertificateHeaderResponse)(nil), // 3: agglayer.node.v1.GetLatestKnownCertificateHeaderResponse + (*GetLatestSettledCertificateHeaderRequest)(nil), // 4: agglayer.node.v1.GetLatestSettledCertificateHeaderRequest + (*GetLatestSettledCertificateHeaderResponse)(nil), // 5: agglayer.node.v1.GetLatestSettledCertificateHeaderResponse + (*GetLatestPendingCertificateHeaderRequest)(nil), // 6: agglayer.node.v1.GetLatestPendingCertificateHeaderRequest + (*GetLatestPendingCertificateHeaderResponse)(nil), // 7: agglayer.node.v1.GetLatestPendingCertificateHeaderResponse + (*types.CertificateId)(nil), // 8: agglayer.protocol.types.v1.CertificateId + (*types.CertificateHeader)(nil), // 9: agglayer.protocol.types.v1.CertificateHeader } var file_node_agglayer_network_state_service_proto_depIdxs = []int32{ - 8, // 0: proto.GetCertificateHeaderRequest.certificate_id:type_name -> proto.types.CertificateId - 9, // 1: proto.GetCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 9, // 2: proto.GetLatestKnownCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 9, // 3: proto.GetLatestSettledCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 9, // 4: proto.GetLatestPendingCertificateHeaderResponse.certificate_header:type_name -> proto.types.CertificateHeader - 0, // 5: proto.AgglayerNetworkStateService.GetCertificateHeader:input_type -> proto.GetCertificateHeaderRequest - 2, // 6: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:input_type -> proto.GetLatestKnownCertificateHeaderRequest - 4, // 7: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:input_type -> proto.GetLatestSettledCertificateHeaderRequest - 6, // 8: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:input_type -> proto.GetLatestPendingCertificateHeaderRequest - 1, // 9: proto.AgglayerNetworkStateService.GetCertificateHeader:output_type -> proto.GetCertificateHeaderResponse - 3, // 10: proto.AgglayerNetworkStateService.GetLatestKnownCertificateHeader:output_type -> proto.GetLatestKnownCertificateHeaderResponse - 5, // 11: proto.AgglayerNetworkStateService.GetLatestSettledCertificateHeader:output_type -> proto.GetLatestSettledCertificateHeaderResponse - 7, // 12: proto.AgglayerNetworkStateService.GetLatestPendingCertificateHeader:output_type -> proto.GetLatestPendingCertificateHeaderResponse + 8, // 0: agglayer.node.v1.GetCertificateHeaderRequest.certificate_id:type_name -> agglayer.protocol.types.v1.CertificateId + 9, // 1: agglayer.node.v1.GetCertificateHeaderResponse.certificate_header:type_name -> agglayer.protocol.types.v1.CertificateHeader + 9, // 2: agglayer.node.v1.GetLatestKnownCertificateHeaderResponse.certificate_header:type_name -> agglayer.protocol.types.v1.CertificateHeader + 9, // 3: agglayer.node.v1.GetLatestSettledCertificateHeaderResponse.certificate_header:type_name -> agglayer.protocol.types.v1.CertificateHeader + 9, // 4: agglayer.node.v1.GetLatestPendingCertificateHeaderResponse.certificate_header:type_name -> agglayer.protocol.types.v1.CertificateHeader + 0, // 5: agglayer.node.v1.NodeStateService.GetCertificateHeader:input_type -> agglayer.node.v1.GetCertificateHeaderRequest + 2, // 6: agglayer.node.v1.NodeStateService.GetLatestKnownCertificateHeader:input_type -> agglayer.node.v1.GetLatestKnownCertificateHeaderRequest + 4, // 7: agglayer.node.v1.NodeStateService.GetLatestSettledCertificateHeader:input_type -> agglayer.node.v1.GetLatestSettledCertificateHeaderRequest + 6, // 8: agglayer.node.v1.NodeStateService.GetLatestPendingCertificateHeader:input_type -> agglayer.node.v1.GetLatestPendingCertificateHeaderRequest + 1, // 9: agglayer.node.v1.NodeStateService.GetCertificateHeader:output_type -> agglayer.node.v1.GetCertificateHeaderResponse + 3, // 10: agglayer.node.v1.NodeStateService.GetLatestKnownCertificateHeader:output_type -> agglayer.node.v1.GetLatestKnownCertificateHeaderResponse + 5, // 11: agglayer.node.v1.NodeStateService.GetLatestSettledCertificateHeader:output_type -> agglayer.node.v1.GetLatestSettledCertificateHeaderResponse + 7, // 12: agglayer.node.v1.NodeStateService.GetLatestPendingCertificateHeader:output_type -> agglayer.node.v1.GetLatestPendingCertificateHeaderResponse 9, // [9:13] is the sub-list for method output_type 5, // [5:9] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name diff --git a/agglayer/proto/node/agglayer_network_state_service.proto b/agglayer/proto/node/agglayer_network_state_service.proto index b6292874..5e511a77 100644 --- a/agglayer/proto/node/agglayer_network_state_service.proto +++ b/agglayer/proto/node/agglayer_network_state_service.proto @@ -1,14 +1,14 @@ -// Proto definition for Agglayer Network State Service +// Proto definition for Agglayer Node State Service syntax = "proto3"; -package proto; +package agglayer.node.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/node;node"; import "types/certificate_header.proto"; import "types/certificate.proto"; -// Service for querying agglayer network state. -service AgglayerNetworkStateService { +// Service for querying agglayer node state. +service NodeStateService { // Method used to get a CertificateHeader for a particular CertificateId. rpc GetCertificateHeader(GetCertificateHeaderRequest) returns (GetCertificateHeaderResponse); @@ -25,13 +25,13 @@ service AgglayerNetworkStateService { // Request to get a CertificateHeader for a particular CertificateId. message GetCertificateHeaderRequest { // The certificate identifier. - types.CertificateId certificate_id = 1; + protocol.types.v1.CertificateId certificate_id = 1; } // Response to the CertificateHeader request. message GetCertificateHeaderResponse { // The certificate header. - types.CertificateHeader certificate_header = 1; + protocol.types.v1.CertificateHeader certificate_header = 1; } // Request to get the latest known certificate header for a network. @@ -43,7 +43,7 @@ message GetLatestKnownCertificateHeaderRequest { // Response to the latest known certificate header request. message GetLatestKnownCertificateHeaderResponse { // The latest known certificate header. - types.CertificateHeader certificate_header = 1; + protocol.types.v1.CertificateHeader certificate_header = 1; } // Request to get the latest settled certificate header for a network. @@ -55,7 +55,7 @@ message GetLatestSettledCertificateHeaderRequest { // Response to the latest settled certificate header request. message GetLatestSettledCertificateHeaderResponse { // The latest settled certificate header. - types.CertificateHeader certificate_header = 1; + protocol.types.v1.CertificateHeader certificate_header = 1; } // Request to get the latest pending certificate header for a network. @@ -67,5 +67,5 @@ message GetLatestPendingCertificateHeaderRequest { // Response to the latest pending certificate header request. message GetLatestPendingCertificateHeaderResponse { // The latest pending certificate header. - types.CertificateHeader certificate_header = 1; + protocol.types.v1.CertificateHeader certificate_header = 1; } \ No newline at end of file diff --git a/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go b/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go index b3a4a6df..e42e0770 100644 --- a/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go +++ b/agglayer/proto/node/agglayer_network_state_service_grpc.pb.go @@ -1,4 +1,4 @@ -// Proto definition for Agglayer Network State Service +// Proto definition for Agglayer Node State Service // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: @@ -21,18 +21,18 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - AgglayerNetworkStateService_GetCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetCertificateHeader" - AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestKnownCertificateHeader" - AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestSettledCertificateHeader" - AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName = "/proto.AgglayerNetworkStateService/GetLatestPendingCertificateHeader" + NodeStateService_GetCertificateHeader_FullMethodName = "/agglayer.node.v1.NodeStateService/GetCertificateHeader" + NodeStateService_GetLatestKnownCertificateHeader_FullMethodName = "/agglayer.node.v1.NodeStateService/GetLatestKnownCertificateHeader" + NodeStateService_GetLatestSettledCertificateHeader_FullMethodName = "/agglayer.node.v1.NodeStateService/GetLatestSettledCertificateHeader" + NodeStateService_GetLatestPendingCertificateHeader_FullMethodName = "/agglayer.node.v1.NodeStateService/GetLatestPendingCertificateHeader" ) -// AgglayerNetworkStateServiceClient is the client API for AgglayerNetworkStateService service. +// NodeStateServiceClient is the client API for NodeStateService 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. // -// Service for querying agglayer network state. -type AgglayerNetworkStateServiceClient interface { +// Service for querying agglayer node state. +type NodeStateServiceClient interface { // Method used to get a CertificateHeader for a particular CertificateId. GetCertificateHeader(ctx context.Context, in *GetCertificateHeaderRequest, opts ...grpc.CallOption) (*GetCertificateHeaderResponse, error) // Method used to get the latest known certificate header for a network. @@ -43,60 +43,60 @@ type AgglayerNetworkStateServiceClient interface { GetLatestPendingCertificateHeader(ctx context.Context, in *GetLatestPendingCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestPendingCertificateHeaderResponse, error) } -type agglayerNetworkStateServiceClient struct { +type nodeStateServiceClient struct { cc grpc.ClientConnInterface } -func NewAgglayerNetworkStateServiceClient(cc grpc.ClientConnInterface) AgglayerNetworkStateServiceClient { - return &agglayerNetworkStateServiceClient{cc} +func NewNodeStateServiceClient(cc grpc.ClientConnInterface) NodeStateServiceClient { + return &nodeStateServiceClient{cc} } -func (c *agglayerNetworkStateServiceClient) GetCertificateHeader(ctx context.Context, in *GetCertificateHeaderRequest, opts ...grpc.CallOption) (*GetCertificateHeaderResponse, error) { +func (c *nodeStateServiceClient) GetCertificateHeader(ctx context.Context, in *GetCertificateHeaderRequest, opts ...grpc.CallOption) (*GetCertificateHeaderResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetCertificateHeaderResponse) - err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetCertificateHeader_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, NodeStateService_GetCertificateHeader_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *agglayerNetworkStateServiceClient) GetLatestKnownCertificateHeader(ctx context.Context, in *GetLatestKnownCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestKnownCertificateHeaderResponse, error) { +func (c *nodeStateServiceClient) GetLatestKnownCertificateHeader(ctx context.Context, in *GetLatestKnownCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestKnownCertificateHeaderResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestKnownCertificateHeaderResponse) - err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, NodeStateService_GetLatestKnownCertificateHeader_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *agglayerNetworkStateServiceClient) GetLatestSettledCertificateHeader(ctx context.Context, in *GetLatestSettledCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestSettledCertificateHeaderResponse, error) { +func (c *nodeStateServiceClient) GetLatestSettledCertificateHeader(ctx context.Context, in *GetLatestSettledCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestSettledCertificateHeaderResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestSettledCertificateHeaderResponse) - err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, NodeStateService_GetLatestSettledCertificateHeader_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *agglayerNetworkStateServiceClient) GetLatestPendingCertificateHeader(ctx context.Context, in *GetLatestPendingCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestPendingCertificateHeaderResponse, error) { +func (c *nodeStateServiceClient) GetLatestPendingCertificateHeader(ctx context.Context, in *GetLatestPendingCertificateHeaderRequest, opts ...grpc.CallOption) (*GetLatestPendingCertificateHeaderResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLatestPendingCertificateHeaderResponse) - err := c.cc.Invoke(ctx, AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, NodeStateService_GetLatestPendingCertificateHeader_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// AgglayerNetworkStateServiceServer is the server API for AgglayerNetworkStateService service. -// All implementations must embed UnimplementedAgglayerNetworkStateServiceServer +// NodeStateServiceServer is the server API for NodeStateService service. +// All implementations must embed UnimplementedNodeStateServiceServer // for forward compatibility // -// Service for querying agglayer network state. -type AgglayerNetworkStateServiceServer interface { +// Service for querying agglayer node state. +type NodeStateServiceServer interface { // Method used to get a CertificateHeader for a particular CertificateId. GetCertificateHeader(context.Context, *GetCertificateHeaderRequest) (*GetCertificateHeaderResponse, error) // Method used to get the latest known certificate header for a network. @@ -105,133 +105,132 @@ type AgglayerNetworkStateServiceServer interface { GetLatestSettledCertificateHeader(context.Context, *GetLatestSettledCertificateHeaderRequest) (*GetLatestSettledCertificateHeaderResponse, error) // Method used to get the latest pending certificate header for a network. GetLatestPendingCertificateHeader(context.Context, *GetLatestPendingCertificateHeaderRequest) (*GetLatestPendingCertificateHeaderResponse, error) - mustEmbedUnimplementedAgglayerNetworkStateServiceServer() + mustEmbedUnimplementedNodeStateServiceServer() } -// UnimplementedAgglayerNetworkStateServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAgglayerNetworkStateServiceServer struct { +// UnimplementedNodeStateServiceServer must be embedded to have forward compatible implementations. +type UnimplementedNodeStateServiceServer struct { } -func (UnimplementedAgglayerNetworkStateServiceServer) GetCertificateHeader(context.Context, *GetCertificateHeaderRequest) (*GetCertificateHeaderResponse, error) { +func (UnimplementedNodeStateServiceServer) GetCertificateHeader(context.Context, *GetCertificateHeaderRequest) (*GetCertificateHeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCertificateHeader not implemented") } -func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestKnownCertificateHeader(context.Context, *GetLatestKnownCertificateHeaderRequest) (*GetLatestKnownCertificateHeaderResponse, error) { +func (UnimplementedNodeStateServiceServer) GetLatestKnownCertificateHeader(context.Context, *GetLatestKnownCertificateHeaderRequest) (*GetLatestKnownCertificateHeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestKnownCertificateHeader not implemented") } -func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestSettledCertificateHeader(context.Context, *GetLatestSettledCertificateHeaderRequest) (*GetLatestSettledCertificateHeaderResponse, error) { +func (UnimplementedNodeStateServiceServer) GetLatestSettledCertificateHeader(context.Context, *GetLatestSettledCertificateHeaderRequest) (*GetLatestSettledCertificateHeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestSettledCertificateHeader not implemented") } -func (UnimplementedAgglayerNetworkStateServiceServer) GetLatestPendingCertificateHeader(context.Context, *GetLatestPendingCertificateHeaderRequest) (*GetLatestPendingCertificateHeaderResponse, error) { +func (UnimplementedNodeStateServiceServer) GetLatestPendingCertificateHeader(context.Context, *GetLatestPendingCertificateHeaderRequest) (*GetLatestPendingCertificateHeaderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatestPendingCertificateHeader not implemented") } -func (UnimplementedAgglayerNetworkStateServiceServer) mustEmbedUnimplementedAgglayerNetworkStateServiceServer() { -} +func (UnimplementedNodeStateServiceServer) mustEmbedUnimplementedNodeStateServiceServer() {} -// UnsafeAgglayerNetworkStateServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AgglayerNetworkStateServiceServer will +// UnsafeNodeStateServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NodeStateServiceServer will // result in compilation errors. -type UnsafeAgglayerNetworkStateServiceServer interface { - mustEmbedUnimplementedAgglayerNetworkStateServiceServer() +type UnsafeNodeStateServiceServer interface { + mustEmbedUnimplementedNodeStateServiceServer() } -func RegisterAgglayerNetworkStateServiceServer(s grpc.ServiceRegistrar, srv AgglayerNetworkStateServiceServer) { - s.RegisterService(&AgglayerNetworkStateService_ServiceDesc, srv) +func RegisterNodeStateServiceServer(s grpc.ServiceRegistrar, srv NodeStateServiceServer) { + s.RegisterService(&NodeStateService_ServiceDesc, srv) } -func _AgglayerNetworkStateService_GetCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _NodeStateService_GetCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetCertificateHeaderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AgglayerNetworkStateServiceServer).GetCertificateHeader(ctx, in) + return srv.(NodeStateServiceServer).GetCertificateHeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AgglayerNetworkStateService_GetCertificateHeader_FullMethodName, + FullMethod: NodeStateService_GetCertificateHeader_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgglayerNetworkStateServiceServer).GetCertificateHeader(ctx, req.(*GetCertificateHeaderRequest)) + return srv.(NodeStateServiceServer).GetCertificateHeader(ctx, req.(*GetCertificateHeaderRequest)) } return interceptor(ctx, in, info, handler) } -func _AgglayerNetworkStateService_GetLatestKnownCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _NodeStateService_GetLatestKnownCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetLatestKnownCertificateHeaderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AgglayerNetworkStateServiceServer).GetLatestKnownCertificateHeader(ctx, in) + return srv.(NodeStateServiceServer).GetLatestKnownCertificateHeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AgglayerNetworkStateService_GetLatestKnownCertificateHeader_FullMethodName, + FullMethod: NodeStateService_GetLatestKnownCertificateHeader_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgglayerNetworkStateServiceServer).GetLatestKnownCertificateHeader(ctx, req.(*GetLatestKnownCertificateHeaderRequest)) + return srv.(NodeStateServiceServer).GetLatestKnownCertificateHeader(ctx, req.(*GetLatestKnownCertificateHeaderRequest)) } return interceptor(ctx, in, info, handler) } -func _AgglayerNetworkStateService_GetLatestSettledCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _NodeStateService_GetLatestSettledCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetLatestSettledCertificateHeaderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AgglayerNetworkStateServiceServer).GetLatestSettledCertificateHeader(ctx, in) + return srv.(NodeStateServiceServer).GetLatestSettledCertificateHeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AgglayerNetworkStateService_GetLatestSettledCertificateHeader_FullMethodName, + FullMethod: NodeStateService_GetLatestSettledCertificateHeader_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgglayerNetworkStateServiceServer).GetLatestSettledCertificateHeader(ctx, req.(*GetLatestSettledCertificateHeaderRequest)) + return srv.(NodeStateServiceServer).GetLatestSettledCertificateHeader(ctx, req.(*GetLatestSettledCertificateHeaderRequest)) } return interceptor(ctx, in, info, handler) } -func _AgglayerNetworkStateService_GetLatestPendingCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _NodeStateService_GetLatestPendingCertificateHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetLatestPendingCertificateHeaderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AgglayerNetworkStateServiceServer).GetLatestPendingCertificateHeader(ctx, in) + return srv.(NodeStateServiceServer).GetLatestPendingCertificateHeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AgglayerNetworkStateService_GetLatestPendingCertificateHeader_FullMethodName, + FullMethod: NodeStateService_GetLatestPendingCertificateHeader_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AgglayerNetworkStateServiceServer).GetLatestPendingCertificateHeader(ctx, req.(*GetLatestPendingCertificateHeaderRequest)) + return srv.(NodeStateServiceServer).GetLatestPendingCertificateHeader(ctx, req.(*GetLatestPendingCertificateHeaderRequest)) } return interceptor(ctx, in, info, handler) } -// AgglayerNetworkStateService_ServiceDesc is the grpc.ServiceDesc for AgglayerNetworkStateService service. +// NodeStateService_ServiceDesc is the grpc.ServiceDesc for NodeStateService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var AgglayerNetworkStateService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "proto.AgglayerNetworkStateService", - HandlerType: (*AgglayerNetworkStateServiceServer)(nil), +var NodeStateService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "agglayer.node.v1.NodeStateService", + HandlerType: (*NodeStateServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetCertificateHeader", - Handler: _AgglayerNetworkStateService_GetCertificateHeader_Handler, + Handler: _NodeStateService_GetCertificateHeader_Handler, }, { MethodName: "GetLatestKnownCertificateHeader", - Handler: _AgglayerNetworkStateService_GetLatestKnownCertificateHeader_Handler, + Handler: _NodeStateService_GetLatestKnownCertificateHeader_Handler, }, { MethodName: "GetLatestSettledCertificateHeader", - Handler: _AgglayerNetworkStateService_GetLatestSettledCertificateHeader_Handler, + Handler: _NodeStateService_GetLatestSettledCertificateHeader_Handler, }, { MethodName: "GetLatestPendingCertificateHeader", - Handler: _AgglayerNetworkStateService_GetLatestPendingCertificateHeader_Handler, + Handler: _NodeStateService_GetLatestPendingCertificateHeader_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/agglayer/proto/types/bridge_exit.pb.go b/agglayer/proto/types/bridge_exit.pb.go index 34d601d8..f2e3a3ed 100644 --- a/agglayer/proto/types/bridge_exit.pb.go +++ b/agglayer/proto/types/bridge_exit.pb.go @@ -80,7 +80,7 @@ type BridgeExit struct { unknownFields protoimpl.UnknownFields // The type of the leaf. - LeafType LeafType `protobuf:"varint,1,opt,name=leaf_type,json=leafType,proto3,enum=proto.types.LeafType" json:"leaf_type,omitempty"` + LeafType LeafType `protobuf:"varint,1,opt,name=leaf_type,json=leafType,proto3,enum=agglayer.protocol.types.v1.LeafType" json:"leaf_type,omitempty"` // Unique ID for the token being transferred. TokenInfo *TokenInfo `protobuf:"bytes,2,opt,name=token_info,json=tokenInfo,proto3" json:"token_info,omitempty"` // Network which the token is transferred to @@ -230,47 +230,53 @@ var File_types_bridge_exit_proto protoreflect.FileDescriptor var file_types_bridge_exit_proto_rawDesc = []byte{ 0x0a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, - 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x02, 0x0a, 0x0a, 0x42, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x32, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x66, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x65, 0x61, 0x66, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x0a, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x3c, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7f, - 0x0a, 0x09, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x12, 0x4b, 0x0a, 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, - 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x52, 0x12, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2a, - 0x54, 0x0a, 0x08, 0x4c, 0x65, 0x61, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4c, - 0x45, 0x41, 0x46, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x41, 0x46, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x01, 0x12, 0x15, - 0x0a, 0x11, 0x4c, 0x45, 0x41, 0x46, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, - 0x41, 0x47, 0x45, 0x10, 0x02, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, - 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x03, 0x0a, 0x0a, 0x42, 0x72, 0x69, + 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x41, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x61, 0x67, 0x67, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x66, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x08, 0x6c, 0x65, 0x61, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x12, 0x4b, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x32, 0x30, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x40, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, + 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8e, 0x01, 0x0a, 0x09, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x5a, 0x0a, + 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x32, 0x30, 0x52, 0x12, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2a, 0x54, 0x0a, 0x08, 0x4c, 0x65, 0x61, + 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x45, 0x41, 0x46, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x41, 0x46, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, + 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4c, 0x45, 0x41, 0x46, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x02, 0x42, + 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -288,19 +294,19 @@ func file_types_bridge_exit_proto_rawDescGZIP() []byte { var file_types_bridge_exit_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_types_bridge_exit_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_types_bridge_exit_proto_goTypes = []interface{}{ - (LeafType)(0), // 0: proto.types.LeafType - (*BridgeExit)(nil), // 1: proto.types.BridgeExit - (*TokenInfo)(nil), // 2: proto.types.TokenInfo - (*FixedBytes20)(nil), // 3: proto.types.FixedBytes20 - (*FixedBytes32)(nil), // 4: proto.types.FixedBytes32 + (LeafType)(0), // 0: agglayer.protocol.types.v1.LeafType + (*BridgeExit)(nil), // 1: agglayer.protocol.types.v1.BridgeExit + (*TokenInfo)(nil), // 2: agglayer.protocol.types.v1.TokenInfo + (*FixedBytes20)(nil), // 3: agglayer.protocol.types.v1.FixedBytes20 + (*FixedBytes32)(nil), // 4: agglayer.protocol.types.v1.FixedBytes32 } var file_types_bridge_exit_proto_depIdxs = []int32{ - 0, // 0: proto.types.BridgeExit.leaf_type:type_name -> proto.types.LeafType - 2, // 1: proto.types.BridgeExit.token_info:type_name -> proto.types.TokenInfo - 3, // 2: proto.types.BridgeExit.dest_address:type_name -> proto.types.FixedBytes20 - 4, // 3: proto.types.BridgeExit.amount:type_name -> proto.types.FixedBytes32 - 4, // 4: proto.types.BridgeExit.metadata:type_name -> proto.types.FixedBytes32 - 3, // 5: proto.types.TokenInfo.origin_token_address:type_name -> proto.types.FixedBytes20 + 0, // 0: agglayer.protocol.types.v1.BridgeExit.leaf_type:type_name -> agglayer.protocol.types.v1.LeafType + 2, // 1: agglayer.protocol.types.v1.BridgeExit.token_info:type_name -> agglayer.protocol.types.v1.TokenInfo + 3, // 2: agglayer.protocol.types.v1.BridgeExit.dest_address:type_name -> agglayer.protocol.types.v1.FixedBytes20 + 4, // 3: agglayer.protocol.types.v1.BridgeExit.amount:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 4, // 4: agglayer.protocol.types.v1.BridgeExit.metadata:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 3, // 5: agglayer.protocol.types.v1.TokenInfo.origin_token_address:type_name -> agglayer.protocol.types.v1.FixedBytes20 6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name diff --git a/agglayer/proto/types/bridge_exit.proto b/agglayer/proto/types/bridge_exit.proto index 1ce0ee2f..7eabefd6 100644 --- a/agglayer/proto/types/bridge_exit.proto +++ b/agglayer/proto/types/bridge_exit.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; import "types/bytes.proto"; diff --git a/agglayer/proto/types/bytes.pb.go b/agglayer/proto/types/bytes.pb.go index ce00896f..1474afe2 100644 --- a/agglayer/proto/types/bytes.pb.go +++ b/agglayer/proto/types/bytes.pb.go @@ -171,19 +171,20 @@ var File_types_bytes_proto protoreflect.FileDescriptor var file_types_bytes_proto_rawDesc = []byte{ 0x0a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x22, 0x24, 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x36, 0x35, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, - 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, + 0x24, 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x36, 0x35, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x32, 0x30, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -200,9 +201,9 @@ func file_types_bytes_proto_rawDescGZIP() []byte { var file_types_bytes_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_types_bytes_proto_goTypes = []interface{}{ - (*FixedBytes65)(nil), // 0: proto.types.FixedBytes65 - (*FixedBytes32)(nil), // 1: proto.types.FixedBytes32 - (*FixedBytes20)(nil), // 2: proto.types.FixedBytes20 + (*FixedBytes65)(nil), // 0: agglayer.protocol.types.v1.FixedBytes65 + (*FixedBytes32)(nil), // 1: agglayer.protocol.types.v1.FixedBytes32 + (*FixedBytes20)(nil), // 2: agglayer.protocol.types.v1.FixedBytes20 } var file_types_bytes_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/agglayer/proto/types/bytes.proto b/agglayer/proto/types/bytes.proto index c69da8e5..6ccfd4b6 100644 --- a/agglayer/proto/types/bytes.proto +++ b/agglayer/proto/types/bytes.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; // FixedBytes65 type. diff --git a/agglayer/proto/types/certificate.pb.go b/agglayer/proto/types/certificate.pb.go index 48a01b88..9c9b4260 100644 --- a/agglayer/proto/types/certificate.pb.go +++ b/agglayer/proto/types/certificate.pb.go @@ -289,66 +289,75 @@ var File_types_certificate_proto protoreflect.FileDescriptor var file_types_certificate_proto_rawDesc = []byte{ 0x0a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x65, 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x04, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x4a, 0x0a, 0x14, 0x70, - 0x72, 0x65, 0x76, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x33, 0x32, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, - 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x48, 0x0a, 0x13, 0x6e, 0x65, 0x77, 0x5f, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, - 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x3a, 0x0a, 0x0c, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, - 0x52, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x53, 0x0a, - 0x15, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x13, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, - 0x74, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, - 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0e, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x41, 0x0a, 0x0e, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0d, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, - 0x61, 0x22, 0x8d, 0x01, 0x0a, 0x0d, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0x39, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x36, - 0x35, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x38, - 0x0a, 0x09, 0x73, 0x70, 0x31, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x48, 0x00, 0x52, 0x08, - 0x73, 0x70, 0x31, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x22, 0x40, 0x0a, 0x0d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, - 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, + 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x94, 0x05, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x59, 0x0a, 0x14, 0x70, 0x72, + 0x65, 0x76, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, + 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x33, 0x32, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, + 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x57, 0x0a, 0x13, 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x10, 0x6e, 0x65, + 0x77, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x49, + 0x0a, 0x0c, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x0b, 0x62, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x62, 0x0a, 0x15, 0x69, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, + 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x42, 0x72, + 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x52, 0x13, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x73, 0x12, 0x44, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x61, 0x67, + 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x50, 0x0a, 0x0e, + 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, + 0x0d, 0x61, 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2a, + 0x0a, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x22, 0xab, 0x01, 0x0a, 0x0d, 0x41, + 0x67, 0x67, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x48, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x36, 0x35, 0x48, 0x00, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x73, 0x70, 0x31, 0x5f, 0x73, 0x74, + 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x33, 0x32, 0x48, 0x00, 0x52, 0x08, 0x73, 0x70, 0x31, 0x53, 0x74, 0x61, 0x72, 0x6b, 0x42, + 0x07, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x4f, 0x0a, 0x0d, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x33, 0x32, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -365,24 +374,24 @@ func file_types_certificate_proto_rawDescGZIP() []byte { var file_types_certificate_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_types_certificate_proto_goTypes = []interface{}{ - (*Certificate)(nil), // 0: proto.types.Certificate - (*AggchainProof)(nil), // 1: proto.types.AggchainProof - (*CertificateId)(nil), // 2: proto.types.CertificateId - (*FixedBytes32)(nil), // 3: proto.types.FixedBytes32 - (*BridgeExit)(nil), // 4: proto.types.BridgeExit - (*ImportedBridgeExit)(nil), // 5: proto.types.ImportedBridgeExit - (*FixedBytes65)(nil), // 6: proto.types.FixedBytes65 + (*Certificate)(nil), // 0: agglayer.protocol.types.v1.Certificate + (*AggchainProof)(nil), // 1: agglayer.protocol.types.v1.AggchainProof + (*CertificateId)(nil), // 2: agglayer.protocol.types.v1.CertificateId + (*FixedBytes32)(nil), // 3: agglayer.protocol.types.v1.FixedBytes32 + (*BridgeExit)(nil), // 4: agglayer.protocol.types.v1.BridgeExit + (*ImportedBridgeExit)(nil), // 5: agglayer.protocol.types.v1.ImportedBridgeExit + (*FixedBytes65)(nil), // 6: agglayer.protocol.types.v1.FixedBytes65 } var file_types_certificate_proto_depIdxs = []int32{ - 3, // 0: proto.types.Certificate.prev_local_exit_root:type_name -> proto.types.FixedBytes32 - 3, // 1: proto.types.Certificate.new_local_exit_root:type_name -> proto.types.FixedBytes32 - 4, // 2: proto.types.Certificate.bridge_exits:type_name -> proto.types.BridgeExit - 5, // 3: proto.types.Certificate.imported_bridge_exits:type_name -> proto.types.ImportedBridgeExit - 3, // 4: proto.types.Certificate.metadata:type_name -> proto.types.FixedBytes32 - 1, // 5: proto.types.Certificate.aggchain_proof:type_name -> proto.types.AggchainProof - 6, // 6: proto.types.AggchainProof.signature:type_name -> proto.types.FixedBytes65 - 3, // 7: proto.types.AggchainProof.sp1_stark:type_name -> proto.types.FixedBytes32 - 3, // 8: proto.types.CertificateId.value:type_name -> proto.types.FixedBytes32 + 3, // 0: agglayer.protocol.types.v1.Certificate.prev_local_exit_root:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 3, // 1: agglayer.protocol.types.v1.Certificate.new_local_exit_root:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 4, // 2: agglayer.protocol.types.v1.Certificate.bridge_exits:type_name -> agglayer.protocol.types.v1.BridgeExit + 5, // 3: agglayer.protocol.types.v1.Certificate.imported_bridge_exits:type_name -> agglayer.protocol.types.v1.ImportedBridgeExit + 3, // 4: agglayer.protocol.types.v1.Certificate.metadata:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 1, // 5: agglayer.protocol.types.v1.Certificate.aggchain_proof:type_name -> agglayer.protocol.types.v1.AggchainProof + 6, // 6: agglayer.protocol.types.v1.AggchainProof.signature:type_name -> agglayer.protocol.types.v1.FixedBytes65 + 3, // 7: agglayer.protocol.types.v1.AggchainProof.sp1_stark:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 3, // 8: agglayer.protocol.types.v1.CertificateId.value:type_name -> agglayer.protocol.types.v1.FixedBytes32 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name diff --git a/agglayer/proto/types/certificate.proto b/agglayer/proto/types/certificate.proto index acc7ea91..2be865c3 100644 --- a/agglayer/proto/types/certificate.proto +++ b/agglayer/proto/types/certificate.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; import "types/bytes.proto"; import "types/bridge_exit.proto"; diff --git a/agglayer/proto/types/certificate_header.pb.go b/agglayer/proto/types/certificate_header.pb.go index d5b8165b..115bffe8 100644 --- a/agglayer/proto/types/certificate_header.pb.go +++ b/agglayer/proto/types/certificate_header.pb.go @@ -108,7 +108,7 @@ type CertificateHeader struct { // Fixed size field of arbitrary data for the chain needs. Metadata *FixedBytes32 `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty"` // Certificate status. - Status CertificateStatus `protobuf:"varint,9,opt,name=status,proto3,enum=proto.types.CertificateStatus" json:"status,omitempty"` + Status CertificateStatus `protobuf:"varint,9,opt,name=status,proto3,enum=agglayer.protocol.types.v1.CertificateStatus" json:"status,omitempty"` // Certificate status error details. Error *CertificateStatusError `protobuf:"bytes,10,opt,name=error,proto3" json:"error,omitempty"` // Settlement transaction hash. @@ -278,73 +278,80 @@ var File_types_certificate_header_proto protoreflect.FileDescriptor var file_types_certificate_header_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x11, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x05, 0x0a, 0x11, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x30, - 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x10, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01, - 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x49, 0x64, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x11, 0x70, 0x72, - 0x65, 0x76, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x48, 0x0a, 0x13, 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, - 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, + 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x06, 0x0a, 0x11, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x0b, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, + 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x88, 0x01, 0x01, 0x12, + 0x50, 0x0a, 0x0e, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x52, 0x0d, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, + 0x64, 0x12, 0x59, 0x0a, 0x14, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, + 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x57, 0x0a, 0x13, + 0x6e, 0x65, 0x77, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, + 0x73, 0x33, 0x32, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x69, + 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x44, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, + 0x32, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x48, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x47, 0x0a, 0x12, 0x73, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, - 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x10, 0x73, 0x65, 0x74, 0x74, - 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x42, 0x0f, 0x0a, 0x0d, - 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x14, 0x0a, - 0x12, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x22, 0x32, 0x0a, 0x16, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0xd9, 0x01, 0x0a, 0x11, 0x43, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, - 0x1e, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, - 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x10, 0x02, - 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x41, 0x4e, 0x44, 0x49, 0x44, 0x41, 0x54, 0x45, - 0x10, 0x03, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, - 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, - 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, - 0x44, 0x10, 0x05, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, - 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x56, 0x0a, 0x12, + 0x73, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x33, 0x32, 0x52, 0x10, 0x73, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x78, + 0x48, 0x61, 0x73, 0x68, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x32, 0x0a, 0x16, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, + 0xd9, 0x01, 0x0a, 0x11, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x1e, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, + 0x41, 0x4e, 0x44, 0x49, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, + 0x5f, 0x49, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, + 0x53, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x37, 0x5a, 0x35, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -362,20 +369,20 @@ func file_types_certificate_header_proto_rawDescGZIP() []byte { var file_types_certificate_header_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_types_certificate_header_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_types_certificate_header_proto_goTypes = []interface{}{ - (CertificateStatus)(0), // 0: proto.types.CertificateStatus - (*CertificateHeader)(nil), // 1: proto.types.CertificateHeader - (*CertificateStatusError)(nil), // 2: proto.types.CertificateStatusError - (*CertificateId)(nil), // 3: proto.types.CertificateId - (*FixedBytes32)(nil), // 4: proto.types.FixedBytes32 + (CertificateStatus)(0), // 0: agglayer.protocol.types.v1.CertificateStatus + (*CertificateHeader)(nil), // 1: agglayer.protocol.types.v1.CertificateHeader + (*CertificateStatusError)(nil), // 2: agglayer.protocol.types.v1.CertificateStatusError + (*CertificateId)(nil), // 3: agglayer.protocol.types.v1.CertificateId + (*FixedBytes32)(nil), // 4: agglayer.protocol.types.v1.FixedBytes32 } var file_types_certificate_header_proto_depIdxs = []int32{ - 3, // 0: proto.types.CertificateHeader.certificate_id:type_name -> proto.types.CertificateId - 4, // 1: proto.types.CertificateHeader.prev_local_exit_root:type_name -> proto.types.FixedBytes32 - 4, // 2: proto.types.CertificateHeader.new_local_exit_root:type_name -> proto.types.FixedBytes32 - 4, // 3: proto.types.CertificateHeader.metadata:type_name -> proto.types.FixedBytes32 - 0, // 4: proto.types.CertificateHeader.status:type_name -> proto.types.CertificateStatus - 2, // 5: proto.types.CertificateHeader.error:type_name -> proto.types.CertificateStatusError - 4, // 6: proto.types.CertificateHeader.settlement_tx_hash:type_name -> proto.types.FixedBytes32 + 3, // 0: agglayer.protocol.types.v1.CertificateHeader.certificate_id:type_name -> agglayer.protocol.types.v1.CertificateId + 4, // 1: agglayer.protocol.types.v1.CertificateHeader.prev_local_exit_root:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 4, // 2: agglayer.protocol.types.v1.CertificateHeader.new_local_exit_root:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 4, // 3: agglayer.protocol.types.v1.CertificateHeader.metadata:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 0, // 4: agglayer.protocol.types.v1.CertificateHeader.status:type_name -> agglayer.protocol.types.v1.CertificateStatus + 2, // 5: agglayer.protocol.types.v1.CertificateHeader.error:type_name -> agglayer.protocol.types.v1.CertificateStatusError + 4, // 6: agglayer.protocol.types.v1.CertificateHeader.settlement_tx_hash:type_name -> agglayer.protocol.types.v1.FixedBytes32 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name diff --git a/agglayer/proto/types/certificate_header.proto b/agglayer/proto/types/certificate_header.proto index ca104e7f..7407dc30 100644 --- a/agglayer/proto/types/certificate_header.proto +++ b/agglayer/proto/types/certificate_header.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; import "types/bytes.proto"; import "types/certificate.proto"; diff --git a/agglayer/proto/types/claim.pb.go b/agglayer/proto/types/claim.pb.go index 051ea3a0..1c3a3b80 100644 --- a/agglayer/proto/types/claim.pb.go +++ b/agglayer/proto/types/claim.pb.go @@ -368,74 +368,88 @@ var File_types_claim_proto protoreflect.FileDescriptor var file_types_claim_proto_rawDesc = []byte{ 0x0a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xcc, 0x01, 0x0a, 0x10, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, - 0x6d, 0x4d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x12, 0x3e, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x6d, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, - 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x4c, 0x65, 0x61, 0x66, 0x4d, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x5f, 0x67, 0x65, 0x72, 0x5f, 0x6c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0e, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x47, 0x65, 0x72, 0x4c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x07, - 0x6c, 0x31, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x31, 0x49, 0x6e, - 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x06, 0x6c, 0x31, 0x4c, 0x65, - 0x61, 0x66, 0x22, 0xcf, 0x01, 0x0a, 0x0e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, - 0x65, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x2b, 0x0a, 0x12, 0x6c, 0x31, 0x5f, 0x69, 0x6e, 0x66, 0x6f, - 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0f, 0x6c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, - 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x03, 0x72, 0x65, 0x72, 0x12, - 0x2b, 0x0a, 0x03, 0x6d, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x03, 0x6d, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x05, - 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, - 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, - 0x6e, 0x6e, 0x65, 0x72, 0x22, 0xb2, 0x01, 0x0a, 0x13, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, - 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x10, - 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, - 0x32, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, - 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x73, 0x0a, 0x0b, 0x4d, 0x65, 0x72, - 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, - 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, - 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x89, - 0x02, 0x0a, 0x0f, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x6f, 0x6c, 0x6c, - 0x75, 0x70, 0x12, 0x3e, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6c, 0x65, 0x61, 0x66, - 0x5f, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4c, 0x65, 0x61, 0x66, 0x4c, - 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6c, 0x65, 0x72, 0x5f, - 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4c, 0x65, 0x72, 0x52, 0x65, 0x72, - 0x12, 0x42, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x67, 0x65, 0x72, 0x5f, 0x6c, 0x31, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x47, 0x65, 0x72, 0x4c, 0x31, - 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x6c, 0x31, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, - 0x61, 0x66, 0x52, 0x06, 0x6c, 0x31, 0x4c, 0x65, 0x61, 0x66, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, + 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xf9, 0x01, 0x0a, 0x10, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, + 0x4d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x12, 0x4d, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x6d, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x72, + 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4c, + 0x65, 0x61, 0x66, 0x4d, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, + 0x67, 0x65, 0x72, 0x5f, 0x6c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, + 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x47, 0x65, 0x72, 0x4c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x6c, 0x31, 0x5f, + 0x6c, 0x65, 0x61, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x67, 0x67, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, + 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x06, 0x6c, 0x31, 0x4c, 0x65, 0x61, 0x66, 0x22, 0xfc, + 0x01, 0x0a, 0x0e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, + 0x66, 0x12, 0x2b, 0x0a, 0x12, 0x6c, 0x31, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x72, 0x65, + 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6c, + 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3a, + 0x0a, 0x03, 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x03, 0x72, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x03, 0x6d, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, + 0x32, 0x52, 0x03, 0x6d, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, + 0x66, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0xd0, 0x01, + 0x0a, 0x13, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x4c, 0x65, 0x61, 0x66, + 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, + 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x47, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x22, 0x91, 0x01, 0x0a, 0x0b, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x12, 0x3c, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x44, + 0x0a, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, + 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x08, 0x73, 0x69, 0x62, 0x6c, + 0x69, 0x6e, 0x67, 0x73, 0x22, 0xc5, 0x02, 0x0a, 0x0f, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, + 0x6f, 0x6d, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x12, 0x4d, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, + 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x4c, 0x65, 0x61, 0x66, 0x4c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x5f, 0x6c, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x72, 0x6b, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4c, 0x65, + 0x72, 0x52, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x67, 0x65, + 0x72, 0x5f, 0x6c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x72, 0x6b, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x47, 0x65, + 0x72, 0x4c, 0x31, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x6c, 0x31, 0x5f, 0x6c, 0x65, + 0x61, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x31, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x65, 0x65, + 0x4c, 0x65, 0x61, 0x66, 0x52, 0x06, 0x6c, 0x31, 0x4c, 0x65, 0x61, 0x66, 0x42, 0x37, 0x5a, 0x35, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -452,28 +466,28 @@ func file_types_claim_proto_rawDescGZIP() []byte { var file_types_claim_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_types_claim_proto_goTypes = []interface{}{ - (*ClaimFromMainnet)(nil), // 0: proto.types.ClaimFromMainnet - (*L1InfoTreeLeaf)(nil), // 1: proto.types.L1InfoTreeLeaf - (*L1InfoTreeLeafInner)(nil), // 2: proto.types.L1InfoTreeLeafInner - (*MerkleProof)(nil), // 3: proto.types.MerkleProof - (*ClaimFromRollup)(nil), // 4: proto.types.ClaimFromRollup - (*FixedBytes32)(nil), // 5: proto.types.FixedBytes32 + (*ClaimFromMainnet)(nil), // 0: agglayer.protocol.types.v1.ClaimFromMainnet + (*L1InfoTreeLeaf)(nil), // 1: agglayer.protocol.types.v1.L1InfoTreeLeaf + (*L1InfoTreeLeafInner)(nil), // 2: agglayer.protocol.types.v1.L1InfoTreeLeafInner + (*MerkleProof)(nil), // 3: agglayer.protocol.types.v1.MerkleProof + (*ClaimFromRollup)(nil), // 4: agglayer.protocol.types.v1.ClaimFromRollup + (*FixedBytes32)(nil), // 5: agglayer.protocol.types.v1.FixedBytes32 } var file_types_claim_proto_depIdxs = []int32{ - 3, // 0: proto.types.ClaimFromMainnet.proof_leaf_mer:type_name -> proto.types.MerkleProof - 3, // 1: proto.types.ClaimFromMainnet.proof_ger_l1root:type_name -> proto.types.MerkleProof - 1, // 2: proto.types.ClaimFromMainnet.l1_leaf:type_name -> proto.types.L1InfoTreeLeaf - 5, // 3: proto.types.L1InfoTreeLeaf.rer:type_name -> proto.types.FixedBytes32 - 5, // 4: proto.types.L1InfoTreeLeaf.mer:type_name -> proto.types.FixedBytes32 - 2, // 5: proto.types.L1InfoTreeLeaf.inner:type_name -> proto.types.L1InfoTreeLeafInner - 5, // 6: proto.types.L1InfoTreeLeafInner.global_exit_root:type_name -> proto.types.FixedBytes32 - 5, // 7: proto.types.L1InfoTreeLeafInner.block_hash:type_name -> proto.types.FixedBytes32 - 5, // 8: proto.types.MerkleProof.root:type_name -> proto.types.FixedBytes32 - 5, // 9: proto.types.MerkleProof.siblings:type_name -> proto.types.FixedBytes32 - 3, // 10: proto.types.ClaimFromRollup.proof_leaf_ler:type_name -> proto.types.MerkleProof - 3, // 11: proto.types.ClaimFromRollup.proof_ler_rer:type_name -> proto.types.MerkleProof - 3, // 12: proto.types.ClaimFromRollup.proof_ger_l1root:type_name -> proto.types.MerkleProof - 1, // 13: proto.types.ClaimFromRollup.l1_leaf:type_name -> proto.types.L1InfoTreeLeaf + 3, // 0: agglayer.protocol.types.v1.ClaimFromMainnet.proof_leaf_mer:type_name -> agglayer.protocol.types.v1.MerkleProof + 3, // 1: agglayer.protocol.types.v1.ClaimFromMainnet.proof_ger_l1root:type_name -> agglayer.protocol.types.v1.MerkleProof + 1, // 2: agglayer.protocol.types.v1.ClaimFromMainnet.l1_leaf:type_name -> agglayer.protocol.types.v1.L1InfoTreeLeaf + 5, // 3: agglayer.protocol.types.v1.L1InfoTreeLeaf.rer:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 5, // 4: agglayer.protocol.types.v1.L1InfoTreeLeaf.mer:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 2, // 5: agglayer.protocol.types.v1.L1InfoTreeLeaf.inner:type_name -> agglayer.protocol.types.v1.L1InfoTreeLeafInner + 5, // 6: agglayer.protocol.types.v1.L1InfoTreeLeafInner.global_exit_root:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 5, // 7: agglayer.protocol.types.v1.L1InfoTreeLeafInner.block_hash:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 5, // 8: agglayer.protocol.types.v1.MerkleProof.root:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 5, // 9: agglayer.protocol.types.v1.MerkleProof.siblings:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 3, // 10: agglayer.protocol.types.v1.ClaimFromRollup.proof_leaf_ler:type_name -> agglayer.protocol.types.v1.MerkleProof + 3, // 11: agglayer.protocol.types.v1.ClaimFromRollup.proof_ler_rer:type_name -> agglayer.protocol.types.v1.MerkleProof + 3, // 12: agglayer.protocol.types.v1.ClaimFromRollup.proof_ger_l1root:type_name -> agglayer.protocol.types.v1.MerkleProof + 1, // 13: agglayer.protocol.types.v1.ClaimFromRollup.l1_leaf:type_name -> agglayer.protocol.types.v1.L1InfoTreeLeaf 14, // [14:14] is the sub-list for method output_type 14, // [14:14] is the sub-list for method input_type 14, // [14:14] is the sub-list for extension type_name diff --git a/agglayer/proto/types/claim.proto b/agglayer/proto/types/claim.proto index c4226c49..89e0bcff 100644 --- a/agglayer/proto/types/claim.proto +++ b/agglayer/proto/types/claim.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; import "types/bytes.proto"; diff --git a/agglayer/proto/types/epoch_configuration.pb.go b/agglayer/proto/types/epoch_configuration.pb.go index 1710ce7f..4cb0db51 100644 --- a/agglayer/proto/types/epoch_configuration.pb.go +++ b/agglayer/proto/types/epoch_configuration.pb.go @@ -83,18 +83,18 @@ var File_types_epoch_configuration_proto protoreflect.FileDescriptor var file_types_epoch_configuration_proto_rawDesc = []byte{ 0x0a, 0x1f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x60, - 0x0a, 0x12, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, 0x6e, - 0x65, 0x73, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, - 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, - 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x60, 0x0a, + 0x12, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0d, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -111,7 +111,7 @@ func file_types_epoch_configuration_proto_rawDescGZIP() []byte { var file_types_epoch_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_epoch_configuration_proto_goTypes = []interface{}{ - (*EpochConfiguration)(nil), // 0: proto.types.EpochConfiguration + (*EpochConfiguration)(nil), // 0: agglayer.protocol.types.v1.EpochConfiguration } var file_types_epoch_configuration_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type diff --git a/agglayer/proto/types/epoch_configuration.proto b/agglayer/proto/types/epoch_configuration.proto index 4c7d4a63..144c32ad 100644 --- a/agglayer/proto/types/epoch_configuration.proto +++ b/agglayer/proto/types/epoch_configuration.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; // Epoch configuration type. diff --git a/agglayer/proto/types/imported_bridge_exit.pb.go b/agglayer/proto/types/imported_bridge_exit.pb.go index 38d71b79..d1420ab7 100644 --- a/agglayer/proto/types/imported_bridge_exit.pb.go +++ b/agglayer/proto/types/imported_bridge_exit.pb.go @@ -133,32 +133,37 @@ var File_types_imported_bridge_exit_proto protoreflect.FileDescriptor var file_types_imported_bridge_exit_proto_rawDesc = []byte{ 0x0a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, - 0x11, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x5f, 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, - 0x02, 0x0a, 0x12, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, - 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, - 0x65, 0x78, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, - 0x78, 0x69, 0x74, 0x52, 0x0a, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, - 0x3c, 0x0a, 0x0c, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, - 0x52, 0x0b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x39, 0x0a, - 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x4d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x48, 0x00, 0x52, - 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x72, 0x6f, 0x6c, 0x6c, - 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, - 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x00, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x6c, 0x75, 0x70, - 0x42, 0x07, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2f, 0x61, 0x67, 0x67, 0x6b, 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x12, 0x1a, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x11, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x17, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, + 0x65, 0x78, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc4, 0x02, + 0x0a, 0x12, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x45, 0x78, 0x69, 0x74, 0x12, 0x47, 0x0a, 0x0b, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x65, + 0x78, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x67, 0x67, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, + 0x74, 0x52, 0x0a, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x45, 0x78, 0x69, 0x74, 0x12, 0x4b, 0x0a, + 0x0c, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x33, 0x32, 0x52, 0x0b, 0x67, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x48, 0x0a, 0x07, 0x6d, 0x61, + 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x61, 0x67, + 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, + 0x6f, 0x6d, 0x4d, 0x61, 0x69, 0x6e, 0x6e, 0x65, 0x74, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x61, 0x69, + 0x6e, 0x6e, 0x65, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x72, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x6f, 0x6c, 0x6c, 0x75, + 0x70, 0x48, 0x00, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x42, 0x07, 0x0a, 0x05, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x61, 0x67, 0x67, 0x6b, + 0x69, 0x74, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -175,17 +180,17 @@ func file_types_imported_bridge_exit_proto_rawDescGZIP() []byte { var file_types_imported_bridge_exit_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_types_imported_bridge_exit_proto_goTypes = []interface{}{ - (*ImportedBridgeExit)(nil), // 0: proto.types.ImportedBridgeExit - (*BridgeExit)(nil), // 1: proto.types.BridgeExit - (*FixedBytes32)(nil), // 2: proto.types.FixedBytes32 - (*ClaimFromMainnet)(nil), // 3: proto.types.ClaimFromMainnet - (*ClaimFromRollup)(nil), // 4: proto.types.ClaimFromRollup + (*ImportedBridgeExit)(nil), // 0: agglayer.protocol.types.v1.ImportedBridgeExit + (*BridgeExit)(nil), // 1: agglayer.protocol.types.v1.BridgeExit + (*FixedBytes32)(nil), // 2: agglayer.protocol.types.v1.FixedBytes32 + (*ClaimFromMainnet)(nil), // 3: agglayer.protocol.types.v1.ClaimFromMainnet + (*ClaimFromRollup)(nil), // 4: agglayer.protocol.types.v1.ClaimFromRollup } var file_types_imported_bridge_exit_proto_depIdxs = []int32{ - 1, // 0: proto.types.ImportedBridgeExit.bridge_exit:type_name -> proto.types.BridgeExit - 2, // 1: proto.types.ImportedBridgeExit.global_index:type_name -> proto.types.FixedBytes32 - 3, // 2: proto.types.ImportedBridgeExit.mainnet:type_name -> proto.types.ClaimFromMainnet - 4, // 3: proto.types.ImportedBridgeExit.rollup:type_name -> proto.types.ClaimFromRollup + 1, // 0: agglayer.protocol.types.v1.ImportedBridgeExit.bridge_exit:type_name -> agglayer.protocol.types.v1.BridgeExit + 2, // 1: agglayer.protocol.types.v1.ImportedBridgeExit.global_index:type_name -> agglayer.protocol.types.v1.FixedBytes32 + 3, // 2: agglayer.protocol.types.v1.ImportedBridgeExit.mainnet:type_name -> agglayer.protocol.types.v1.ClaimFromMainnet + 4, // 3: agglayer.protocol.types.v1.ImportedBridgeExit.rollup:type_name -> agglayer.protocol.types.v1.ClaimFromRollup 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name diff --git a/agglayer/proto/types/imported_bridge_exit.proto b/agglayer/proto/types/imported_bridge_exit.proto index eea00c5d..dc73d5ec 100644 --- a/agglayer/proto/types/imported_bridge_exit.proto +++ b/agglayer/proto/types/imported_bridge_exit.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package proto.types; +package agglayer.protocol.types.v1; option go_package = "github.com/agglayer/aggkit/agglayer/proto/types;types"; import "types/bytes.proto"; import "types/bridge_exit.proto"; diff --git a/cmd/run.go b/cmd/run.go index ab5a1f3d..c9c03aa1 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -8,6 +8,7 @@ import ( "os" "os/signal" "runtime" + "strings" "time" jRPC "github.com/0xPolygon/cdk-rpc/rpc" @@ -144,7 +145,8 @@ func createAggSender( l2Syncer *bridgesync.BridgeSync, l2Client *ethclient.Client) (*aggsender.AggSender, error) { logger := log.WithFields("module", aggkitcommon.AGGSENDER) - agglayerClient, err := agglayer.NewAgglayerGRPCClient(cfg.AggLayerURL) + aggLayerURL := strings.TrimPrefix(cfg.AggLayerURL, "http://") + agglayerClient, err := agglayer.NewAgglayerGRPCClient(aggLayerURL) if err != nil { return nil, fmt.Errorf("failed to create agglayer grpc client: %w", err) }