From a773998923bf19d2d6b1023621ee91064e910f4d Mon Sep 17 00:00:00 2001 From: "Invis [Bitfly]" <162128378+invis-bitfly@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:46:43 +0100 Subject: [PATCH] Revert "add(exporter): expand el payload exporter logging" This reverts commit d4d3b18b624ff0da5c067483951e197fbd73aba5. --- .../modules/execution_payloads_exporter.go | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/backend/pkg/exporter/modules/execution_payloads_exporter.go b/backend/pkg/exporter/modules/execution_payloads_exporter.go index db7440fab..7f8ebb0cd 100644 --- a/backend/pkg/exporter/modules/execution_payloads_exporter.go +++ b/backend/pkg/exporter/modules/execution_payloads_exporter.go @@ -100,7 +100,6 @@ func (d *executionPayloadsExporter) maintainTable() (err error) { blockChan := make(chan *types.Eth1BlockIndexed, 1000) type Result struct { BlockHash []byte - BlockNumber uint64 FeeRecipientReward decimal.Decimal } resData := make([]Result, 0, maxBlock-minBlock+1) @@ -139,7 +138,7 @@ func (d *executionPayloadsExporter) maintainTable() (err error) { if err != nil { return fmt.Errorf("error converting tx reward to decimal for block %v: %w", block.Number, err) } - resData = append(resData, Result{BlockHash: hash, FeeRecipientReward: dec, BlockNumber: block.Number}) + resData = append(resData, Result{BlockHash: hash, FeeRecipientReward: dec}) } }) @@ -157,40 +156,23 @@ func (d *executionPayloadsExporter) maintainTable() (err error) { return fmt.Errorf("error processing blocks: %w", err) } // sanity checks: check if any block hashes are 0x0000000000000000000000000000000000000000000000000000000000000000 or duplicate, check if count matches expected + if uint64(len(resData)) != maxBlock-minBlock+1 { + return fmt.Errorf("error processing blocks: expected %v blocks, got %v", maxBlock-minBlock+1, len(resData)) + } seen := make(map[string]bool) emptyBlockHash := bytes.Repeat([]byte{0}, 32) - err = error(nil) - counter := 0 for _, r := range resData { - if counter > 25 { - err = fmt.Errorf("too many errors, aborting") - log.Error(err, "error processing blocks", 0) - break - } if len(r.BlockHash) == 0 { - err = fmt.Errorf("error processing blocks: block hash is empty, block number: %v", r.BlockNumber) - log.Error(err, "error processing blocks", 0) - counter++ + return fmt.Errorf("error processing blocks: block hash is empty") } if bytes.Equal(r.BlockHash, emptyBlockHash) { - err = fmt.Errorf("error processing blocks: block hash is all zeros, block number: %v", r.BlockNumber) - log.Error(err, "error processing blocks", 0) - counter++ + return fmt.Errorf("error processing blocks: block hash is all zeros") } if _, ok := seen[string(r.BlockHash)]; ok { - err = fmt.Errorf("error processing blocks: duplicate block hash, block number: %v", r.BlockNumber) - log.Error(err, "error processing blocks", 0) - counter++ + return fmt.Errorf("error processing blocks: duplicate block hash") } seen[string(r.BlockHash)] = true } - if err != nil { - return err - } - - if uint64(len(resData)) != maxBlock-minBlock+1 { - return fmt.Errorf("error processing blocks: expected %v blocks, got %v", maxBlock-minBlock+1, len(resData)) - } // update the execution_payloads table log.Infof("preparing copy update to temp table")