1

We have been spoiled with free, almost unlimited public websocker rpcs in Kusama and Polkadot ecosystem, but this is changing fast, so we are exploring paid RPC API services. But we have noticed that when using websocket rpc with polkadot.js it does system_health call every 10 seconds, which can be costly. If a single client subscribes to balance changes and keeps the client/connection active for 24h that's 8640 calls. On Popular dapps like NFT marketplace or a defi, this can get quite expensive. Some well known RPC API services count each response towards your limits. So I am wondering if there's a way to perhaps opt-out from system_health calls? Ofcourse alternative is to adjust front-end code to check for balance on-demand instead of having an open websocket subscription and use https rpcs instead, but this is worse dev and end-user user-experience.

1
  • 1
    Without it, the WS will disconnect after 60 seconds (even with open subscriptions) since no data is received. Recent versions of the Substrate code has the WS ping-pong built-in on the node WS layer, so it is on the roadmap to remove the health calls in the JS API since it is (since very recently) not needed in up-to-date chains. TL;DR For some chains it is still needed, for others it is not (anymore) - for broad compat, it is (still) on by default with no switch.
    – Jaco
    Nov 1, 2022 at 13:24

1 Answer 1

2

OnFinality plans to discount all system_health RPC calls from paid API plan response counts to zero cost to alleviate this issue for now. This should be in place in the coming weeks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.