gno icon indicating copy to clipboard operation
gno copied to clipboard

WIP feat(PoC,gov): initial sys/validators and gov/dao contracts

Open moul opened this issue 1 year ago • 3 comments

This PR showcases a model that combines multiple contracts with defined goals and constraints. The aim is to make everything in sys/* usable by the chain (tm2 powered) efficiently, with minimal need for updates while maintaining flexibility in usage.

The sys/ contracts focus on defining data types and helpers to ensure that received callbacks meet minimal constraints, like GovDAO approval. They do not handle DAO logic or state due to complexity and upgradability requirements for DAOs.

I won't include complete DAO examples in this PR. Imagine having these sections once everything is done:

  • {p,r}/sys: minimal interface with the chain
  • {p,r}/gov: simple DAO frameworks
  • {p,r}/*: where users will develop permissionless logic and propose it to gov for approval using sys to trigger the chain.

Personal note -> try to introduce and document the notion of "pausable threads". Related with #1974.


TODO:

  • [x] pseudo-code for proof of conribution's valset management.
  • [x] proposal example.
  • [ ] pseudo-code for gnosdk v0 to catch the event and apply the change from tm2. cc @gfanton
  • [ ] add unit-tests, to illustrate the expected usage.

depends on std.Emit (#575). depends on #1948 (need rebase).

moul avatar Apr 17 '24 20:04 moul

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 57.34%. Comparing base (e2e0611) to head (0a5daf1). Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1945      +/-   ##
==========================================
+ Coverage   54.62%   57.34%   +2.71%     
==========================================
  Files         581      419     -162     
  Lines       77954    66663   -11291     
==========================================
- Hits        42583    38225    -4358     
+ Misses      32193    25610    -6583     
+ Partials     3178     2828     -350     
Flag Coverage Δ
contribs/gnodev 23.81% <ø> (-0.15%) :arrow_down:
contribs/gnofaucet 14.46% <ø> (ø)
contribs/gnokeykc 0.00% <ø> (ø)
contribs/gnomd 0.00% <ø> (ø)
gno.land ?
gnovm 60.00% <100.00%> (ø)
misc/autocounterd ?
misc/genproto ?
misc/genstd ?
misc/goscan ?
misc/logos ?
misc/loop ?
tm2 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 17 '24 21:04 codecov[bot]

Not finished yet. Seeking initial review, feedback, and questions to aid in continuation.

moul avatar May 03 '24 12:05 moul

something related https://github.com/gnolang/gno/pull/319/files

ltzmaxwell avatar May 20 '24 14:05 ltzmaxwell

@moul

I've looked it over again, and here's what we need to do in order to merge #1945:

  • drop the antehandler changes entirely, we will handle this in a separate PR
  • consider the alternative to realm executors from this comment
  • fix the failing CI / linting errors

I'm perfectly fine with having v0.1.0 of the govdao have TODOs that we will fill out in parallel in separate PRs

After we merge #1945, I will define a proof of contribution validator protocol implementation in #2130, and after we merge that we can merge #2229

cc @gfanton

zivkovicmilos avatar Jun 09 '24 17:06 zivkovicmilos

@moul

@gfanton and I agreed to merge this as a foundation, even with the TODOs, so we can unblock and iterate 🙏

zivkovicmilos avatar Jun 12 '24 12:06 zivkovicmilos

this broke master

gnodev fails with: unable to load genesis packages: unable to sort pkgs: missing dependency 'gno.land/r/gov/dao' for package 'valopers' for example

n0izn0iz avatar Jun 12 '24 13:06 n0izn0iz