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

feat: add includeClaimedRewards query param in staking-info #1593

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

Imod7
Copy link
Contributor

@Imod7 Imod7 commented Feb 17, 2025

Description

This PR adds the includeClaimedRewards query param in the endpoint /accounts/{accountId}/staking-info. When set to false:

  • the field claimedRewards will be omitted from the response and
  • all internal calculations for claimed rewards in AccountsStakingInfoService will be skipped, potentially speeding up the response time.

Defaults to true so it does not break the current functionality of the endpoint.

Motivation

An exchange reported significantly long response times for the endpoint /accounts/{accountId}/staking-info after the release of v20.0.0. This is most likely due to the breaking changes introduced to this endpoint (calculation of claimedRewards changed). To address this, a new flag/query parameter has been added to improve performance when the claimedRewards data is not required, speeding up the response time.

@Imod7 Imod7 marked this pull request as ready for review February 17, 2025 13:30
@Imod7 Imod7 requested a review from a team as a code owner February 17, 2025 13:30
Copy link
Contributor

@filvecchiato filvecchiato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Imod7 Imod7 merged commit ed8b04a into master Feb 17, 2025
14 checks passed
@Imod7 Imod7 deleted the domi-claimed-flag branch February 17, 2025 13:48
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

Successfully merging this pull request may close these issues.

3 participants