gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
882 stars 364 forks source link

`boards` app crashes on incorrect name #203

Closed jubnzv closed 2 years ago

jubnzv commented 2 years ago

If we try to create a board with a name starting with a digit, we'll get a stacktrace.

I used the following commands to create a board:

./build/gnokey maketx call jubnzv --pkgpath "gno.land/r/boards" --func CreateBoard --args "2something" --gas-fee 1gnot --gas-wanted 2000000 > createboard.unsigned.txt
./build/gnokey sign jubnzv --txpath createboard.unsigned.txt --chainid "testchain" --number 645 --sequence 0 > createboard.signed.txt              
./build/gnokey broadcast createboard.signed.txt --remote gno.land:36657

Error output:

transaction failed &core_types.ResultBroadcastTxCommit{CheckTx:abci.ResponseCheckTx{ResponseBase:abci.ResponseBase{Error:abci.Error(nil), Data:[]uint8(nil), Events:[]abci.Event(nil), Log:"msg:0,success:true,log:,events:[]", Info:""}, GasWanted:2000000, GasUsed:24979}, DeliverTx:abci.ResponseDeliverTx{ResponseBase:abci.ResponseBase{Error:std.InternalError{abciError:std.abciError{}}, Data:[]uint8(nil), Events:[]abci.Event(nil), Log:"recovered: (\"invalid name: 2something\" string)\nstack:\ngoroutine 15 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1()\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:741 +0x2aa\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call.func1()\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:229 +0xc5\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno.(*Machine).doOpPanic2(0xc0044b0480)\n\t/home/user/website2/gno/op_call.go:405 +0xc9\ngithub.com/gnolang/gno.(*Machine).Run(0xc0044b0480)\n\t/home/user/website2/gno/machine.go:999 +0x5ae\ngithub.com/gnolang/gno.(*Machine).Eval(0xc0044b0480, {0xea1008, 0xc00615c240})\n\t/home/user/website2/gno/machine.go:573 +0x552\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:232 +0xbe5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.handleMsgCall({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:64 +0x2c5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Process({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:29 +0x238\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runMsgs(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:642 +0x42e\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx(0xc000208100, 0x2, {0xc00521a960, 0xed, _}, {{0xc002b54bd0, 0x1, 0x1}, {0x1e8480, {{0xc004793776, ...}, ...}}, ...})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:821 +0x905\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).DeliverTx(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:578 +0x167\ngithub.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).DeliverTxAsync(0xc003d19d40, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/abci/client/local_client.go:82 +0x103\ngithub.com/gnolang/gno/pkgs/bft/proxy.(*appConnConsensus).DeliverTxAsync(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/proxy/app_conn.go:73 +0x26\ngithub.com/gnolang/gno/pkgs/bft/state.execBlockOnProxyApp({0xe936b8, 0xc003d1ba40}, {0xe98cb0, 0xc003d2e730}, 0xc007ab0680, {0xea2680, 0xc0000102c0})\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:256 +0x8c2\ngithub.com/gnolang/gno/pkgs/bft/state.(*BlockExecutor).ApplyBlock(_, {{0xc5b291, 0xb}, {0xc5b291, 0xb}, {0x0, 0x0}, {0xc003d03ff0, 0x9}, 0x8112, ...}, ...)\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:104 +0x115\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).finalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1353 +0x97e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryFinalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1281 +0x305\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit.func1()\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1227 +0x8e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit(0xc003861200, 0x8113, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1258 +0xaaf\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).addVote(0xc003861200, 0xc00aad83c0, {0x0, 0x0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1646 +0x8ce\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryAddVote(0xc003861200, 0x4af2a6, {0x0, 0xc00b219bf0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1489 +0x27\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).handleMsg(0xc003861200, {{0xe7cca0, 0xc006c1c3f0}, {0x0, 0xeda172398}})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:695 +0x388\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).receiveRoutine(0xc003861200, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:654 +0x45f\ncreated by github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).OnStart\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:346 +0x4dd\n", Info:""}, GasWanted:2000000, GasUsed:620155}, Hash:[]uint8{0xc9, 0x70, 0x9e, 0xf1, 0xb6, 0x77, 0xb0, 0x53, 0x95, 0x4a, 0xf1, 0x8, 0xe7, 0x6e, 0xdc, 0xae, 0x93, 0xc8, 0xee, 0xcd, 0xe8, 0xc0, 0x7d, 0xa5, 0x39, 0x7a, 0x85, 0x2b, 0x49, 0x35, 0x8d, 0xca}, Height:33043}
log recovered: ("invalid name: 2something" string)
stack:
goroutine 15 [running]:
runtime/debug.Stack()
    /usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1()
    /home/user/website2/gno/pkgs/sdk/baseapp.go:741 +0x2aa
panic({0xc4ac60, 0xc0085ff5c0})
    /usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call.func1()
    /home/user/website2/gno/pkgs/sdk/vm/keeper.go:229 +0xc5
panic({0xc4ac60, 0xc0085ff5c0})
    /usr/local/go/src/runtime/panic.go:1038 +0x215
github.com/gnolang/gno.(*Machine).doOpPanic2(0xc0044b0480)
    /home/user/website2/gno/op_call.go:405 +0xc9
github.com/gnolang/gno.(*Machine).Run(0xc0044b0480)
    /home/user/website2/gno/machine.go:999 +0x5ae
github.com/gnolang/gno.(*Machine).Eval(0xc0044b0480, {0xea1008, 0xc00615c240})
    /home/user/website2/gno/machine.go:573 +0x552
github.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
    /home/user/website2/gno/pkgs/sdk/vm/keeper.go:232 +0xbe5
github.com/gnolang/gno/pkgs/sdk/vm.vmHandler.handleMsgCall({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
    /home/user/website2/gno/pkgs/sdk/vm/handler.go:64 +0x2c5
github.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Process({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
    /home/user/website2/gno/pkgs/sdk/vm/handler.go:29 +0x238
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runMsgs(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)
    /home/user/website2/gno/pkgs/sdk/baseapp.go:642 +0x42e
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx(0xc000208100, 0x2, {0xc00521a960, 0xed, _}, {{0xc002b54bd0, 0x1, 0x1}, {0x1e8480, {{0xc004793776, ...}, ...}}, ...})
    /home/user/website2/gno/pkgs/sdk/baseapp.go:821 +0x905
github.com/gnolang/gno/pkgs/sdk.(*BaseApp).DeliverTx(0x0, {{}, {0xc00521a960, 0x0, 0x0}})
    /home/user/website2/gno/pkgs/sdk/baseapp.go:578 +0x167
github.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).DeliverTxAsync(0xc003d19d40, {{}, {0xc00521a960, 0x0, 0x0}})
    /home/user/website2/gno/pkgs/bft/abci/client/local_client.go:82 +0x103
github.com/gnolang/gno/pkgs/bft/proxy.(*appConnConsensus).DeliverTxAsync(0x0, {{}, {0xc00521a960, 0x0, 0x0}})
    /home/user/website2/gno/pkgs/bft/proxy/app_conn.go:73 +0x26
github.com/gnolang/gno/pkgs/bft/state.execBlockOnProxyApp({0xe936b8, 0xc003d1ba40}, {0xe98cb0, 0xc003d2e730}, 0xc007ab0680, {0xea2680, 0xc0000102c0})
    /home/user/website2/gno/pkgs/bft/state/execution.go:256 +0x8c2
github.com/gnolang/gno/pkgs/bft/state.(*BlockExecutor).ApplyBlock(_, {{0xc5b291, 0xb}, {0xc5b291, 0xb}, {0x0, 0x0}, {0xc003d03ff0, 0x9}, 0x8112, ...}, ...)
    /home/user/website2/gno/pkgs/bft/state/execution.go:104 +0x115
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).finalizeCommit(0xc003861200, 0x8113)
    /home/user/website2/gno/pkgs/bft/consensus/state.go:1353 +0x97e
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryFinalizeCommit(0xc003861200, 0x8113)
    /home/user/website2/gno/pkgs/bft/consensus/state.go:1281 +0x305
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit.func1()
    /home/user/website2/gno/pkgs/bft/consensus/state.go:1227 +0x8e
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit(0xc003861200, 0x8113, 0x0)
    /home/user/website2/gno/pkgs/bft/consensus/state.go:1258 +0xaaf
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).addVote(0xc003861200, 0xc00aad83c0, {0x0, 0x0})
    /home/user/website2/gno/pkgs/bft/consensus/state.go:1646 +0x8ce
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryAddVote(0xc003861200, 0x4af2a6, {0x0, 0xc00b219bf0})
    /home/user/website2/gno/pkgs/bft/consensus/state.go:1489 +0x27
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).handleMsg(0xc003861200, {{0xe7cca0, 0xc006c1c3f0}, {0x0, 0xeda172398}})
    /home/user/website2/gno/pkgs/bft/consensus/state.go:695 +0x388
