retry on delta state mismatch before Hawaii height
@@ -150,7 +150,8 @@ func (dao *blockDAO) checkIndexers(ctx context.Context) error {
bcCtx.Tip.Hash = g.Hash()
bcCtx.Tip.Timestamp = time.Unix(g.Timestamp, 0)
}
- if err := indexer.PutBlock(protocol.WithBlockCtx(
+ for {
+ if err = indexer.PutBlock(protocol.WithBlockCtx(
protocol.WithBlockchainCtx(ctx, bcCtx),
protocol.BlockCtx{
BlockHeight: i,
@@ -158,7 +159,13 @@ func (dao *blockDAO) checkIndexers(ctx context.Context) error {
Producer: producer,
GasLimit: g.BlockGasLimit,
},
- ), blk); err != nil {
+ ), blk); err == nil {
+ break
+ }
+ if i < g.HawaiiBlockHeight && errors.Cause(err) == block.ErrDeltaStateMismatch {
+ log.L().Info("delta state mismatch", zap.Uint64("block", i))
+ continue
+ }
return err
}
if i%5000 == 0 {
