cometbft / cometbft-db

Database wrapper for CometBFT
Apache License 2.0
29 stars 51 forks source link

Rollback command broken with v0.13+ #179

Open GAtom22 opened 2 months ago

GAtom22 commented 2 months ago

The changes introduced in v0.13.0 broke the rollback command.

Steps to reproduce (using a Cosmos-SDK app - simapp) :

Error Stack trace:

1:42AM INF Replay last block using real app module=consensus
panic: stored minter should not have been nil

goroutine 100 [running]:
github.com/cosmos/cosmos-sdk/x/mint/keeper.Keeper.GetMinter({{0x7fbe2873dac0, 0xc001680af0}, {0x31a3ef8, 0xc000a64680}, {0x7fbe287437d8, 0xc000c8d7a0}, {0x7fbe287437a8, 0xc001655080}, {0x252ea2b, 0xd}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.47.8/x/mint/keeper/keeper.go:68 +0xed
github.com/cosmos/cosmos-sdk/x/mint.BeginBlocker({{0x31be700, 0x46e6a00}, {0x31d2a80, 0xc000c5ad40}, {{0xb, 0x0}, {0xc0020e5d50, 0x4}, 0x5, {0x28eecd95, ...}, ...}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.47.8/x/mint/abci.go:17 +0xd8
github.com/cosmos/cosmos-sdk/x/mint.AppModule.BeginBlock(...)
        github.com/cosmos/cosmos-sdk@v0.47.8/x/mint/module.go:183
github.com/cosmos/cosmos-sdk/types/module.(*Manager).BeginBlock(_, {{0x31be700, 0x46e6a00}, {0x31d2a80, 0xc000c5ad40}, {{0xb, 0x0}, {0xc0020e5d50, 0x4}, 0x5, ...}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.47.8/types/module/module.go:562 +0x175
github.com/cosmos/cosmos-sdk/runtime.(*App).BeginBlocker(...)
        github.com/cosmos/cosmos-sdk@v0.47.8/runtime/app.go:139
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).BeginBlock(_, {{0xc0010e0aa0, 0x20, 0x20}, {{0xb, 0x0}, {0xc0020e5d50, 0x4}, 0x5, {0x28eecd95, ...}, ...}, ...})
        github.com/cosmos/cosmos-sdk@v0.47.8/baseapp/abci.go:196 +0x838
github.com/cometbft/cometbft/abci/client.(*localClient).BeginBlockSync(_, {{0xc0010e0aa0, 0x20, 0x20}, {{0xb, 0x0}, {0xc0020e5d50, 0x4}, 0x5, {0x28eecd95, ...}, ...}, ...})
        github.com/cometbft/cometbft@v0.37.5/abci/client/local_client.go:283 +0xfe
github.com/cometbft/cometbft/proxy.(*appConnConsensus).BeginBlockSync(_, {{0xc0010e0aa0, 0x20, 0x20}, {{0xb, 0x0}, {0xc0020e5d50, 0x4}, 0x5, {0x28eecd95, ...}, ...}, ...})
        github.com/cometbft/cometbft@v0.37.5/proxy/app_conn.go:101 +0x195
github.com/cometbft/cometbft/state.execBlockOnProxyApp({0x31be6c8, 0xc000e6a7e0}, {0x31cf9a0, 0xc00069b1a0}, 0xc00039e780, {0x31d3210, 0xc00069b6b0}, 0x1)
        github.com/cometbft/cometbft@v0.37.5/state/execution.go:363 +0x4fd
github.com/cometbft/cometbft/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x0}, {0xc0020e4a30, 0x6}}, {0xc0020e4a38, 0x4}, 0x1, 0x4, {{0xc0020f6520, ...}, ...}, ...}, ...)
        github.com/cometbft/cometbft@v0.37.5/state/execution.go:197 +0x18e
github.com/cometbft/cometbft/consensus.(*Handshaker).replayBlock(_, {{{0xb, 0x0}, {0xc0020e4a30, 0x6}}, {0xc0020e4a38, 0x4}, 0x1, 0x4, {{0xc0020f6520, ...}, ...}, ...}, ...)
        github.com/cometbft/cometbft@v0.37.5/consensus/replay.go:527 +0x226
github.com/cometbft/cometbft/consensus.(*Handshaker).ReplayBlocksWithContext(_, {_, _}, {{{0xb, 0x0}, {0xc0020e4a30, 0x6}}, {0xc0020e4a38, 0x4}, 0x1, ...}, ...)
        github.com/cometbft/cometbft@v0.37.5/consensus/replay.go:433 +0x6ce
github.com/cometbft/cometbft/consensus.(*Handshaker).HandshakeWithContext(0xc002170090, {0x31bec78, 0x46e6a00}, {0x31d6938, 0xc000a257a0})
        github.com/cometbft/cometbft@v0.37.5/consensus/replay.go:274 +0x398
github.com/cometbft/cometbft/node.doHandshake({_, _}, {_, _}, {{{0xb, 0x0}, {0xc0020e4a30, 0x6}}, {0xc0020e4a38, 0x4}, ...}, ...)
        github.com/cometbft/cometbft@v0.37.5/node/node.go:449 +0x1a8
github.com/cometbft/cometbft/node.NewNodeWithContext({0x31bec78, 0x46e6a00}, 0xc0010f5340, {0x31a8640, 0xc0020ce780}, 0xc0020bfa90, {0x3197f20, 0xc0020e99b0}, 0xc002171d60, 0x2be8170, ...)
        github.com/cometbft/cometbft@v0.37.5/node/node.go:929 +0x59b
github.com/cometbft/cometbft/node.NewNode(0x0?, {0x31a8640?, 0xc0020ce780?}, 0x0?, {0x3197f20?, 0xc0020e99b0?}, 0x1?, 0x46e6a00?, 0x0?, {0x31be6c8, ...}, ...)
        github.com/cometbft/cometbft@v0.37.5/node/node.go:849 +0xa9
github.com/cosmos/cosmos-sdk/server.startInProcess(_, {{0x0, 0x0, 0x0}, {0x31d46e0, 0xc000ed5320}, 0x0, {0xc000ef4a80, 0x4}, {0x31e66c0, ...}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.47.8/server/start.go:372 +0x1597
github.com/cosmos/cosmos-sdk/server.StartCmd.func2.2()
        github.com/cosmos/cosmos-sdk@v0.47.8/server/start.go:153 +0x45
github.com/cosmos/cosmos-sdk/server.wrapCPUProfile.func2()
        github.com/cosmos/cosmos-sdk@v0.47.8/server/start.go:617 +0x23
created by github.com/cosmos/cosmos-sdk/server.wrapCPUProfile in goroutine 1
        github.com/cosmos/cosmos-sdk@v0.47.8/server/start.go:616 +0x23f
melekes commented 1 month ago

I believe this is a Cosmos SDK issue. The change is breaking, yes. We should've bumped the major version.

melekes commented 1 month ago

We've decided to retract the v0.14 and v0.15 versions. And release v1.0.0 to indicate a breaking nature of https://github.com/cometbft/cometbft-db/pull/168

cc @cometbft/engineering