-
Notifications
You must be signed in to change notification settings - Fork 162
fix: claimed in staking info endpoint #1445
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
Conversation
|
The change is reasonable. Sidecar user does not care of internal renaming changes since the retrieved info has the same meaning. Is this PR ready for review or are we waiting for the Todos list to be checked? |
Yes, ideally the todos needs to be completed before a review. However, if any review will speed things up then please feel free to add them. |
|
Update
The response will also needs to be changed from a Related Resource |
marshacb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just had a question about unwraps
docs/src/openapi-v1.yaml
Outdated
| for _validators._ This array is populated with values from `stakingLedger.legacyClaimedRewards` | ||
| or `stakingLedger.claimedRewards`, as well as the `query.staking.claimedRewards` call, depending | ||
| on whether the queried block is before or after the migration. For more details on the implementation | ||
| and the migration, refer to the related PR and linked issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where/how can the user find the relevant linked info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added specific links of the PR and linked issue. Let me know if this covers your question. I also updated the schema description since I no longer return lastReward. Changes included in this commit.
Do we have specific data for this statement? How long does it take to return the staking info in the any worst case scenario (for example, 84 eras in different pages and/or with different logic)? |
You are right, I didn't have any formal data when I wrote that. It was based on my observations from the tests I did and also on my knowledge of the calculations of each implementation.
|
|
@IkerAlus After our last convo on whether the status
Here is the next round of conclusions about
Currently, I am also considering that in both scenarios, it is useful to add the |
- removed `partially claimed` value - added `undefined` value - updated tests
- bringing back `partially claimed` for validator
filvecchiato
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to understand oldCallsCheck flag a bit more but in the meanwhile a few minor nits that might help readability
|
I have added some comments, or possible updates to the codebase to increase performance ( I ran a few tests and it seems like the response time halved). Quite a complex PR, good job in getting it out! |
|
All good on my side! I think the oldCallCheck flag can be moved outside the loop in a later stage (maybe create another tracking issue for that), great job overall, very complex stuff!! |
|
Thank you @filvecchiato for the super thorough and detailed review. All your notes on the performance improvements were well noted and implemented. Your questions, doubts and thoughts on the logic were excellent and super helpful in improving the implementation guide for future readers. I greatly appreciate the time, effort and brain matter (due to its complexity) you put into this review. A big thank you! |
|
Thanks for the kind words! I'm glad I could help! LGTM 🚀 |
Description
Closes #1433
This PR restores the field
claimed(understaking) in thestaking-infoendpoint's response which was "broken". The root cause of this is explained here.For the Reviewer
To review this PR please refer to :
Todos
partially claimederas &erasStakersOverview= nulldepth.lastRewardinstead ofclaimedRewardsunderstakingLedgernominatorlogic mentioned in this commentIMPLEMENTATION_DETAILSguideChangelog
This PR introduces breaking changes to the
staking-infoendpoint response by :lastRewardfor early eras and addingclaimedRewardsupdated accordingly.claimedRewardsfield name after the breaking change of renaming it tolegacyClaimedRewardsclaimedRewardsfield (understaking) : before we had an array of eras that were claimed, now we have an object with the list of eras and their corresponding statusclaimedRewardsThese changes should be explicitly mentioned in the corresponding Changelog and Release Notes of the release in which this PR is included.