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

Epoching AnteHandler rejects genesis staking transactions #36

Closed
vitsalis opened this issue Jun 29, 2022 · 5 comments · Fixed by #41
Closed

Epoching AnteHandler rejects genesis staking transactions #36

vitsalis opened this issue Jun 29, 2022 · 5 comments · Fixed by #41
Labels
bug Something isn't working

Comments

@vitsalis
Copy link
Member

Currently, the chain cannot bootstrap:

>>> make localnet-start
...
>>> cat .testnets/node0/babylond/babylond.log
....
panic: internal

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/x/genutil.DeliverGenTxs({{0x1d71888, 0x4000126000}, {0x1d95a80, 0x4000172c00}, {{0x0, 0x0}, {0x4000d542b0, 0xc}, 0x0, {0x3b88bb77, ...}, ...}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.45.4/x/genutil/gentx.go:113 +0x228
github.com/cosmos/cosmos-sdk/x/genutil.InitGenesis(...)
        github.com/cosmos/cosmos-sdk@v0.45.4/x/genutil/genesis.go:18
github.com/cosmos/cosmos-sdk/x/genutil.AppModule.InitGenesis({{}, {0x1d56530, 0x400003eb40}, {0x1d3ba80, 0x4000cd5130}, 0x400152c690, {0xffff85cd9498, 0x400007a040}}, {{0x1d71888, 0x4000126000}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.45.4/x/genutil/module.go:99 +0x108
github.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(0x4000272300, {{0x1d71888, 0x4000126000}, {0x1d95a80, 0x4000172c00}, {{0x0, 0x0}, {0x4000d542b0, 0xc}, 0x0, ...}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.45.4/types/module/module.go:320 +0x204
github.com/babylonchain/babylon/app.(*BabylonApp).InitChainer(0x40000a9200, {{0x1d71888, 0x4000126000}, {0x1d95a80, 0x4000172c00}, {{0x0, 0x0}, {0x4000d542b0, 0xc}, 0x0, ...}, ...}, ...)
        github.com/babylonchain/babylon/app/app.go:522 +0x198
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0x400101f040, {{0x3b88bb77, 0xeda4e2881, 0x0}, {0x4000d542b0, 0xc}, 0x4000dce180, {0x2ae2360, 0x0, 0x0}, ...})
        github.com/cosmos/cosmos-sdk@v0.45.4/baseapp/abci.go:62 +0x330
github.com/tendermint/tendermint/abci/client.(*localClient).InitChainSync(0x400018c300, {{0x3b88bb77, 0xeda4e2881, 0x0}, {0x4000d542b0, 0xc}, 0x4000dce180, {0x2ae2360, 0x0, 0x0}, ...})
        github.com/tendermint/tendermint@v0.34.19/abci/client/local_client.go:272 +0x118
github.com/tendermint/tendermint/proxy.(*appConnConsensus).InitChainSync(0x40000a16e0, {{0x3b88bb77, 0xeda4e2881, 0x0}, {0x4000d542b0, 0xc}, 0x4000dce180, {0x2ae2360, 0x0, 0x0}, ...})
        github.com/tendermint/tendermint@v0.34.19/proxy/app_conn.go:77 +0x58
github.com/tendermint/tendermint/consensus.(*Handshaker).ReplayBlocks(0x400105df50, {{{0xb, 0x0}, {0x14a4fd7, 0x7}}, {0x4000d542b0, 0xc}, 0x1, 0x0, {{0x0, ...}, ...}, ...}, ...)
        github.com/tendermint/tendermint@v0.34.19/consensus/replay.go:319 +0xc98
github.com/tendermint/tendermint/consensus.(*Handshaker).Handshake(0x400105df50, {0x1d96b68, 0x4000cd8000})
        github.com/tendermint/tendermint@v0.34.19/consensus/replay.go:268 +0x3f8
github.com/tendermint/tendermint/node.doHandshake({0x1d92468, 0x400016e970}, {{{0xb, 0x0}, {0x14a4fd7, 0x7}}, {0x4000d542b0, 0xc}, 0x1, 0x0, ...}, ...)
        github.com/tendermint/tendermint@v0.34.19/node/node.go:325 +0x128
github.com/tendermint/tendermint/node.NewNode(0x4000e6a000, {0x1d540d0, 0x4000c25360}, 0x400152d9e0, {0x1d39440, 0x400000f5a8}, 0x400152da50, 0x1b59a58, 0x400152dbf0, {0x1d725a8, ...}, ...)
        github.com/tendermint/tendermint@v0.34.19/node/node.go:733 +0x534
github.com/cosmos/cosmos-sdk/server.startInProcess(0x4000f20d80, {{0x0, 0x0, 0x0}, {0x1da5018, 0x400016d110}, {0x0, 0x0}, {0x1d7a3c0, 0x4000ce2240}, ...}, ...)
        github.com/cosmos/cosmos-sdk@v0.45.4/server/start.go:272 +0x7c0
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0x40000b8780, {0x4000e7e900, 0x0, 0x4})
        github.com/cosmos/cosmos-sdk@v0.45.4/server/start.go:126 +0x12c
github.com/spf13/cobra.(*Command).execute(0x40000b8780, {0x4000e7e8c0, 0x4, 0x4})
        github.com/spf13/cobra@v1.4.0/command.go:856 +0x678
github.com/spf13/cobra.(*Command).ExecuteC(0x4000596280)
        github.com/spf13/cobra@v1.4.0/command.go:974 +0x424
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.4.0/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        github.com/spf13/cobra@v1.4.0/command.go:895
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x4000596280, {0x4000121260, 0x11})
        github.com/cosmos/cosmos-sdk@v0.45.4/server/cmd/execute.go:36 +0x23c
main.main()
        github.com/babylonchain/babylon/cmd/babylond/main.go:18 +0x48

If the change introduced by #18 inside x/epoching/keeper/drop_validator_msg_decorator.go is reverted, the code works fine.

@SebastianElvis @aakoshh thoughts? If an immediate fix is not available, I suggest reverting the commit because it is currently blocking development on other features since the chain can't be ran.

@vitsalis vitsalis added the bug Something isn't working label Jun 29, 2022
@SebastianElvis
Copy link
Member

Thanks for the finding and adding this check to CI. I will look into this issue and submit a PR to patch it tomorrow.

@vitsalis
Copy link
Member Author

I suspect that the cause of this issue is that during genesis, a set of validators is created using genesis transactions. This means that we need to modify those transactions that are generated for genesis to transactions that are handled by the epoching module.

@SebastianElvis
Copy link
Member

You are right, the issue's root cause is the module initialisation, including genesis and parameters. The AnteHandler has to skip the genesis so that the genesis transactions can be executed correctly.

I'm working on a PR (#41) to fix this issue, as well as other initialisation stuff of the epoching module, as they need to be done anyway. However, there is a test that constantly fails, blocking this PR. It seems that the issue is also about initialisation, where each module's genesis will be exported to somewhere. Do you have any idea on this?

image

@vitsalis
Copy link
Member Author

vitsalis commented Jun 30, 2022

Just tested it on the branch and I don't get this kind of error. What sequence of commands are you executing?

Maybe you need to remove the directory in which you instantiated the testnet files and rerun. Also, ignite chain serve --reset-once --verbose might come in handy for quick testing.

@SebastianElvis
Copy link
Member

Just tested it on the branch and I don't get this kind of error. What sequence of commands are you executing?

Well I just fixed it 5 min ago in the last commit... I forgot adding some stuff in app.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants