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

Update query type of LocalStateQuery protocol for Shelley #1442

Closed
mrBliss opened this issue Jan 10, 2020 · 4 comments · Fixed by #1848
Closed

Update query type of LocalStateQuery protocol for Shelley #1442

mrBliss opened this issue Jan 10, 2020 · 4 comments · Fixed by #1848
Assignees
Labels
consensus issues related to ouroboros-consensus daedalus When the wallet switches from cardano-sl to the new node
Milestone

Comments

@mrBliss
Copy link
Contributor

mrBliss commented Jan 10, 2020

See #1366. Shelley will need more/different types of Queries, so the query type of the LocalStateQuery will need to be extended/updated to accommodate for the new functionality required by the Shelley wallet.

@mrBliss mrBliss added consensus issues related to ouroboros-consensus shelley mainnet daedalus When the wallet switches from cardano-sl to the new node labels Jan 10, 2020
@mrBliss mrBliss added this to the S6 2020-02-13 milestone Jan 10, 2020
@dcoutts
Copy link
Contributor

dcoutts commented Jan 10, 2020

In particular extra things this will cover include:

  • info about stake pools (probably just bulk info)
  • reward account values (probably just query individual accounts)

@mrBliss
Copy link
Contributor Author

mrBliss commented Jan 23, 2020

Copying from #1366 (comment)

I am not sure where to log this so, for lack of a better place I'll put it here:

For Byron, @dcoutts has already captured the requirements / needed pieces of the ledger state (updatable protocol params & confirmed update proposals).

For Shelley, we are looking for:

* All the Byron's requirements

* The rewards given to a particular account. The latest balance would be a must-have, while the complete history would be a nice-to-have (although I am not sure of the feasibility for the node. This is something we would likely keep in an explorer).

* The stake distribution of past epochs, per epoch, (up to a certain age, last `k` is nice but also much more than what we would need) in terms of pools ids (who owns what?).

* The total reward amount distributed in past epochs, per epoch (i.e. the `R` in the incentive paper).

Cheers!

@mrBliss mrBliss self-assigned this Feb 4, 2020
@KtorZ
Copy link
Contributor

KtorZ commented Feb 10, 2020

*Small precision, I was probably a bit tired when I wrote this 🙃
About the stake distribution, what I meant to say was that, having the last k is nice but NOT sufficient. We need to know the stake distribution of at least the previous epoch. So we are looking more for 10*k than k (although, I assume this particular ratio is not set in stone).

@edsko edsko modified the milestones: S6 2020-02-13, S7 2020-02-27 Feb 10, 2020
@edsko
Copy link
Contributor

edsko commented Feb 17, 2020

So @dcoutts , @mrBliss and myself discussed this. Our current proposal is:

  • The Shelley ledger is extended with rules (and state) for maintaining stakepool performance, which can then easily be queried through the LocalStateQuery protocol.
  • We do not offer the wallet any historical data. If/when the wallet needs to present historical data to the user, it is responsible for replaying the chain as it sees fit (it can of course reuse the ledger library to do so) -- if useful, it could do this out-of-process.

There isn't too much point having the node implement a view on historical data, as in either case the user's machine would now temporarily have two copies of the ledger state in memory. The only advantage might be that the node could maintain additional snapshots of the ledger state (say, one per epoch) but that too is probably excessive for most users (currently that would result in about 11 GB of data), although it might be an option for exchange nodes.

@edsko edsko modified the milestones: S7 2020-02-27, S8 2020-03-12 Feb 27, 2020
@mrBliss mrBliss modified the milestones: S8 2020-03-12, S9 2020-03-26 Mar 3, 2020
iohk-bors bot added a commit that referenced this issue Mar 25, 2020
1848: Shelley: update query type of LocalStateQuery protocol r=mrBliss a=mrBliss

Fixes #1442.

Co-authored-by: Thomas Winant <thomas@well-typed.com>
@iohk-bors iohk-bors bot closed this as completed in 2b3be37 Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus daedalus When the wallet switches from cardano-sl to the new node
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants