Skip to content

Commit

Permalink
chore(taiko-client): fix upgrade error
Browse files Browse the repository at this point in the history
  • Loading branch information
luanxu-mxc committed Nov 12, 2024
1 parent 0e044fb commit 293f8a0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/taiko-client/driver/chain_syncer/blob/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,17 @@ func (s *Syncer) onBlockProposed(
parent, err = s.rpc.L2ParentByBlockID(ctx, meta.GetBlockID())
}
if err != nil {
return fmt.Errorf("failed to fetch L2 parent block: %w", err)
// CHANGE(MOONCHAIN): upgrade height may anchor failed
if meta.GetBlockID().Uint64() == encoding.GetProtocolConfig(s.rpc.L2.ChainID.Uint64()).OntakeForkHeight {
parent, err = s.rpc.L2.HeaderByNumber(ctx, meta.GetBlockID())
if err != nil {
return fmt.Errorf("failed to fetch L2 parent block: %w", err)
}
}
parent, err = s.rpc.L2ParentByBlockID(ctx, meta.GetBlockID())
if err != nil {
return fmt.Errorf("failed to fetch L2 parent block: %w", err)
}
}

log.Debug(
Expand Down

0 comments on commit 293f8a0

Please sign in to comment.