Skip to content

CLI bug: testnet command can't generate configuration for local validators on version 4.0.0-rc1 #335

@nman98

Description

@nman98

Summary of Bug

There are 2 commands affected by this problem:

  1. The CLI command atomoned testnet init-files produces an error for hrp claiming bech32 prefix doesn't match and expects atone prefix, where it should use atonevaloper.
  2. The second CLI command atomoned testnet start --v 4 --minimum-gas-prices 0.000006stake --output-dir .testnets/ can be used to initiate files and run the testnet at the same time. It is possible since it also needs to initiate files as the command above the error is connected. However the program seems to panic as it tries to create a temporary directory.

Version

Affected version: cd26cec, v4.0.0-rc1
Last known working version: 4631da0, v3.3.0

Steps to Reproduce

Run next commands using the affected binary version, v4.0.0-rc1.

For first CLI command run atomoned testnet init-files and the result should be:

Error: hrp does not match bech32 prefix: expected 'atone' got 'atonevaloper': internal logic error
Usage:
  atomoned testnet init-files [flags]

Flags:
      --chain-id string              genesis file chain-id, if left blank will be randomly created
  -h, --help                         help for init-files
      --key-type string              Key signing algorithm to generate keys for (default "secp256k1")
      --keyring-backend string       Select keyring's backend (os|file|test) (default "os")
      --minimum-gas-prices string    Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake) (default "0.000006stake")
      --node-daemon-home string      Home directory of the node's daemon configuration (default "simd")
      --node-dir-prefix string       Prefix the directory name for each node with (node results in node0, node1, ...) (default "node")
  -o, --output-dir string            Directory to store initialization data for the testnet (default "./.testnets")
      --starting-ip-address string   Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...) (default "192.168.0.1")
      --v int                        Number of validators to initialize the testnet with (default 4)

Global Flags:
      --home string         directory for config and data (default "/home/nm/.atomone")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info")
      --log_no_color        Disable colored logs
      --trace               print out full stack trace on errors

hrp does not match bech32 prefix: expected 'atone' got 'atonevaloper': internal logic error [cosmos/cosmos-sdk@v0.53.4/codec/address/bech32_codec.go:37]

For the second CLI command run atomoned testnet start --v 4 --minimum-gas-prices 0.000006stake --output-dir .testnets/:

panic: failed creating temporary directory: mkdirtemp /home/nm/.atomone: pattern contains path separator

goroutine 1 [running]:
github.com/atomone-hub/atomone/cmd/atomoned/cmd.NewTestNetworkFixture()
        github.com/atomone-hub/atomone/cmd/atomoned/cmd/testnet.go:545 +0x474
github.com/cosmos/cosmos-sdk/testutil/network.DefaultConfig(_)
        github.com/cosmos/cosmos-sdk@v0.53.4/testutil/network/network.go:138 +0x4d
github.com/atomone-hub/atomone/cmd/atomoned/cmd.startTestnet(0xabfa86a3b08, {{0x3d61913, 0x9}, {0xabfa94afd40, 0x14}, {0x0, 0x0}, 0x0, {0xabfaa22bcb0, 0xe}, ...})
        github.com/atomone-hub/atomone/cmd/atomoned/cmd/testnet.go:502 +0x31
github.com/atomone-hub/atomone/cmd/atomoned/cmd.testnetStartCmd.func1(0xabfa86a3b08, {0xabfa8cf73e0?, 0x0?, 0x6?})
        github.com/atomone-hub/atomone/cmd/atomoned/cmd/testnet.go:196 +0x493
github.com/spf13/cobra.(*Command).execute(0xabfa86a3b08, {0xabfa8cf7380, 0x6, 0x6})
        github.com/spf13/cobra@v1.10.1/command.go:1015 +0xb14
github.com/spf13/cobra.(*Command).ExecuteC(0xabfa86a2f08)
        github.com/spf13/cobra@v1.10.1/command.go:1148 +0x465
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.10.1/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        github.com/spf13/cobra@v1.10.1/command.go:1064
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0xabfa86a2f08, {0x0, 0x0}, {0xabfa84a0d08, 0x11})
        github.com/cosmos/cosmos-sdk@v0.53.4/server/cmd/execute.go:34 +0x187
main.main()
        github.com/atomone-hub/atomone/cmd/atomoned/main.go:16 +0x33

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
  • Is a spike necessary to map out how the issue should be approached?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions