ExocoreNetwork / exocore

5 stars 9 forks source link

Unjail function does not work #101

Open cloud8little opened 2 weeks ago

cloud8little commented 2 weeks ago

Summary of Bug

When an operator node is down for jail, it should be able to unjail it with sending a unjail function.

Version

https://github.com/ExocoreNetwork/exocore/pull/72/commits/ccec0bbe3afdb057886281772c0fb2726fcf0205 from PR #72

Steps to Reproduce

  1. Start a single node consensus.
  2. Register an operator and start the operator node to sync blocks.
  3. Deposit tokens and delegate to the new registered operator.
  4. Stop the operator node so that it will be jailed in the next epoch.
  5. Start the operator node and send unjail transaction with following example command.

exocored tx slashing unjail --from newoperator1

Screenshots

Additional context

Error Log:

raw_log: "recovered: unimplemented on this keeper\nstack:\ngoroutine 180 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24
  +0x5e\ngithub.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.func3({0x2c8b0c0,
  0x42789c0})\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/recovery.go:71 +0x25\ngithub.com/cosmos/cosmos-sdk/baseapp.NewBaseApp.newDefaultRecoveryMiddleware.newRecoveryMiddleware.func5({0x2c8b0c0?,
  0x42789c0?})\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/recovery.go:39 +0x2d\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x2c8b0c0,
  0x42789c0}, 0x64?)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/recovery.go:28
  +0x2f\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x2c8b0c0, 0x42789c0},
  0x3?)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/recovery.go:33 +0x53\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/baseapp.go:641
  +0x138\npanic({0x2c8b0c0?, 0x42789c0?})\n\truntime/panic.go:770 +0x132\ngithub.com/ExocoreNetwork/exocore/x/dogfood/keeper.Keeper.Delegation(...)\n\tgithub.com/ExocoreNetwork/exocore/x/dogfood/keeper/impl_sdk.go:146\ngithub.com/cosmos/cosmos-sdk/x/slashing/keeper.Keeper.Unjail({{_,
  _}, {_, _}, _, {_, _}, {_, _}}, {{0x42b5aa0, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/x/slashing/keeper/unjail.go:18
  +0x11f\ngithub.com/cosmos/cosmos-sdk/x/slashing/keeper.msgServer.Unjail({{{0x428f070,
  0xc0020d6520}, {0x42d1d00, 0xc0017311b0}, 0xc000524538, {0x42d1980, 0xc00121ca90},
  {0xc0010100f0, 0x2a}}}, {0x42b5f70, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/x/slashing/keeper/msg_server.go:48
  +0x165\ngithub.com/cosmos/cosmos-sdk/x/slashing/types._Msg_Unjail_Handler.func1({0x42b5f70?,
  0xc0082fd680?}, {0x3181e60?, 0xc006cf1ba0?})\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/x/slashing/types/tx.pb.go:434
  +0xcb\ngithub.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).RegisterService.func2.1({0x42b5b10,
  0xc007de2008}, {0xc008017bb8?, 0x4138c5?}, 0x2a0?, 0xc000c03e18)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/msg_service_router.go:118
  +0x8a\ngithub.com/cosmos/cosmos-sdk/x/slashing/types._Msg_Unjail_Handler({0x31e84a0,
  0xc0018a7810}, {0x42b5b10, 0xc007de2008}, 0x3b87fd0, 0xc002b35100)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/x/slashing/types/tx.pb.go:436
  +0x143\ngithub.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).RegisterService.func2({{0x42b5aa0,
  0x61e7500}, {0x42d2390, 0xc005f63f40}, {{0xb, 0x0}, {0xc0068fbbc0, 0x14}, 0x1f08,
  {0x2811f406, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/msg_service_router.go:139
  +0x2a7\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runMsgs(_, {{0x42b5aa0,
  0x61e7500}, {0x42d2390, 0xc005f63f40}, {{0xb, 0x0}, {0xc0068fbbc0, 0x14}, 0x1f08,
  ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/baseapp.go:800
  +0x285\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0xc000340780, 0x3,
  {0xc007bbe900, 0x114, 0x114})\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/baseapp.go:743
  +0xe65\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).DeliverTx(0xc000340780,
  {{0xc007bbe900?, 0xd75471?, 0xc007dcbf80?}})\n\tgithub.com/cosmos/cosmos-sdk@v0.47.8/baseapp/abci.go:409
  +0x178\ngithub.com/ExocoreNetwork/exocore/app.(*ExocoreApp).DeliverTx(0x7fb73c0ca338?,
  {{0xc007bbe900?, 0x7fb784830a68?, 0x20?}})\n\tgithub.com/ExocoreNetwork/exocore/app/app.go:1167
  +0xd2\ngithub.com/cometbft/cometbft/abci/client.(*localClient).DeliverTxAsync(0xc002d815c0,
  {{0xc007bbe900?, 0x0?, 0x0?}})\n\tgithub.com/cometbft/cometbft@v0.37.4/abci/client/local_client.go:82
  +0xf9\ngithub.com/cometbft/cometbft/proxy.(*appConnConsensus).DeliverTxAsync(0xc0000131e8,
  {{0xc007bbe900?, 0x20?, 0xb?}})\n\tgithub.com/cometbft/cometbft@v0.37.4/proxy/app_conn.go:106
  +0x163\ngithub.com/cometbft/cometbft/state.execBlockOnProxyApp({0x42b5ad8, 0xc001890840},
  {0x42ce440, 0xc0000131e8}, 0xc0077734a0, {0x42d30f0, 0xc000c03518}, 0x1)\n\tgithub.com/cometbft/cometbft@v0.37.4/state/execution.go:376
  +0x666\ngithub.com/cometbft/cometbft/state.(*BlockExecutor).ApplyBlock(_, {{{0xb,
  0x0}, {0xc001aba8f4, 0x6}}, {0xc001853410, 0x14}, 0x1, 0x1f07, {{0xc0064ab7e0, ...},
  ...}, ...}, ...)\n\tgithub.com/cometbft/cometbft@v0.37.4/state/execution.go:197
  +0x18e\ngithub.com/cometbft/cometbft/consensus.(*State).finalizeCommit(0xc000f7b188,
  0x1f08)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1710 +0xa4c\ngithub.com/cometbft/cometbft/consensus.(*State).tryFinalizeCommit(0xc000f7b188,
  0x1f08)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1619 +0x2e8\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(0xc000f7b188,
  0x1f08, 0x0)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:1592 +0xc3b\ngithub.com/cometbft/cometbft/consensus.(*State).addVote(0xc000f7b188,
  0xc007b1b720, {0x0, 0x0})\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:2223
  +0x182d\ngithub.com/cometbft/cometbft/consensus.(*State).tryAddVote(0xc000f7b188,
  0xc007b1b720, {0x0?, 0x4eb6f0?})\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:2012
  +0x26\ngithub.com/cometbft/cometbft/consensus.(*State).handleMsg(0xc000f7b188, {{0x4284460,
  0xc0067daae0}, {0x0, 0x0}})\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:865
  +0x39c\ngithub.com/cometbft/cometbft/consensus.(*State).receiveRoutine(0xc000f7b188,
  0x0)\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:792 +0x4f9\ncreated
  by github.com/cometbft/cometbft/consensus.(*State).OnStart in goroutine 1\n\tgithub.com/cometbft/cometbft@v0.37.4/consensus/state.go:383
  +0x10c\n: panic"

For Admin Use

TimmyExogenous commented 2 weeks ago

The unjail depends on the self-delegation, maybe it should be addressed when implementing the self-delegation.