ExocoreNetwork / exocore

6 stars 9 forks source link

Register new asset leads to consensus failure #135

Closed cloud8little closed 1 month ago

cloud8little commented 1 month ago

Summary of Bug

Version

develop(https://github.com/ExocoreNetwork/exocore/commit/2b00dd8bd3ea9298c984e3c0fc5b66d8286204c6) + PR #132(https://github.com/ExocoreNetwork/exocore/pull/132/commits/de82413a93830b650a1eca8a699e00244119d4e9) + PR #133(https://github.com/ExocoreNetwork/exocore/pull/133/commits/42837d9a7e4b202a62e3260aec43125401f7fd5b)

Steps to Reproduce

  1. Register Client Chain via assets.
  2. update oracle params to add a new chain
  3. update oracle params to add a new token with asset id.
  4. update oracle params to add new token feeder with start base block to be 1000000
  5. Register asset via assets module.
  6. Validator failed with consensus failure.
exocored tx assets RegisterClientChain  "Holesky" "holesky" 40159 20 --from relayer --keyring-backend test --home /root/.testnetV3/node1 --fees 50000000000aexo --node http://localhost:20000

exocored tx oracle update-params '{"chains":[{"name":"Holesky", "desc":"-"}]}' --from relayer --keyring-backend test --home /root/.testnetV3/node1 --gas-prices 7aexo --node http://localhost:20000

exocored tx oracle update-params '{"tokens":[{"name":"exoETH", "chain_id":"2", "asset_id":"0x1e867667ef16111047c2c7f6adf4612bdf80064d_0x9cdf", "decimal":8}]}' --from relayer --keyring-backend test --home /root/.testnetV3/node1 --gas-prices 7aexo --node http://localhost:20000

exocored tx oracle update-params '{"token_feeders":[{"token_id":"2","start_base_block":"1000000","end_block":"0", "interval": "10", "start_round_id": "1", "rule_id": "1"}]}' --from relayer --keyring-backend test --home /root/.testnetV3/node1 --gas-prices 7aexo --node http://localhost:20000

exocored tx assets RegisterAsset "Holesky Exo ETH" "hexoETH" 0x1E867667Ef16111047C2c7f6ADf4612bDf80064D "exoETH on holeksy" 100000000000000000000000000 40159 18 --home /root/.testnetV3/node1 --from relayer --keyring-backend test --fees 50000000000aexo --node http://localhost:20000

Screenshots

error Log:

Jul 18 08:08:20 den-sm5038ml-h12trf-6-11 exocored[3456852]: 8:08AM INF AfterEpochEnd minted successfully=20000000000000000000aexo module=x/exomint
Jul 18 08:08:20 den-sm5038ml-h12trf-6-11 exocored[3456852]: 8:08AM INF prepare for next oracle round of each tokenFeeder height=344 module=x/oracle
Jul 18 08:08:20 den-sm5038ml-h12trf-6-11 exocored[3456852]: 8:08AM ERR CONSENSUS FAILURE!!! err="assetID does not exist in oracle 0x1e867667ef16111047c2c7f6adf4612bdf80064d_0x9cdf: get price failed for asset not found" module=consensus server=node stack="goroutine 149 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x5e\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine.func2()\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:736 +0x46\npanic({0x2f42300?, 0xc007d98a60?})\n\truntime/panic.go:914 +0x21f\ngithub.com/ExocoreNetwork/exocore/x/operator/keeper.(*Keeper).EndBlock(_, {{0x41ac620, 0x607c180}, {0x41c7d30, 0xc007a6e280}, {{0xb, 0x0}, {0xc00786da28, 0x14}, 0x158, ...}, ...}, ...)\n\tgithub.com/ExocoreNetwork/exocore/x/operator/keeper/abci.go:159 +0x10c\ngithub.com/ExocoreNetwork/exocore/x/operator.AppModule.EndBlock(...)\n\tgithub.com/ExocoreNetwork/exocore/x/operator/module.go:97\ngithub.com/cosmos/cosmos-sdk/types/module.(*Manager).EndBlock(_, {{0x41ac620, 0x607c180}, {0x41c7d30, 0xc007a6e280}, {{0xb, 0x0}, {0xc00786da28, 0x14}, 0x158, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/types/module/module.go:583 +0x1c9\ngithub.com/ExocoreNetwork/exocore/app.(*ExocoreApp).EndBlocker(...)\n\tgithub.com/ExocoreNetwork/exocore/app/app.go:1144\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).EndBlock(0xc00033e780, {0x40?})\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/abci.go:219 +0x165\ngithub.com/cometbft/cometbft/abci/client.(*localClient).EndBlockSync(0xc0025e4c00, {0xc004bfe680?})\n\tgithub.com/cometbft/cometbft@v0.37.4/abci/client/local_client.go:291 +0xd3\ngithub.com/cometbft/cometbft/proxy.(*appConnConsensus).EndBlockSync(0xc0025e7050, {0xc004bfe680?})\n\tgithub.com/cometbft/cometbft@v0.37.4/proxy/app_conn.go:111 +0x14c\ngithub.com/cometbft/cometbft/state.execBlockOnProxyApp({0x41ac658?, 0xc001310150}, {0x41c3d00, 0xc0025e7050}, 0xc0041e7c20, {0x41c8a68, 0xc000dd6d20}, 0x157?)\n\tgithub.com/cometbft/cometbft@v0.37.4/state/execution.go:383 +0x6fc\ngithub.com/cometbft/cometbft/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x0}, {0xc0025ebc20, 0x6}}, {0xc0025f66a8, 0x14}, 0x1, 0x157, {{0xc00773ec20, ...}, ...}, ...}, ...)\n\tgithub.com/cometbft/cometbft@v0.37.4/state/execution.go:197 +0x165\ngithub.com/cometbft/cometbft/consensus.(*State).finalizeCommit(0xc001b70a80, 0x158)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1710 +0xa65\ngithub.com/cometbft/cometbft/consensus.(*State).tryFinalizeCommit(0xc001b70a80, 0x158)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1619 +0x2f6\ngithub.com/cometbft/cometbft/consensus.(*State).enterCommit.func1()\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1554 +0x9c\ngithub.com/cometbft/cometbft/consensus.(*State).enterCommit(0xc001b70a80, 0x158, 0x0)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1592 +0xc5b\ngithub.com/cometbft/cometbft/consensus.(*State).addVote(0xc001b70a80, 0xc007a4c1e0, {0xc002698330, 0x28})\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:2223 +0x18ed\ngithub.com/cometbft/cometbft/consensus.(*State).tryAddVote(0xc001b70a80, 0xc007a4c1e0, {0xc002698330?, 0xc00731fc08?})\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:2012 +0x26\ngithub.com/cometbft/cometbft/consensus.(*State).handleMsg(0xc001b70a80, {{0x417a940, 0xc007207430}, {0xc002698330, 0x28}})\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:865 +0x3ce\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine(0xc001b70a80, 0x0)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:772 +0x3d1\ncreated by github.com/cometbft/cometbft/consensus.(*State).OnStart in goroutine 118\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:383 +0x10c\n"
Jul 18 08:08:20 den-sm5038ml-h12trf-6-11 exocored[3456852]: 8:08AM INF service stop impl=baseWAL module=consensus msg="Stopping baseWAL service" server=node wal=node1/data/cs.wal/wal

Additional context


For Admin Use

leonz789 commented 1 month ago

fixed by #136