babylonchain / babylon

Main repo for Babylon full node
https://babylonchain.io
Other
240 stars 171 forks source link

Passing `nil` proof in MsgAddFinality vote leads to Panic` #668

Open KonradStaniec opened 5 months ago

KonradStaniec commented 5 months ago

Nil pointer from here:https://github.com/babylonchain/babylon/blob/dev/x/finality/types/msg.go#L29

                            goroutine 44 [running]:
                            runtime/debug.Stack()
                                runtime/debug/stack.go:24 +0x64
                            github.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.func5({0x107b87ee0, 0x109de6b00})
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:74 +0x24
                            github.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.newRecoveryMiddleware.func7({0x107b87ee0?, 0x109de6b00?})
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:42 +0x38
                            github.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x107b87ee0, 0x109de6b00}, 0x140037b7558?)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:31 +0x38
                            github.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x107b87ee0, 0x109de6b00}, 0x140037b75b8?)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:36 +0x60
                            github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:837 +0xec
                            panic({0x107b87ee0?, 0x109de6b00?})
                                runtime/panic.go:770 +0x124
                            github.com/babylonchain/babylon/x/finality/types.VerifyFinalitySig(0x1400511ad20, 0x14001d88090?)
                                github.com/babylonchain/babylon@v0.8.6-0.20240605064737-7be9d5c57afb/x/finality/types/msg.go:29 +0x2c
                            github.com/babylonchain/babylon/x/finality/keeper.msgServer.AddFinalitySig({{{0x108125020, 0x14001d88090}, {0x1080c89f8, 0x14001796e48}, {0x1081229b0, 0x1400162b730}, {0x1080c8678, 0x1400162b7a0}, {0x14000e82090, 0x2a}}}, ...)
                                github.com/babylonchain/babylon@v0.8.6-0.20240605064737-7be9d5c57afb/x/finality/keeper/msg_server.go:107 +0x488
                            github.com/babylonchain/babylon/x/finality/types._Msg_AddFinalitySig_Handler.func1({0x108108660?, 0x14006ae1410?}, {0x107ffc360?, 0x1400511ad20?})
                                github.com/babylonchain/babylon@v0.8.6-0.20240605064737-7be9d5c57afb/x/finality/types/tx.pb.go:544 +0xd0
                            github.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).registerMsgServiceHandler.func2.1({0x108107988, 0x14005ac4708}, {0x140037b8c18?, 0x105853bf0?}, 0x358?, 0x14006bc6948)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/msg_service_router.go:175 +0x98
                            github.com/babylonchain/babylon/x/finality/types._Msg_AddFinalitySig_Handler({0x10808f1e0, 0x1400252a7d0}, {0x108107988, 0x14005ac4708}, 0x1080b5a68, 0x1400061e1c0)
                                github.com/babylonchain/babylon@v0.8.6-0.20240605064737-7be9d5c57afb/x/finality/types/tx.pb.go:546 +0x148
                            github.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).registerMsgServiceHandler.func2({{0x108108660, 0x14006ac1920}, {0x108125a30, 0x14005aaf100}, {{0x0, 0x0}, {0x14001dfe3b0, 0xa}, 0x10, {0x358c8ea0, ...}, ...}, ...}, ...)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/msg_service_router.go:198 +0x2b0
                            github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runMsgs(_, {{0x108108660, 0x14006ac1920}, {0x108125a30, 0x14005aaf100}, {{0x0, 0x0}, {0x14001dfe3b0, 0xa}, 0x10, ...}, ...}, ...)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:1010 +0x170
                            github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0x14001b10b48, 0x2, {0x14002474780, 0x128, 0x128})
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/baseapp.go:948 +0xc78
                            github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Simulate(...)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/test_helpers.go:28
                            github.com/cosmos/cosmos-sdk/x/auth/tx.txServer.Simulate({{{0x0, 0x0, 0x0}, {0x10812dc98, 0x14001e78fc0}, 0x0, {0x14000e019c0, 0xa}, {0x10814e9b0, 0x14000e05e40}, ...}, ...}, ...)
                                github.com/cosmos/cosmos-sdk@v0.50.6/x/auth/tx/service.go:98 +0x10c
                            github.com/cosmos/cosmos-sdk/types/tx._Service_Simulate_Handler({0x107f31b60, 0x140013fe5a0}, {0x108107988, 0x14005ab4a88}, 0x14006bc6618, 0x0)
                                github.com/cosmos/cosmos-sdk@v0.50.6/types/tx/service.pb.go:1436 +0x1c0
                            github.com/cosmos/cosmos-sdk/baseapp.(*GRPCQueryRouter).registerABCIQueryHandler.func1({{0x108107c28, 0x10a004060}, {0x108125a30, 0x14005aaef80}, {{0x0, 0x0}, {0x14001dfe3b0, 0xa}, 0x10, {0x358c8ea0, ...}, ...}, ...}, ...)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/grpcrouter.go:109 +0xc4
                            github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).handleQueryGRPC(0x14001b10b48, 0x14001e78ff0, 0x140059d5000)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/abci.go:1139 +0x140
                            github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Query(0x14001b10b48, {0x107cf8820?, 0x140037be9f8?}, 0x140059d5000)
                                github.com/cosmos/cosmos-sdk@v0.50.6/baseapp/abci.go:177 +0x520
                            github.com/cosmos/cosmos-sdk/server.cometABCIWrapper.Query(...)
                                github.com/cosmos/cosmos-sdk@v0.50.6/server/cmt_abci.go:24
                            github.com/cometbft/cometbft/abci/client.(*localClient).Query(0x1400160d160?, {0x1081084a0?, 0x10a004060?}, 0x113c943a8?)
                                github.com/cometbft/cometbft@v0.38.6/abci/client/local_client.go:106 +0xe8
                            github.com/cometbft/cometbft/proxy.(*appConnQuery).Query(0x14001449620, {0x1081084a0, 0x10a004060}, 0x140059d5000)
                                github.com/cometbft/cometbft@v0.38.6/proxy/app_conn.go:181 +0x130
                            github.com/cometbft/cometbft/rpc/core.(*Environment).ABCIQuery(0x1400020e488, 0x1049d587c?, {0x14006747fb0, 0x23}, {0x140023df180, 0x12b, 0x280}, 0x0, 0x0)
                                github.com/cometbft/cometbft@v0.38.6/rpc/core/abci.go:22 +0xcc
                            reflect.Value.call({0x107bff4e0?, 0x14000e81380?, 0x140037bf358?}, {0x106ef2c94, 0x4}, {0x14001a92a00, 0x5, 0x1056ec880?})
                                reflect/value.go:596 +0x970
                            reflect.Value.Call({0x107bff4e0?, 0x14000e81380?, 0x2a9?}, {0x14001a92a00?, 0x1080a9ca0?, 0x0?})
                                reflect/value.go:380 +0x94
                            github.com/cometbft/cometbft/rpc/jsonrpc/server.RegisterRPCFuncs.makeJSONRPCHandler.func3({0x1080fb0e0, 0x140036d55a8}, 0x140057257a0)
                                github.com/cometbft/cometbft@v0.38.6/rpc/jsonrpc/server/http_json_handler.go:108 +0xa54
                            github.com/cometbft/cometbft/rpc/jsonrpc/server.RegisterRPCFuncs.handleInvalidJSONRPCPaths.func4({0x1080fb0e0?, 0x140036d55a8?}, 0x140037bf8a8?)
                                github.com/cometbft/cometbft@v0.38.6/rpc/jsonrpc/server/http_json_handler.go:140 +0x5c
                            net/http.HandlerFunc.ServeHTTP(0x14001c6bdd0?, {0x1080fb0e0?, 0x140036d55a8?}, 0x10492a7ec?)
                                net/http/server.go:2166 +0x38
                            net/http.(*ServeMux).ServeHTTP(0x140008dc6c0?, {0x1080fb0e0, 0x140036d55a8}, 0x140057257a0)
                                net/http/server.go:2683 +0x1a4
                            github.com/cometbft/cometbft/node.(*Node).startRPC.(*Cors).Handler.func9({0x1080fb0e0, 0x140036d55a8}, 0x140057257a0)
                                github.com/rs/cors@v1.8.3/cors.go:236 +0x19c
                            net/http.HandlerFunc.ServeHTTP(0x0?, {0x1080fb0e0?, 0x140036d55a8?}, 0x104e768ac?)
                                net/http/server.go:2166 +0x38
                            github.com/cometbft/cometbft/rpc/jsonrpc/server.maxBytesHandler.ServeHTTP({{0x1080c9a60?, 0x14000eaa6a0?}, 0x8?}, {0x1080fb0e0, 0x140036d55a8}, 0x140057257a0)
                                github.com/cometbft/cometbft@v0.38.6/rpc/jsonrpc/server/http_server.go:256 +0xec
                            github.com/cometbft/cometbft/rpc/jsonrpc/server.Serve.RecoverAndLogHandler.func1({0x1080f4030, 0x140033a28c0}, 0x140057257a0)
                                github.com/cometbft/cometbft@v0.38.6/rpc/jsonrpc/server/http_server.go:229 +0x1dc
                            net/http.HandlerFunc.ServeHTTP(0x10?, {0x1080f4030?, 0x140033a28c0?}, 0x140033a28c0?)
                                net/http/server.go:2166 +0x38
                            net/http.serverHandler.ServeHTTP({0x1080dcca0?}, {0x1080f4030?, 0x140033a28c0?}, 0x6?)
                                net/http/server.go:3137 +0xbc
                            net/http.(*conn).serve(0x1400194b0e0, {0x108108660, 0x140010ff2f0})
                                net/http/server.go:2039 +0x508
                            created by net/http.(*Server).Serve in goroutine 392
                                net/http/server.go:3285 +0x3f0
                            : panic [cosmos/cosmos-sdk@v0.50.6/baseapp/recovery.go:72] with gas used: '39798': unknown request