diff --git a/node-platform/chip-schemas.json b/node-platform/chip-schemas.json index 9b555b51..024c325d 100644 --- a/node-platform/chip-schemas.json +++ b/node-platform/chip-schemas.json @@ -13,6 +13,10 @@ "entity": "common.v1.NodeJobInfo", "path": "common/v1/node_job_info.proto" }, + { + "entity": "common.v1.CLJobInfo", + "path": "common/v1/cl_job_info.proto" + }, { "entity": "common.v1.HealthInfo", "path": "common/v1/health_info.proto" diff --git a/node-platform/common/v1/cl_job_info.pb.go b/node-platform/common/v1/cl_job_info.pb.go new file mode 100644 index 00000000..7d2671d3 --- /dev/null +++ b/node-platform/common/v1/cl_job_info.pb.go @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.6 +// protoc v5.29.3 +// source: node-platform/common/v1/cl_job_info.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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) +) + +// CLJobInfoTrigger is the reason a CLJobInfo event was emitted. +type CLJobInfoTrigger int32 + +const ( + CLJobInfoTrigger_CL_JOB_INFO_TRIGGER_UNSPECIFIED CLJobInfoTrigger = 0 + CLJobInfoTrigger_CL_JOB_INFO_TRIGGER_HEARTBEAT CLJobInfoTrigger = 1 + CLJobInfoTrigger_CL_JOB_INFO_TRIGGER_CREATE CLJobInfoTrigger = 2 + CLJobInfoTrigger_CL_JOB_INFO_TRIGGER_DELETE CLJobInfoTrigger = 3 +) + +// Enum value maps for CLJobInfoTrigger. +var ( + CLJobInfoTrigger_name = map[int32]string{ + 0: "CL_JOB_INFO_TRIGGER_UNSPECIFIED", + 1: "CL_JOB_INFO_TRIGGER_HEARTBEAT", + 2: "CL_JOB_INFO_TRIGGER_CREATE", + 3: "CL_JOB_INFO_TRIGGER_DELETE", + } + CLJobInfoTrigger_value = map[string]int32{ + "CL_JOB_INFO_TRIGGER_UNSPECIFIED": 0, + "CL_JOB_INFO_TRIGGER_HEARTBEAT": 1, + "CL_JOB_INFO_TRIGGER_CREATE": 2, + "CL_JOB_INFO_TRIGGER_DELETE": 3, + } +) + +func (x CLJobInfoTrigger) Enum() *CLJobInfoTrigger { + p := new(CLJobInfoTrigger) + *p = x + return p +} + +func (x CLJobInfoTrigger) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CLJobInfoTrigger) Descriptor() protoreflect.EnumDescriptor { + return file_node_platform_common_v1_cl_job_info_proto_enumTypes[0].Descriptor() +} + +func (CLJobInfoTrigger) Type() protoreflect.EnumType { + return &file_node_platform_common_v1_cl_job_info_proto_enumTypes[0] +} + +func (x CLJobInfoTrigger) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CLJobInfoTrigger.Descriptor instead. +func (CLJobInfoTrigger) EnumDescriptor() ([]byte, []int) { + return file_node_platform_common_v1_cl_job_info_proto_rawDescGZIP(), []int{0} +} + +// CLJobInfo is a type-agnostic snapshot of a single Chainlink job: common +// identity fields plus the whole job definition as TOML, so any job type is +// reported through one schema with no per-type message or extractor. This is +// also how JD moves specs around — ProposeJobRequest and Proposal both carry +// the TOML as an opaque string. +// +// Timestamps are int64 epoch millis, not google.protobuf.Timestamp: nothing +// registered with chip-ingress imports a WKT, and the Timestamp version +// registered fine but never got a table. +type CLJobInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Node identity. + CsaPublicKey string `protobuf:"bytes,1,opt,name=csa_public_key,json=csaPublicKey,proto3" json:"csa_public_key,omitempty"` + NodeVersion string `protobuf:"bytes,2,opt,name=node_version,json=nodeVersion,proto3" json:"node_version,omitempty"` + Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` + // Job identity — common to every job type. + ExternalJobId string `protobuf:"bytes,10,opt,name=external_job_id,json=externalJobId,proto3" json:"external_job_id,omitempty"` + JobId int32 `protobuf:"varint,11,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` + Name string `protobuf:"bytes,12,opt,name=name,proto3" json:"name,omitempty"` + JobType string `protobuf:"bytes,13,opt,name=job_type,json=jobType,proto3" json:"job_type,omitempty"` + SchemaVersion uint32 `protobuf:"varint,14,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"` + ForwardingAllowed bool `protobuf:"varint,15,opt,name=forwarding_allowed,json=forwardingAllowed,proto3" json:"forwarding_allowed,omitempty"` + GasLimit *uint32 `protobuf:"varint,16,opt,name=gas_limit,json=gasLimit,proto3,oneof" json:"gas_limit,omitempty"` + StreamId *uint32 `protobuf:"varint,17,opt,name=stream_id,json=streamId,proto3,oneof" json:"stream_id,omitempty"` + // Epoch millis, UTC. Not RFC3339: Go emits those at variable width, so they + // don't sort chronologically. + CreatedAtMs *int64 `protobuf:"varint,18,opt,name=created_at_ms,json=createdAtMs,proto3,oneof" json:"created_at_ms,omitempty"` + // Whole job definition as TOML, covering all type-specific spec fields. + SpecToml string `protobuf:"bytes,30,opt,name=spec_toml,json=specToml,proto3" json:"spec_toml,omitempty"` + // Event metadata. + Trigger CLJobInfoTrigger `protobuf:"varint,40,opt,name=trigger,proto3,enum=common.v1.CLJobInfoTrigger" json:"trigger,omitempty"` + TimestampMs int64 `protobuf:"varint,41,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + // JD provenance. Unset for jobs created directly (CLI, UI, TOML on disk), + // which is how a consumer spots an unmanaged job. + FeedsManagerId *int64 `protobuf:"varint,50,opt,name=feeds_manager_id,json=feedsManagerId,proto3,oneof" json:"feeds_manager_id,omitempty"` + // Join key back to api.job.v1.Job.uuid. + RemoteUuid *string `protobuf:"bytes,51,opt,name=remote_uuid,json=remoteUuid,proto3,oneof" json:"remote_uuid,omitempty"` + // Revision of the approved proposal spec that produced this job. + SpecVersion *int32 `protobuf:"varint,52,opt,name=spec_version,json=specVersion,proto3,oneof" json:"spec_version,omitempty"` + ProposedAtMs *int64 `protobuf:"varint,53,opt,name=proposed_at_ms,json=proposedAtMs,proto3,oneof" json:"proposed_at_ms,omitempty"` + ApprovedAtMs *int64 `protobuf:"varint,54,opt,name=approved_at_ms,json=approvedAtMs,proto3,oneof" json:"approved_at_ms,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CLJobInfo) Reset() { + *x = CLJobInfo{} + mi := &file_node_platform_common_v1_cl_job_info_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CLJobInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CLJobInfo) ProtoMessage() {} + +func (x *CLJobInfo) ProtoReflect() protoreflect.Message { + mi := &file_node_platform_common_v1_cl_job_info_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CLJobInfo.ProtoReflect.Descriptor instead. +func (*CLJobInfo) Descriptor() ([]byte, []int) { + return file_node_platform_common_v1_cl_job_info_proto_rawDescGZIP(), []int{0} +} + +func (x *CLJobInfo) GetCsaPublicKey() string { + if x != nil { + return x.CsaPublicKey + } + return "" +} + +func (x *CLJobInfo) GetNodeVersion() string { + if x != nil { + return x.NodeVersion + } + return "" +} + +func (x *CLJobInfo) GetHostname() string { + if x != nil { + return x.Hostname + } + return "" +} + +func (x *CLJobInfo) GetExternalJobId() string { + if x != nil { + return x.ExternalJobId + } + return "" +} + +func (x *CLJobInfo) GetJobId() int32 { + if x != nil { + return x.JobId + } + return 0 +} + +func (x *CLJobInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CLJobInfo) GetJobType() string { + if x != nil { + return x.JobType + } + return "" +} + +func (x *CLJobInfo) GetSchemaVersion() uint32 { + if x != nil { + return x.SchemaVersion + } + return 0 +} + +func (x *CLJobInfo) GetForwardingAllowed() bool { + if x != nil { + return x.ForwardingAllowed + } + return false +} + +func (x *CLJobInfo) GetGasLimit() uint32 { + if x != nil && x.GasLimit != nil { + return *x.GasLimit + } + return 0 +} + +func (x *CLJobInfo) GetStreamId() uint32 { + if x != nil && x.StreamId != nil { + return *x.StreamId + } + return 0 +} + +func (x *CLJobInfo) GetCreatedAtMs() int64 { + if x != nil && x.CreatedAtMs != nil { + return *x.CreatedAtMs + } + return 0 +} + +func (x *CLJobInfo) GetSpecToml() string { + if x != nil { + return x.SpecToml + } + return "" +} + +func (x *CLJobInfo) GetTrigger() CLJobInfoTrigger { + if x != nil { + return x.Trigger + } + return CLJobInfoTrigger_CL_JOB_INFO_TRIGGER_UNSPECIFIED +} + +func (x *CLJobInfo) GetTimestampMs() int64 { + if x != nil { + return x.TimestampMs + } + return 0 +} + +func (x *CLJobInfo) GetFeedsManagerId() int64 { + if x != nil && x.FeedsManagerId != nil { + return *x.FeedsManagerId + } + return 0 +} + +func (x *CLJobInfo) GetRemoteUuid() string { + if x != nil && x.RemoteUuid != nil { + return *x.RemoteUuid + } + return "" +} + +func (x *CLJobInfo) GetSpecVersion() int32 { + if x != nil && x.SpecVersion != nil { + return *x.SpecVersion + } + return 0 +} + +func (x *CLJobInfo) GetProposedAtMs() int64 { + if x != nil && x.ProposedAtMs != nil { + return *x.ProposedAtMs + } + return 0 +} + +func (x *CLJobInfo) GetApprovedAtMs() int64 { + if x != nil && x.ApprovedAtMs != nil { + return *x.ApprovedAtMs + } + return 0 +} + +var File_node_platform_common_v1_cl_job_info_proto protoreflect.FileDescriptor + +const file_node_platform_common_v1_cl_job_info_proto_rawDesc = "" + + "\n" + + ")node-platform/common/v1/cl_job_info.proto\x12\tcommon.v1\"\xf5\x06\n" + + "\tCLJobInfo\x12$\n" + + "\x0ecsa_public_key\x18\x01 \x01(\tR\fcsaPublicKey\x12!\n" + + "\fnode_version\x18\x02 \x01(\tR\vnodeVersion\x12\x1a\n" + + "\bhostname\x18\x03 \x01(\tR\bhostname\x12&\n" + + "\x0fexternal_job_id\x18\n" + + " \x01(\tR\rexternalJobId\x12\x15\n" + + "\x06job_id\x18\v \x01(\x05R\x05jobId\x12\x12\n" + + "\x04name\x18\f \x01(\tR\x04name\x12\x19\n" + + "\bjob_type\x18\r \x01(\tR\ajobType\x12%\n" + + "\x0eschema_version\x18\x0e \x01(\rR\rschemaVersion\x12-\n" + + "\x12forwarding_allowed\x18\x0f \x01(\bR\x11forwardingAllowed\x12 \n" + + "\tgas_limit\x18\x10 \x01(\rH\x00R\bgasLimit\x88\x01\x01\x12 \n" + + "\tstream_id\x18\x11 \x01(\rH\x01R\bstreamId\x88\x01\x01\x12'\n" + + "\rcreated_at_ms\x18\x12 \x01(\x03H\x02R\vcreatedAtMs\x88\x01\x01\x12\x1b\n" + + "\tspec_toml\x18\x1e \x01(\tR\bspecToml\x125\n" + + "\atrigger\x18( \x01(\x0e2\x1b.common.v1.CLJobInfoTriggerR\atrigger\x12!\n" + + "\ftimestamp_ms\x18) \x01(\x03R\vtimestampMs\x12-\n" + + "\x10feeds_manager_id\x182 \x01(\x03H\x03R\x0efeedsManagerId\x88\x01\x01\x12$\n" + + "\vremote_uuid\x183 \x01(\tH\x04R\n" + + "remoteUuid\x88\x01\x01\x12&\n" + + "\fspec_version\x184 \x01(\x05H\x05R\vspecVersion\x88\x01\x01\x12)\n" + + "\x0eproposed_at_ms\x185 \x01(\x03H\x06R\fproposedAtMs\x88\x01\x01\x12)\n" + + "\x0eapproved_at_ms\x186 \x01(\x03H\aR\fapprovedAtMs\x88\x01\x01B\f\n" + + "\n" + + "_gas_limitB\f\n" + + "\n" + + "_stream_idB\x10\n" + + "\x0e_created_at_msB\x13\n" + + "\x11_feeds_manager_idB\x0e\n" + + "\f_remote_uuidB\x0f\n" + + "\r_spec_versionB\x11\n" + + "\x0f_proposed_at_msB\x11\n" + + "\x0f_approved_at_ms*\x9a\x01\n" + + "\x10CLJobInfoTrigger\x12#\n" + + "\x1fCL_JOB_INFO_TRIGGER_UNSPECIFIED\x10\x00\x12!\n" + + "\x1dCL_JOB_INFO_TRIGGER_HEARTBEAT\x10\x01\x12\x1e\n" + + "\x1aCL_JOB_INFO_TRIGGER_CREATE\x10\x02\x12\x1e\n" + + "\x1aCL_JOB_INFO_TRIGGER_DELETE\x10\x03BFZDgithub.com/smartcontractkit/chainlink-protos/node-platform/common/v1b\x06proto3" + +var ( + file_node_platform_common_v1_cl_job_info_proto_rawDescOnce sync.Once + file_node_platform_common_v1_cl_job_info_proto_rawDescData []byte +) + +func file_node_platform_common_v1_cl_job_info_proto_rawDescGZIP() []byte { + file_node_platform_common_v1_cl_job_info_proto_rawDescOnce.Do(func() { + file_node_platform_common_v1_cl_job_info_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_node_platform_common_v1_cl_job_info_proto_rawDesc), len(file_node_platform_common_v1_cl_job_info_proto_rawDesc))) + }) + return file_node_platform_common_v1_cl_job_info_proto_rawDescData +} + +var file_node_platform_common_v1_cl_job_info_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_node_platform_common_v1_cl_job_info_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_node_platform_common_v1_cl_job_info_proto_goTypes = []any{ + (CLJobInfoTrigger)(0), // 0: common.v1.CLJobInfoTrigger + (*CLJobInfo)(nil), // 1: common.v1.CLJobInfo +} +var file_node_platform_common_v1_cl_job_info_proto_depIdxs = []int32{ + 0, // 0: common.v1.CLJobInfo.trigger:type_name -> common.v1.CLJobInfoTrigger + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_platform_common_v1_cl_job_info_proto_init() } +func file_node_platform_common_v1_cl_job_info_proto_init() { + if File_node_platform_common_v1_cl_job_info_proto != nil { + return + } + file_node_platform_common_v1_cl_job_info_proto_msgTypes[0].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_node_platform_common_v1_cl_job_info_proto_rawDesc), len(file_node_platform_common_v1_cl_job_info_proto_rawDesc)), + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_node_platform_common_v1_cl_job_info_proto_goTypes, + DependencyIndexes: file_node_platform_common_v1_cl_job_info_proto_depIdxs, + EnumInfos: file_node_platform_common_v1_cl_job_info_proto_enumTypes, + MessageInfos: file_node_platform_common_v1_cl_job_info_proto_msgTypes, + }.Build() + File_node_platform_common_v1_cl_job_info_proto = out.File + file_node_platform_common_v1_cl_job_info_proto_goTypes = nil + file_node_platform_common_v1_cl_job_info_proto_depIdxs = nil +} diff --git a/node-platform/common/v1/cl_job_info.proto b/node-platform/common/v1/cl_job_info.proto new file mode 100644 index 00000000..567c6926 --- /dev/null +++ b/node-platform/common/v1/cl_job_info.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package common.v1; + +option go_package = "github.com/smartcontractkit/chainlink-protos/node-platform/common/v1"; + +// CLJobInfo is a type-agnostic snapshot of a single Chainlink job: common +// identity fields plus the whole job definition as TOML, so any job type is +// reported through one schema with no per-type message or extractor. This is +// also how JD moves specs around — ProposeJobRequest and Proposal both carry +// the TOML as an opaque string. +// +// Timestamps are int64 epoch millis, not google.protobuf.Timestamp: nothing +// registered with chip-ingress imports a WKT, and the Timestamp version +// registered fine but never got a table. +message CLJobInfo { + // Node identity. + string csa_public_key = 1; + string node_version = 2; + string hostname = 3; + + // Job identity — common to every job type. + string external_job_id = 10; + int32 job_id = 11; + string name = 12; + string job_type = 13; + uint32 schema_version = 14; + bool forwarding_allowed = 15; + optional uint32 gas_limit = 16; + optional uint32 stream_id = 17; + // Epoch millis, UTC. Not RFC3339: Go emits those at variable width, so they + // don't sort chronologically. + optional int64 created_at_ms = 18; + + // Whole job definition as TOML, covering all type-specific spec fields. + string spec_toml = 30; + + // Event metadata. + CLJobInfoTrigger trigger = 40; + int64 timestamp_ms = 41; + + // JD provenance. Unset for jobs created directly (CLI, UI, TOML on disk), + // which is how a consumer spots an unmanaged job. + optional int64 feeds_manager_id = 50; + // Join key back to api.job.v1.Job.uuid. + optional string remote_uuid = 51; + // Revision of the approved proposal spec that produced this job. + optional int32 spec_version = 52; + optional int64 proposed_at_ms = 53; + optional int64 approved_at_ms = 54; +} + +// CLJobInfoTrigger is the reason a CLJobInfo event was emitted. +enum CLJobInfoTrigger { + CL_JOB_INFO_TRIGGER_UNSPECIFIED = 0; + CL_JOB_INFO_TRIGGER_HEARTBEAT = 1; + CL_JOB_INFO_TRIGGER_CREATE = 2; + CL_JOB_INFO_TRIGGER_DELETE = 3; +}