Skip to content

Commit

Permalink
Revert "add(exporter): sanity check for el payload exporter"
Browse files Browse the repository at this point in the history
This reverts commit 9f77294.
  • Loading branch information
invis-bitfly authored Jan 14, 2025
1 parent 9043d22 commit 16c3057
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions backend/pkg/exporter/modules/execution_payloads_exporter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package modules

import (
"bytes"
"context"
"database/sql"
"fmt"
Expand Down Expand Up @@ -155,26 +154,9 @@ func (d *executionPayloadsExporter) maintainTable() (err error) {
if err != nil {
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)
for _, r := range resData {
if len(r.BlockHash) == 0 {
return fmt.Errorf("error processing blocks: block hash is empty")
}
if bytes.Equal(r.BlockHash, emptyBlockHash) {
return fmt.Errorf("error processing blocks: block hash is all zeros")
}
if _, ok := seen[string(r.BlockHash)]; ok {
return fmt.Errorf("error processing blocks: duplicate block hash")
}
seen[string(r.BlockHash)] = true
}

// update the execution_payloads table

log.Infof("preparing copy update to temp table")

// load data into temp table
Expand Down

0 comments on commit 16c3057

Please sign in to comment.