Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "add(exporter): expand el payload exporter logging" #1267

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 7 additions & 25 deletions backend/pkg/exporter/modules/execution_payloads_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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})
}
})

Expand All @@ -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")
Expand Down
Loading