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

Staking/Distribution/Gov query support #1521

Open
5 of 32 tasks
webmaster128 opened this issue Nov 29, 2022 · 2 comments
Open
5 of 32 tasks

Staking/Distribution/Gov query support #1521

webmaster128 opened this issue Nov 29, 2022 · 2 comments

Comments

@webmaster128
Copy link
Member

webmaster128 commented Nov 29, 2022

Tracking stacking, distributions and gov queries.

staking

  • Validators: StakingQuery::AllValidators (only active set, no pagination support)
  • Validator: StakingQuery::Validator (only active set? At least that is documented)
  • ValidatorDelegations: inefficient, useful in contracts?
  • ValidatorUnbondingDelegations
  • Delegation: StakingQuery::Delegation
  • UnbondingDelegation
  • DelegatorDelegations: StakingQuery::AllDelegations
  • DelegatorUnbondingDelegations
  • Redelegations
  • DelegatorValidators
  • DelegatorValidator
  • HistoricalInfo
  • Pool
  • Params: only bond_denom query supported

distribution

  • Params
  • ValidatorDistributionInfo
  • ValidatorOutstandingRewards
  • ValidatorCommission
  • ValidatorSlashes
  • DelegationRewards
  • DelegationTotalRewards
  • DelegatorValidators
  • DelegatorWithdrawAddress
  • CommunityPool

gov (classic version, no v1 support)

Note: we do not have QueryRequest::Ggov yet, just Gov messages

  • Proposal
  • Proposals
  • Vote
  • Votes
  • Params
  • Deposit
  • Deposits
  • TallyResult
@webmaster128 webmaster128 changed the title Staking and Distribution query support Staking/Distribution/Gov query support Jan 17, 2023
@0xphilipp
Copy link

@webmaster128 Is this open for contribution? We are needing the Proposal query for one of our contracts.

And if yes, do you have a good example implementation of a query that I could use and port?

@webmaster128
Copy link
Member Author

The issue I see here is that – given this list – adding the queries one by one is not scalable. For each query we need to touch the codebases of cosmwasm, wasmvm and wasmd, worry about JSON serialization of requests and responses and have example contracts to ensure they actually work. Then the moment we have gov queries, the next requests will be coming from users who migrated to the new gov module v1 instead of the classic v1beta1.

The list of proposals adds a new challenge we have not solved in the past: pagination. Right now all queries return reasonably small data. For the list of validators this might already be an issue as some chains have a large number of active validators. While we might get away with it for validators, that won't work for proposals. Osmosis exceeded 400 proposals in less than 2 years.

I'll have to check what the status of the general purpose Stargate query is. It was disabled in wasmd due to non-determinism in some cases. Then I did not follow recent development around that.

So yeah, TLDR: it's complicated.

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

No branches or pull requests

2 participants