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

fix: claimed in staking info endpoint #1445

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/dist/app.bundle.js

Large diffs are not rendered by default.

33 changes: 27 additions & 6 deletions docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2656,8 +2656,13 @@ components:
stakingLedger:
$ref: '#/components/schemas/StakingLedger'
description: >-
Note: Runtime versions of Kusama less than 1062 will either have `lastReward` in place of
`claimedRewards`, or no field at all. This is related to changes in reward distribution. See: [Lazy Payouts](https://github.com/paritytech/substrate/pull/4474), [Simple Payouts](https://github.com/paritytech/substrate/pull/5406)
Note: After Sidecar's v.20.0.0, we always return the field `claimedRewards` under `stakingLedger`.
Before we returned `lastReward`, `claimedRewards` or `legacyClaimedRewards`. While these fields (and their corresponding calls)
are still taken into account, they are now only used in the background to calculate the right values for the `claimedRewards` field.
Note on lastReward: Runtime versions of Kusama less than 1062 will either have `lastReward` in place of
`claimedRewards`, or no field at all. This is related to changes in reward distribution.
See: [Lazy Payouts](https://github.com/paritytech/substrate/pull/4474),
[Simple Payouts](https://github.com/paritytech/substrate/pull/5406)
AccountStakingPayouts:
type: object
properties:
Expand Down Expand Up @@ -4259,11 +4264,27 @@ components:
format: unsignedInteger
claimedRewards:
type: array
description: Array of eras for which the stakers behind a validator have
claimed rewards. Only updated for _validators._
description: Array of objects, each containing an `era` and its corresponding `status`,
which represents the rewards status of the stakers backing a validator. Only updated
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 (https://github.com/paritytech/substrate-api-sidecar/pull/1445)
and linked issue (https://github.com/paritytech/substrate-api-sidecar/issues/1433#issuecomment-2075914389).
items:
type: string
format: unsignedInteger
type: object
properties:
era:
type: string
description: The era for which we check the rewards status.
format: unsignedInteger
status:
type: string
description: The rewards status of the stakers backing a validator.
enum:
- claimed
- unclaimed
- partially claimed
description: The staking ledger.
StakingProgress:
type: object
Expand Down
Loading