Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gaiacli stake delegate show error when bonded shares=0:division by zero #1287

Closed
nobsu opened this issue Jun 16, 2018 · 2 comments · Fixed by #1612
Closed

gaiacli stake delegate show error when bonded shares=0:division by zero #1287

nobsu opened this issue Jun 16, 2018 · 2 comments · Fixed by #1612
Assignees

Comments

@nobsu
Copy link

nobsu commented Jun 16, 2018

[work@chaindown-web04 ~]$ gaiacli version
0.19.0-c671181
[work@chaindown-web04 ~]$ gaiad version
0.19.0-c671181
[work@chaindown-web04 ~]$ gaiacli stake validator cosmosaccaddr1tpkccgq3drmh4ynhpxfax8a03fchf8wusdx87q --chain-id=gaia-6002
Validator
Owner: cosmosaccaddr1tpkccgq3drmh4ynhpxfax8a03fchf8wusdx87q
Validator: cosmosvalpub1zcjduc3qzy8srgcep6y9c705h6gkfqzpc4dvh84zyxnadvhkxadlc3fft0zqq56g9q
Shares: Status Bonded, Amount: 0/1
Delegator Shares: 258674205209/-3638297687727013888
Description: {xiha }
Bond Height: 116859
Proposer Reward Pool:
Commission: 0/1
Max Commission Rate: 0/1
Comission Change Rate: 0/1
Commission Change Today: 0/1
Previously Bonded Stares: 0/1

[work@chaindown-web04 ~]$ gaiacli stake delegate --amount=1steak --address-delegator=cosmosaccaddr1tpkccgq3drmh4ynhpxfax8a03fchf8wusdx87q --address-validator=cosmosaccaddr1tpkccgq3drmh4ynhpxfax8a03fchf8wusdx87q --name=node01 --chain-id=gaia-6002
Defaulting to account number: 44
Defaulting to next sequence number: 14
Password to sign with 'node01':
ERROR: DeliverTx failed: (65537) === ABCI Log ===
Codespace: 1
Code: 1
ABCICode: 65537
Error: --= Error =--
Message: Recovered: division by zero
stack:
goroutine 2253 [running]:
runtime/debug.Stack(0xc426566c80, 0xbbe200, 0xed32b0)
/home/work/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1(0xc42656a2c0)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/baseapp/baseapp.go:474 +0x1f4
panic(0xbbe200, 0xed32b0)
/home/work/local/go/src/runtime/panic.go:502 +0x229
math/big.(*Rat).Quo(0xc426566df0, 0xc426566e40, 0xc426566e80, 0x0)
/home/work/local/go/src/math/big/rat.go:509 +0x167
github.com/cosmos/cosmos-sdk/types.Rat.Quo(0x0, 0xc42e1f2ea0, 0x1, 0x5, 0x0, 0xc42e1f2ed0, 0x0, 0x5, 0x0, 0x0, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/types/rational.go:91 +0x94
github.com/cosmos/cosmos-sdk/x/stake.Validator.addTokensFromDel(0xc43cc604e0, 0x14, 0x14, 0xedf960, 0xc43cc60540, 0x0, 0x2, 0x0, 0xc42e1f2fc0, 0x1, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/x/stake/validator.go:207 +0x326
github.com/cosmos/cosmos-sdk/x/stake.delegate(0xedee60, 0xc442ca9950, 0xc42ae16940, 0xe, 0xed8680, 0xc4200db8b0, 0xc420a4a660, 0xed8680, 0xc4200db820, 0xee5060, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/x/stake/handler.go:166 +0x41c
github.com/cosmos/cosmos-sdk/x/stake.handleMsgDelegate(0xedee60, 0xc442ca9950, 0xc42ae16940, 0xe, 0xc43cc60260, 0x14, 0x14, 0xc43cc60280, 0x14, 0x14, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/x/stake/handler.go:137 +0x40c
github.com/cosmos/cosmos-sdk/x/stake.NewHandler.func1(0xedee60, 0xc442ca9950, 0xc42ae16940, 0xe, 0xedfbe0, 0xc425360c30, 0x0, 0x0, 0x0, 0x0, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/x/stake/handler.go:19 +0x78c
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0xc4201002a0, 0x2, 0xc428574e10, 0xe5, 0xe5, 0xed6c20, 0xc425360c80, 0x0, 0x0, 0x0, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/baseapp/baseapp.go:537 +0x340
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).DeliverTx(0xc4201002a0, 0xc428574e10, 0xe5, 0xe5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/baseapp/baseapp.go:426 +0x466
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/abci/client.(*localClient).DeliverTxAsync(0xc4200d89c0, 0xc428574e10, 0xe5, 0xe5, 0x0)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/abci/client/local_client.go:76 +0x88
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/proxy.(*appConnConsensus).DeliverTxAsync(0xc4200da790, 0xc428574e10, 0xe5, 0xe5, 0xc43048aa10)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/proxy/app_conn.go:73 +0x51
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/state.execBlockOnProxyApp(0xedf560, 0xc422295960, 0xee2380, 0xc4200da790, 0xc42fbaba40, 0xc442898360, 0xee59e0, 0xc423d640b8, 0x1, 0xc4270803e0, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/state/execution.go:203 +0x735
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(0xc4200d8f60, 0xc420cab4f0, 0x9, 0x1ccfc, 0x63c1, 0xc43cd1a120, 0x14, 0x20, 0x1, 0xc4270803e0, ...)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/state/execution.go:76 +0x12f
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit(0xc4214902c0, 0x1ccfd)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:1267 +0xbb2
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit(0xc4214902c0, 0x1ccfd)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:1198 +0x468
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1(0xc4214902c0, 0x0, 0x1ccfd)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:1146 +0x98
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit(0xc4214902c0, 0x1ccfd, 0x0)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:1175 +0x802
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).addVote(0xc4214902c0, 0xc423db9040, 0xc428cc2e10, 0x28, 0x0, 0x0, 0xc424fea758)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:1532 +0xbb4
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote(0xc4214902c0, 0xc423db9040, 0xc428cc2e10, 0x28, 0xf6, 0xc4350b9a00)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:1390 +0x56
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg(0xc4214902c0, 0xbf5d80, 0xc42094a270, 0xc428cc2e10, 0x28)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:607 +0x643
github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine(0xc4214902c0, 0x0)
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:560 +0x6c0
created by github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart
/home/work/workplace/gopath/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/consensus/state.go:272 +0x140

Cause:
T: 0x1
Msg Traces:
--= /Error =--

=== /ABCI Log ===

@ebuchman ebuchman added the T:Bug label Jun 19, 2018
@rigelrozanski rigelrozanski changed the title gaiacli stake delegate show error when bonded sahres=0:division by zero gaiacli stake delegate show error when bonded shares=0:division by zero Jul 6, 2018
@rigelrozanski
Copy link
Contributor

@nobsu how did the validator get there with zero power to begin with? Makes sense that there is a panic here because a validator should not persist in the state if it has zero power - sounds like a genesis bug

@rigelrozanski
Copy link
Contributor

actually maybe we need to allow for this because of #1056

chillyvee pushed a commit to chillyvee/cosmos-sdk that referenced this issue Mar 1, 2024
…mos#1287)

* Fix commands for quickstart for mac and linux compatability

* Update dead links

* Update service-providers.md

* Update join-mainnet.md

Co-authored-by: billy rennekamp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants