QOSGroup/qos

发起ParameterChange提案报panic

Closed this issue · 2 comments

情形1:输入正确密码

~/qos/bin/qoscli tx submit-proposal --proposal-type ParameterChange --title "ParameterChange-50000-no-deposit" --description "none" --proposer charles --deposit 50000 --params "gov:normal_min_deposit:99999" --indent
Password to sign with 'charles':
{
  "check_tx": {
    "code": 1,
    "log": "{\"codespace\":\"sdk\",\"code\":1,\"message\":\"checkTxStd recovered: runtime error: invalid memory address or nil pointer dereference\\nstack:\\ngoroutine 553 [running]:\\nruntime/debug.Stack(0xc0021543b8, 0xf530c0, 0x1bec560)\\n\\t/opt/go/src/runtime/debug/stack.go:24 +0x9d\\ngithub.com/QOSGroup/qbase/baseabci.(*BaseApp).checkTxStd.func1(0xc002154bc0, 0xc002154b88, 0xc002a000f0)\\n\\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/baseabci/baseapp.go:429 +0x24c\\npanic(0xf530c0, 0x1bec560)\\n\\t/opt/go/src/runtime/panic.go:522 +0x1b5\\nmath/big.(*Int).Sign(...)\\n\\t/opt/go/src/math/big/int.go:39\\ngithub.com/QOSGroup/qos/types.Dec.IsNegative(...)\\n\\t/home/admin/文档/qos/types/decimal.go:193\\ngithub.com/QOSGroup/qos/module/gov/types.(*Params).Validate(0xc00017c9a0, 0xc0008db1a0, 0xc0029f8273)\\n\\t/home/admin/文档/qos/module/gov/types/params.go:257 +0xe4\\ngithub.com/QOSGroup/qos/module/gov/txs.TxParameterChange.ValidateData(0xc0029df4c0, 0x20, 0xc0029f824c, 0x4, 0x2, 0xc0029df4e0, 0x14, 0x14, 0xc0029ea5c0, 0xc0029ed560, ...)\\n\\t/home/admin/文档/qos/module/gov/txs/proposal.go:262 +0x215\\ngithub.com/QOSGroup/qbase/txs.(*TxStd).ValidateBasicData(0xc002a000f0, 0x13950a0, 0xc0029ed920, 0xc0029e8040, 0x10, 0x1359201, 0xc00298c480, 0xa, 0x10, 0x203000)\\n\\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/txs/txstd.go:165 +0x11f\\ngithub.com/QOSGroup/qbase/baseabci.(*BaseApp).checkTxStd(0xc000394180, 0x13950a0, 0xc0029ed920, 0xc0029e8040, 0x10, 0xc002a000f0, 0x0, 0x0, 0x0, 0x0, ...)\\n\\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/baseabci/baseapp.go:441 +0x1d6\\ngithub.com/QOSGroup/qbase/baseabci.(*BaseApp).CheckTx(0xc000394180, 0xc002a02000, 0x103, 0x105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\\n\\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/baseabci/baseapp.go:398 +0x3f9\\ngithub.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync(0xc000a4aea0, 0xc002a02000, 0x103, 0x105, 0x0)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/abci/client/local_client.go:99 +0x129\\ngithub.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync(0xc000a5a490, 0xc002a02000, 0x103, 0x105, 0x1)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/proxy/app_conn.go:114 +0x51\\ngithub.com/tendermint/tendermint/mempool.(*CListMempool).CheckTxWithInfo(0xc000901e10, 0xc002a02000, 0x103, 0x105, 0xc0029b7f50, 0xf80000, 0x0, 0x0)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/mempool/clist_mempool.go:282 +0x25e\\ngithub.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx(0xc000901e10, 0xc002a02000, 0x103, 0x105, 0xc0029b7f50, 0xc0028bea50, 0xf)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/mempool/clist_mempool.go:212 +0x5a\\ngithub.com/tendermint/tendermint/rpc/core.BroadcastTxCommit(0xc0029ea3e0, 0xc002a02000, 0x103, 0x105, 0x0, 0x0, 0x0)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/core/mempool.go:238 +0x6a1\\nreflect.Value.call(0xf45e20, 0x121fe10, 0x13, 0x108bfe8, 0x4, 0xc0029ed200, 0x2, 0x2, 0x2, 0xc0029ed200, ...)\\n\\t/opt/go/src/reflect/value.go:447 +0x461\\nreflect.Value.Call(0xf45e20, 0x121fe10, 0x13, 0xc0029ed200, 0x2, 0x2, 0x1, 0x1, 0x0)\\n\\t/opt/go/src/reflect/value.go:308 +0xa4\\ngithub.com/tendermint/tendermint/rpc/lib/server.makeJSONRPCHandler.func1(0x1390360, 0xc0029ea3a0, 0xc002973200)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/handlers.go:157 +0x90a\\ngithub.com/tendermint/tendermint/rpc/lib/server.handleInvalidJSONRPCPaths.func1(0x1390360, 0xc0029ea3a0, 0xc002973200)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/handlers.go:181 +0x9c\\nnet/http.HandlerFunc.ServeHTTP(0xc000179490, 0x1390360, 0xc0029ea3a0, 0xc002973200)\\n\\t/opt/go/src/net/http/server.go:1995 +0x44\\nnet/http.(*ServeMux).ServeHTTP(0xc00038fe00, 0x1390360, 0xc0029ea3a0, 0xc002973200)\\n\\t/opt/go/src/net/http/server.go:2375 +0x1d6\\ngithub.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x1379a20, 0xc00038fe00, 0xf4240, 0x1390360, 0xc0029ea3a0, 0xc002973200)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/http_server.go:208 +0xd0\\ngithub.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x1390a60, 0xc0026162a0, 0xc002973200)\\n\\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/http_server.go:181 +0x317\\nnet/http.HandlerFunc.ServeHTTP(0xc002012000, 0x1390a60, 0xc0026162a0, 0xc002973200)\\n\\t/opt/go/src/net/http/server.go:1995 +0x44\\nnet/http.serverHandler.ServeHTTP(0xc0009b6000, 0x1390a60, 0xc0026162a0, 0xc002973200)\\n\\t/opt/go/src/net/http/server.go:2774 +0xa8\\nnet/http.(*conn).serve(0xc0029641e0, 0x1394fe0, 0xc00283afc0)\\n\\t/opt/go/src/net/http/server.go:1878 +0x851\\ncreated by net/http.(*Server).Serve\\n\\t/opt/go/src/net/http/server.go:2884 +0x2f4\\n\"}",
    "gasWanted": "9223372036854775807",
    "gasUsed": "29374",
    "events": []
  },
  "deliver_tx": {},
  "hash": "DC53DD5152196063F9F9C8C710EC5CE9FC59CC42E6FE4F2D8E8E988A6EABB020",
  "height": "0"
}
ERROR: {"codespace":"sdk","code":1,"message":"checkTxStd recovered: runtime error: invalid memory address or nil pointer dereference\nstack:\ngoroutine 553 [running]:\nruntime/debug.Stack(0xc0021543b8, 0xf530c0, 0x1bec560)\n\t/opt/go/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/QOSGroup/qbase/baseabci.(*BaseApp).checkTxStd.func1(0xc002154bc0, 0xc002154b88, 0xc002a000f0)\n\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/baseabci/baseapp.go:429 +0x24c\npanic(0xf530c0, 0x1bec560)\n\t/opt/go/src/runtime/panic.go:522 +0x1b5\nmath/big.(*Int).Sign(...)\n\t/opt/go/src/math/big/int.go:39\ngithub.com/QOSGroup/qos/types.Dec.IsNegative(...)\n\t/home/admin/文档/qos/types/decimal.go:193\ngithub.com/QOSGroup/qos/module/gov/types.(*Params).Validate(0xc00017c9a0, 0xc0008db1a0, 0xc0029f8273)\n\t/home/admin/文档/qos/module/gov/types/params.go:257 +0xe4\ngithub.com/QOSGroup/qos/module/gov/txs.TxParameterChange.ValidateData(0xc0029df4c0, 0x20, 0xc0029f824c, 0x4, 0x2, 0xc0029df4e0, 0x14, 0x14, 0xc0029ea5c0, 0xc0029ed560, ...)\n\t/home/admin/文档/qos/module/gov/txs/proposal.go:262 +0x215\ngithub.com/QOSGroup/qbase/txs.(*TxStd).ValidateBasicData(0xc002a000f0, 0x13950a0, 0xc0029ed920, 0xc0029e8040, 0x10, 0x1359201, 0xc00298c480, 0xa, 0x10, 0x203000)\n\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/txs/txstd.go:165 +0x11f\ngithub.com/QOSGroup/qbase/baseabci.(*BaseApp).checkTxStd(0xc000394180, 0x13950a0, 0xc0029ed920, 0xc0029e8040, 0x10, 0xc002a000f0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/baseabci/baseapp.go:441 +0x1d6\ngithub.com/QOSGroup/qbase/baseabci.(*BaseApp).CheckTx(0xc000394180, 0xc002a02000, 0x103, 0x105, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/baseabci/baseapp.go:398 +0x3f9\ngithub.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync(0xc000a4aea0, 0xc002a02000, 0x103, 0x105, 0x0)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/abci/client/local_client.go:99 +0x129\ngithub.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync(0xc000a5a490, 0xc002a02000, 0x103, 0x105, 0x1)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/proxy/app_conn.go:114 +0x51\ngithub.com/tendermint/tendermint/mempool.(*CListMempool).CheckTxWithInfo(0xc000901e10, 0xc002a02000, 0x103, 0x105, 0xc0029b7f50, 0xf80000, 0x0, 0x0)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/mempool/clist_mempool.go:282 +0x25e\ngithub.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx(0xc000901e10, 0xc002a02000, 0x103, 0x105, 0xc0029b7f50, 0xc0028bea50, 0xf)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/mempool/clist_mempool.go:212 +0x5a\ngithub.com/tendermint/tendermint/rpc/core.BroadcastTxCommit(0xc0029ea3e0, 0xc002a02000, 0x103, 0x105, 0x0, 0x0, 0x0)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/core/mempool.go:238 +0x6a1\nreflect.Value.call(0xf45e20, 0x121fe10, 0x13, 0x108bfe8, 0x4, 0xc0029ed200, 0x2, 0x2, 0x2, 0xc0029ed200, ...)\n\t/opt/go/src/reflect/value.go:447 +0x461\nreflect.Value.Call(0xf45e20, 0x121fe10, 0x13, 0xc0029ed200, 0x2, 0x2, 0x1, 0x1, 0x0)\n\t/opt/go/src/reflect/value.go:308 +0xa4\ngithub.com/tendermint/tendermint/rpc/lib/server.makeJSONRPCHandler.func1(0x1390360, 0xc0029ea3a0, 0xc002973200)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/handlers.go:157 +0x90a\ngithub.com/tendermint/tendermint/rpc/lib/server.handleInvalidJSONRPCPaths.func1(0x1390360, 0xc0029ea3a0, 0xc002973200)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/handlers.go:181 +0x9c\nnet/http.HandlerFunc.ServeHTTP(0xc000179490, 0x1390360, 0xc0029ea3a0, 0xc002973200)\n\t/opt/go/src/net/http/server.go:1995 +0x44\nnet/http.(*ServeMux).ServeHTTP(0xc00038fe00, 0x1390360, 0xc0029ea3a0, 0xc002973200)\n\t/opt/go/src/net/http/server.go:2375 +0x1d6\ngithub.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x1379a20, 0xc00038fe00, 0xf4240, 0x1390360, 0xc0029ea3a0, 0xc002973200)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/http_server.go:208 +0xd0\ngithub.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x1390a60, 0xc0026162a0, 0xc002973200)\n\t/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/rpc/lib/server/http_server.go:181 +0x317\nnet/http.HandlerFunc.ServeHTTP(0xc002012000, 0x1390a60, 0xc0026162a0, 0xc002973200)\n\t/opt/go/src/net/http/server.go:1995 +0x44\nnet/http.serverHandler.ServeHTTP(0xc0009b6000, 0x1390a60, 0xc0026162a0, 0xc002973200)\n\t/opt/go/src/net/http/server.go:2774 +0xa8\nnet/http.(*conn).serve(0xc0029641e0, 0x1394fe0, 0xc00283afc0)\n\t/opt/go/src/net/http/server.go:1878 +0x851\ncreated by net/http.(*Server).Serve\n\t/opt/go/src/net/http/server.go:2884 +0x2f4\n"}

情形2:输入错误密码

~/qos/bin/qoscli tx submit-proposal --proposal-type ParameterChange --title "ParameterChange-50000-no-deposit" --description "none" --proposer charles --deposit 50000 --params "gov:normal_min_deposit:99999" --indent
Password to sign with 'charles':
null
ERROR: buildAndSignTx recovered: goroutine 1 [running]:
runtime/debug.Stack(0xc0002ed568, 0xdb6b80, 0xc00098c150)
	/opt/go/src/runtime/debug/stack.go:24 +0x9d
github.com/QOSGroup/qbase/client/tx.buildAndSignTx.func1(0xc0002edad8, 0xc0002edae8)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:52 +0x46
panic(0xdb6b80, 0xc00098c150)
	/opt/go/src/runtime/panic.go:522 +0x1b5
github.com/QOSGroup/qbase/client/tx.signData(0xc00098fc70, 0x11b0980, 0xc000a588d0, 0x0, 0xeeb5b7, 0x15, 0x0, 0x0, 0x0, 0x1, ...)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:236 +0x391
github.com/QOSGroup/qbase/client/tx.signStdTx(0xc00098fc70, 0x11b0980, 0xc000a588d0, 0x0, 0xeeb5b7, 0x15, 0x0, 0x0, 0x0, 0x1, ...)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:211 +0x228
github.com/QOSGroup/qbase/client/tx.BuildAndSignStdTx(0xc00098fc70, 0x11b0980, 0xc000a588d0, 0x0, 0xeeb5b7, 0x15, 0x0, 0x0, 0x0, 0x1, ...)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:181 +0x31f
github.com/QOSGroup/qbase/client/tx.buildAndSignTx(0xc00098fc70, 0x11b0980, 0xc000a588d0, 0x0, 0xeeb5b7, 0x15, 0x0, 0x0, 0x0, 0x1, ...)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:68 +0x1ea
github.com/QOSGroup/qbase/client/tx.BroadcastTx(0xc00098fc70, 0xc000a3cee0, 0x40d619, 0xc000a3cee0, 0x10)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:40 +0xb9
github.com/QOSGroup/qbase/client/tx.BroadcastTxAndPrintResult(0xc00098fc70, 0xc000a3cee0, 0xc0002edc78, 0x0)
	/opt/go/src/pkg/mod/github.com/!q!o!s!group/qbase@v0.2.3-0.20190830041728-040c2afa7d32/client/tx/utils.go:32 +0x4d
github.com/QOSGroup/qos/module/gov/client.ProposalCmd.func1(0xc000a35900, 0xc000a4af70, 0x0, 0xd, 0x0, 0x0)
	/home/admin/文档/qos/module/gov/client/proposal.go:29 +0x69
github.com/spf13/cobra.(*Command).execute(0xc000a35900, 0xc000a4add0, 0xd, 0xd, 0xc000a35900, 0xc000a4add0)
	/opt/go/src/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:762 +0x465
github.com/spf13/cobra.(*Command).ExecuteC(0x18e9f60, 0xb8967f, 0x18e9f60, 0xedb0bc)
	/opt/go/src/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2ec
github.com/spf13/cobra.(*Command).Execute(...)
	/opt/go/src/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0x18e9f60, 0x10663b0, 0x3, 0xc000302dc0)
	/opt/go/src/pkg/mod/github.com/tendermint/tendermint@v0.32.0/libs/cli/setup.go:89 +0x3c
main.main()
	/home/admin/文档/qos/cmd/qoscli/main.go:49 +0x22d
imuge commented

情形1 参数校验bug
情形2 qbase中针对密码错误需要做处理

imuge commented

情形2 ref QOSGroup/qbase#215