Skip to content

Commit

Permalink
Use correct type for internal OCR3 telemetry in LLO (#15100)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samsondav authored Nov 4, 2024
1 parent bfd9a3f commit c575d1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions core/services/llo/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type DelegateConfig struct {
RetirementReportCache RetirementReportCache
RetirementReportCodec datastreamsllo.RetirementReportCodec
ShouldRetireCache datastreamsllo.ShouldRetireCache
EAMonitoringEndpoint ocrcommontypes.MonitoringEndpoint

// OCR3
TraceLogging bool
Expand All @@ -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]
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion core/services/ocr2/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit c575d1d

Please sign in to comment.