Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat: update method.go
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jul 21, 2023
1 parent c82c463 commit 8c5f7a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/rpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,20 @@ func (c *Client) CheckL1Reorg(ctx context.Context, blockID *big.Int) (bool, *typ
// If the L2 EE is just synced through P2P, there is a chance that the EE do not have
// the chain head L1Origin information recorded.
if err.Error() == ethereum.NotFound.Error() {
stateVars, err := c.TaikoL1.GetStateVariables(nil)
if err != nil {
return false, nil, nil, err
}
log.Info("L1Origin not found", "blockID", blockID)
return false, nil, nil, nil

if blockID.Uint64() <= stateVars.LastVerifiedBlockId {
return false, nil, nil, nil
}

log.Info("Reorg detected due to L1Origin not found", "blockID", blockID)
reorged = true
blockID = new(big.Int).Sub(blockID, common.Big1)
continue
}
return false, nil, nil, err
}
Expand Down

0 comments on commit 8c5f7a7

Please sign in to comment.