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

staking-info improvement on claimed #1577

Open
Imod7 opened this issue Jan 16, 2025 · 0 comments
Open

staking-info improvement on claimed #1577

Imod7 opened this issue Jan 16, 2025 · 0 comments

Comments

@Imod7
Copy link
Contributor

Imod7 commented Jan 16, 2025

Description

This is an issue in continuation of the changes made in the #1445 PR, to implement a performance improvement and test checking in the staking-info endpoint (claimed field).

Performance Improvement

In the staking-info endpoint, an improvement can be done regarding the calculation of claimed that can potentially increase the performance of the endpoint.

  • Moving the OldCalls check outside the eras loop

Credits for this idea to @filvecchiato

Double Check Test Cases

It will be a good opportunity with the above improvement to also review existing tests & check if the below cases are covered:

  • Case of era < 518 and chain = isKusama -> the era is considered as claimed "automatically".
  • Case of status = undefined -> which is when we do not have enough info to determine the status of the era.
  • Case where staking.erasStakersOverview = null & erasStakers = 0 which can be implemented by mocking this request http://127.0.0.1:8080/accounts/CmjHFdR59QAZMuyjDF5Sn4mwTgGbKMH2cErUFuf6UT51UwS/staking-info?at=22869643

If not, consider of adding them as tests or adding those cases in the STAKING_IMPLEMENTATION_DETAILS guide.

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

No branches or pull requests

1 participant