Skip to content

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

Merged
Imod7 merged 2 commits into
masterfrom
domi-claimed-flag
Feb 17, 2025
Merged

feat: add includeClaimedRewards query param in staking-info#1593
Imod7 merged 2 commits into
masterfrom
domi-claimed-flag

Conversation

@Imod7

@Imod7 Imod7 commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

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

@filvecchiato filvecchiato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! LGTM

@TarikGul TarikGul left a comment

Copy link
Copy Markdown
Member

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
@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