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: refactor govdao structure and examples #2379

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

moul
Copy link
Member

@moul moul commented Jun 18, 2024

  • remove gov/integration/
  • remove gov/proposals/
  • move the integration test in gov/dao/*test.gno
  • add r/sys/validators.Render()

@moul moul self-assigned this Jun 18, 2024
@zivkovicmilos zivkovicmilos self-requested a review June 18, 2024 10:13
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jun 18, 2024
@moul moul changed the title feat: refactor govdao execution mechanism and examples feat: refactor govdao structure and examples Jun 18, 2024
@moul moul marked this pull request as ready for review June 18, 2024 11:03
@moul moul requested review from a team as code owners June 18, 2024 11:03
@moul moul requested review from piux2 and removed request for a team June 18, 2024 11:03
Signed-off-by: moul <94029+moul@users.noreply.github.com>
@moul moul merged commit 6825293 into gnolang:master Jun 19, 2024
11 checks passed
@moul moul deleted the dev/moul/govdao++ branch June 19, 2024 17:43
zivkovicmilos pushed a commit that referenced this pull request Jul 8, 2024
This PR introduces a new pattern for arbitrary govdao proposals using
Gno code using contexts. It involves wrapping the provided closure with
a system that configures a `context.Context` with a field indicating
that the execution occurs in the context of an `approvedByGovDao`
proposal. This opens the door to a new ACL system, not based on
`PrevRealm()`, but on a context-based "certification" system.

I believe this pattern makes sense to exist; however, here are some
drawbacks I can see:

1. `context.Context` is not yet needed (no goroutine support), and we
may eventually never need this package depending on how we implement
goroutines internally. (h/t @thehowl)
2. `context.Context` is used like an environment variable, which
introduces implicitness—something we usually try to avoid to make Gno a
very explicit language. Explicitness brings “simplicity” and
“verifiability.”
3. The usual Go idiomatic way of using `context` is to pass it as the
first argument. If this becomes more common, it will result in more
contracts having exposed functions that are not callable by `maketx
call` (though they can be called with `maketx run` or via an import).

Depends on #2379  
Related to #2386

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
gfanton pushed a commit to gfanton/gno that referenced this pull request Jul 23, 2024
- remove `gov/integration/`
- remove `gov/proposals/`
- move the integration test in `gov/dao/*test.gno`
- add `r/sys/validators.Render()`

Signed-off-by: moul <94029+moul@users.noreply.github.com>
gfanton pushed a commit to gfanton/gno that referenced this pull request Jul 23, 2024
This PR introduces a new pattern for arbitrary govdao proposals using
Gno code using contexts. It involves wrapping the provided closure with
a system that configures a `context.Context` with a field indicating
that the execution occurs in the context of an `approvedByGovDao`
proposal. This opens the door to a new ACL system, not based on
`PrevRealm()`, but on a context-based "certification" system.

I believe this pattern makes sense to exist; however, here are some
drawbacks I can see:

1. `context.Context` is not yet needed (no goroutine support), and we
may eventually never need this package depending on how we implement
goroutines internally. (h/t @thehowl)
2. `context.Context` is used like an environment variable, which
introduces implicitness—something we usually try to avoid to make Gno a
very explicit language. Explicitness brings “simplicity” and
“verifiability.”
3. The usual Go idiomatic way of using `context` is to pass it as the
first argument. If this becomes more common, it will result in more
contracts having exposed functions that are not callable by `maketx
call` (though they can be called with `maketx run` or via an import).

Depends on gnolang#2379  
Related to gnolang#2386

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants