Skip to content

Commit

Permalink
Add EVM panic stack trace (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
codchen authored Mar 27, 2024
1 parent 4e37d32 commit 8440b54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/evm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"math"
"math/big"
"runtime/debug"

"github.com/armon/go-metrics"
"github.com/cosmos/cosmos-sdk/telemetry"
Expand Down Expand Up @@ -57,6 +58,8 @@ func (server msgServer) EVMTransaction(goCtx context.Context, msg *types.MsgEVMT

defer func() {
if pe := recover(); pe != nil {
// there is not supposed to be any panic
debug.PrintStack()
ctx.Logger().Error(fmt.Sprintf("EVM PANIC: %s", pe))
telemetry.IncrCounter(1, types.ModuleName, "panics")

Expand Down

0 comments on commit 8440b54

Please sign in to comment.