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

feat: r/gov/dao v2 #2581

Merged
merged 95 commits into from
Oct 29, 2024
Merged

feat: r/gov/dao v2 #2581

merged 95 commits into from
Oct 29, 2024

Conversation

zivkovicmilos
Copy link
Member

@zivkovicmilos zivkovicmilos commented Jul 13, 2024

Description

This PR introduces an upgrade to the r/gov/dao system:

  • it makes it configurable through custom implementations
    • added a p/demo/simpledao implementation
  • the implementations are changeable through a govdao proposal
  • adds weighted voting to a govdao example implementation
Contributors' checklist...
  • 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, if any. More info here.

@zivkovicmilos zivkovicmilos added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jul 13, 2024
@zivkovicmilos zivkovicmilos requested a review from moul July 13, 2024 16:21
@zivkovicmilos zivkovicmilos self-assigned this Jul 13, 2024
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jul 13, 2024
@moul
Copy link
Member

moul commented Jul 13, 2024

The high-level feedback is:

  • Avoid using GetAllXXX []XXX for members, votes, and proposals. Instead, use Size(), GetByID, and eventually GetByOffset.
  • Simplify the p/gov/dao structure, reducing complexity (flatten the interfaces or eventually embed), remove what's unnecessary.
  • Move the implementation (r/) to the demo/ directory. This allows you to keep the Opt pattern, the 3 Add, Remove, and Update operations instead of just Set, and enables faster PR review/merging. The /nt component should be more optimized and minimal, and you can start something in demo/ and eventually move it after.

Copy link
Contributor

@mvertes mvertes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly doc nitpicking comments, one clarification needed about missing vs abstain votes, and a suggestion on members() method.

examples/gno.land/p/combinederr/combinederr.gno Outdated Show resolved Hide resolved
examples/gno.land/p/demo/dao/proposals.gno Outdated Show resolved Hide resolved
examples/gno.land/p/demo/dao/vote.gno Show resolved Hide resolved
@Kouteki Kouteki added the in focus Core team is prioritizing this work label Oct 18, 2024
Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we are ready to move forward. We can iterate with version 3 later.

@zivkovicmilos zivkovicmilos removed the don't merge Please don't merge this functionality temporarily label Oct 29, 2024
@zivkovicmilos zivkovicmilos merged commit 2a2be39 into master Oct 29, 2024
124 checks passed
@zivkovicmilos zivkovicmilos deleted the dev/zivkovicmilos/govdao branch October 29, 2024 15:56
moul added a commit that referenced this pull request Oct 31, 2024
## Description

This PR introduces an upgrade to the `r/gov/dao` system:
- it makes it configurable through custom implementations
    - added a `p/demo/simpledao` implementation
- the implementations are changeable through a govdao proposal
- adds weighted voting to a govdao example implementation

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

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] 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: Manfred Touron <[email protected]>
Copy link
Contributor

@ltzmaxwell ltzmaxwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments for the sake of future iteration.

case prop.tally.abstains > majorityPower:
// 2/3+ voted ABSTAIN
declineProposal()
case prop.tally.yays+prop.tally.nays+prop.tally.abstains >= totalPower:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>= should be == ?

// Remove the old member info
// in case the address changed
if address != member.Address {
m.members.Remove(address.String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's meant to be changing address of a member, it is better to have another func rather than Update. for me, update is more for update voting power, desc, etc. while changing address is more about transfer ownership. WDYT.

@Kouteki Kouteki mentioned this pull request Nov 4, 2024
@Kouteki Kouteki removed the in focus Core team is prioritizing this work label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

6 participants