Commit 5a26401f authored by 令狐一冲's avatar 令狐一冲 Committed by GitHub

fix: Fix the error judgment when obtaining the finalized/safe block of L2 when...

fix: Fix the error judgment when obtaining the finalized/safe block of L2 when the chain is started (#10127)
parent 4aa875f0
......@@ -102,7 +102,7 @@ func (s *L2Client) L2BlockRefByLabel(ctx context.Context, label eth.BlockLabel)
if err != nil {
// Both geth and erigon like to serve non-standard errors for the safe and finalized heads, correct that.
// This happens when the chain just started and nothing is marked as safe/finalized yet.
if strings.Contains(err.Error(), "block not found") || strings.Contains(err.Error(), "Unknown block") {
if strings.Contains(err.Error(), "block not found") || strings.Contains(err.Error(), "Unknown block") || strings.Contains(err.Error(), "unknown block") {
err = ethereum.NotFound
}
// w%: wrap to preserve ethereum.NotFound case
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment