Skip to content

Commit ddf7c3d

Browse files
authored
execution: remove BadHashes (#17733)
See ethereum/go-ethereum#29609
1 parent 3e2ccf8 commit ddf7c3d

3 files changed

Lines changed: 0 additions & 54 deletions

File tree

execution/core/blocks.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

execution/core/error.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ var (
2929
// ErrKnownBlock is returned when a block to import is already known locally.
3030
ErrKnownBlock = errors.New("block already known")
3131

32-
// ErrBlacklistedHash is returned if a block to import is on the blacklist.
33-
ErrBlacklistedHash = errors.New("blacklisted hash")
34-
3532
// ErrNoGenesis is returned when there is no Genesis Block.
3633
ErrNoGenesis = errors.New("genesis not found in chain")
3734

execution/stages/blockchain_test.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ package stages_test
2222
import (
2323
"context"
2424
"encoding/binary"
25-
"errors"
2625
"fmt"
2726
"maps"
2827
"math"
@@ -425,28 +424,6 @@ func testReorg(t *testing.T, first, second []int64, td int64) {
425424
}
426425
}
427426

428-
// Tests that the insertion functions detect banned hashes.
429-
func TestBadBlockHashes(t *testing.T) { testBadHashes(t) }
430-
431-
func testBadHashes(t *testing.T) {
432-
t.Parallel()
433-
t.Skip("to support this error in Erigon")
434-
// Create a pristine chain and database
435-
m := newCanonical(t, 0)
436-
var err error
437-
438-
// Create a chain, ban a hash and try to import
439-
chain := makeBlockChain(current(m, nil), 3, m, 10)
440-
441-
core.BadHashes[chain.Headers[2].Hash()] = true
442-
defer func() { delete(core.BadHashes, chain.Headers[2].Hash()) }()
443-
444-
err = m.InsertChain(chain)
445-
if !errors.Is(err, core.ErrBlacklistedHash) {
446-
t.Errorf("error mismatch: have: %v, want: %v", err, core.ErrBlacklistedHash)
447-
}
448-
}
449-
450427
// Tests that chain reorganisations handle transaction removals and reinsertions.
451428
func TestChainTxReorgs(t *testing.T) {
452429
if testing.Short() {

0 commit comments

Comments
 (0)