Skip to content

Commit

Permalink
don't validate genesis for statesync mode (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang authored Feb 18, 2022
1 parent 7e154f1 commit 6b1d032
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pystarport/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,6 @@ def create_account(cli, account, use_ledger=False):
config.get("genesis", {}),
)
(data_dir / "genesis.json").write_text(json.dumps(genesis))
cli.validate_genesis()

# create accounts
accounts = []
Expand Down Expand Up @@ -864,6 +863,12 @@ def create_account(cli, account, use_ledger=False):
jsonmerge.merge(config.get("app-config", {}), val.get("app-config", {})),
)

# if the first validator is using statesync mode, then don't validate genesis,
# because the new binary may be a breaking one.
doc = tomlkit.parse((data_dir / "node0/config/config.toml").read_text())
if not doc["statesync"]["enable"]:
cli.validate_genesis()

# write supervisord config file
with (data_dir / SUPERVISOR_CONFIG_FILE).open("w") as fp:
write_ini(
Expand Down

0 comments on commit 6b1d032

Please sign in to comment.