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

improve analysis of closures/anonymous functions #1974

Open
moul opened this issue Apr 24, 2024 · 2 comments
Open

improve analysis of closures/anonymous functions #1974

moul opened this issue Apr 24, 2024 · 2 comments
Labels
help wanted Want to contribute? We recommend these issues. 🌱 feature New update to Gno

Comments

@moul
Copy link
Member

moul commented Apr 24, 2024

In Gno.land, to preserve type safety while allowing a strong range of dynamism and addressing the chicken-egg problem where a contract could manage things that are developed and published AFTER the contract is published, we expect Gno to use closures and anonymous functions more frequently rather than marshalling everything as intermediary types. The challenge is to improve the analysis of these closures and anonymous functions, and not just simple variables.

We are looking for ways to "visualise" variables in general (similar to how Etherscan can display the last values), but also to display closures. Ideally, we should have the variable viewer/explorer straight from Gnoweb, but as a temporary solution, we can also look for an indexer.

Consider this case: we have a DAO vote that will execute a privileged closure once approved. The goal is to allow proposal reviewers to check exactly what will be the impact.

TODO: offer a bounty

Related with #1284
Related with #1262
Related with #1945

@ltzmaxwell
Copy link
Contributor

Hi @moul , Can you give a bit more about this :

similar to how Etherscan can display the last values

Thank you!

@moul
Copy link
Member Author

moul commented Apr 24, 2024

Taking a random contract: https://etherscan.io/address/0x5b5da40bbde2d864697196284eb949332e4149ee#readContract

CleanShot 2024-04-24 at 13 48 00@2x

I can see two values.

I want something similar, preferably inlined with the source code viewer. It could initially be a dedicated data viewer, similar to etherscan.

@Kouteki Kouteki moved this from Triage to Backlog in 🧙‍♂️gno.land core team Apr 26, 2024
@Kouteki Kouteki added help wanted 🌱 feature New update to Gno labels Apr 26, 2024
zivkovicmilos added a commit that referenced this issue Jun 12, 2024
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).

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
Co-authored-by: Milos Zivkovic <milos.zivkovic@tendermint.com>
Co-authored-by: gfanton <8671905+gfanton@users.noreply.github.com>
@Kouteki Kouteki added this to the 💡Someday/Maybe milestone Oct 2, 2024
@Kouteki Kouteki added help wanted Want to contribute? We recommend these issues. and removed help wanted labels Oct 2, 2024
@Kouteki Kouteki removed this from the 💡Someday/Maybe milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Want to contribute? We recommend these issues. 🌱 feature New update to Gno
Projects
Status: 📥 Inbox
Status: Backlog
Development

No branches or pull requests

3 participants