-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow legacy dereg
certs
#638
Conversation
d4e985b
to
4cb1ced
Compare
@@ -130,7 +130,7 @@ data _⊢_⇀⦇_,DELEG⦈_ where | |||
|
|||
DELEG-dereg : | |||
∙ (c , 0) ∈ rwds | |||
∙ (CredentialDeposit c , d) ∈ dep | |||
∙ d ≡ 0 ⊎ (CredentialDeposit c , d) ∈ dep |
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 think it'd make more sense to change the type of the deposit so that we can check d ≡ nothing
instead. I guess the idea here is that the deposit must be there because of the previous line, so we don't need to check that the credential appears in the deposits map. Still looks a bit weird though...
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.
@WhatisRT, just to be clear, are you suggesting line 133 should be
∙ d ≡ nothing ⊎ (CredentialDeposit c , d) ∈ dep
...and change the type of the deposit so the above type-checks?
I must admit, I don't fully understand this change (beyond maybe "that's what the implementation does"). @Soupstraw could you explain?
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 changed the type of the deposit field to Maybe Coin
and then added an additional check that the declared deposit is eihter nothing
or just d
, where d
is equal to the deposit in the deposits map for the credential c
. The former case is the "legacy" certificate which will be phased out in a future era and the latter is the one we want people to be using from Conway onwards.
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.
But both certificates are accepted in Conway, so it makes sense to also talk about it in the spec, because people who implement smart contracts should be aware that the legacy certificates also exist.
dereg
certs
4cb1ced
to
683c0da
Compare
683c0da
to
e6a23cf
Compare
e6a23cf
to
8102d88
Compare
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. I just merged another PR though, so this needs a rebase
Ah, you already did that, nevermind |
Description
This PR changes the
DELEG-dereg
rule so that the deposit can be zero. In the implementation the deposit is optional and if it's not provided, we translate that to a deposit of zero. The implementation does that for backwards compatibility because the previous eras did not have a deposit field in thedereg
cert.closes #636
Checklist
CHANGELOG.md