polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.07k stars 349 forks source link

ApiDerive.staking backwards compatibility. #5868

Closed TarikGul closed 4 months ago

TarikGul commented 5 months ago

This PR works on giving the support needed for backwards compatibility. With the recent staking breaking changes these PR's introduced: https://github.com/polkadot-js/api/pull/5860 https://github.com/polkadot-js/api/pull/5862 It also ended up breaking compatibility for some parachains in the UI.

This is part 1 of the staking changes saga, and once this goes in I can rework the UI to have support for the new and the old.

Summary

TODO:

NOTE: My one concern is that api.derive.staking.stakersRewards* uses withClaimedErasRewards as a default flag here which could potentially still act as a regression for the UI.

rel: https://github.com/polkadot-js/apps/issues/10512 rel :https://github.com/polkadot-js/apps/issues/10513 rel: https://github.com/polkadot-js/apps/issues/10505

TarikGul commented 5 months ago

It might be useful to add some throttling to api.derive.staking.queryMulti so that thousands of calls aren't emitted at the same time. (Not sure if this is the appropriate decision yet as I have not thought about it much.)

TarikGul commented 5 months ago

Note: I wont be able to test this against Apps until I have some stable internet come Sunday as I am still OOO.

TarikGul commented 4 months ago

I tested each call that was changed against polkadex to ensure the old calls are now available, and I also ensured everything is fault tolerant so it wont fail if the calls don't exist.

polkadot-js-bot commented 4 months ago

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.