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

[chain] ABI-like support for Realm / Package requests / responses #1842

Open
zivkovicmilos opened this issue Mar 26, 2024 · 4 comments
Open
Assignees
Labels
in focus Core team is prioritizing this work

Comments

@zivkovicmilos
Copy link
Member

Description

This effort covers the introduction of an ABI-like standard for Gno Realm / Packages.

Copied from an issue on the Gno repo:
Gno.land Realms expose public methods that can be queried off-chain by client applications. The problem lies in the fact that the responses of specific public methods can be different from primitive types in Golang, for example a struct or a type alias.
In this case, the response the clients will receive will contain the raw value and the type of response (ex my response MyComplexType), leaving the clients to do custom parsing on their own.

There is also the parallel problem of constructing method calls. Clients need to know upfront what kind of data needs to be packaged as the arguments of a public Realm method.
Ethereum Solidity Smart Contracts provide a contract ABI (essentially a JSON specification), which the clients can utilize to understand how to call Smart Contract methods, and what kinds of responses to expect.

Successful outcome of this effort:

  • There is a defined standard for Realms / Packages that clients can use to construct requests / parse responses
  • There is an implemented tool that can generate this specification (in JSON for example) based on an input Realm / Package
@thehowl
Copy link
Member

thehowl commented Jun 25, 2024

Are we not doing this in #1776?

@thehowl
Copy link
Member

thehowl commented Jun 25, 2024

I mean, ok, this issue is about making a spec for it, but I'm still surprised to see that it wasn't even mentioned as an effort

Having good cross-references to other issues is one of the few good things about our issue tracker, let's try to keep it that way :)

@leohhhn
Copy link
Contributor

leohhhn commented Jul 5, 2024

@jeronimoalbi @salmad3 pinging just for visibility. Could be a related effort to gnoschema.

@n0izn0iz
Copy link
Contributor

n0izn0iz commented Aug 7, 2024

not sure where to put this:

re: encoding structs in transaction result

solidity supports returning structs via ABIEncoderV2
maybe we can learn from that effort

@linear linear bot removed the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Sep 11, 2024
mvertes added a commit to mvertes/gno that referenced this issue Sep 23, 2024
The Realm ABI Specification formally describes the protocol
and encoding of interactions between realms and external clients,
independently of their language.

It can be seen as an extension of the
[ABCI](https://github.com/tendermint/tendermint/tree/master/spec/abci)
which covers the protocol between blockchain nodes and clients, but
without details on blockchain practical applications, such as realms.

This PR addresses [gnolang#1842].

This is an initial draft commit, work in progress.
mvertes added a commit that referenced this issue Sep 23, 2024
The Realm ABI Specification formally describes the protocol
and encoding of interactions between realms and external clients, not
necessarily written in Go.

It can be seen as an extension of the
[ABCI](https://github.com/tendermint/tendermint/tree/master/spec/abci)
which covers the protocol between blockchain nodes and clients, but
without details on their practical applications, such as realms.

This PR addresses [#1842].

This is an initial draft commit, work in progress.
@Kouteki Kouteki added in focus Core team is prioritizing this work and removed 🌟 must have 🌟 labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in focus Core team is prioritizing this work
Projects
Status: Core
Status: In Progress
Development

No branches or pull requests

6 participants