From ecb5ce0d738e0b113f7c81232d4c55f23c9265a1 Mon Sep 17 00:00:00 2001 From: amirylm Date: Wed, 3 Jan 2024 16:48:08 +0200 Subject: [PATCH 1/3] logs --- .../evmregistry/v21/logprovider/buffer.go | 4 ++++ .../evmregistry/v21/logprovider/provider.go | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go index 81f51311d44..e391025e2c0 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer.go @@ -148,6 +148,8 @@ type logEventBuffer struct { blocks []fetchedBlock // latestBlock is the latest block number seen latestBlock int64 + + logsInBuffer int64 } func newLogEventBuffer(lggr logger.Logger, size, maxBlockLogs, maxUpkeepLogsPerBlock int) *logEventBuffer { @@ -223,6 +225,7 @@ func (b *logEventBuffer) enqueue(id *big.Int, logs ...logpoller.Log) int { } if added > 0 { lggr.Debugw("Added logs to buffer", "addedLogs", added, "dropped", dropped, "latestBlock", latestBlock) + atomic.AddInt64(&b.logsInBuffer, int64(added-dropped)) } return added - dropped @@ -324,6 +327,7 @@ func (b *logEventBuffer) dequeueRange(start, end int64, upkeepLimit, totalLimit if len(results) > 0 { b.lggr.Debugw("Dequeued logs", "results", len(results), "start", start, "end", end) + atomic.AddInt64(&b.logsInBuffer, -int64(len(results))) } return results diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go index 2dabcc82671..049e37c9201 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/provider.go @@ -102,6 +102,8 @@ type logEventProvider struct { opts LogTriggersOptions currentPartitionIdx uint64 + + servedLogs int64 } func NewLogProvider(lggr logger.Logger, poller logpoller.LogPoller, packer LogDataPacker, filterStore UpkeepFilterStore, opts LogTriggersOptions) *logEventProvider { @@ -142,6 +144,21 @@ func (p *logEventProvider) Start(context.Context) error { }) }) + p.threadCtrl.Go(func(ctx context.Context) { + ticker := time.NewTicker(10 * time.Second) + defer ticker.Stop() + + for { + select { + case <-ticker.C: + p.lggr.Debugw("logs stats", "servedLogs", atomic.LoadInt64(&p.servedLogs), "logsInBuffer", atomic.LoadInt64(&p.buffer.logsInBuffer), "latestBlockSeen", p.buffer.latestBlockSeen()) + case <-ctx.Done(): + return + } + } + + }) + return nil }) } @@ -188,6 +205,8 @@ func (p *logEventProvider) GetLatestPayloads(ctx context.Context) ([]ocr2keepers payloads = append(payloads, payload) } + atomic.AddInt64(&p.servedLogs, int64(len(logs))) + return payloads, nil } From ef34b00c197f3314f01dd3329177c298c63e1f92 Mon Sep 17 00:00:00 2001 From: amirylm Date: Fri, 5 Jan 2024 17:31:31 +0200 Subject: [PATCH 2/3] update chainlink-automation --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 98ab5cbfaf9..ac4f7e69b4e 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -18,7 +18,7 @@ require ( github.com/olekukonko/tablewriter v0.0.5 github.com/pelletier/go-toml/v2 v2.1.1 github.com/shopspring/decimal v1.3.1 - github.com/smartcontractkit/chainlink-automation v1.0.1 + github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 170e36ad2cc..c1a2eb37b7b 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1162,8 +1162,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= -github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 h1:VmIQb8jSlxOf3jLKoP3nIYJsKvYkDKDn1qnWQzsDlcE= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a h1:ViX8kP1/WYW1dLG85Frqpvus1nRGif/1QiK7qeyS+Rc= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 h1:kBnmjv3fxU7krVIqZFvo1m4F6qBc4vPURQFX/mcChhI= diff --git a/go.mod b/go.mod index 7fe535a425e..6fb9708797c 100644 --- a/go.mod +++ b/go.mod @@ -64,7 +64,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.11 github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 - github.com/smartcontractkit/chainlink-automation v1.0.1 + github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 diff --git a/go.sum b/go.sum index 38eaa89993a..246a0741dd0 100644 --- a/go.sum +++ b/go.sum @@ -1148,8 +1148,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= -github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 h1:VmIQb8jSlxOf3jLKoP3nIYJsKvYkDKDn1qnWQzsDlcE= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a h1:ViX8kP1/WYW1dLG85Frqpvus1nRGif/1QiK7qeyS+Rc= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 h1:kBnmjv3fxU7krVIqZFvo1m4F6qBc4vPURQFX/mcChhI= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 673fbf4dbd5..03631f23ecc 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/scylladb/go-reflectx v1.0.1 github.com/segmentio/ksuid v1.0.4 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-automation v1.0.1 + github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a github.com/smartcontractkit/chainlink-testing-framework v1.22.1 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 9977ed84b8b..f45ece9559d 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1479,8 +1479,8 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk= -github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 h1:VmIQb8jSlxOf3jLKoP3nIYJsKvYkDKDn1qnWQzsDlcE= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a h1:ViX8kP1/WYW1dLG85Frqpvus1nRGif/1QiK7qeyS+Rc= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 h1:kBnmjv3fxU7krVIqZFvo1m4F6qBc4vPURQFX/mcChhI= From 718d09979ed63f229da956641084e070f1b8febe Mon Sep 17 00:00:00 2001 From: amirylm Date: Wed, 10 Jan 2024 20:30:54 +0200 Subject: [PATCH 3/3] update cla version --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index ac4f7e69b4e..03a1362088e 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -18,7 +18,7 @@ require ( github.com/olekukonko/tablewriter v0.0.5 github.com/pelletier/go-toml/v2 v2.1.1 github.com/shopspring/decimal v1.3.1 - github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 + github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index c1a2eb37b7b..ea3b2ff887f 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1162,8 +1162,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 h1:VmIQb8jSlxOf3jLKoP3nIYJsKvYkDKDn1qnWQzsDlcE= -github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f h1:GpLQfWoG3nuc6uhOJf+yLcvWFr3EdhlVsXSYKFP9Q/U= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a h1:ViX8kP1/WYW1dLG85Frqpvus1nRGif/1QiK7qeyS+Rc= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 h1:kBnmjv3fxU7krVIqZFvo1m4F6qBc4vPURQFX/mcChhI= diff --git a/go.mod b/go.mod index 6fb9708797c..2654f39ddc6 100644 --- a/go.mod +++ b/go.mod @@ -64,7 +64,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.11 github.com/shopspring/decimal v1.3.1 github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 - github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 + github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 diff --git a/go.sum b/go.sum index 246a0741dd0..3fecbafe0a1 100644 --- a/go.sum +++ b/go.sum @@ -1148,8 +1148,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 h1:VmIQb8jSlxOf3jLKoP3nIYJsKvYkDKDn1qnWQzsDlcE= -github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f h1:GpLQfWoG3nuc6uhOJf+yLcvWFr3EdhlVsXSYKFP9Q/U= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a h1:ViX8kP1/WYW1dLG85Frqpvus1nRGif/1QiK7qeyS+Rc= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 h1:kBnmjv3fxU7krVIqZFvo1m4F6qBc4vPURQFX/mcChhI= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 03631f23ecc..7fc7db2e6bb 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -24,7 +24,7 @@ require ( github.com/scylladb/go-reflectx v1.0.1 github.com/segmentio/ksuid v1.0.4 github.com/slack-go/slack v0.12.2 - github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 + github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a github.com/smartcontractkit/chainlink-testing-framework v1.22.1 github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index f45ece9559d..4f2884760fe 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1479,8 +1479,8 @@ github.com/slack-go/slack v0.12.2 h1:x3OppyMyGIbbiyFhsBmpf9pwkUzMhthJMRNmNlA4LaQ github.com/slack-go/slack v0.12.2/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumvbfM1u/etVq42Afwq/jtNSBSOA8n5jntnNPo= github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M= -github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74 h1:VmIQb8jSlxOf3jLKoP3nIYJsKvYkDKDn1qnWQzsDlcE= -github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240103144621-2bf8f94dbb74/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f h1:GpLQfWoG3nuc6uhOJf+yLcvWFr3EdhlVsXSYKFP9Q/U= +github.com/smartcontractkit/chainlink-automation v1.0.2-0.20240110182654-3f94b9262f0f/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a h1:ViX8kP1/WYW1dLG85Frqpvus1nRGif/1QiK7qeyS+Rc= github.com/smartcontractkit/chainlink-common v0.1.7-0.20231222010926-795676d23c7a/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q= github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231218175426-6e0427c661e5 h1:kBnmjv3fxU7krVIqZFvo1m4F6qBc4vPURQFX/mcChhI=