From 6900214c1df3bd4b1fb4b4debed2087e06cb5490 Mon Sep 17 00:00:00 2001 From: Goran Rojovic Date: Wed, 19 Feb 2025 12:42:55 +0100 Subject: [PATCH] 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 ++++ .../proto/node/agglayer_query_service.pb.go | 536 ++++++++++++++++ .../proto/node/agglayer_query_service.proto | 56 ++ .../node/agglayer_query_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, 4545 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_query_service.pb.go create mode 100644 agglayer/proto/node/agglayer_query_service.proto create mode 100644 agglayer/proto/node/agglayer_query_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..99841e4c --- /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, 0x76, 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, 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.CertificateSubmissionService.SubmitCertificate:input_type -> proto.SubmitCertificateRequest + 2, // 3: proto.CertificateSubmissionService.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..71c097b1 --- /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 CertificateSubmissionService { + // 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..93f03c14 --- /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 ( + CertificateSubmissionService_SubmitCertificate_FullMethodName = "/proto.CertificateSubmissionService/SubmitCertificate" +) + +// 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 CertificateSubmissionServiceClient interface { + // Method used to submit a certificate. + SubmitCertificate(ctx context.Context, in *SubmitCertificateRequest, opts ...grpc.CallOption) (*SubmitCertificateResponse, error) +} + +type certificateSubmissionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCertificateSubmissionServiceClient(cc grpc.ClientConnInterface) CertificateSubmissionServiceClient { + return &certificateSubmissionServiceClient{cc} +} + +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, CertificateSubmissionService_SubmitCertificate_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// 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 CertificateSubmissionServiceServer interface { + // Method used to submit a certificate. + SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) + mustEmbedUnimplementedCertificateSubmissionServiceServer() +} + +// UnimplementedCertificateSubmissionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCertificateSubmissionServiceServer struct { +} + +func (UnimplementedCertificateSubmissionServiceServer) SubmitCertificate(context.Context, *SubmitCertificateRequest) (*SubmitCertificateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitCertificate not implemented") +} +func (UnimplementedCertificateSubmissionServiceServer) mustEmbedUnimplementedCertificateSubmissionServiceServer() { +} + +// 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 UnsafeCertificateSubmissionServiceServer interface { + mustEmbedUnimplementedCertificateSubmissionServiceServer() +} + +func RegisterCertificateSubmissionServiceServer(s grpc.ServiceRegistrar, srv CertificateSubmissionServiceServer) { + s.RegisterService(&CertificateSubmissionService_ServiceDesc, srv) +} + +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.(CertificateSubmissionServiceServer).SubmitCertificate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CertificateSubmissionService_SubmitCertificate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CertificateSubmissionServiceServer).SubmitCertificate(ctx, req.(*SubmitCertificateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// 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 CertificateSubmissionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.CertificateSubmissionService", + HandlerType: (*CertificateSubmissionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitCertificate", + Handler: _CertificateSubmissionService_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_query_service.pb.go b/agglayer/proto/node/agglayer_query_service.pb.go new file mode 100644 index 00000000..d592d65d --- /dev/null +++ b/agglayer/proto/node/agglayer_query_service.pb.go @@ -0,0 +1,536 @@ +// Proto definition for Agglayer Query Service + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v5.29.3 +// source: node/agglayer_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_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_query_service_proto_rawDescGZIP(), []int{5} +} + +func (x *GetLatestPendingCertificateHeaderResponse) GetCertificateHeader() *types.CertificateHeader { + if x != nil { + return x.CertificateHeader + } + return nil +} + +var File_node_agglayer_query_service_proto protoreflect.FileDescriptor + +var file_node_agglayer_query_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x5f, + 0x71, 0x75, 0x65, 0x72, 0x79, 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_query_service_proto_rawDescOnce sync.Once + file_node_agglayer_query_service_proto_rawDescData = file_node_agglayer_query_service_proto_rawDesc +) + +func file_node_agglayer_query_service_proto_rawDescGZIP() []byte { + file_node_agglayer_query_service_proto_rawDescOnce.Do(func() { + file_node_agglayer_query_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_node_agglayer_query_service_proto_rawDescData) + }) + return file_node_agglayer_query_service_proto_rawDescData +} + +var file_node_agglayer_query_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_node_agglayer_query_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_query_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_query_service_proto_init() } +func file_node_agglayer_query_service_proto_init() { + if File_node_agglayer_query_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_node_agglayer_query_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_query_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_query_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_query_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_query_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_query_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_query_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_node_agglayer_query_service_proto_goTypes, + DependencyIndexes: file_node_agglayer_query_service_proto_depIdxs, + MessageInfos: file_node_agglayer_query_service_proto_msgTypes, + }.Build() + File_node_agglayer_query_service_proto = out.File + file_node_agglayer_query_service_proto_rawDesc = nil + file_node_agglayer_query_service_proto_goTypes = nil + file_node_agglayer_query_service_proto_depIdxs = nil +} diff --git a/agglayer/proto/node/agglayer_query_service.proto b/agglayer/proto/node/agglayer_query_service.proto new file mode 100644 index 00000000..ba504cd1 --- /dev/null +++ b/agglayer/proto/node/agglayer_query_service.proto @@ -0,0 +1,56 @@ +// Proto definition for Agglayer Query 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_query_service_grpc.pb.go b/agglayer/proto/node/agglayer_query_service_grpc.pb.go new file mode 100644 index 00000000..c4d6f0db --- /dev/null +++ b/agglayer/proto/node/agglayer_query_service_grpc.pb.go @@ -0,0 +1,199 @@ +// Proto definition for Agglayer Query 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_query_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_query_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 +}