-
Notifications
You must be signed in to change notification settings - Fork 25
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
HFC: generalize cross era ticking #1295
base: main
Are you sure you want to change the base?
Conversation
47ed819
to
aba5ef9
Compare
This makes a few things more convenient in a follow-up commit, and should be very easy for downstream users to adapt to.
A subsequent commit will remove the `InPairs` of `Translate`ions from `CanHardFork`. Apart from their use in the HFC, they are also used for Cardano to create initial non-Byron extended ledger states at Genesis. This commit refactors this logic to no longer rely on `CanHardFork`, while being semantically equivalent. See the added Note [Creating the initial extended ledger state for Cardano] for details.
Co-authored-by: Nicolas Frisby <[email protected]>
aba5ef9
to
a2e7828
Compare
-- TODO justify | ||
case State.match (State.tip st) st' of | ||
-- TODO Previously, this might have been 'TransitionKnown' if the | ||
-- next era uses 'TriggerHardForkAtEpoch'. It /seems/ | ||
-- inconsequential that we know a bit less here. | ||
Left _ -> TransitionUnknown (ledgerTipSlot lst) | ||
Right _ -> State.mostRecentTransitionInfo cfg st |
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.
FTR this is the tricky party. There will be a difference in behavior here e.g. when someone configures TriggerHardForkAtEpoch
with a non-zero argument. (Ideally we want to remove that functionality, see #416.)
An alternative we discussed was to let the cross-era ticking function return a TransitionInfo
, but this also seems very ad-hoc.
The other alternative is to use WhetherTickedOrNot
as in #358.
Closes #345
Essentially a revived version of #358. Main difference/simplification is that this PR doesn't use
WhetherTickedOrNot
, but this requires careful thought.