tendermint / spn

A blockchain to launch blockchains.
Other
112 stars 41 forks source link

Error that should never occur when publishing a chain #966

Closed lostak closed 1 year ago

lostak commented 2 years ago

https://github.com/tendermint/spn/blob/142531a50099c9af3c0c7d69133b8143061161f0/x/launch/types/initial_genesis.go#L59

When I run $ ignite n chain publish https://github.com/crow-labs/zeta I get the following output:

✔ Source code fetched
✔ Blockchain set up
✔ Chain's binary built
✔ Blockchain initialized
✔ Genesis initialized
error code: '4' msg: 'unrecognized initial genesis: the initial genesis is invalid'

Was told this should never occur

fadeev commented 2 years ago

@lostak could you also share details of your environment with ignite version?

I couldn't reproduce this:

~ ignite n chain publish github.com/crow-labs/zeta
✔ Source code fetched
✔ Blockchain set up
✔ Chain's binary built
✔ Blockchain initialized
✔ Genesis initialized
✔ Network published 
⋆ Launch ID: 24 

(it also worked for me on Gitpod)

lostak commented 1 year ago

Ignite CLI version: v0.24.0 Ignite CLI build date: 2022-09-12T14:14:32Z Ignite CLI source hash: 21c6430cfcc17c69885524990c448d4a3f56461c Your OS: linux Your arch: amd64 Your Node.js version: v16.17.1 Your go version: go version go1.18.1 linux/amd64 Your uname -a: Linux universe 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux Your cwd: /home/lostak Is on Gitpod: false

I got the same error when I ran the command on WSL on a different computer

aljo242 commented 1 year ago

I also was unable to reproduce. Will be looking into this more.

lostak commented 1 year ago

I got the same error on Gitpod. Is there anything else I may need to install?

gitpod /workspace/zeta (main) $ go version
go version go1.19 linux/amd64
gitpod /workspace/zeta (main) $ sudo curl https://get.ignite.com/cli! | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3967    0  3967    0     0  29827      0 --:--:-- --:--:-- --:--:-- 30053
Installing ignite v0.24.0.....
######################################################################## 100.0%
Installed at /usr/local/bin/ignite
gitpod /workspace/zeta (main) $ ignite version
Ignite CLI version:     v0.24.0
Ignite CLI build date:  2022-09-12T14:14:32Z
Ignite CLI source hash: 21c6430cfcc17c69885524990c448d4a3f56461c
Your OS:                linux
Your arch:              amd64
Your Node.js version:   v16.17.1
Your go version:        go version go1.19 linux/amd64
Your uname -a:          Linux crowlabs-zeta-f2hrqyxgwhz 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Your cwd:               /workspace/zeta
Is on Gitpod:           true

gitpod /workspace/zeta (main) $ ignite n chain publish https://github.com/crow-labs/zeta
✔ Source code fetched
✔ Blockchain set up
✔ Chain's binary built
✔ Blockchain initialized
✔ Genesis initialized
error code: '4' msg: 'unrecognized initial genesis: the initial genesis is invalid'
tbruyelle commented 1 year ago

According to the error message, the current spn chain expects to read a MsgCreateChain.InitialGenesis field, but CLI v0.24.0 doesn't fill it, because it's outdated. Can you confirm @lubtd @aljo242 ?

lumtis commented 1 year ago

According to the error message, the current spn chain expects to read a MsgCreateChain.InitialGenesis field, but CLI v0.24.0 doesn't fill it, because it's outdated. Can you confirm @lubtd @aljo242 ?

We refactored MsgCreateChain to include a generic field InitialGenesis instead of a GenesisURL and GenesisHash field and using DefaultInitialGenesis when GenesisURL was set to 0 https://github.com/tendermint/spn/pull/958

Therefore if an older version of the CLI is used, InitialGenesis will not be set in MsgCreateChain sent to spn, and it will be recognized as an invalid genesis

@lostak

silverstr89 commented 1 year ago

i also got same trouble

tbruyelle commented 1 year ago

@silverstr89 @lostak It should work with the latest nightly release https://github.com/ignite/cli/releases/tag/nightly

silverstr89 commented 1 year ago

it is working now! thank you so much!

lumtis commented 1 year ago

Great, closing the issue right now as the solution is to upgrade Ignite CLI on your machine