You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
With the recent MinimumActiveStake being put in storage, this could be complemented with a runtime call that returns the remaining metadata dashboards need to display vital active nominator / validator stats.
Proposed runtime call:
stakingApi.totalActiveStakers()
Purpose:
Gets a count of active nominators and validators at the currently active era.
Note that the active validator count is easy to get from validatorCount, and this call could indeed hjust be used to nominators and still retain some value. For completeness though, validators are included here so devs can avoid calling validatorCount in addition to this.
Validators would be those who have been elected, and nominators are those who are backing at least one of those validators (in erasStakers). This saves application-side code from iterating through the whole of erasStakers, accumulating an active nominators list by summing their bonds, and taking the least of those bonded values to find the minimum.
This calculation instead would be done by the call.
Returns the counts of active entities:
{
activeValidators: u32,
activeNominators: u32,
}
The text was updated successfully, but these errors were encountered:
If you are sure that this will help UIs, then we can easily do it. Just note that the API should not be doing all the calculation dynamically upon receiving the call. In that case, the API call would be rather unsafe. If reasonable, we can actually keep track of this number as we are collect_exposures-ing at the end of the era.
With the recent
MinimumActiveStake
being put in storage, this could be complemented with a runtime call that returns the remaining metadata dashboards need to display vital active nominator / validator stats.Proposed runtime call:
stakingApi.totalActiveStakers()
Purpose:
Gets a count of active nominators and validators at the currently active era.
Note that the active validator count is easy to get from
validatorCount
, and this call could indeed hjust be used to nominators and still retain some value. For completeness though, validators are included here so devs can avoid callingvalidatorCount
in addition to this.Validators would be those who have been elected, and nominators are those who are backing at least one of those validators (in
erasStakers
). This saves application-side code from iterating through the whole oferasStakers
, accumulating an active nominators list by summing their bonds, and taking the least of those bonded values to find the minimum.This calculation instead would be done by the call.
Returns the counts of active entities:
The text was updated successfully, but these errors were encountered: