Skip to content

Commit

Permalink
fix: panic on END_BLOCK error
Browse files Browse the repository at this point in the history
Right now if we fail to rewind the SwingSet state, we return an
error.  The best reaction is to panic so that we can replay the
state from scratch, and get to the new state.
  • Loading branch information
michaelfig committed Mar 9, 2020
1 parent 3a5936a commit 28b6d46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cosmic-swingset/x/swingset/blockers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ func EndBlock(ctx sdk.Context, req abci.RequestEndBlock, keeper Keeper) ([]abci.

// fmt.Fprintln(os.Stderr, "Returned from SwingSet", out, err)
if err != nil {
return nil, err
// NOTE: A failed END_BLOCK means that the SwingSet state is inconsistent.
// Panic here, in the hopes that a replay from scratch will fix the problem.
panic(err)
}
return []abci.ValidatorUpdate{}, nil
}

0 comments on commit 28b6d46

Please sign in to comment.