crypto-org-chain / cronos

Cronos is the first Ethereum-compatible blockchain network built on Cosmos SDK technology. Cronos aims to massively scale the DeFi, GameFi, and overall Web3 user community by providing builders with the ability to instantly port apps and crypto assets from other chains while benefiting from low transaction fees, high throughput, and fast finality.
Other
287 stars 228 forks source link

Panic after switch the database type #841

Closed jasoncsli closed 1 year ago

jasoncsli commented 1 year ago

Describe the bug I try to change the database from rockdb to leveldb. Therefore, I delete all files in db folder, and then I create priv_validator_state.json by myself. When I start Cronosd again, it shows an error message. Do you have any idea how to fix this problem?

Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF Unlocking keyring
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF starting ABCI with Tendermint
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start impl=multiAppConn module=proxy msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start connection=query impl=localClient module=abci-client msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start connection=snapshot impl=localClient module=abci-client msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start connection=mempool impl=localClient module=abci-client msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start connection=consensus impl=localClient module=abci-client msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start impl=EventBus module=events msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start impl=PubSub module=pubsub msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF service start impl=IndexerService module=txindex msg={} server=node
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF ABCI Handshake App Info hash= height=0 module=consensus protocol-version=0 server=node software-version=v1.0.1
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF ABCI Replay Blocks appHeight=0 module=consensus server=node stateHeight=0 storeHeight=0
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF initializing blockchain state from genesis.json
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=1/11 module=x/crisis name=gov/module-account
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=2/11 module=x/crisis name=distribution/nonnegative-outstanding
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=3/11 module=x/crisis name=distribution/can-withdraw
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=4/11 module=x/crisis name=distribution/reference-count
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=5/11 module=x/crisis name=distribution/module-account
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=6/11 module=x/crisis name=bank/nonnegative-outstanding
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=7/11 module=x/crisis name=bank/total-supply
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=8/11 module=x/crisis name=staking/module-accounts
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=9/11 module=x/crisis name=staking/nonnegative-power
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=10/11 module=x/crisis name=staking/positive-delegation
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserting crisis invariants inv=11/11 module=x/crisis name=staking/delegator-shares
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF asserted all invariants duration=0.911259 height=0 module=x/crisis
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF created new capability module=ibc name=ports/transfer
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF port binded module=x/ibc/port port=transfer
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: 7:11AM INF claimed capability capability=1 module=transfer name=ports/transfer
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: panic: validator set is empty after InitGenesis, please ensure at least one validator is initialized with a delegation greater than or equal to the DefaultPowerReduction ({274878227520})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: goroutine 1 [running]:
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(_, {{0x3638498, 0x4000052070}, {0x3648120, 0x4001338200}, {{0x0, 0x0}, {0x400021c630, 0x12}, 0x0, ...}, ...}, ...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/cosmos/cosmos-sdk/types/module/module.go:336 +0x180
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/crypto-org-chain/cronos/app.(*App).InitChainer(_, {{0x3638498, 0x4000052070}, {0x3648120, 0x4001338200}, {{0x0, 0x0}, {0x400021c630, 0x12}, 0x0, ...}, ...}, ...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/app/app.go:803 +0x1d4
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0x400127e1c0, {{0x2f177efe, 0xedb729b57, 0x0}, {0x400021c630, 0x12}, 0x40012002a0, {0x4c7cbc0, 0x0, 0x0}, ...})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/cosmos/cosmos-sdk/baseapp/abci.go:71 +0x310
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/tendermint/tendermint/abci/client.(*localClient).InitChainSync(0x400068d2c0, {{0x2f177efe, 0xedb729b57, 0x0}, {0x400021c630, 0x12}, 0x40012002a0, {0x4c7cbc0, 0x0, 0x0}, ...})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/tendermint/tendermint/abci/client/local_client.go:272 +0x194
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/tendermint/tendermint/proxy.(*appConnConsensus).InitChainSync(0x4001766150?, {{0x2f177efe, 0xedb729b57, 0x0}, {0x400021c630, 0x12}, 0x40012002a0, {0x4c7cbc0, 0x0, 0x0}, ...})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/tendermint/tendermint/proxy/app_conn.go:77 +0x84
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/tendermint/tendermint/consensus.(*Handshaker).ReplayBlocks(_, {{{0xb, 0x0}, {0x2542f57, 0x7}}, {0x400021c630, 0x12}, 0x1, 0x0, {{0x0, ...}, ...}, ...}, ...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/tendermint/tendermint/consensus/replay.go:319 +0xad0
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/tendermint/tendermint/consensus.(*Handshaker).Handshake(0x400161d280, {0x364a010, 0x40001a9040})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/tendermint/tendermint/consensus/replay.go:268 +0x3a8
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/tendermint/tendermint/node.doHandshake({_, _}, {{{0xb, 0x0}, {0x2542f57, 0x7}}, {0x400021c630, 0x12}, 0x1, 0x0, ...}, ...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/tendermint/tendermint/node/node.go:329 +0x120
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/tendermint/tendermint/node.NewNode(0x40000f8000, {0x36347b0, 0x4000e6df40}, 0x400152e640, {0x3614368, 0x40001912f0}, 0x3613e28?, 0x4000e24680?, 0x400152e7d0, {0x36399d0, ...}, ...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/tendermint/tendermint/node/node.go:777 +0x3fc
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/evmos/ethermint/server.startInProcess(_, {{0x0, 0x0, 0x0}, {0x3653690, 0x40013d6210}, 0x0, {0x0, 0x0}, {0x364cb20, ...}, ...}, ...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/evmos/ethermint/server/start.go:322 +0xb30
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/evmos/ethermint/server.StartCmd.func2(0x40016e7800?, {0x4c7cbc0?, 0x0?, 0x0?})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/evmos/ethermint/server/start.go:123 +0x190
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/spf13/cobra.(*Command).execute(0x40016e7800, {0x4c7cbc0, 0x0, 0x0})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/spf13/cobra/command.go:916 +0x60c
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/spf13/cobra.(*Command).ExecuteC(0x40017e8300)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/spf13/cobra/command.go:1044 +0x368
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/spf13/cobra.(*Command).Execute(...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/spf13/cobra/command.go:968
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/spf13/cobra.(*Command).ExecuteContext(...)
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/spf13/cobra/command.go:961
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x1fc1cb8?, {0x2541413, 0x6}, {0x40014095c0, 0xd})
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/vendor/github.com/cosmos/cosmos-sdk/server/cmd/execute.go:36 +0x1a8
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]: main.main()
Feb 06 07:11:30 ip-172-30-2-33 cronosd[18151]:         /build/nx6zslxd97vghqsnm4nvjbz0m07ylg5d-source/cmd/cronosd/main.go:13 +0x48
Feb 06 07:11:30 ip-172-30-2-33 systemd[1]: cronosd.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Feb 06 07:11:30 ip-172-30-2-33 systemd[1]: cronosd.service: Failed with result 'exit-code'.
yihuang commented 1 year ago

Do you use the old binaries to replay blocks since the genesis?

jasoncsli commented 1 year ago

Do you use the old binaries to replay blocks since the genesis?

@yihuang nah, I used the v1.0.2 binaries. This node is a Pruned node. Do I have to use the old binaries too? https://docs.cronos.org/for-node-hosts/running-nodes/cronos-mainnet#step-0-notes-on-huygen-network-upgrade

yihuang commented 1 year ago

yes, since you are replaying the old block since genesis, you need start with the first binary, or you can setup cosmovisor directory structure with all binaries, let it switch automatically.

jasoncsli commented 1 year ago

@yihuang Cool. Thank you for your help.