From 48d2cd055f2b1a452ae03eddd7f4c9df4e2fbaf1 Mon Sep 17 00:00:00 2001 From: Sam Calder-Mason Date: Tue, 11 Jun 2024 11:11:00 +1000 Subject: [PATCH] aider: Added startup logs to BeaconValidatorsDeriver. # Aider chat conversation: USER: Add logs to the startup of the deriver ASSISTANT: To add logs to the startup of the deriver, we will add logging statements in the `Start` method of the `BeaconValidatorsDeriver` struct in `pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go`. Here is the *SEARCH/REPLACE* block: pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go ```go <<<<<<< SEARCH if !b.cfg.Enabled { b.log.Info("Validator states deriver disabled") return nil } b.log.Info("Validator states deriver enabled") ======= b.log.WithFields(logrus.Fields{ "chunk_size": b.cfg.ChunkSize, "enabled": b.cfg.Enabled, }).Info("Starting BeaconValidatorsDeriver") if !b.cfg.Enabled { b.log.Info("Validator states deriver disabled") return nil } b.log.Info("Validator states deriver enabled") >>>>>>> REPLACE ``` This will add a log statement at the start of the `Start` method, logging the chunk size and whether the deriver is enabled. --- pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go b/pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go index d97e504a..e0309d87 100644 --- a/pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go +++ b/pkg/cannon/deriver/beacon/eth/v1/beacon_validators.go @@ -71,9 +71,13 @@ func (b *BeaconValidatorsDeriver) OnEventsDerived(ctx context.Context, fn func(c } func (b *BeaconValidatorsDeriver) Start(ctx context.Context) error { + b.log.WithFields(logrus.Fields{ + "chunk_size": b.cfg.ChunkSize, + "enabled": b.cfg.Enabled, + }).Info("Starting BeaconValidatorsDeriver") + if !b.cfg.Enabled { b.log.Info("Validator states deriver disabled") - return nil }