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

PoS - refactor the crate's API #19

Closed
tzemanovic opened this issue Sep 7, 2021 · 2 comments · Fixed by #570
Closed

PoS - refactor the crate's API #19

tzemanovic opened this issue Sep 7, 2021 · 2 comments · Fixed by #570

Comments

@tzemanovic
Copy link
Member

tzemanovic commented Sep 7, 2021

Consider refactoring the PoS crate's main API, which currently provides traits for the transaction and base ledger integrations.

┆Issue is synchronized with this Asana task by Unito

@tzemanovic
Copy link
Member Author

The approach to this will be to use trait StorageRead introduced in #324 (with some related follow-up PRs, currently included in draft #352) to provide a simpler read queries interface at PoS specific RPC paths.

This is because with the raw PoS data, to e.g. find a staking power of a validator or delegator, one must read from multiple storage values (slashes and reward products), so it's much better if that's handled on the ledger's side before returning back to client, instead of the client having to query the raw storage value multiple times.

@tzemanovic tzemanovic moved this from Low-prio to Todo in Namada-Old Sep 15, 2022
@tzemanovic
Copy link
Member Author

I'm switching this to high priority as it will help with code re-use (in e.g. our client, governance which needs to know voting power of validators and delegators for proposal tallying), other integrations wanting to query PoS state such as namada-interface. It will also help with PoS development for which we need to do many breaking changes to the storage layout and types, but can and should be hidden from PoS state consumers by such RPC interface.

@tzemanovic tzemanovic self-assigned this Sep 15, 2022
@tzemanovic tzemanovic moved this from Todo to WIP in Namada-Old Sep 22, 2022
This was referenced Oct 6, 2022
Repository owner moved this from WIP to Tested in Devnet in Namada-Old Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Tested in Devnet
Development

Successfully merging a pull request may close this issue.

2 participants