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

Split GET delegators/{address} endpoint #2258

Closed
3 of 4 tasks
fedekunze opened this issue Sep 7, 2018 · 4 comments
Closed
3 of 4 tasks

Split GET delegators/{address} endpoint #2258

fedekunze opened this issue Sep 7, 2018 · 4 comments

Comments

@fedekunze
Copy link
Collaborator

fedekunze commented Sep 7, 2018

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:

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

  1. 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.

  1. Get rid of GET stake/delegators/{delegatorAddress}

cc: @jackzampolin @faboweb @alexanderbez


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alessio
Copy link
Contributor

alessio commented Sep 7, 2018

I'd second this 👍

@alexanderbez
Copy link
Contributor

++

@faboweb
Copy link
Contributor

faboweb commented Sep 7, 2018

I doubt that this solves the problem. Do we have any metrics that proof that this will reduce the time until we have all the data?

@jackzampolin
Copy link
Member

Sounds like there is consensus here. Is there any work on implementation here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants