forest icon indicating copy to clipboard operation
forest copied to clipboard

Lotus' OpenRPC definitions are inaccurate

Open aatifsyed opened this issue 2 years ago • 1 comments

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

aatifsyed avatar Nov 03 '23 14:11 aatifsyed

@aatifsyed Should it be rather an issue in lotus?

LesnyRumcajs avatar Nov 06 '23 14:11 LesnyRumcajs

https://github.com/filecoin-project/lotus/issues/12164

aatifsyed avatar Jul 01 '24 16:07 aatifsyed