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

Add GetRewardInfoPools local state query #3423

Merged
merged 5 commits into from
Dec 1, 2021
Merged

Conversation

HeinrichApfelmus
Copy link
Contributor

@HeinrichApfelmus HeinrichApfelmus commented Oct 8, 2021

Issue number

CAD-3479

Summary

Introduces a new local state query GetRewardInfoPools which provides up-to-date information the stake pool rewards and ranking.

@KtorZ
Copy link
Contributor

KtorZ commented Oct 10, 2021

Isn't this one a bit redundant with GetRewardProvenance 🤔 ?

@HeinrichApfelmus HeinrichApfelmus changed the title Add GetRewardInfoPool local state query Add GetRewardInfoPools local state query Oct 11, 2021
@HeinrichApfelmus
Copy link
Contributor Author

Isn't this one a bit redundant with GetRewardProvenance 🤔 ?

Unfortunately, it's not redundant enough. 😅 Specifically,

  • The GetRewardProvenance query returns the stake distribution and pool parameters from the snapshot labeled "go". At the time of query execution, this snapshot is two epochs old.
  • The new GetRewardInfoPools query returns the current stake distribution and pool parameters*. To make an informed delegation choice, this information is required, as only this information pertains to the current epoch.

* "current" pool parameters (cost, margin) include any parameter changes from the previous epoch, but not from the current epoch.

@KtorZ
Copy link
Contributor

KtorZ commented Oct 11, 2021

Well, that's unfortunate 😅...

Although, as far as I remember, the main reason for introducing GetRewardProvenance was to give local clients means to make educated delegation choices. So perhaps the semantic of this query needs to be revised 🤔?

@HeinrichApfelmus
Copy link
Contributor Author

So perhaps the semantic of this query needs to be revised 🤔?

Maybe, but changing the query semantics would not be backwards compatible (for example, the data types differ). My thinking was that adding a new query and deprecating the old one later would be the least disruptive path to getting a query with suitable semantics.

@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/CAD-3479 branch from 69187b9 to 31a44bf Compare October 11, 2021 12:28
@nfrisby
Copy link
Contributor

nfrisby commented Oct 12, 2021

Please also add an entry atop the https://github.com/input-output-hk/ouroboros-network/blob/master/ouroboros-consensus/docs/interface-CHANGELOG.md file. Thanks!

@nfrisby
Copy link
Contributor

nfrisby commented Oct 20, 2021

We reviewed the use of versions here during a recent Consensus Planning call. I think the PR looks good.

@HeinrichApfelmus What's the status here? Do you have a plan for the CI failures?

I'm just double-checking that you're not blocked on us. Thanks.

@nfrisby
Copy link
Contributor

nfrisby commented Oct 20, 2021

Also, we merge with bors and it includes the PR description in the resulting merge commit. So would you please remove the "Comments" section from the PR description? (Maybe relocate it as a quote in a reply to this comment for posterity's sake.)

@nfrisby
Copy link
Contributor

nfrisby commented Oct 20, 2021

Lastly (I'm sorry for the comment barrage), we just merged a PR that updates the cardano-ledger-specs dependency. So you'll likely need to rebase onto master and then you'll be able to drop at least one of your commits (the want one that handles a deprecation warning from c-l-s).

@HeinrichApfelmus
Copy link
Contributor Author

So would you please remove the "Comments" section from the PR description? (Maybe relocate it as a quote in a reply to this comment for posterity's sake.)

For posterity here the comments that were originally in the PR description:

Comments

@HeinrichApfelmus
Copy link
Contributor Author

HeinrichApfelmus commented Oct 21, 2021

What's the status here? Do you have a plan for the CI failures?

we just merged a PR that updates the cardano-ledger-specs dependency. So you'll likely need to rebase onto master and then you'll be able to drop at least one of your commits

Great, thanks! The merge of the PR from cardano-ledger-specs is essentially what I was waiting for. There is little point in appeasing CI if the main function to be called does not exist yet. 😄

@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/CAD-3479 branch 2 times, most recently from e22fbff to 81a85ad Compare October 25, 2021 11:29
@HeinrichApfelmus
Copy link
Contributor Author

@nfrisby CI is now green. From my perspective, this PR is ready to be merged. 😊

If you merge this at the same time as #3404 , then you only have a single bump to NodeToClientV_11.

@@ -361,6 +362,21 @@ pattern CardanoNodeToClientVersion7 =
:* Nil
)

-- | The hard fork enabled, and the Shelley, Allegra, Mary and Alonzo eras enabled
-- Using 'ShelleyNodeToClientVersion5' for the Shelley-based eras , which
-- enables new queries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to refer to what these new queries are?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that since comments are particularly susceptible to bitrot, it would be best if I mention the specific queries in a single place only, in this case the definition of ShelleyNodeToClientVersion5.

But I you prefer, I'm happy to the specific query (GetRewardInfoPools) at the definition of CardanoNodeToClientVersion8 as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured that since comments are particularly susceptible to bitrot, it would be best if I mention the specific queries in a single place only, in this case the definition of ShelleyNodeToClientVersion5.

Sure, that makes sense. I'm ok with the comment as is.

Copy link
Member

@dnadales dnadales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@nfrisby nfrisby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HeinrichApfelmus Please issue bors merge whenever you're content with the commits (eg after one final rebase, etc). Thanks!

… and try to add appropriate version numbers.

NOTE: This depends on a new function `getRewardInfoPools` in `cardano-ledger-specs`
@HeinrichApfelmus HeinrichApfelmus force-pushed the HeinrichApfelmus/CAD-3479 branch from 81a85ad to 2da0d31 Compare November 30, 2021 12:42
@HeinrichApfelmus
Copy link
Contributor Author

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 1, 2021

@iohk-bors iohk-bors bot merged commit 4a99407 into master Dec 1, 2021
@iohk-bors iohk-bors bot deleted the HeinrichApfelmus/CAD-3479 branch December 1, 2021 11:19
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

Successfully merging this pull request may close these issues.

4 participants