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

go/oasis-node/cmd/genesis: Add convert CLI command #3290

Closed
wants to merge 2 commits into from

Conversation

tjanez
Copy link
Member

@tjanez tjanez commented Sep 18, 2020

It can be used to convert a given genesis file to the canonical form.

@tjanez tjanez added the c:cli Category: command line interface label Sep 18, 2020
@tjanez tjanez force-pushed the tjanez/canonical-genesis-convert branch from 60d51ee to d21d269 Compare September 18, 2020 13:15
@tjanez tjanez marked this pull request as ready for review September 18, 2020 13:16
@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #3290 into master will increase coverage by 0.13%.
The diff coverage is 19.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3290      +/-   ##
==========================================
+ Coverage   65.16%   65.30%   +0.13%     
==========================================
  Files         371      371              
  Lines       33016    33021       +5     
==========================================
+ Hits        21514    21563      +49     
+ Misses       8335     8291      -44     
  Partials     3167     3167              
Impacted Files Coverage Δ
go/oasis-node/cmd/genesis/genesis.go 49.16% <19.04%> (-2.40%) ⬇️
go/oasis-node/cmd/common/metrics/disk.go 65.38% <0.00%> (-19.24%) ⬇️
go/worker/compute/executor/committee/state.go 71.42% <0.00%> (-14.29%) ⬇️
go/oasis-node/cmd/common/metrics/resource.go 78.94% <0.00%> (-10.53%) ⬇️
go/consensus/tendermint/abci/state/state.go 54.54% <0.00%> (-9.10%) ⬇️
.../consensus/tendermint/apps/epochtime_mock/state.go 75.00% <0.00%> (-5.00%) ⬇️
go/consensus/tendermint/full/services.go 77.11% <0.00%> (-4.24%) ⬇️
go/worker/compute/executor/committee/node.go 60.15% <0.00%> (-4.14%) ⬇️
...consensus/tendermint/apps/registry/transactions.go 55.80% <0.00%> (-1.66%) ⬇️
go/consensus/tendermint/abci/state.go 66.20% <0.00%> (-1.38%) ⬇️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ef3126...43847a7. Read the comment docs.

@Yawning
Copy link
Contributor

Yawning commented Sep 18, 2020

Why do we need this if it's a one time thing (tooling produces canonical output by default)?

@tjanez
Copy link
Member Author

tjanez commented Sep 18, 2020

Why do we need this if it's a one time thing (tooling produces canonical output by default)?

I guess it could be useful more than once (I'm guessing you meant for converting the proposed Mainnet genesis file) since people could use external tools to assemble a genesis file or do some modifications to a genesis file and then use this CLI command to convert it back to the canonical form.

It can be used to convert a given genesis file to the canonical form.
@tjanez tjanez force-pushed the tjanez/canonical-genesis-convert branch from d21d269 to 43847a7 Compare September 18, 2020 20:06
@Yawning
Copy link
Contributor

Yawning commented Sep 21, 2020

I am against this.

  • The utility seems dubious at best.
  • There is no need for this to be a sub-command of oasis-node.
  • There are already too many sub-commands that quite honestly should be moved to elsewhere.

The first step to fixing the sub-command situation is, not actively making the problem worse.

@tjanez
Copy link
Member Author

tjanez commented Sep 21, 2020

I am against this.

Yea, agreed. The usefulness vs. maintenance burden ratio is too low.

If we need this for a one-off thing, I can do the conversion manually.

@tjanez tjanez closed this Sep 21, 2020
@tjanez tjanez deleted the tjanez/canonical-genesis-convert branch September 21, 2020 13:02
@ravenac95 ravenac95 restored the tjanez/canonical-genesis-convert branch November 13, 2020 17:37
@ravenac95 ravenac95 deleted the tjanez/canonical-genesis-convert branch November 13, 2020 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:cli Category: command line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants