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

[DX Streamline] OpenRPC definitions are inaccurate #12164

Open
5 of 11 tasks
aatifsyed opened this issue Jun 27, 2024 · 4 comments
Open
5 of 11 tasks

[DX Streamline] OpenRPC definitions are inaccurate #12164

aatifsyed opened this issue Jun 27, 2024 · 4 comments
Labels
Milestone

Comments

@aatifsyed
Copy link

Checklist

  • This is not a security-related bug/issue. If it is, please follow please follow the security policy.
  • I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
  • I am running the Latest release, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
  • I did not make any code changes to lotus.

Lotus component

  • lotus daemon - chain sync
  • lotus fvm/fevm - Lotus FVM and FEVM interactions
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt/WinningPoSt)
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Lotus Version

1.27.1

Repro Steps

No response

Describe the Bug

https://github.com/filecoin-project/lotus/blob/36d96342c36186ab15417b53511dce94b66ae089/build/openrpc/full.json#L71-L91

The schema for, e.g cid is wrong - it's not

{
  "type": "string"
}

it's

{
  "type": "object",
  "required": ["/"],
  "properties": {
    "/": { "type": "string" }
  }
}

(as expected and emitted by lotus)

Logging Information

N/A
@aatifsyed aatifsyed added the kind/bug Kind: Bug label Jun 27, 2024
@aatifsyed
Copy link
Author

There may be other bugs in the definitions - forest has put effort into emitting correct schemas which may be a useful reference

@rvagg
Copy link
Member

rvagg commented Jun 28, 2024

Great! Thanks for this one.

What about the use of TipSetKey, they seem to be "type": ["object"] but could be defined as an array of CIDs, does Forest do this differently?

@aatifsyed
Copy link
Author

Yep, forest represents them correctly, also respecting the quirk that empty arrays are serialized as null by Lotus

{
  "type": [
    "array",
    "null"
  ],
  "items": {
    "$ref": "#/components/schemas/Cid"
  },
  "components": {
    "schemas": {
      "Cid": {
        "type": "object",
        "required": [
          "/"
        ],
        "properties": {
          "/": {
            "type": "string"
          }
        }
      }
    }
  }
}

@rjan90 rjan90 changed the title OpenRPC definitions are inaccurate [DX Streamline] OpenRPC definitions are inaccurate Jul 2, 2024
@aatifsyed
Copy link
Author

@rjan90 rjan90 added this to the DX-Streamline milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

4 participants