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

rfc: move examples to gno.land/genesis #1589

Open
thehowl opened this issue Jan 26, 2024 · 4 comments
Open

rfc: move examples to gno.land/genesis #1589

thehowl opened this issue Jan 26, 2024 · 4 comments

Comments

@thehowl
Copy link
Member

thehowl commented Jan 26, 2024

This came up in a conversation w/ @leohhhn. Essentially, the "examples" directory, while useful, is not entirely true to what its purpose is. We know it does not just contain examples of gno code, but actually it contains all the packages and realms that are initialized with the gno.land genesis node when starting it up.

The way I propose to change this is:

  • Move the directory contents of examples to gno.land/genesis
  • Create a more organic and easy-to-discover examples directory, managed by @gnolang/devrels, which has some symlinks to useful packages/realms to discover, as well as a comprehensive README pointing to examples to explore, as well as further resources like the docs.

This also came up yesterday in conversation with @jaekwon. (IIRC: "If we are working towards eventually splitting gno.land, tm2 and gnovm into their own repositories, does it not make sense for the examples directory to be contained in gno.land or gnovm?)

@waymobetta
Copy link
Contributor

I agree that this examples directory needs to be renamed, but my main concern is not what this repo is named or where it should be moved to but rather understanding what the criteria is for a package/realm to make it into this directory in the first place; @moul describes these as userland.

If these packages/realms are deployed at genesis, and are therefore foundational to the chain, then their inclusion should be carefully considered (perhaps even voted on) with each resource being deemed absolutely necessary and serve to epitomize proper package/realm standards (clear naming convention, well commented, organized, not a WIP) in accordance to Effective Gno. Personally, I feel that getting a package/realm into this directory should be a thoughtful process (much like an EIP) as it is effectively an endorsement by the core team with the opportunity of imprinting on the chain at genesis.

I also like the idea of an examples repo for devrel to own but believe this should live outside of the monorepo.

@thehowl
Copy link
Member Author

thehowl commented Jan 26, 2024

I agree that this examples directory needs to be renamed, but my main concern is not what this repo is named or where it should be moved to but rather understanding what the criteria is for a package/realm to make it into this directory in the first place; @moul describes these as userland.

I don't see creating a "perfect genesis" directory as crucial in this moment.

As of right now, we don't even have any up-to-date testnet. Putting your code in examples (or genesis) is really the best place to do it, otherwise we just have a bunch of useful gno code scattered in random repositories on GitHub. In this moment, having a lot of packages and realms in examples also helps us test that we haven't introduced any regressions in the CI, when modifying gnovm code.

Vetting and auditing all existing contracts before launching mainnet is already part of the roadmap being drafted. And I'm pretty sure it will be conservative, too: only the packages in p/ which have been tried and vetted over the course of several months of writing dApps and Gno software will make it in; everything else will have to be re-uploaded later by the authors.

I've thought of a middleground solution (creating an "official" set of genesis packages, and a "supplemental" which is expected to not make it into genesis but is where we can put gno code right now). I don't like it, though, because we ultimately don't know which packages and realm are going to be useful when we create them and obsessing over what should go where leads to more burocratization and slowness in managing code that we don't need right now.

@waymobetta
Copy link
Contributor

In this moment, having a lot of packages and realms in examples also helps us test that we haven't introduced any regressions in the CI, when modifying gnovm code.

Yep, understood. Then it makes sense to keep some packages/realms housed within the monorepo for testing. I like the idea of having code re-uploaded by authors later as well once we are in a more stable place and the proposed middleground solution makes sense.

@moul
Copy link
Member

moul commented Jan 31, 2024

We should keep certain contracts as the default, similar to a stdlib of contracts.
The current folder contains both contracts that should be built-in and examples that will need to be moved later.
Currently, it is logical to have everything in a single folder, and we can consider dividing it into src and samples later.

After splitting, we can transfer the non-essential contracts to ./gno.land/genesis. The essential contracts could eventually be moved to ./gnovm/basecontracts.

Today, we should keep everything in the monorepo and examples folder. Because, the future basecontracts are not finished yet, and none of them (except maybe p/avl) can be considered safe enough to become a standard.
We should postpone the split until we determine the proper placement of everything. Perhaps we can use an EIP approach, as suggested by @waymobetta. However, we are currently unprepared for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants