fetchai / fetchd

Source code for Fetch.ai blockchain nodes
Other
96 stars 40 forks source link

v0.10.5 gives error with "max_wasm_code_size" on genesis file, doesn't sync from scratch #285

Open AronVanAmmers opened 1 year ago

AronVanAmmers commented 1 year ago

Prerequisites

Expected Behavior

Using the latest genesis file: https://github.com/fetchai/genesis-fetchhub/blob/main/fetchhub-4/data/genesis_migrated_5300200.json

Renamed to genesis.json, and placed in the config/ path of the node, the output of fetchd validate-genesis genesis.json should not list any errors. A new, fresh node should be able to start syncing from this genesis file.

Current Behavior

The output of `fetchd validate-genesis is:

Error: error validating genesis file genesis.json: unknown field "max_wasm_code_size" in types.Params
Usage:
  fetchd validate-genesis [file] [flags]

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

Global Flags:
      --home string         directory for config and data (default "/home/fetchd/.fetchd")
      --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

When starting the node, this check is also done, and the node crashes with panic message.

Partial log showing the error:

5:12PM INF ABCI Handshake App Info hash= height=0 module=consensus protocol-version=0 software-version=v0.10.5
5:12PM INF ABCI Replay Blocks appHeight=0 module=consensus stateHeight=0 storeHeight=0
5:12PM INF asserting crisis invariants inv=1/11 module=x/crisis name=distribution/nonnegative-outstanding
5:12PM INF asserting crisis invariants inv=2/11 module=x/crisis name=distribution/can-withdraw
5:13PM INF asserting crisis invariants inv=3/11 module=x/crisis name=distribution/reference-count
5:13PM INF asserting crisis invariants inv=4/11 module=x/crisis name=distribution/module-account
5:13PM INF asserting crisis invariants inv=5/11 module=x/crisis name=staking/module-accounts
5:13PM INF asserting crisis invariants inv=6/11 module=x/crisis name=staking/nonnegative-power
5:13PM INF asserting crisis invariants inv=7/11 module=x/crisis name=staking/positive-delegation
5:13PM INF asserting crisis invariants inv=8/11 module=x/crisis name=staking/delegator-shares
5:13PM INF asserting crisis invariants inv=9/11 module=x/crisis name=bank/nonnegative-outstanding
5:13PM INF asserting crisis invariants inv=10/11 module=x/crisis name=bank/total-supply
5:13PM INF asserting crisis invariants inv=11/11 module=x/crisis name=gov/module-account
5:13PM INF asserted all invariants duration=45141.050308 height=5300201 module=x/crisis
panic: unknown field "max_wasm_code_size" in types.Params
goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/codec.(*ProtoCodec).MustUnmarshalJSON(0x0?, {0xc002fac000?, 0x0?, 0x0?}, {0x2507550?, 0xc022b85800?})
        github.com/cosmos/cosmos-sdk@v0.45.6/codec/proto_codec.go:176 +0x45
github.com/CosmWasm/wasmd/x/wasm.AppModule.InitGenesis({{}, {_, _}, _, {_, _}, {_, _}, {_, _}}, ...)
        github.com/CosmWasm/wasmd@v0.27.0/x/wasm/module.go:161 +0xc2

The panic does not occur on a node that already has chain data. The output of fetchd validate-genesis genesis.json does show the error there however.

To Reproduce

See above.

Context

Fetchd 0.10.5. In the above case the synced node is Ubuntu 20.04 and the fresh node is Ubuntu 22.04. I think it's unlikely that the OS version difference would cause this. I will manually get chain data to the fresh node and test whether the panic then still occurs and update this issue to confirm.

Failure Logs

No response

erNail commented 1 year ago

I have exactly the same problem with the docker image fetchai/fetchd:0.10.7 with Testnet Dorado

EDIT: As a workaround, i am currently using this genesis file EDIT 2: Experiencing the same issue on Mainnet

penghian commented 9 months ago

hi, i am currently facing the same issue, was wondering if you guys manage to solve it.

i took the snapshot from fetch.ai's official docs and still no luck

Screenshot 2023-12-15 at 7 12 23 PM

its able to read the database as you can see there is block height, but same error occurred

penghian commented 9 months ago

small update to anyone in the future, if syncing from 0 it does not work as cosmos sdk now has a new paramenter use snapshot from fetch.ai docs

after doing initialisation from the node remove the wasm folder unpack snapshot to ur .fetchd folder