-
Notifications
You must be signed in to change notification settings - Fork 34
Utilize new PParams prediction functionality for HFC #1078
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
Utilize new PParams prediction functionality for HFC #1078
Conversation
0f58889 to
7b15748
Compare
ad3720a to
45e379c
Compare
amesgen
left a comment
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.
Great to see the hard fork detection code being moved to Ledger, looks very clean! 🎉
| pparamsUpdate st = | ||
| let nes = shelleyLedgerState st | ||
| in ShelleyUpdatedPParams | ||
| (nes ^. SL.newEpochStateGovStateL . SL.futurePParamsGovStateG) |
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.
If want to further minimize the API surface: It would suffice to just store the protocol version here.
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.
EpochNo is used in shelleyTransition, but my worry was that guard $ updatesBefore /= updatesAfter is affected by removal of this epochNo, so if they are guaranteed to be the same, then we can remove it from ShelleyLedgerUpdate
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.
Right, I was imprecise; I think it makes sense to keep EpochNo here; but the Maybe (Core.PParams era) could be changed to Maybe ProtVer.
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.
So this suggestion would be fine if inspectLedger was only used for predicting protocol version. I am just really not sure that this is indeed the case. I would suspect that updates to other protocol parameters could be useful for inspection as well?
In other words if I thin this to only ProtVer then inspecLedger will return Nothing on any other parameter update, while previously it would return a Just value, due to some parameter change and this guard $ updatesBefore /= updatesAfter
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/ShelleyHFC.hs
Show resolved
Hide resolved
45e379c to
902aeaf
Compare
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/ShelleyHFC.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/ShelleyHFC.hs
Show resolved
Hide resolved
18f13c8 to
c3ae431
Compare
Use the updated behavior Fixup haddock to reflect generality of protocol version update
Change in serialization is due to the addition of future `PParams` to the `LedgerState`
c3ae431 to
4f4296f
Compare
Description
Please include a meaningful description of the PR and link the relevant issues
this PR might resolve.
Also note that: