cli icon indicating copy to clipboard operation
cli copied to clipboard

Potential error in ConsensusVersion template

Open jhlq opened this issue 3 years ago • 2 comments

https://github.com/tendermint/starport/blob/75b6421ed6d680789b784090a8d53c82774fc764/starport/templates/module/create/stargate/x/%7B%7BmoduleName%7D%7D/module.go.plush#L168

The Cosmos docs says the initial ConsensusVersion() must be set to 1: https://docs.cosmos.network/master/building-modules/upgrade.html

Here it is set to 2, I asked about this in the Starport discord and Denis Fadeev said it might be a bug and that I should open an issue.

If this is an error I'd be happy to submit a PR, there is also a line in the docs that needs to be modified.

jhlq avatar Feb 19 '22 19:02 jhlq

I've noticed the same thing and it's making upgrade module unhappy :). It still returns version 2: https://github.com/ignite/cli/blob/develop/ignite/templates/module/create/stargate/x/%7B%7BmoduleName%7D%7D/module.go.plush#L168

Vizualni avatar Jul 18 '22 11:07 Vizualni

The cosmos docs says the initial value must be 1, to avoid potential errors with default values (0), but it can be greater.

If during an upgrade you introduce a breaking change in your module, you have to increment the returned value. I can't explain why the initial value has been set to 2 for CLI, but I don't think that's a problem.

tbruyelle avatar Jul 21 '22 12:07 tbruyelle

Consensus version has been set to 1.

https://github.com/ignite/cli/blob/7c836df5ec90e9a7abd15a114cd6ec2b10969a27/ignite/templates/module/create/stargate/x/%7B%7BmoduleName%7D%7D/module.go.plush#L153

fadeev avatar Sep 17 '22 07:09 fadeev