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

Lotus' OpenRPC definitions are inaccurate #3668

Closed
aatifsyed opened this issue Nov 3, 2023 · 2 comments
Closed

Lotus' OpenRPC definitions are inaccurate #3668

aatifsyed opened this issue Nov 3, 2023 · 2 comments

Comments

@aatifsyed
Copy link
Contributor

aatifsyed commented Nov 3, 2023

Forest wants to use Lotus' OpenRPC definitions to ensure RPC compatibility.
But we've found that most endpoints are incorrect.

Here are some examples:

Snippets are taken from Lotus' OpenRPC definitions, and extraneous items have been redacted for brevity.
Tested against Lotus v1.23.3

Objects in spec do not match objects in practice

        {
            "name": "Filecoin.WalletList",
            "result": {
                "description": "[]address.Address",
                "schema": {
                    "items": [
                        {
                            "additionalProperties": false,
                            "type": [
                                "object"
                            ]
                        }
                    ],
                    "type": [ "array" ]
                },
                "required": true,
            }
        },

Claims to return an array of empty objects: [ {}, {}, {} ], but actually returns an array of strings

        {
            "name": "Filecoin.ChainHasObj",
            "params": [
                {
                    "description": "cid.Cid",
                    "schema": {
                        "examples": [
                            {
                                "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
                            }
                        ],
                        "type": [ "string" ]
                    },
                    "required": true,
                }
            ],

Claims to accept a string but in actually accepts only objects like { "/": "<some CID>" }.
Note that the example does match the schema.

The schema does not represent all (stable) endpoints

Filecoin.Version does not appear in the schema, but is callable, and appears in the documentation

@LesnyRumcajs
Copy link
Member

@aatifsyed Should it be rather an issue in lotus?

@aatifsyed
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants