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

[gnoland] /tx?hash= endpoint not usable #2489

Open
gfant opened this issue Jul 3, 2024 · 4 comments
Open

[gnoland] /tx?hash= endpoint not usable #2489

gfant opened this issue Jul 3, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@gfant
Copy link
Contributor

gfant commented Jul 3, 2024

Tx Hash not usable in the node RPC

Description

When you make a tx:

  • The hash for the tx is not hex encoded
  • The hash can't be used to check it in the node rpc, no matter if it's hex or not.

Your environment

  • MacOS Sonoma 14.5
  • latest (built from the commit 3b42391)
  • main

Steps to reproduce

  • Make a tx with Adena wallet.
  • Get the resulting hash.
  • Try to use the endpoint http://127.0.0.1:26657/tx?hash=_ and substitute it with the hash.

Expected behaviour

The output when accessing that path should be the content of this tx.

Actual behaviour

{
  "jsonrpc": "2.0",
  "id": "",
  "error": {
    "code": -32603,
    "message": "Internal error",
    "data": "Could not find tx result for hash #[hash in hex format]"
  }
}

Proposed solution

I'm currently checking how is this done to give an alternative. Will add an alternative once I understand where it appears

@leohhhn
Copy link
Contributor

leohhhn commented Jul 3, 2024

cc @thehowl @zivkovicmilos

@linhpn99
Copy link
Contributor

linhpn99 commented Jul 3, 2024

From a comment of Milos : #2309 (comment)

@leohhhn
Copy link
Contributor

leohhhn commented Jul 4, 2024

From some testing & discussions, the current state is this.

If you pass in the following request body to the root endpoint, ie localhost:26657/, via a POST request:

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tx",
  "params": [
    "dX+7ubf0tsbzQ1zPPh+1Op607o/kj6goWzbrnclR8CE="
  ]
}

It will work. However, using the/tx endpoint while providing it the hash, either wrapped in quotes or not, does not work.

On top of this, when you receive a proper response, the transaction data is actually base64 encoded, so it is not readable. Also, when you do decode the data from base64, you're left with an amino representation that is not fully readable.

@leohhhn leohhhn changed the title Tx Hash not usable in the node RPC [gnoland] /tx?hash= endpoint not usable Jul 4, 2024
@Kouteki Kouteki added the 🐞 bug Something isn't working label Jul 5, 2024
@Kouteki Kouteki moved this from Triage to Todo in 🧙‍♂️gno.land core team Jul 5, 2024
@linhpn99
Copy link
Contributor

linhpn99 commented Jul 6, 2024

I found the root cause and fixed it : #2518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

4 participants