IntersectMBO / IntersectMBO/cardano-ledger

Switch previous `PParams` to previous `ProtVer`

Open
#5,759 0 comments 0 reactions 0 assignees View on GitHub
:cake: good first issue
Dominant language
Haskell
Stars
295
Forks
179
Avg merge
4d 21h
Merged PRs (30d)
30

Description

This is an exploratory ticket. The goal is to identify if we can get rid of `prevPParamsGovStateL` in favor of new `prevProtVerGovStateL`.
I suspect the only part from `prevPParamsGovStateL` that we use is `ppProtocolVersionL`, which means the rest of the `PParams` that are retained in the state for prior epoch are not used at all.
Besides this having some unnecessary memory overhead, there is an issue retaining previous PParams in current form that is defined in the state. Occasionally when we cross era boundaries, this field will contain PParams from the previous era translated into the current era, which is totally wrong.

So, the goal is to change the field from `PParams` to `ProtVer` and see what breaks. If there is nothing that needs other info from `PParams`, then we should make this change permanent.
If it so happens that some parts besides `ProtVer` in `prevPParamsGovStateL` are actually used, then we will implement a proper solution, which will depend on what information is actually used.

Contributor guide

Open the contributing guide

Research direction

Search the ledger code for references to prevPParamsGovStateL and ppProtocolVersionL, then inspect how prior-epoch state is represented across era boundaries. Check whether any information besides the protocol version is read. Done means either replacing the retained PParams with ProtVer or documenting which additional information requires a different solution.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
blockchain
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.