Revert bugfix that introduces performance regression (until a better one found) (#2056)

* Revert "Bug fix"

This reverts commit ae6f04b084318039747583e902e16e52315f0c32.

* Temp skip test

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
ledgerwatch 2021-05-30 21:44:36 +01:00 committed by GitHub
parent aa1f64eb78
commit 1181054409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -1036,6 +1036,7 @@ func TestLargeReorgTrieGC(t *testing.T) {
// - https://github.com/ethereum/go-ethereum/issues/18977
// - https://github.com/ethereum/go-ethereum/pull/18988
func TestLowDiffLongChain(t *testing.T) {
t.Skip("Find better bugfix")
defer log.Root().SetHandler(log.Root().GetHandler())
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
// Generate a canonical chain to act as the main dataset

View File

@ -708,7 +708,7 @@ func (hi *HeaderInserter) FeedHeader(db ethdb.StatelessRwTx, header *types.Heade
if err1 != nil {
return fmt.Errorf("reading canonical hash for height %d: %w", blockHeight-1, err1)
}
if ch == header.ParentHash {
if ch == (common.Hash{}) || ch == header.ParentHash {
forkingPoint = blockHeight - 1
} else {
// Going further back