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

Exported genesis can't be validated using gaiad validate-genesis #1384

Closed
4 tasks
uditvira opened this issue Apr 5, 2022 · 6 comments
Closed
4 tasks

Exported genesis can't be validated using gaiad validate-genesis #1384

uditvira opened this issue Apr 5, 2022 · 6 comments
Assignees

Comments

@uditvira
Copy link
Contributor

uditvira commented Apr 5, 2022

Summary of Bug

If you use gaiad validate-genesis to validate an exported genesis from the Cosmos Hub mainnet, you get the following error:

Error: error validating genesis file mainnet-genesis.json: name field cannot be blank

This was reproduced by @ASoTNetworks

Version

I've reproduced this with gaiad 6.00 and 6.0.4

Steps to Reproduce

  1. Stop a synced node
  2. Export a genesis file gaiad --for-zero-height --height=9961097 &> mainnet-genesis.json (Notice I need to use &> and not > to dump contents into a file, because gaiad is writing output to stderr and not stdout. This is an unrelated issue)
  3. gaiad validate-genesis mainnet-genesis.json

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@okwme
Copy link
Contributor

okwme commented Apr 11, 2022

@alexanderbez you helped confirm this issue, is there a summary of what needs to be fixed in a future release to address the issue?

@glnro
Copy link
Contributor

glnro commented Apr 11, 2022

Yeah just to confirm this would be in Rho...we'd need to add two lines I think in SetUpgradeHandler

banktypes.DefaultGenesisState().DenomMetadata[0].Name = "Cosmos Hub Atom"
banktypes.DefaultGenesisState().DenomMetadata[0].Symbol = "ATOM"

@yaruwangway
Copy link
Contributor

hi, here is the fix for export to stdout, not stderr.
cosmos/cosmos-sdk#11844

@mmulji-ic mmulji-ic added the rho label Aug 15, 2022
@Pantani Pantani self-assigned this Aug 30, 2022
@Pantani
Copy link
Contributor

Pantani commented Sep 2, 2022

@uditvira, can you please check the beginning of the genesis.json, if the JSON looks consistent or if there are any logs?

Can you also try it to export the JSON?
gaiad export --for-zero-height --height=9961097 2> mainnet-genesis.json

@Pantani
Copy link
Contributor

Pantani commented Sep 6, 2022

I found two bugs regarding the export and validate-genesis commands.

{
  "app_state": {
    "authz": {},
    "packetfowardmiddleware": {
      "params": {
        "fee_percentage": "0.000000000000000000"
      }
    },
    "interchainaccounts": {
      "host_genesis_state": {
        "port": "icahost"
      }
    },
    "liquidity": {
      "params": {
        "pool_types": [
          {
            "id": 1,
            "name": "StandardLiquidityPool",
            "min_reserve_coin_num": 2,
            "max_reserve_coin_num": 2,
            "description": "Standard liquidity pool with pool price function X/Y, ESPM constraint, and two kinds of reserve coins"
          }
        ],
        "min_init_deposit_amount": "1000000",
        "init_pool_coin_mint_amount": "1000000",
        "max_reserve_coin_amount": "0",
        "pool_creation_fee": [
          {
            "denom": "stake",
            "amount": "40000000"
          }
        ],
        "swap_fee_rate": "0.003000000000000000",
        "withdraw_fee_rate": "0.000000000000000000",
        "max_order_amount_ratio": "0.100000000000000000",
        "unit_batch_height": 1,
        "circuit_breaker_enabled": false
      },
      "pool_records": []
    },
    "bank": {
      "denom_metadata": [
        {
          "name": "Cosmos Hub Atom",
          "symbol": "ATOM"
        }
      ]
    },
    "ibc": {
      "connection_genesis": {
        "params": {
          "max_expected_time_per_block": 30000000000
        }
      }
    }
  }
}

@okwme
Copy link
Contributor

okwme commented Oct 10, 2022

think we just need to hard code our bank metadata in our initgenesis or export genesis for gaia
https://docs.cosmos.network/main/architecture/adr-024-coin-metadata.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants