diff --git a/.changelog/unreleased/bug-fixes/496-error-on-applyblock-should-panic.md b/.changelog/unreleased/bug-fixes/496-error-on-applyblock-should-panic.md new file mode 100644 index 0000000000..55e9c874f8 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/496-error-on-applyblock-should-panic.md @@ -0,0 +1,2 @@ +- `[consensus]` Unexpected error conditions in `ApplyBlock` are non-recoverable, so ignoring the error and carrying on is a bug. We replaced a `return` that disregarded the error by a `panic`. + ([\#496](https://github.com/cometbft/cometbft/pull/496)) \ No newline at end of file diff --git a/consensus/state.go b/consensus/state.go index 144ea7d65d..941ea1d5e6 100644 --- a/consensus/state.go +++ b/consensus/state.go @@ -1667,8 +1667,7 @@ func (cs *State) finalizeCommit(height int64) { block, ) if err != nil { - logger.Error("failed to apply block", "err", err) - return + panic(fmt.Sprintf("failed to apply block; error %v", err)) } fail.Fail() // XXX