github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).receiveRoutine(0xc003861200, 0x0)
    /home/user/website2/gno/pkgs/bft/consensus/state.go:654 +0x45f
created by github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).OnStart
    /home/user/website2/gno/pkgs/bft/consensus/state.go:346 +0x4dd

--= Error =--
Data: errors.FmtError{format:"transaction failed %#v\nlog %s", args:[]interface {}{(*core_types.ResultBroadcastTxCommit)(0xc0000f0500), "recovered: (\"invalid name: 2something\" string)\nstack:\ngoroutine 15 [running]:\nruntime/debug.Stack()\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x65\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx.func1()\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:741 +0x2aa\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call.func1()\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:229 +0xc5\npanic({0xc4ac60, 0xc0085ff5c0})\n\t/usr/local/go/src/runtime/panic.go:1038 +0x215\ngithub.com/gnolang/gno.(*Machine).doOpPanic2(0xc0044b0480)\n\t/home/user/website2/gno/op_call.go:405 +0xc9\ngithub.com/gnolang/gno.(*Machine).Run(0xc0044b0480)\n\t/home/user/website2/gno/machine.go:999 +0x5ae\ngithub.com/gnolang/gno.(*Machine).Eval(0xc0044b0480, {0xea1008, 0xc00615c240})\n\t/home/user/website2/gno/machine.go:573 +0x552\ngithub.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Call(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/keeper.go:232 +0xbe5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.handleMsgCall({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:64 +0x2c5\ngithub.com/gnolang/gno/pkgs/sdk/vm.vmHandler.Process({_}, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/vm/handler.go:29 +0x238\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runMsgs(_, {{0xe8e620, 0xc007ff1e60}, 0x2, {0xe88c48, 0xc002b55600}, {0xe8e7a8, 0xc000035760}, {0xc002d96ac0, 0x9}, ...}, ...)\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:642 +0x42e\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).runTx(0xc000208100, 0x2, {0xc00521a960, 0xed, _}, {{0xc002b54bd0, 0x1, 0x1}, {0x1e8480, {{0xc004793776, ...}, ...}}, ...})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:821 +0x905\ngithub.com/gnolang/gno/pkgs/sdk.(*BaseApp).DeliverTx(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/sdk/baseapp.go:578 +0x167\ngithub.com/gnolang/gno/pkgs/bft/abci/client.(*localClient).DeliverTxAsync(0xc003d19d40, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/abci/client/local_client.go:82 +0x103\ngithub.com/gnolang/gno/pkgs/bft/proxy.(*appConnConsensus).DeliverTxAsync(0x0, {{}, {0xc00521a960, 0x0, 0x0}})\n\t/home/user/website2/gno/pkgs/bft/proxy/app_conn.go:73 +0x26\ngithub.com/gnolang/gno/pkgs/bft/state.execBlockOnProxyApp({0xe936b8, 0xc003d1ba40}, {0xe98cb0, 0xc003d2e730}, 0xc007ab0680, {0xea2680, 0xc0000102c0})\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:256 +0x8c2\ngithub.com/gnolang/gno/pkgs/bft/state.(*BlockExecutor).ApplyBlock(_, {{0xc5b291, 0xb}, {0xc5b291, 0xb}, {0x0, 0x0}, {0xc003d03ff0, 0x9}, 0x8112, ...}, ...)\n\t/home/user/website2/gno/pkgs/bft/state/execution.go:104 +0x115\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).finalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1353 +0x97e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryFinalizeCommit(0xc003861200, 0x8113)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1281 +0x305\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit.func1()\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1227 +0x8e\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).enterCommit(0xc003861200, 0x8113, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1258 +0xaaf\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).addVote(0xc003861200, 0xc00aad83c0, {0x0, 0x0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1646 +0x8ce\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).tryAddVote(0xc003861200, 0x4af2a6, {0x0, 0xc00b219bf0})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:1489 +0x27\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).handleMsg(0xc003861200, {{0xe7cca0, 0xc006c1c3f0}, {0x0, 0xeda172398}})\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:695 +0x388\ngithub.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).receiveRoutine(0xc003861200, 0x0)\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:654 +0x45f\ncreated by github.com/gnolang/gno/pkgs/bft/consensus.(*ConsensusState).OnStart\n\t/home/user/website2/gno/pkgs/bft/consensus/state.go:346 +0x4dd\n"}}
Msg Traces:
--= /Error =--
giansalex commented 2 years ago

Currently this is how errors are displayed.