-
Notifications
You must be signed in to change notification settings - Fork 15
Made CERTBASE
get applied at the end of CERTS
#710
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
base: master
Are you sure you want to change the base?
Conversation
d859917
to
2ebfcbd
Compare
dereg
does not remove delegationsCERTBASE
get called last in CERTS
CERTBASE
get called last in CERTS
CERTBASE
get applied at the end of CERTS
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.
Good catch!
I see where the problem comes from:
ReflexiveTransitiveClosureᵇ'
has nothing to do with a basecase (as the superscript seems to indicate) but about nonemptyness.
Maybe you can remove this definition (and _⊢_⇀⟦_⟧*'_
which doesn't seem to be used anywhere) as part of this PR? (if not please open an issue so we keep track of it)
|
What conformance test issue does this address? |
@carlostome I added the issue number above |
ea7a63f
to
5e85af0
Compare
5e85af0
to
789d8f7
Compare
789d8f7
to
57731ff
Compare
@Soupstraw I'm going to see if I can modify your PR so that it addresses the conformance test issue (#635) while also preserving the changes I made a while back to resolve issue #545 (PR 604). |
∙ filter isKeyHash wdrlCreds ⊆ dom voteDelegs | ||
∙ mapˢ (map₁ stake) (wdrls ˢ) ⊆ rewards ˢ |
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.
@Soupstraw I see you moved these two premises to the LEDGER
rule. Could you explain why they can't remain here? (I need them here for the proof of the CERTBASE-pov
lemma, which is used in the proof of CERTS-pov
.)
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.
The problem with the first premise is that in the implementation we check it in the LEDGER
rule. I guess we could keep it in the same place in the spec and change the implementation instead. The important part is that it's still checked before the certs are applied, like it was before this PR.
The thing that was wrong was that validVoteDelegs
was applied before the certificates had been applied. This caused DRep delegations to not get removed when the transaction had a unregdrep
certificate, because the filter function used the old dReps
map, where the DRep was still registered.
I think the second one could actually stay here as well if we call CERTBASE
at the start, but I think it makes way more sense to do anything related to withdrawals in the LEDGER
rule. The fact that we do the withrawals logic in CERTS
is because that's how it was done in Shelley, before we had a dedicated CERTS
rule. The withdrawals don't really have anything to do with certificates, so I don't think it makes sense to keep it here, and I've talked with @WhatisRT and @lehins about this and they both agreed. I've already moved that check to LEDGER
in the implementation, so I think it'd be good to do it here also.
I think the best solution would be to have two base cases in the CERTS
rule, one that gets applied at the start and then another that gets applied at the end. That way we can do the checks before we apply the certificates, and then update the voteDelegs
only once we have applied all the certificates.
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.
Okay, I'll have to take a closer look at this to refresh my memory and really understand exactly what's going on. My impression was that the premises that were moved were required for the CERTS-pov
proof... but it's possible the statement of that property turns out to be wrong and/or not actually what we want. I think you understand this issue better than anyone right now, so I trust your judgment on it, and would be grateful if you could take some time at the water cooler today to explain it. I will then help with this PR by fixing the CERTS-pov
theorem statement and construct a new proof of it.
It seems too much has changed here for me to be able to recover the proof of I recommend either (a) revert some of the changes (and, if necessary, modify the Haskell implementation so conformance tests pass) OR (b) somehow find a new proof of pov for Since I'm not sure (b) is possible, I vote for (a). Perhaps it's just a matter of moving the two premises back to By the way, I was able to fix some of the type-checking errors by copying the changes you made to |
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.
The PR doesn't type check right now. (Please see other comments.)
@williamdemeo I thought that if |
Sure, but I can also help with the pov proofs. As I mentioned above, it's possible we will need to adjust the statements of the properties we're proving. |
Description
Previously the
CERTBASE
rule was applied to the state before theCERT
transitions happened, but this caused the DRep delegations not get removed when the DRep was removed with thederegdrep
certificate.I've modified
CERTS
so thatCERTBASE
now gets applied last, after all of the certificates have been applied. I also moved reward withdrawals fromCERTS
toLEDGER
.closes #635
Checklist
CHANGELOG.md