Skip to content

Commit

Permalink
[CCIP-2611] Report new heads to atlas' OTI (#13647)
Browse files Browse the repository at this point in the history
* feat(oti-head-report): Report new heads to atlas' OTI

* tests

tests

review fixes

ci fixes

ci fixes

telemetry reporter test

fix chain in proto

fix chain in proto

fix ci

changeset

fix config test

review fix

fix config test

fix docs test

fix config testscript

fix config testscript

fix test

* move to relayer

move to relayer

move service to evm

* go generate

* move config

* simplify

* review

* Revert moving to relayer

* review

* review

* head telemetry enabled by default

* review

* rebase

* review

* drop config

* rebase

* review

* regenerate

* cl node timeout

* review fix

* rebase

---------

Co-authored-by: Jordan Krage <[email protected]>
  • Loading branch information
bukata-sa and jmank88 authored Aug 15, 2024
1 parent 48c0846 commit a41b353
Show file tree
Hide file tree
Showing 24 changed files with 1,280 additions and 464 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-jokes-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#added Report new heads as a telemetry to OTI
22 changes: 20 additions & 2 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,20 @@ packages:
ORM:
Runner:
PipelineParamUnmarshaler:
github.com/smartcontractkit/chainlink/v2/core/services/promreporter:
github.com/smartcontractkit/chainlink/v2/core/services/headreporter:
config:
dir: core/internal/mocks
dir: "{{ .InterfaceDir }}"
filename: "{{ .InterfaceName | snakecase }}_mock.go"
inpackage: true
mockname: "Mock{{ .InterfaceName | camelcase }}"
interfaces:
HeadReporter:
PrometheusBackend:
github.com/smartcontractkit/libocr/commontypes:
config:
dir: "common/types/mocks"
interfaces:
MonitoringEndpoint:
github.com/smartcontractkit/chainlink/v2/core/services/relay/evm:
interfaces:
BatchCaller:
Expand Down Expand Up @@ -301,6 +310,15 @@ packages:
interfaces:
Config:
FeeConfig:
github.com/smartcontractkit/chainlink/v2/core/services/telemetry:
config:
dir: "{{ .InterfaceDir }}"
filename: "{{ .InterfaceName | snakecase }}_mock.go"
inpackage: true
mockname: "Mock{{ .InterfaceName | camelcase }}"
interfaces:
MonitoringEndpointGenerator:
IngressAgent:
github.com/smartcontractkit/chainlink/v2/core/services/webhook:
interfaces:
ExternalInitiatorManager:
Expand Down
65 changes: 65 additions & 0 deletions common/types/mocks/monitoring_endpoint.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

204 changes: 0 additions & 204 deletions core/internal/mocks/prometheus_backend.go

This file was deleted.

14 changes: 10 additions & 4 deletions core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/feeds"
"github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2"
"github.com/smartcontractkit/chainlink/v2/core/services/gateway"
"github.com/smartcontractkit/chainlink/v2/core/services/headreporter"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/services/keeper"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore"
Expand All @@ -56,7 +57,6 @@ import (
externalp2p "github.com/smartcontractkit/chainlink/v2/core/services/p2p/wrapper"
"github.com/smartcontractkit/chainlink/v2/core/services/periodicbackup"
"github.com/smartcontractkit/chainlink/v2/core/services/pipeline"
"github.com/smartcontractkit/chainlink/v2/core/services/promreporter"
"github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer"
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury"
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc"
Expand Down Expand Up @@ -323,8 +323,6 @@ func NewApplication(opts ApplicationOpts) (Application, error) {

srvcs = append(srvcs, mailMon)
srvcs = append(srvcs, relayerChainInterops.Services()...)
promReporter := promreporter.NewPromReporter(opts.DS, legacyEVMChains, globalLogger)
srvcs = append(srvcs, promReporter)

// Initialize Local Users ORM and Authentication Provider specified in config
// BasicAdminUsersORM is initialized and required regardless of separate Authentication Provider
Expand Down Expand Up @@ -364,8 +362,16 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
workflowORM = workflowstore.NewDBStore(opts.DS, globalLogger, clockwork.NewRealClock())
)

promReporter := headreporter.NewPrometheusReporter(opts.DS, legacyEVMChains)
chainIDs := make([]*big.Int, legacyEVMChains.Len())
for i, chain := range legacyEVMChains.Slice() {
chainIDs[i] = chain.ID()
}
telemReporter := headreporter.NewTelemetryReporter(telemetryManager, chainIDs...)
headReporter := headreporter.NewHeadReporterService(opts.DS, globalLogger, promReporter, telemReporter)
srvcs = append(srvcs, headReporter)
for _, chain := range legacyEVMChains.Slice() {
chain.HeadBroadcaster().Subscribe(promReporter)
chain.HeadBroadcaster().Subscribe(headReporter)
chain.TxManager().RegisterResumeCallback(pipelineRunner.ResumeRun)
}

Expand Down
Loading

0 comments on commit a41b353

Please sign in to comment.