Skip to content

Commit

Permalink
WIP: Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
trianglesphere committed Jan 29, 2024
1 parent d4e12b3 commit 8795cfc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions consensus/beacon/oplegacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
)

Expand All @@ -25,7 +26,9 @@ func (o *OpLegacy) VerifyHeader(chain consensus.ChainHeaderReader, header *types
}
parent := chain.GetHeader(header.ParentHash, number-1)
if parent == nil {
return consensus.ErrUnknownAncestor
log.Warn("Failed to get parent header", "hash", header.Hash().String(), "number", number, "parentHash", header.ParentHash.String, "parentNumber", number-1,
"fn", "VerifyHeader")
// return consensus.ErrUnknownAncestor
}
return nil // legacy chain is verified by block-hash reverse sync otherwise
}
Expand All @@ -42,7 +45,8 @@ func (o *OpLegacy) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*t
}
var err error
if parent == nil {
err = consensus.ErrUnknownAncestor
log.Warn("Failed to get parent header", "hash", header.Hash().String(), "number", header.Number.Uint64(), "parentHash", header.ParentHash.String, "parentNumber", header.Number.Uint64()-1, "fn", "VerifyHeaders")
// err = consensus.ErrUnknownAncestor
} else {
err = o.VerifyHeader(chain, header)
}
Expand Down

0 comments on commit 8795cfc

Please sign in to comment.