Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"path/filepath"
"regexp"
"runtime/debug"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -1399,12 +1400,14 @@ func (app *App) ProcessBlock(ctx sdk.Context, txs [][]byte, req BlockProcessRequ
defer func() {
if r := recover(); r != nil {
panicMsg := fmt.Sprintf("%v", r)

// Re-panic for upgrade-related panics to allow proper upgrade mechanism
if upgradePanicRe.MatchString(panicMsg) {
ctx.Logger().Error("upgrade panic detected, panicking to trigger upgrade", "panic", r)
panic(r) // Re-panic to trigger upgrade mechanism
}
ctx.Logger().Error("panic recovered in ProcessBlock", "panic", r)
stack := string(debug.Stack())
ctx.Logger().Error("panic recovered in ProcessBlock", "panic", r, "stack", stack)
err = fmt.Errorf("ProcessBlock panic: %v", r)
events = nil
txResults = nil
Expand Down