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

bug(export): genesis.json shows some plain-text logs #13331

Closed
5 tasks
okwme opened this issue Sep 19, 2022 · 5 comments · Fixed by #13802
Closed
5 tasks

bug(export): genesis.json shows some plain-text logs #13331

okwme opened this issue Sep 19, 2022 · 5 comments · Fixed by #13802

Comments

@okwme
Copy link
Contributor

okwme commented Sep 19, 2022

@Pantani commented on Tue Sep 06 2022

Summary of Bug

Export genesis JSON from a local chain will add some log lines to the begging of the file.

Version

v7.0.3

Steps to Reproduce

  • run a local chain
  • stop the node
  • export the genesis: gaiad export --for-zero-height --height=5 > local-genesis.json
12:35PM INF asserting crisis invariants inv=1/13 module=x/crisis name=distribution/nonnegative-outstanding
12:35PM INF asserting crisis invariants inv=2/13 module=x/crisis name=distribution/can-withdraw
12:35PM INF asserting crisis invariants inv=3/13 module=x/crisis name=distribution/reference-count
12:35PM INF asserting crisis invariants inv=4/13 module=x/crisis name=distribution/module-account
12:35PM INF asserting crisis invariants inv=5/13 module=x/crisis name=liquidity/escrow-amount
12:35PM INF asserting crisis invariants inv=6/13 module=x/crisis name=bank/nonnegative-outstanding
12:35PM INF asserting crisis invariants inv=7/13 module=x/crisis name=bank/total-supply
12:35PM INF asserting crisis invariants inv=8/13 module=x/crisis name=gov/module-account
12:35PM INF asserting crisis invariants inv=9/13 module=x/crisis name=staking/module-accounts
12:35PM INF asserting crisis invariants inv=10/13 module=x/crisis name=staking/nonnegative-power
12:35PM INF asserting crisis invariants inv=11/13 module=x/crisis name=staking/positive-delegation
12:35PM INF asserting crisis invariants inv=12/13 module=x/crisis name=staking/delegator-shares
12:35PM INF asserting crisis invariants inv=13/13 module=x/crisis name=group/Group-TotalWeight
12:35PM INF asserted all invariants duration=2.899084 height=5 module=x/crisis
{"app_hash":"","app_state":{"auth":{"accounts":[{"@type":"/cosmos.auth.v1beta1.BaseAccount","account_number":"2","address":"cosmos1y2krvz7ex966mtlyf00s76a8d3l0xzhe7t4nk3","pub_key":null,"sequence":"0"}....
...

Solution

Remove the stdout from the context logger for the export command.


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 commented on Mon Sep 19 2022

could be related to this: #8498

@alexanderbez
Copy link
Contributor

Mhhh smells like a regression :/

@tac0turtle
Copy link
Member

It looks like crisis invariants are run on export, if you skip them does it fix the issue you are running into?

@alexanderbez
Copy link
Contributor

Either way, we should ensure the output goes to dev/null unless the invariants fail.

@jacobhjkim
Copy link

jacobhjkim commented Nov 8, 2022

@alexanderbez What about writing genesis to a file instead of printing to stdout? We could add a flag like below.

Usage:
  simd export [flags]

Flags:
      --output string                  Output file path (default "./genesis.json")

Even if we eliminate invariants logs, simd export has other info and warning messages printed to the stdout.

For example:

Is there an easy way to send info logs to /dev/null?

@alexanderbez
Copy link
Contributor

@jacobhjkim I'm in favor of that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
@okwme @alexanderbez @tac0turtle @jacobhjkim and others