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
Split the logic of GET stake/delegators/{delegatorAddress} into 3 endpoints:
GET stake/delegators/{delegatorAddress}/delegations
GET stake/delegators/{delegatorAddress}/unbonding_delegations
GET stake/delegators/{delegatorAddress}/redelegations
Problem Definition
One of the problems of the bad performance of the delegator endpoint (described in detail in #2009) is due to the fact that it concentrates the logic of 3 different endpoints in a single DelegationSummary which is returned to the client:
// aggregates of all delegations, unbondings and redelegations
type DelegationSummary struct {
Delegations []Delegation `json:"delegations"`
UnbondingDelegations []UnbondingDelegation `json:"unbonding_delegations"`
Redelegations []Redelegation `json:"redelegations"`
}
Also the current name of the endpoint does not describe the logic of the endpoint. One would expect from GET stake/delegators/{delegatorAddress} to obtain the information of a delegator and not a DelegatorSummary, but since a delegator is just a mere AccAddress there's no point on keeping that endpoint.
Proposal
Split the logic of GET stake/delegators/{delegatorAddress} into 3 endpoints:
GET stake/delegators/{delegatorAddress}/delegations:
GET stake/delegators/{delegatorAddress}/unbonding-delegations
GET stake/delegators/{delegatorAddress}/redelegations
This will require to create 3 new queriers for each of this endpoints.
Get rid of GET stake/delegators/{delegatorAddress}
Summary
Split the logic of
GET stake/delegators/{delegatorAddress}
into 3 endpoints:GET stake/delegators/{delegatorAddress}/delegations
GET stake/delegators/{delegatorAddress}/unbonding_delegations
GET stake/delegators/{delegatorAddress}/redelegations
Problem Definition
One of the problems of the bad performance of the delegator endpoint (described in detail in #2009) is due to the fact that it concentrates the logic of 3 different endpoints in a single
DelegationSummary
which is returned to the client:Also the current name of the endpoint does not describe the logic of the endpoint. One would expect from
GET stake/delegators/{delegatorAddress}
to obtain the information of a delegator and not aDelegatorSummary
, but since a delegator is just a mereAccAddress
there's no point on keeping that endpoint.Proposal
GET stake/delegators/{delegatorAddress}
into 3 endpoints:GET stake/delegators/{delegatorAddress}/delegations
:GET stake/delegators/{delegatorAddress}/unbonding-delegations
GET stake/delegators/{delegatorAddress}/redelegations
This will require to create 3 new queriers for each of this endpoints.
GET stake/delegators/{delegatorAddress}
cc: @jackzampolin @faboweb @alexanderbez
For Admin Use
The text was updated successfully, but these errors were encountered: