Is there an existing issue for this?
What happened?
This is how init cmd saves genesis file on v0.47. It uses correct cometbft json pkg to marshal.
func (genDoc *GenesisDoc) SaveAs(file string) error {
genDocBytes, err := cmtjson.MarshalIndent(genDoc, "", " ")
if err != nil {
return err
}
return cmtos.WriteFile(file, genDocBytes, 0644)
}
This is for v0.50.1. It uses default golang json pkg to marshal in x/genutil/types/genesis.go
func (ag *AppGenesis) SaveAs(file string) error {
appGenesisBytes, err := json.MarshalIndent(ag, "", " ")
if err != nil {
return err
}
return os.WriteFile(file, appGenesisBytes, 0o600)
}
This led to confusing error when we tried to run the node, especially after upgrading to v0.50.1, which breaks many stuff.
Cosmos SDK Version
v0.50.1
How to reproduce?
- Run init command on both v0.47.x and v0.50.x to generate genesis files.
- Compare 2 files and see that on v0.47.x it's
"initial_height": **"1"** while on v0.50.x it's "initial_height": **1**
Is there an existing issue for this?
What happened?
This is how init cmd saves genesis file on v0.47. It uses correct cometbft json pkg to marshal.
This is for v0.50.1. It uses default golang json pkg to marshal in
x/genutil/types/genesis.goThis led to confusing error when we tried to run the node, especially after upgrading to v0.50.1, which breaks many stuff.
Cosmos SDK Version
v0.50.1
How to reproduce?
"initial_height": **"1"**while on v0.50.x it's"initial_height": **1**