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

META GitHub oracle & r/gh #1133

Open
moul opened this issue Sep 16, 2023 · 5 comments
Open

META GitHub oracle & r/gh #1133

moul opened this issue Sep 16, 2023 · 5 comments
Assignees

Comments

@moul
Copy link
Member

moul commented Sep 16, 2023

Revisiting our previous discussions on the GitHub oracle idea, I'd like to delve deeper into some specifics and potential enhancements.

To recap, the oracle, comprising certain contracts and an external bot, aims to translate select GitHub metrics onto the chain, rendering them usable in our on-chain ecosystem.

While I've shared my skepticism about GitHub being the sole platform for evaluations and score/token allocations, I remain steadfast in treating GitHub as a reliable data source. It's essential we maintain its widely recognized URIs for consistency.

Elaborating further:

  1. On-Chain Reflection of Issues and PRs: I propose that we mirror essential data from GitHub, such as titles, statuses (open, closed, merged), URIs, and some metadata. Visualize it like this:
import "gno.land/r/github"

issue := github.IssueByID("gnolang/gno#4242")
println(issue.Title, issue.State)

This allows on-chain management and tracking that's interlinked with GitHub issues. As @waymobetta and @MichaelFrazzy have been exploring similar territory, I'd like to emphasize:
- We shouldn't treat GitHub activities as direct equivalents to scores. While these metrics can guide score determinations, human oversight is vital to ensure fairness and counteract potential manipulation.
- The focus shouldn't be restricted to "merged PRs." Open issues, valuable but closed PRs, and other meaningful contributions deserve recognition.

  1. Two-Way Data Flow: While our bot can translate GitHub activities on-chain, the opposite should be feasible too. It can monitor on-chain events and mirror these as comments on GitHub issues and PRs.

  2. GitHub and Gno Account Linkage: As discussed, users can create a repository like github.com/<username>/.gno with a config.yml, signed with their private key. An on-chain transaction like:

gnokey maketx gno.land/r/github -func LinkAccount -args moul -args sig(moul)`

can create a robust two-way connection, broadening our interaction possibilities, such as a bot commenting on GitHub issues/PRs.

I believe refining these concepts can significantly enhance our integration and workflow.

Edit: bootstrapping foundations here: #1134

@MichaelFrazzy
Copy link

@waymobetta

@piux2
Copy link
Contributor

piux2 commented Sep 29, 2023

Who will provide oracle service for gno.land in this case?

@MichaelFrazzy
Copy link

Who will provide oracle service for gno.land in this case?

It'd be really cool to have a native solution, but absolute worst case I have friends at Chainlink

@moul moul changed the title GitHub oracle META GitHub oracle & r/gh Oct 3, 2023
@moul
Copy link
Member Author

moul commented Oct 3, 2023

A quick update on the needs we can expect from the GitHub realm, oracle, and bot:

Essentially, we require a GitHub realm for the following purposes:

  • Allowing an oracle to notify the blockchain about off-chain events. In the case of GitHub, this would involve linking on-chain contributions with pull requests (PRs) and potentially including other information related to issues.
  • Enabling semi-automated contribution review/annotation.
  • Facilitating the development of GitHub bots that can respond and update GitHub issues and PRs based on on-chain activities.
  • Establishing a bi-directional link between a GitHub account and a GNO account, similar to how Keybase used to do it.
  • Enabling the creation of a GitHub faucet. This would allow us, after the launch, to attract not only Cosmos citizens through the current airdrop, but also developers. Developers would be a better early target than web3 DeFi users for the initial use cases of the chain. -> this one will have its own issue, soon. cc @MichaelFrazzy

@deelawn
Copy link
Contributor

deelawn commented Jan 22, 2024

This PR is the WIP for a both a github oracle realm and package to integrate generalized oracle functionality into realms. Wi need to clean it up a bit before it is ready for review.
#1568

deelawn added a commit that referenced this issue May 7, 2024
Relates to #1133 

Note: the unit tests are missing from the gnorkle packages. This will
not be merged without unit tests. They will be written once the design
has been reviewed so no time is wasted writing and rewriting them should
it be determined that structural changes need to occur.

Note 2: there are two readme files included in this PR so maybe read
those first.

The PR is meant to be a first attempt at implementing a gno package that
allows realms to integrate oracle functionality. There is a gh (github)
application bundled in this PR that is an oracle and will be able to
handle github handle -> gno address verification requests.

Everything at the gno package (/p) level falls within a v1 path because
I think this package still has a lot of room for improvements.

Some things that need to be done before marking this ready for review:
- [x] remove old first iteration code
- [x] convert newest prototyped code from go to gno and restructure
subdirectories for compatibility
- [x] add more comments and doc strings
- [x] create readmes
- [x] add unit tests
- [x] add gh verification realm tests
- [x] make a way for the owner or an orkle instance to manage both
instance and individual feeds' whitelists

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>

---------

Co-authored-by: Morgan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🌟 Wanted for Launch
Development

No branches or pull requests

7 participants