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

Embed Genesis #677

Closed
4 tasks
faddat opened this issue Feb 22, 2021 · 7 comments
Closed
4 tasks

Embed Genesis #677

faddat opened this issue Feb 22, 2021 · 7 comments

Comments

@faddat
Copy link
Contributor

faddat commented Feb 22, 2021

Summary

Go 1.16 has support for embed and gaia could carry mainnet genesis with her in the default build.

Problem Definition

  • Chasing down the genesis.json file increases "time to fully operational node"

Proposal

The cosmos SDK expects that genesis.json is always in the home directory. We can modify the cosmos SDK to support embedded genesis. When it does not find one, it falls back to looking in the home directory.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@faddat faddat mentioned this issue Feb 22, 2021
4 tasks
@shahankhatch
Copy link
Contributor

While I support the notion of having mainnet genesis automatically available, I'm not in favour of the embed approach on this gaia repo for the following reasons:

  • does not follow a practice of separating data from code
  • gaia has releases with increasing frequency, but the genesis will be fairly static
  • each platform binary generated from reproducible builds, even if the genesis is 20MB compressed, unnecessarily bloats the size of releases by 50% just to carry fairly-static data
  • It's straightforward to include a command to download the genesis before startup or on build for mainnet that can achieve this, while maintaining the genesis file in a separate location outside of the code repo

@faddat
Copy link
Contributor Author

faddat commented Feb 22, 2021

So I am looking at it from more of a user perspective -- people currently have trouble getting their node going for the first time, mainly due to issues with seeds and genesis.

This said there are other ways to skin the cat, but Docker really did not look like one of them. The genesis, I'd imagine, will be entirely static, until a new network is launched, right?

Thinking is to reduce the user-workload to simply downloading gaiad.

@cosmos cosmos deleted a comment from workshub bot Feb 24, 2021
@shahankhatch
Copy link
Contributor

Yes, the genesis will be static until the next upgrade.

The idea you mentioned of using curl still appeals to me. wdyt of using that for seeds and genesis?

@faddat
Copy link
Contributor Author

faddat commented Feb 24, 2021

I did it once, and could do it again-- in fact, I just noticed that we're shipping compiled binaries now, means that the majority of this is a cherry pick away.

https://github.com/galaxypi/galaxy/blob/master/install.sh

In that repository there's a mac flavored script and a linux-flavored script, but while writing this I realized there's a practical way to support both OSes from the same script without much difficulty. Does the approach in that script work for you?

Thinking it may be best to remove the uninstaller lest someone delete their precious information.

If that approach works, I can close these two issues and open up a One-Liner Install issue.

@andynog
Copy link

andynog commented Feb 25, 2021

Agree with @shahankhatch, not a big fan of combining data and code, might lead into other problems. Not sure how embed in Go 1.16 is implemented but if it has to read the all the bytes in memory might not be feasible because the genesis uncompressed is getting larger and this would require a good amount of RAM, not sure exactly how the SDK process the genesis but I believe it might parse it so it is like processing chunks then having it separate would probably be better.

@cosmos cosmos deleted a comment from workshub bot Feb 26, 2021
@faddat
Copy link
Contributor Author

faddat commented Feb 27, 2021

Alright, I think that these two issues can be closed, since it seems that we should keep from shipping state with Gaia.

I'll make an issue for the one-liner install and adapt the Galaxy installer to Gaia's needs.

I'll also take the embed seeds issue, and move it over to the SDK repo.

@faddat
Copy link
Contributor Author

faddat commented Feb 27, 2021

Discussion moved here:

cosmos/cosmos-sdk#8720

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

3 participants