-
Notifications
You must be signed in to change notification settings - Fork 156
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
Made some preparations for Conway era #3216
Conversation
5eb57d7
to
d9d983e
Compare
f2e169f
to
c591901
Compare
f829af1
to
6f2be71
Compare
00c3395
to
a9bfac5
Compare
f650268
to
626de04
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.
I haven't matched it to the spec, but I think @JaredCorduan already did that and I am sure we'll be going through the rules in the end again anyways. Implementation wise it looks great. Few minor remarks, like redundant constraints and such, but nothing terribly important.
There was a couple of prior comments that were marked as resolved, but in fact weren't resolved, so I unresolved them. I am sure it was an accident, but mentioning it just in case.
Massive work, great job @Soupstraw!
eras/shelley/impl/src/Cardano/Ledger/Shelley/LedgerState/Types.hs
Outdated
Show resolved
Hide resolved
yes to both!
💯 ☝️ |
a7c8167
to
5d4c8e3
Compare
Made `PPUPState` and `PPUPPredFailure` into type families so that we can switch out the concrete instances in Conway and future eras. Added `EraTallyState` type family so that we don't have to make `LedgerState` into a type family and we can just set the tally state to a unit in pre-Conway eras.
5d4c8e3
to
6443c3c
Compare
Description
This PR makes some changes in preparation for the Conway era. The changes are based on IntersectMBO/formal-ledger-specifications#40.
Rule graph
New typeclasses
This PR turns some data types into typeclasses.
PPUPState
andPPUPPredFailure
are now closed type families parametrized by era. This makes it easy to swap out fields of those types in Conway and future eras. I also added a new type familyTallyState
which has a nullary constructorNoTallyState
in all eras before Conway.Changes to rules
The old PParam update logic got replaced with governance actions and with that I got rid of the
UPEC
rule and addedTALLY
andENACTMENT
rules. TheTALLY
rule has been implemented as specified in the formal specification.ENACTMENT
is just a stub for now.Conway transaction body
Since protocol parameters are no longer a part of
TxBody
, I added a getter for thePParamsUpdate
in the transaction body that returns an empty update starting from conway. This got rid of some protocol version constraints and made it possible to reuse some functions from previous eras.Ledger state
The ledger state datatype now has a tally state. In pre-Conway eras this field uses the datatype of
ShelleyTallyState
which only has a nullary constructor, but in the Conway era it is a map of governance action ID to governance action state, which stores information about the governance action and all the votes that the action has received.This PR also adds an
EraTallyState
class that specifies the type instance ofTallyState
in that era and also provides a way to create an emptyTallyState
of that type.resolves #3147
resolves #3148
resolves #3159
Checklist
scripts/ormolise.sh