Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

genesis incompatibility between versions #1950

Closed
5 tasks
greg-szabo opened this issue Dec 8, 2022 · 11 comments
Closed
5 tasks

genesis incompatibility between versions #1950

greg-szabo opened this issue Dec 8, 2022 · 11 comments
Assignees

Comments

@greg-szabo
Copy link
Member

Summary of Bug

The Cosmos Hub (cosmoshub-4) genesis file does not pass the validate-genesis test with gaiad v7.1.0. Notably:

$ gaiad-v7.1.0-darwin-amd64 validate-genesis
Error: error validating genesis file config/genesis.json: failed to unmarshal authz genesis state: EOF
Usage:
  gaiad validate-genesis [file] [flags]

Flags:
  -h, --help   help for validate-genesis

Global Flags:
      --home string         directory for config and data (default "/Users/greg/.gaia")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --trace               print out full stack trace on errors

Version

v7.1.0, v7.0.1, possibly others
The binary is the MacOS release from this repo.

Steps to Reproduce

# gaiad init something
$ wget -O $HOME/.gaia/config/genesis.json.gz https://github.com/cosmos/mainnet/raw/master/genesis/genesis.cosmoshub-4.json.gz
$ gunzip $HOME/.gaia/config/genesis.json.gz
$ gaiad validate-genesis

Expected resolution

I understand that newer versions of gaiad will introduce new features but we should have a way to still validate the genesis of yesteryear so a new node can start up, for example, using statesync.


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?
@okwme
Copy link
Contributor

okwme commented Dec 9, 2022

thanks for the issue @greg-szabo !
we ran into something similar earlier this year with the content of the bank module (#1384). It was fixed here but I believe it came about from a bad migration of the bank module initially. This issue could come from the same thing but with the authz module based on the error.

This should be fixed but just an additional point: you don't need to have the correct genesis for statesync. In fact you can have a completely blank genesis as long as the chain-id is correct.

@okwme
Copy link
Contributor

okwme commented Dec 13, 2022

Actually can you confirm @greg-szabo , are you requesting the ability to validate a previous version of gaia's genesis with a more recent version? For instance gaia v6.0.0 exported genesis (cosmoshub-4) being bale to be validated by v7.1.0 gaia?

@mpoke
Copy link
Contributor

mpoke commented Jan 20, 2023

@glnro @yaruwangway will this issue be fixed by the migration code in v8?

@glnro
Copy link
Contributor

glnro commented Jan 20, 2023

We fixed export on a clean genesis, I can double check on stateful genesis.

@yaruwangway
Copy link
Contributor

yaruwangway commented Jan 20, 2023

Hi, I think this is still not working .failed to unmarshal authz genesis state: EOF with v8

@glnro
Copy link
Contributor

glnro commented Jan 22, 2023

Exported a genesis from a localnet with v8.0.0-rc3 successfully and confirmed it was a valid genesis.

@yaruwangway
Copy link
Contributor

yaruwangway commented Jan 23, 2023

the genesis is from here, this is testing backward compatibility? @glnro

@glnro
Copy link
Contributor

glnro commented Jan 23, 2023

This isn't a bug, rather it might be a feature we may want to support in the future.

@glnro
Copy link
Contributor

glnro commented Jan 23, 2023

@julienrbrt is validating previous versions of genesis files something the sdk could support in the future? At present, my understanding is there's no way for the sdk to be able to know which version to validate against (except the current), so the expected behavior in this case would be that this fails validation.

@julienrbrt
Copy link
Member

@julienrbrt is validating previous versions of genesis files something the sdk could support in the future? At present, my understanding is there's no way for the sdk to be able to know which version to validate against (except the current), so the expected behavior in this case would be that this fails validation.

I don't think validating a previous genesis with a new binary should be supported.
IMHO if there is a breaking change in the genesis that makes it invalid with a new version, the genesis should be migrated to a valid genesis for that version.

Currently, the SDK supports genesis migration, but only for different SDK versions (simd genesis migrate 0.xx).
We will eventually support the addition of genesis migration set by an app: cosmos/cosmos-sdk#5041.

mergify bot pushed a commit to cosmos/cosmos-sdk that referenced this issue Apr 4, 2023
## Description

Closes: #5041
ref: cosmos/gaia#1950 (comment)

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

* [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
* [ ] added `!` to the type prefix if API or client breaking change
* [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
* [ ] provided a link to the relevant issue or specification
* [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules)
* [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
* [ ] added a changelog entry to `CHANGELOG.md`
* [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
* [ ] updated the relevant documentation or specification
* [ ] reviewed "Files changed" and left comments if necessary
* [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

* [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
* [ ] confirmed `!` in the type prefix if API or client breaking change
* [ ] confirmed all author checklist items have been addressed 
* [ ] reviewed state machine logic
* [ ] reviewed API design and naming
* [ ] reviewed documentation is accurate
* [ ] reviewed tests and test coverage
* [ ] manually tested (if applicable)
@glnro
Copy link
Contributor

glnro commented Apr 14, 2023

Closing this as the fix for this issue is forthcoming once the Hub updates the SDK to v0.47. #2402 acceptance criteria includes migrating and uploading a valid genesis.json that can be validated.

@glnro glnro closed this as completed Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

No branches or pull requests

6 participants