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

ApiDerive.staking backwards compatibility. #5868

Merged
merged 7 commits into from
May 6, 2024

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented Apr 30, 2024

This PR works on giving the support needed for backwards compatibility. With the recent staking breaking changes these PR's introduced: #5860 #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

  • ownExposure && ownExposures will properly build safe types for historic calls such as erasStakers, and erasStakersClipped. It also ensures the calls exist or else will default to the empty type.

  • query && queryMulti now take in a flag withExposureErasStakersLegacy and returns a new field called exposureEraStakers

  • nextElected now has support for both erasStakersPaged and erasStakers.

TODO:

  • Test the following changes against apps to ensure it works for both old and new.

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: polkadot-js/apps#10512
rel :polkadot-js/apps#10513
rel: polkadot-js/apps#10505

@TarikGul
Copy link
Member Author

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
Copy link
Member Author

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

@TarikGul
Copy link
Member Author

TarikGul commented May 6, 2024

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.

@TarikGul TarikGul added the -auto label May 6, 2024
@polkadot-js-bot polkadot-js-bot merged commit 15c8859 into master May 6, 2024
6 checks passed
@polkadot-js-bot polkadot-js-bot deleted the tg-fix-staking-derive branch May 6, 2024 16:18
@polkadot-js-bot
Copy link

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.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants