-
Notifications
You must be signed in to change notification settings - Fork 13
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
Change the way SPO votes are counted #594
Conversation
This closes issue #578.
(It's unclear to me whether this is the intent of the WIP section of the CHANGELOG, or whether I should have left this issue in the 0.9 section.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what actually needs to be done here is a bit more complicated. DState.voteDelegs
needs to be available to actualSPOVotes
. Then, if you have a credVoter SPO c
, you need to lookup c
in voteDelegs
and the result of that lookup is the default vote.
@WhatisRT @Lucsanszky I've revised the SPO default vote function. I think it's correct now, but let me know if you notice anything wrong with it. Thanks! |
@WhatisRT @williamdemeo conformance is still failing for me. I had a better look at the ledger implementation (here's my PR which updates the SPO vote counting: IntersectMBO/cardano-ledger#4659) and the spec. To me it seems like that they indeed don't really match. In the implementation, we check if the SPO's reward address is delegated to an
|
@Lucsanszky Your description seems reasonable to me. I'll go ahead and try to change the Agda code to match your understanding of how the policy should be implemented. I'll let you know when the changes are done. |
@Lucsanszky I believe |
At a first glance, this looks good! Unfortunately, conformance is still failing but that could be because of something else (and I have an idea why). Anyways, I'll wait for @WhatisRT's approval. Thanks! |
Okay, conformance passes. :) I opened a PR which also adds your changes to the conformance files, feel free to cherry pick the commits. Also, I took the liberty to slightly change your specification and opted not to pass in the complete |
Looks good. Thanks @Lucsanszky! I've merged your mods into this PR, so you can close your PR. |
Andre's changes were addressed last week and he has been indisposed and busy with other things since then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! 👍
\end{code} | ||
\begin{code}[hide] | ||
λ where | ||
getPoolParams : Credential → Maybe PoolParams | ||
getPoolParams c = case lookupᵐ? stakeDelegs c of λ where nothing → nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lookup is incorrect, you just need to lookup c
in pools
(if it is a KeyHash
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good to know, thanks. If there is a particular place in a prior version of the spec or a CIP that would have helped me understand this better so that I wouldn't have made this mistake, please advise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. It's just that lookupᵐ? pools c
is the PoolParams
associated to c
and contains c
's RewardAddr
, which is what you want. As the code is written here, it gives you the PoolParams
of the pool that c
is delegating to which could be any random pool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks for the explanation. Very helpful. 👍🏼
SPODefaultVote _ _ = Vote.no | ||
|
||
actualCCVote : Credential → Epoch → Vote | ||
actualCCVote c e = case getCCHotCred (c , e) of λ where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you un-hide the λ where
? It just makes the PDF more confusing to people who don't know Agda.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, the only way I could get the TeX to compile without the "missing parameter l" error was to expose the λ where
here and above. I tried many permutations of exposing and hiding various parts of the code, and the one I ended up with was the closest to what we want while still getting the pdf to compile without error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably just this bug again: agda/agda#7290
You probably just need to indent the clauses of the λ where
a bit more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's exactly that bug. I tried indenting all sorts of ways, but I'll try again to get it to compile while hiding all the λ where
s and I'll also fix the bug in getPoolParams
, of course.
|
||
SPODefaultVote : GovAction → VDeleg → Vote | ||
SPODefaultVote (TriggerHF _) _ = Vote.no | ||
SPODefaultVote NoConfidence (credVoter SPO c) = case getPoolParams c of λ where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those λ where
s should be hidden as well
Sorry, this is incorrect, and the implementation is probably too (if this is what makes conformance tests pass). Also, looking at this it would make much more sense to just use the credential of the stake pool itself instead of the reward account. Why should voting & setting the default for the vote require 2 different credentials? |
It is too late to change implementation.
Why would Stake Pool private key be used for both managing a pool and registering a stake credential? |
Description
This closes issue #578.
Checklist
CHANGELOG.md