-
Notifications
You must be signed in to change notification settings - Fork 23
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
Remove ShelleyGenesis from ShelleyLedgerConfig #409
Remove ShelleyGenesis from ShelleyLedgerConfig #409
Comments
We recently assigned Issue #571 to @yogeshsajanikar -- we wanted an onboarding techdebt task that was directly altering the code because his onboarding work so far has been on infrastructure concerns. We wanted something for him that is more directly Consensus work. I'm also assigning this one to him. I think both Issues have a relatively narrow scope, won't require a burdensomely-large diff in the end, but aren't trivial. All of those are good qualities for this kind of onboarding. If Yogesh chooses one, maybe we'll give the other to Bart when Bart returns. |
The The slotNo and the epochNo are (indirectly) part of the So there are two failure modes when we try to use existing information outside of
Another interesting side note: The formal specification of the Shelley ledger (on page 11) seems to imply that at least the epoch size is considered to be a global constant for the Shelley ledger. Why is it not in |
The Shelley ledger formal spec is written from the perspective of a single era -- it doesn't consider the HFC. And within a single era, the epoch size (and |
The external API used by the node makes use of the This puts the status of this issue on blocked until further notice. |
Hmm. Looks like that query
Those are all selectors from this record type: https://github.com/input-output-hk/cardano-node/blob/df1dea590d9ad7a6caed58147ad8792ff98711db/cardano-api/src/Cardano/Api/GenesisParameters.hs#L37
Those fields are also all present in the similar data type in the Ledger https://github.com/input-output-hk/cardano-ledger/blob/9a25a43f3970941a2cd64029f7ce667b48832635/libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs#L585
My proposed So this doesn't seem fully blocked to me. It's a matter of:
|
Thank you for these pointers @nfrisby 👍 These three action points sound sensible. Let's try that. |
One idea would be to keep the This could be done by adding it as a field to the This would minimize the scope of the issue (shrinking the Shelley ledger cfg to what actually needs translating) without having to submit upstream PRs (IIRC, a PR to wallet would otherwise also be necessary). At the same time, it does not prevent tweaking/removing |
Bah! I could have sworn I already wrote a reply here... I'll attempt to replicate what I thought I wrote, but I'm a bit rushed at the moment. We discussed this on a call. I think Esgen's suggestion is strictly-speaking an improvement (because it avoids the unnecessary translations---he emphasized on the call that we never translate I think it's valuable as a contingency plan, if we (ie mostly Bart) determines that the current plan is an overwhelming amount of change. |
My plan is to do this in two steps, and separate blocks of PRs:
The benefits to this approach, as I see them, are that we keep a sense of progress, and that we separate the work involving mostly simple changes to the codebase, from the work (and the delays) involved in interacting with other teams. The drawback that there is overhead in re-implementing the |
Sounds good. It'll end up with some excessive churn in the commit diffs, but that's ultimately fine if it simplifies the work for you 👍 |
I updated the description of this ticket to reflect what I just now commented on here: IntersectMBO/cardano-ledger#3053 (comment) |
I am running into a conceptual complication executing the plan on removing Genesis from the ShelleyLedgerConfig. The issue is that there is another thing in ledger, the Now, the The obvious technical work-around is to keep the separation between Byron and Shelley-based era's in the
I'd be interested in discussing approaches, including the one where we take the easy way out, and leave cleaning up the relation for later. Including @amesgen in the discussion, as we had some talks about this PR earlier. |
Update: we've discussed a bit on Slack, Crucially, @amesgen noticed the relation to a change I made in this neighborhood when drafting the Conway PR. I think that decoupled the two type families in a way that unblocks Bart here, but hopefully @bartfrenk can confirm that and write a follow-up explanation here 👍 |
This ticket was automatically and wrongfully closed by github because it had the keyword |
Marked this as "Ready" again. Current status: The relevant upstream PRs (IntersectMBO/cardano-ledger#3164, IntersectMBO/cardano-ledger#3224) have landed and have been in the cardano-ledger releases for quite some time. In particular, The remaining work is to remove |
The difference between Babbage and Conway was intentionally as minimal as possible. This has a couple benefits.
Clarke had orchestrated the integration of new eras. So it's nice that the first one we did without him is so minimal.
The minimality helped us (especially in Clarke's absence) notice the aspects that we found confusing.
This Issue is about one such aspect: I don't think
ShelleyGenesis
(asCompactGenesis
) should be in theShelleyLedgerConfig
. In other words, I'm proposing removing the following function.I've catalogued its uses as follows:
Ouroboros.Consensus.Cardano.CanHardFork
for translating/forecasting from Byron to the first Shelley era. This is a necessary use.Ouroboros.Consensus.Shelley.Ledger.Inspect
,Ouroboros.Consensus.Shelley.Ledger.Ledger
, andOuroboros.Consensus.Shelley.ShelleyHFC
to get the value ofk
,f
(only used to compute the stability window),quorum
,slotLength
, andepochLength
. I think all of these could and should instead use the (already-existing!)shelleyLedgerGlobals :: SL.Globals
field.The second bullet point is for enabling the hard fork combinator, which every era needs to do. The first bullet point is instead for translating from Byron to Shelley, which only the first Shelley-based era needs to do. Moreover, I don't think we want to require that any Shelley-based era could be the successor Byron, do we? So I propose:
(see IntersectMBO/cardano-ledger#3053 (comment) for motivating the
StaticMaybe
layer)where in the ledger we have:
As a result of this, we should be able to remove all of the oxymoronic
TranslateEra ShelleyGenesis
instances. We'll have to replace them withTranslateEra Globals
instances (or some translate-able data that determines theGlobals
). For example, these new translation instances won't even have a "genesis delegates" field, and so it'll avoid the existing confusing fact that theTranslateEra ShelleyGenesis ConwayEra
instance does not need to update thesgGenDelegs
field!The text was updated successfully, but these errors were encountered: