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

RPCs not compliant with the JSON-RPC spec #1246

Open
josepot opened this issue Oct 17, 2024 · 2 comments
Open

RPCs not compliant with the JSON-RPC spec #1246

josepot opened this issue Oct 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@josepot
Copy link

josepot commented Oct 17, 2024

Dear Interlay Team,

I hope this message finds you well. My name is Josep, and I'm the technical lead of the Polkadot-API (PAPI) team.

In case you're not familiar with Polkadot-API, it's a modern library designed to replace PolkadotJS, built on top of a properly specified and standardized JSON-RPC API for Polkadot-based networks. The modern JSON-RPC APIs offer many advantages over the legacy ones; you can read more about it here and here.

We've noticed that there are no available public Interlay RPCs that expose the modern JSON-RPC API. Thankfully, it's still possible to use PAPI with Interlay thanks to the light-client provider, using the following chainspec with smoldot:

{
  "name": "Interlay",
  "id": "interlay",
  "chainType": "Live",
  "bootNodes": [
    "/dns/interlay-01.interlay.interlay.io/tcp/30333/p2p/12D3KooWGD9FgkiKWQTp5t6VLJgTKYqex7AY8CHTs7PGpARLTSZr",
    "/dns/interlay-02.interlay.interlay.io/tcp/30333/p2p/12D3KooWJ8Ga38UfUWcBuKCVjJFNCyFAd5YrLnDikTvinE4QG8TG",
    "/dns/interlay-03.interlay.interlay.io/tcp/30333/p2p/12D3KooWRXVqAn6xNkUbs1g2KhugSMCRDRxWVXq7ZRnvqjUQ71cr",
    "/dns/interlay-04.interlay.interlay.io/tcp/30333/p2p/12D3KooWHJW8vqWTbVJsJPYMDypm14Qrwf2rdKrW7t1TuAUbKEZw",
    "/dns/interlay-05.interlay.interlay.io/tcp/30333/p2p/12D3KooWQWUe64Cmqg3ygRNhxtZFaQHtoPBrCsJW6bUucuyiiR78",
    "/dns/interlay-06.interlay.interlay.io/tcp/30333/p2p/12D3KooWEUYPLnp1mVHZmitDLUiu4PHwMD2FxEx5GvEfMN8tiSLq",
    "/dns/interlay-07.interlay.interlay.io/tcp/30333/p2p/12D3KooWQsTnGMPF2uoHvF3p9yTxLsRiWfgVMQZvmq974ebkrqVX"
  ],
  "properties": {
    "ss58Format": 2032,
    "tokenDecimals": [10, 8, 10, 12, 8, 12],
    "tokenSymbol": ["INTR", "IBTC", "DOT", "KINT", "KBTC", "KSM"],
    "bitcoinNetwork": "bitcoin-mainnet"
  },
  "relay_chain": "polkadot",
  "para_id": 2032,
  "codeSubstitutes": {},
  "genesis": {
    "stateRootHash": "0x7b656545a767d7c7b5aeee94307434a45a15713aeb53e05914875ab061fa6600"
  }
}

However, not all consumers can utilize the light-client.

Our team has developed a middleware solution to ensure that Polkadot-API can function seamlessly with chains running older versions of the Polkadot-SDK node. Unfortunately, it appears that the RPC providers for Interlay are using an even older version, which the middleware does not support.

We kindly request that you consider working with your RPC providers to upgrade the PolkadotSDK node to a more modern version that supports the new JSON-RPC API. This upgrade would enable DApp developers to easily interact with your chain using PAPI, unlocking benefits such as improved performance, reduced resource usage, out-of-the-box strong type generation for your chain, and the ability for developers to handle runtime upgrades on the fly.

Thank you for your time and consideration.

Best regards,

Josep

@josepot josepot added the enhancement New feature or request label Oct 17, 2024
@nud3l
Copy link
Member

nud3l commented Oct 22, 2024

Thanks for opening the issue! I don't see upgrading these nodes in the foreseeable future. If anyone wants to pick up this issue, though, it'd be highly appreciated!

I'll give a bit of background on why we won't focus on this right now:

  • While there might be performance improvements in PAPI and the new Polkadot SDK versions, Interlay does not have performance issues. There is plenty of extra space in the blocks for the current load, and we haven't received complaints about performance.
  • Upgrading Polkadot SDK is relatively time-consuming due to various breaking changes in pallets that are sometimes, but not always, adequately versioned. This introduces a layer of extra risk for a chain that has been running in production for quite a while.
  • There's already a backlog of changes that improve Interlay as a product, and they will take precedence. We are already slow in getting these upgraded, tested, and released.
  • It's great to see PAPI's new ownership. It's been in development for quite a while though, and all the Interlay code is built on p.js. There's no meaningful benefit to Interlay in upgrading to PAPI.

I'm not really sure why the middleware created for PAPI does not support the Interlay RPC nodes. Maybe that is a change that can be done on the PAPI side? New js libraries should support the bigger parachains rather than the parachains adapting their code to meet the needs of a js library. In the end, if PAPI support for Interlay breaks, it's not a major issue. It is a major issue if Interlay breaks due to a Polkadot SDK upgrade.

@josepot
Copy link
Author

josepot commented Oct 24, 2024

You're completely missing the point.

The modern JSON-RPC APIs aren’t just some "PAPI thing"—they’re the only properly spec'd JSON-RPC APIs we have, designed to replace the outdated legacy ones. PolkadotJS is on its way out, in maintenance mode, and soon enough, it’ll either migrate entirely to the new JSON-RPC API or be sunsetted.

If you care to understand more, you can read up on it here:

It's great to see PAPI's new ownership. It's been in development for quite a while though.

That’s flat-out wrong. You’re clearly confusing PAPI with something else.

I'm not really sure why the middleware created for PAPI does not support the Interlay RPC nodes.

I know exactly why—because you haven’t bothered upgrading the PolkadotSDK node in over a year.

All the Interlay code is built on PolkadotJS. There's no meaningful benefit to Interlay in upgrading to PAPI.

Actually, there would be a benefit for modern DApps that want to interact with your chain. But if keeping your chain up to date isn’t important enough for you, then frankly, there’s no reason to waste time supporting it with the modern dev tools we’re building.

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

No branches or pull requests

2 participants