From c575d1dd9f8ccfcdaaafb0ee898dbc91601c4b36 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 4 Nov 2024 13:39:29 -0500 Subject: [PATCH] Use correct type for internal OCR3 telemetry in LLO (#15100) Should fix: https://smartcontract-it.atlassian.net/browse/MERC-6583 LLO was incorrectly sending internal OCR3 telemetry with the wrong type. Additionally, scope contractID to actually include the contact ID along with the DON ID. --- core/services/llo/delegate.go | 7 ++++--- core/services/ocr2/delegate.go | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/services/llo/delegate.go b/core/services/llo/delegate.go index 70df901c730..7c05ffbe52a 100644 --- a/core/services/llo/delegate.go +++ b/core/services/llo/delegate.go @@ -56,6 +56,7 @@ type DelegateConfig struct { RetirementReportCache RetirementReportCache RetirementReportCodec datastreamsllo.RetirementReportCodec ShouldRetireCache datastreamsllo.ShouldRetireCache + EAMonitoringEndpoint ocrcommontypes.MonitoringEndpoint // OCR3 TraceLogging bool @@ -65,7 +66,7 @@ type DelegateConfig struct { ContractConfigTrackers []ocr2types.ContractConfigTracker ContractTransmitter ocr3types.ContractTransmitter[llotypes.ReportInfo] Database ocr3types.Database - MonitoringEndpoint ocrcommontypes.MonitoringEndpoint + OCR3MonitoringEndpoint ocrcommontypes.MonitoringEndpoint OffchainConfigDigester ocr2types.OffchainConfigDigester OffchainKeyring ocr2types.OffchainKeyring OnchainKeyring ocr3types.OnchainKeyring[llotypes.ReportInfo] @@ -93,7 +94,7 @@ func NewDelegate(cfg DelegateConfig) (job.ServiceCtx, error) { var t TelemeterService if cfg.CaptureEATelemetry { - t = NewTelemeterService(lggr, cfg.MonitoringEndpoint) + t = NewTelemeterService(lggr, cfg.EAMonitoringEndpoint) } else { t = NullTelemeter } @@ -131,7 +132,7 @@ func (d *delegate) Start(ctx context.Context) error { Database: d.cfg.Database, LocalConfig: d.cfg.LocalConfig, Logger: ocrLogger, - MonitoringEndpoint: d.cfg.MonitoringEndpoint, + MonitoringEndpoint: d.cfg.OCR3MonitoringEndpoint, OffchainConfigDigester: d.cfg.OffchainConfigDigester, OffchainKeyring: d.cfg.OffchainKeyring, OnchainKeyring: d.cfg.OnchainKeyring, diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index ce2ad8ae763..371eccdbe89 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -1034,6 +1034,8 @@ func (d *Delegate) newServicesLLO( lggr.Infof("Using on-chain signing keys for LLO job %d (%s): %v", jb.ID, jb.Name.ValueOrZero(), kbm) kr := llo.NewOnchainKeyring(lggr, kbm) + telemetryContractID := fmt.Sprintf("%s/%d", spec.ContractID, pluginCfg.DonID) + cfg := llo.DelegateConfig{ Logger: lggr, DataSource: d.ds, @@ -1047,6 +1049,7 @@ func (d *Delegate) newServicesLLO( RetirementReportCache: d.retirementReportCache, ShouldRetireCache: provider.ShouldRetireCache(), RetirementReportCodec: datastreamsllo.StandardRetirementReportCodec{}, + EAMonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, telemetryContractID, synchronization.EnhancedEAMercury), TraceLogging: d.cfg.OCR2().TraceLogging(), BinaryNetworkEndpointFactory: d.peerWrapper.Peer2, @@ -1055,7 +1058,7 @@ func (d *Delegate) newServicesLLO( ContractConfigTrackers: provider.ContractConfigTrackers(), Database: ocrDB, LocalConfig: lc, - MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, fmt.Sprintf("%d", pluginCfg.DonID), synchronization.EnhancedEAMercury), + OCR3MonitoringEndpoint: d.monitoringEndpointGen.GenMonitoringEndpoint(rid.Network, rid.ChainID, telemetryContractID, synchronization.OCR3Mercury), OffchainConfigDigester: provider.OffchainConfigDigester(), OffchainKeyring: kb, OnchainKeyring: kr,