terra-money / LocalTerra

One-click local Terra testnet and ecosystem for rapid prototyping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terrad runtime error

pronvis opened this issue · comments

terrad container exits with: panic: runtime error: invalid memory address or nil pointer dereference

Steps to reproduce:

  1. clone repo
  2. docker-compose up
  3. docker logs localterra_terrad_1 -> panic: unknown field "base_pool" in types.Params
  4. ok, change that field in config/genesis.json:
{
    "market": {
      "params": {
        "base_pool": "7000000000000.000000000000000000", <<< rename to 'mint_base_pool'
        "pool_recovery_period": "200",
        "min_stability_spread": "0.005000000000000000"
      }
    }
}
  1. try again docker-compose down, docker-compose up, wait a bit, docker logs localterra_terrad_1:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x19d1dc6]

goroutine 1 [running]:
math/big.(*Int).Sign(...)
        math/big/int.go:39
github.com/cosmos/cosmos-sdk/types.Dec.IsNegative(...)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/types/decimal.go:203
github.com/terra-money/core/x/market/types.validateMintBasePool(0x24dcbe0, 0x0, 0x199, 0x24dcb01)
        github.com/terra-money/core/x/market/types/params.go:92 +0x46
github.com/cosmos/cosmos-sdk/x/params/types.Subspace.SetParamSet(0x2c6b178, 0xc001089cd0, 0xc000c05d70, 0x2c35198, 0xc001231bb0, 0x2c351e8, 0xc001231c80, 0xc00126ff38, 0x6, 0x18, ...)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/x/params/types/subspace.go:236 +0x199
github.com/terra-money/core/x/market/keeper.Keeper.SetParams(...)
        github.com/terra-money/core/x/market/keeper/params.go:42
github.com/terra-money/core/x/market.InitGenesis(0x2c538e8, 0xc000056060, 0x2c6dd60, 0xc0001c6680, 0x0, 0x0, 0xc000c70750, 0xa, 0x0, 0x17a67180, ...)
        github.com/terra-money/core/x/market/genesis.go:15 +0x16f
github.com/terra-money/core/x/market.AppModule.InitGenesis(0x2c70e18, 0xc001089cd0, 0x2c35198, 0xc001231c20, 0x2c6b178, 0xc001089cd0, 0x2c6b178, 0xc001089cd0, 0xc000c05d70, 0x2c35198, ...)
        github.com/terra-money/core/x/market/module.go:151 +0x128
github.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(0xc0010c4690, 0x2c538e8, 0xc000056060, 0x2c6dd60, 0xc0001c6680, 0x0, 0x0, 0xc000c70750, 0xa, 0x0, ...)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/types/module/module.go:306 +0x2b5
github.com/terra-money/core/app.(*TerraApp).InitChainer(0xc001029b00, 0x2c538e8, 0xc000056060, 0x2c6dd60, 0xc0001c6680, 0x0, 0x0, 0xc000c70750, 0xa, 0x0, ...)
        github.com/terra-money/core/app/app.go:614 +0x170
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0xc0011b21a0, 0x17a67180, 0xed840139e, 0x0, 0xc000c70750, 0xa, 0xc00004fae0, 0x3c24490, 0x0, 0x0, ...)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/baseapp/abci.go:62 +0x315
github.com/tendermint/tendermint/abci/client.(*localClient).InitChainSync(0xc000e29aa0, 0x17a67180, 0xed840139e, 0x0, 0xc000c70750, 0xa, 0xc00004fae0, 0x3c24490, 0x0, 0x0, ...)
        github.com/tendermint/tendermint@v0.34.11/abci/client/local_client.go:266 +0x115
github.com/tendermint/tendermint/proxy.(*appConnConsensus).InitChainSync(0xc000c6b310, 0x17a67180, 0xed840139e, 0x0, 0xc000c70750, 0xa, 0xc00004fae0, 0x3c24490, 0x0, 0x0, ...)
        github.com/tendermint/tendermint@v0.34.11/proxy/app_conn.go:77 +0x78
github.com/tendermint/tendermint/consensus.(*Handshaker).ReplayBlocks(0xc000155c18, 0xb, 0x0, 0x25004ad, 0x7, 0xc000c70750, 0xa, 0x1, 0x0, 0x0, ...)
        github.com/tendermint/tendermint@v0.34.11/consensus/replay.go:319 +0x655
github.com/tendermint/tendermint/consensus.(*Handshaker).Handshake(0xc000155c18, 0x2c6f068, 0xc0011f2000, 0x1f4, 0xc001019f60)
        github.com/tendermint/tendermint@v0.34.11/consensus/replay.go:268 +0x458
github.com/tendermint/tendermint/node.doHandshake(0x2c6ac38, 0xc000c6a6d0, 0xb, 0x0, 0x25004ad, 0x7, 0xc000c70750, 0xa, 0x1, 0x0, ...)
        github.com/tendermint/tendermint@v0.34.11/node/node.go:308 +0x1d8
github.com/tendermint/tendermint/node.NewNode(0xc0010fa640, 0x2c48a50, 0xc000026b40, 0xc000c27bc0, 0x2c11620, 0xc00123db60, 0xc000c27c30, 0x29e63a8, 0xc000c27d20, 0x2c545d0, ...)
        github.com/tendermint/tendermint@v0.34.11/node/node.go:715 +0x20e5
github.com/cosmos/cosmos-sdk/server.startInProcess(0xc001152ac0, 0x0, 0x0, 0x0, 0x2c785d8, 0xc0011b9170, 0xc001143ce0, 0xa, 0x2c5db90, 0xc001089cd0, ...)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/server/start.go:261 +0x685
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc001110000, 0x3c24490, 0x0, 0x0, 0x0, 0x0)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/server/start.go:129 +0x209
github.com/spf13/cobra.(*Command).execute(0xc001110000, 0x3c24490, 0x0, 0x0, 0xc001110000, 0x3c24490)
        github.com/spf13/cobra@v1.1.3/command.go:852 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000e7ef00, 0x0, 0x0, 0xc001082b10)
        github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.1.3/command.go:897
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        github.com/spf13/cobra@v1.1.3/command.go:890
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0xc000e7ef00, 0xc001082b10, 0xc, 0x2c70e18, 0xc001089cd0)
        github.com/cosmos/cosmos-sdk@v0.43.0-rc0/server/cmd/execute.go:36 +0x285
main.main()
        github.com/terra-money/core/cmd/terrad/main.go:15 +0x45

docker-compose used old image.
To fix: docker pull terramoney/localterra-core:bombay
Do not edit genesis.conf! Original is working fine!