diff --git a/core/config/app_config.go b/core/config/app_config.go index 869477218db..84d8b85be20 100644 --- a/core/config/app_config.go +++ b/core/config/app_config.go @@ -52,6 +52,7 @@ type AppConfig interface { Pyroscope() Pyroscope Sentry() Sentry TelemetryIngress() TelemetryIngress + HeadReport() HeadReport Threshold() Threshold WebServer() WebServer Tracing() Tracing diff --git a/core/config/head_report_config.go b/core/config/head_report_config.go new file mode 100644 index 00000000000..9f4ae85eb6c --- /dev/null +++ b/core/config/head_report_config.go @@ -0,0 +1,5 @@ +package config + +type HeadReport interface { + TelemetryEnabled() bool +} diff --git a/core/config/toml/types.go b/core/config/toml/types.go index 9f2b7d05477..c11c3ff3a14 100644 --- a/core/config/toml/types.go +++ b/core/config/toml/types.go @@ -57,6 +57,7 @@ type Core struct { Tracing Tracing `toml:",omitempty"` Mercury Mercury `toml:",omitempty"` Capabilities Capabilities `toml:",omitempty"` + HeadReport HeadReport `toml:",omitempty"` } // SetFrom updates c with any non-nil values from f. (currently TOML field only!) @@ -76,6 +77,7 @@ func (c *Core) SetFrom(f *Core) { c.TelemetryIngress.setFrom(&f.TelemetryIngress) c.AuditLogger.SetFrom(&f.AuditLogger) c.Log.setFrom(&f.Log) + c.HeadReport.setFrom(&f.HeadReport) c.WebServer.setFrom(&f.WebServer) c.JobPipeline.setFrom(&f.JobPipeline) @@ -485,6 +487,16 @@ func (t *TelemetryIngress) setFrom(f *TelemetryIngress) { } } +type HeadReport struct { + TelemetryEnabled *bool +} + +func (t *HeadReport) setFrom(f *HeadReport) { + if v := f.TelemetryEnabled; v != nil { + t.TelemetryEnabled = v + } +} + type AuditLogger struct { Enabled *bool ForwardToUrl *commonconfig.URL diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index f535e42a2f6..4ace4521dd8 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -315,7 +315,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) { srvcs = append(srvcs, mailMon) srvcs = append(srvcs, relayerChainInterops.Services()...) - headReporter := headreporter.NewHeadReporterService(opts.DS, legacyEVMChains, globalLogger, telemetryManager) + headReporter := headreporter.NewHeadReporterService(cfg.HeadReport(), opts.DS, legacyEVMChains, globalLogger, telemetryManager) srvcs = append(srvcs, headReporter) // Initialize Local Users ORM and Authentication Provider specified in config diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index 5b4a6271d52..4f026c1b342 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -474,6 +474,12 @@ func (g *generalConfig) RootDir() string { return h } +func (g *generalConfig) HeadReport() coreconfig.HeadReport { + return &headReport{ + h: g.c.HeadReport, + } +} + func (g *generalConfig) TelemetryIngress() coreconfig.TelemetryIngress { return &telemetryIngressConfig{ c: g.c.TelemetryIngress, diff --git a/core/services/chainlink/config_general_test.go b/core/services/chainlink/config_general_test.go index 29393ee0fdd..6247ebd91c8 100644 --- a/core/services/chainlink/config_general_test.go +++ b/core/services/chainlink/config_general_test.go @@ -30,6 +30,7 @@ func TestTOMLGeneralConfig_Defaults(t *testing.T) { assert.False(t, config.StarkNetEnabled()) assert.Equal(t, false, config.JobPipeline().ExternalInitiatorsEnabled()) assert.Equal(t, 15*time.Minute, config.WebServer().SessionTimeout().Duration()) + assert.Equal(t, false, config.HeadReport().TelemetryEnabled()) } func TestTOMLGeneralConfig_InsecureConfig(t *testing.T) { diff --git a/core/services/chainlink/config_head_report.go b/core/services/chainlink/config_head_report.go new file mode 100644 index 00000000000..e6e292938d9 --- /dev/null +++ b/core/services/chainlink/config_head_report.go @@ -0,0 +1,13 @@ +package chainlink + +import ( + "github.com/smartcontractkit/chainlink/v2/core/config/toml" +) + +type headReport struct { + h toml.HeadReport +} + +func (h headReport) TelemetryEnabled() bool { + return *h.h.TelemetryEnabled +} diff --git a/core/services/chainlink/config_head_report_test.go b/core/services/chainlink/config_head_report_test.go new file mode 100644 index 00000000000..b740c5fd7b2 --- /dev/null +++ b/core/services/chainlink/config_head_report_test.go @@ -0,0 +1,17 @@ +package chainlink + +import ( + "github.com/stretchr/testify/require" + "testing" +) + +func TestHeadReportConfig(t *testing.T) { + opts := GeneralConfigOpts{ + ConfigStrings: []string{fullTOML}, + } + cfg, err := opts.New() + require.NoError(t, err) + + hr := cfg.HeadReport() + require.True(t, hr.TelemetryEnabled()) +} diff --git a/core/services/chainlink/testdata/config-full.toml b/core/services/chainlink/testdata/config-full.toml index 6a0bbe86882..726bc450496 100644 --- a/core/services/chainlink/testdata/config-full.toml +++ b/core/services/chainlink/testdata/config-full.toml @@ -232,6 +232,9 @@ TLSCertPath = '/path/to/cert.pem' env = 'dev' test = 'load' +[HeadReport] +TelemetryEnabled = true + [Mercury] [Mercury.Cache] LatestReportTTL = '1m40s' diff --git a/core/services/headreporter/head_reporter.go b/core/services/headreporter/head_reporter.go index b4203dcb7bd..55e20e69916 100644 --- a/core/services/headreporter/head_reporter.go +++ b/core/services/headreporter/head_reporter.go @@ -3,6 +3,7 @@ package headreporter import ( "context" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" "sync" "time" @@ -35,11 +36,13 @@ type ( } ) -func NewHeadReporterService(ds sqlutil.DataSource, chainContainer legacyevm.LegacyChainContainer, lggr logger.Logger, monitoringEndpointGen telemetry.MonitoringEndpointGenerator, opts ...interface{}) *HeadReporterService { - return NewHeadReporterServiceWithReporters(ds, chainContainer, lggr, []HeadReporter{ - NewPrometheusReporter(ds, chainContainer, lggr, opts), - NewTelemetryReporter(chainContainer, lggr, monitoringEndpointGen), - }, opts) +func NewHeadReporterService(config config.HeadReport, ds sqlutil.DataSource, chainContainer legacyevm.LegacyChainContainer, lggr logger.Logger, monitoringEndpointGen telemetry.MonitoringEndpointGenerator, opts ...interface{}) *HeadReporterService { + reporters := make([]HeadReporter, 2) + reporters = append(reporters, NewPrometheusReporter(ds, chainContainer, lggr, opts)) + if config.TelemetryEnabled() { + reporters = append(reporters, NewTelemetryReporter(chainContainer, lggr, monitoringEndpointGen)) + } + return NewHeadReporterServiceWithReporters(ds, chainContainer, lggr, reporters, opts) } func NewHeadReporterServiceWithReporters(ds sqlutil.DataSource, chainContainer legacyevm.LegacyChainContainer, lggr logger.Logger, reporters []HeadReporter, opts ...interface{}) *HeadReporterService { diff --git a/core/services/headreporter/telemetry_reporter.go b/core/services/headreporter/telemetry_reporter.go index 78653405d11..26e8c426749 100644 --- a/core/services/headreporter/telemetry_reporter.go +++ b/core/services/headreporter/telemetry_reporter.go @@ -10,20 +10,19 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" "github.com/smartcontractkit/libocr/commontypes" "google.golang.org/protobuf/proto" - "math/big" ) type ( telemetryReporter struct { logger logger.Logger - endpoints map[*big.Int]commontypes.MonitoringEndpoint + endpoints map[uint64]commontypes.MonitoringEndpoint } ) -func NewTelemetryReporter(chainContainer legacyevm.LegacyChainContainer, lggr logger.Logger, monitoringEndpointGen telemetry.MonitoringEndpointGenerator) *telemetryReporter { - endpoints := make(map[*big.Int]commontypes.MonitoringEndpoint) +func NewTelemetryReporter(chainContainer legacyevm.LegacyChainContainer, lggr logger.Logger, monitoringEndpointGen telemetry.MonitoringEndpointGenerator) HeadReporter { + endpoints := make(map[uint64]commontypes.MonitoringEndpoint) for _, chain := range chainContainer.Slice() { - endpoints[chain.ID()] = monitoringEndpointGen.GenMonitoringEndpoint("EVM", chain.ID().String(), "", synchronization.HeadReport) + endpoints[chain.ID().Uint64()] = monitoringEndpointGen.GenMonitoringEndpoint("EVM", chain.ID().String(), "", synchronization.HeadReport) } return &telemetryReporter{ logger: lggr.Named("TelemetryReporter"), @@ -32,13 +31,24 @@ func NewTelemetryReporter(chainContainer legacyevm.LegacyChainContainer, lggr lo } func (t *telemetryReporter) ReportNewHead(ctx context.Context, head *evmtypes.Head) { - monitoringEndpoint := t.endpoints[head.EVMChainID.ToInt()] + monitoringEndpoint := t.endpoints[head.EVMChainID.ToInt().Uint64()] + var lastFinalized *telem.Block + lastFinalizedHead := head.LatestFinalizedHead() + if lastFinalizedHead != nil { + lastFinalized = &telem.Block{ + Timestamp: uint64(lastFinalizedHead.GetTimestamp().UTC().Unix()), + BlockNumber: uint64(lastFinalizedHead.BlockNumber()), + BlockHash: lastFinalizedHead.BlockHash().Hex(), + } + } request := &telem.HeadReportRequest{ - ChainId: head.EVMChainID.String(), - Timestamp: uint64(head.Timestamp.UTC().Unix()), - BlockNumber: uint64(head.Number), - BlockHash: head.Hash.Hex(), - Finalized: head.IsFinalized, + ChainId: head.EVMChainID.String(), + Current: &telem.Block{ + Timestamp: uint64(head.Timestamp.UTC().Unix()), + BlockNumber: uint64(head.Number), + BlockHash: head.Hash.Hex(), + }, + LastFinalized: lastFinalized, } bytes, err := proto.Marshal(request) if err != nil { diff --git a/core/services/synchronization/telem/telem_head_report.pb.go b/core/services/synchronization/telem/telem_head_report.pb.go index 24d4ddd7ae8..849012ff3d9 100644 --- a/core/services/synchronization/telem/telem_head_report.pb.go +++ b/core/services/synchronization/telem/telem_head_report.pb.go @@ -25,12 +25,9 @@ type HeadReportRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Node string `protobuf:"bytes,2,opt,name=node,proto3" json:"node,omitempty"` - Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - BlockNumber uint64 `protobuf:"varint,4,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - BlockHash string `protobuf:"bytes,5,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` - Finalized bool `protobuf:"varint,6,opt,name=finalized,proto3" json:"finalized,omitempty"` + ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Current *Block `protobuf:"bytes,2,opt,name=current,proto3" json:"current,omitempty"` + LastFinalized *Block `protobuf:"bytes,3,opt,name=last_finalized,json=lastFinalized,proto3" json:"last_finalized,omitempty"` } func (x *HeadReportRequest) Reset() { @@ -72,41 +69,83 @@ func (x *HeadReportRequest) GetChainId() string { return "" } -func (x *HeadReportRequest) GetNode() string { +func (x *HeadReportRequest) GetCurrent() *Block { if x != nil { - return x.Node + return x.Current } - return "" + return nil } -func (x *HeadReportRequest) GetTimestamp() uint64 { +func (x *HeadReportRequest) GetLastFinalized() *Block { + if x != nil { + return x.LastFinalized + } + return nil +} + +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + BlockHash string `protobuf:"bytes,3,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_core_services_synchronization_telem_telem_head_report_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 Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_core_services_synchronization_telem_telem_head_report_proto_rawDescGZIP(), []int{1} +} + +func (x *Block) GetTimestamp() uint64 { if x != nil { return x.Timestamp } return 0 } -func (x *HeadReportRequest) GetBlockNumber() uint64 { +func (x *Block) GetBlockNumber() uint64 { if x != nil { return x.BlockNumber } return 0 } -func (x *HeadReportRequest) GetBlockHash() string { +func (x *Block) GetBlockHash() string { if x != nil { return x.BlockHash } return "" } -func (x *HeadReportRequest) GetFinalized() bool { - if x != nil { - return x.Finalized - } - return false -} - var File_core_services_synchronization_telem_telem_head_report_proto protoreflect.FileDescriptor var file_core_services_synchronization_telem_telem_head_report_proto_rawDesc = []byte{ @@ -114,20 +153,28 @@ var file_core_services_synchronization_telem_telem_head_report_proto_rawDesc = [ 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, - 0x65, 0x6c, 0x65, 0x6d, 0x22, 0xc0, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, + 0x65, 0x6c, 0x65, 0x6d, 0x22, 0x8b, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 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, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x33, 0x0a, + 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x22, 0x67, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x42, 0x4e, 0x5a, 0x4c, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -142,16 +189,19 @@ func file_core_services_synchronization_telem_telem_head_report_proto_rawDescGZI return file_core_services_synchronization_telem_telem_head_report_proto_rawDescData } -var file_core_services_synchronization_telem_telem_head_report_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_core_services_synchronization_telem_telem_head_report_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_core_services_synchronization_telem_telem_head_report_proto_goTypes = []interface{}{ (*HeadReportRequest)(nil), // 0: telem.HeadReportRequest + (*Block)(nil), // 1: telem.Block } var file_core_services_synchronization_telem_telem_head_report_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 + 1, // 0: telem.HeadReportRequest.current:type_name -> telem.Block + 1, // 1: telem.HeadReportRequest.last_finalized:type_name -> telem.Block + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] 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_core_services_synchronization_telem_telem_head_report_proto_init() } @@ -172,6 +222,18 @@ func file_core_services_synchronization_telem_telem_head_report_proto_init() { return nil } } + file_core_services_synchronization_telem_telem_head_report_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Block); 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{ @@ -179,7 +241,7 @@ func file_core_services_synchronization_telem_telem_head_report_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_core_services_synchronization_telem_telem_head_report_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/core/services/synchronization/telem/telem_head_report.proto b/core/services/synchronization/telem/telem_head_report.proto index e7d88e06ef2..bacf6b57bec 100644 --- a/core/services/synchronization/telem/telem_head_report.proto +++ b/core/services/synchronization/telem/telem_head_report.proto @@ -5,9 +5,13 @@ option go_package = "github.com/smartcontractkit/chainlink/v2/core/services/sync package telem; message HeadReportRequest { - string chain_id=1; - uint64 timestamp = 3; - uint64 block_number = 4; - string block_hash = 5; - bool finalized = 6; -} \ No newline at end of file + string chain_id = 1; + Block current = 2; + Block last_finalized = 3; +} + +message Block { + uint64 timestamp = 1; + uint64 block_number = 2; + string block_hash = 3; +}