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

GetSharesByNamespace JSON RPC returns the the old representation of NamespacedShares #2631

Closed
oblique opened this issue Aug 29, 2023 · 7 comments
Assignees
Labels
bug Something isn't working external Issues created by non node team members

Comments

@oblique
Copy link
Contributor

oblique commented Aug 29, 2023

Celestia Node version

4b96022

OS

Arch Linux

Install tools

No response

Others

No response

Steps to reproduce it

Do share.GetSharesByNamespace request.

Expected result

I was expecting to get the new protobuf representation (share.p2p.shrex.nd.NamespaceRowResponse):

[
    {
      "shares": [],
      "proof": {
        "start": 1,
        "end": 2,
        "nodes": [
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEinncqCRtmn9rQpzZu1bRShpoTh01mE75gkp9C68byu",
          "/////////////////////////////////////////////////////////////////////////////w81Htmj5E2p0vlhWgUHbEu+jHu0S74GbTWrHUPWC0NB"
        ],
        "leafHash": "AAAAAAAAAAAAAAAAAAAAAAAAAAwECTkh44s4pzQAAAAAAAAAAAAAAAAAAAAAAAAADAQJOSHjizinNErclwFCmkujstcQOiIunyB5edz+oREPWyE1GeDzvN9+",
        "isMaxNamespaceIgnored": true
      }
    }
]

Actual result

Instead I got the old representation (share.NamespacedShares):

[
    {
      "Shares": [],
      "Proof": {
        "start": 1,
        "end": 2,
        "nodes": [
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEinncqCRtmn9rQpzZu1bRShpoTh01mE75gkp9C68byu",
          "/////////////////////////////////////////////////////////////////////////////w81Htmj5E2p0vlhWgUHbEu+jHu0S74GbTWrHUPWC0NB"
        ],
        "leaf_hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAwECTkh44s4pzQAAAAAAAAAAAAAAAAAAAAAAAAADAQJOSHjizinNErclwFCmkujstcQOiIunyB5edz+oREPWyE1GeDzvN9+",
        "is_max_namespace_id_ignored": true
      }
    }
]

Relevant log output

No response

Notes

I think the issue starts from here.

@oblique oblique added the bug Something isn't working label Aug 29, 2023
@github-actions github-actions bot added the external Issues created by non node team members label Aug 29, 2023
@oblique
Copy link
Contributor Author

oblique commented Aug 29, 2023

Relevant issues: #2427, #2423.

Also in the new representation can you rename the fields in snake_case format?

@distractedm1nd
Copy link
Collaborator

Good catch, we will still return NamespacedShares but we will make the json fields match and be all in snake_case

@oblique
Copy link
Contributor Author

oblique commented Sep 6, 2023

Tested the latest release and I still get the old representation. I think this should be removed.

@distractedm1nd
Copy link
Collaborator

@oblique The protobuf definitions from nmt have now changed so that the fields are snake case - so your old actual result should be the new expected result. Or am I missing something?

@oblique
Copy link
Contributor Author

oblique commented Sep 6, 2023

I'm using ghcr.io/celestiaorg/celestia-node:v0.11.0-rc11 and when I request blob.GetProof I get this result:

{
  "jsonrpc": "2.0",
  "result": [
    {
      "end": 2,
      "is_max_namespace_id_ignored": true,
      "leaf_hash": null,
      "nodes": [
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLdBzzpUnHG99n3rFul1zuDC3/mibQH8Ics9I1EP3muK",
        "/////////////////////////////////////////////////////////////////////////////yVANEGwvveNvq0ylhBwcRNmpTd/hLmgSlPtjrMfJSMj"
      ],
      "start": 1
    }
  ],
  "id": 4
}

The is_max_namespace_id_ignored is from the previous representation. If masrhialing was done by the new protobuf definition it should be is_max_namespace_ignored. I believe this is because the custom MarshalJSON was not replaced by the protobuf one. Instead of jsonProof it should marshal pb.Proof.

@distractedm1nd
Copy link
Collaborator

Yes, it should, didn't even catch that - thanks

rootulp pushed a commit to celestiaorg/nmt that referenced this issue Sep 18, 2023
jsonProof is not necessary when we already have pb.Proof, which caused
issues because of mismatching field names.

Related: celestiaorg/celestia-node#2631
Specifically:
celestiaorg/celestia-node#2631 (comment)
@distractedm1nd
Copy link
Collaborator

related #2728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Issues created by non node team members
Projects
None yet
Development

No branches or pull requests

2 participants