-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Labels
💳 technical-debtIssues related to technical debt we introducedIssues related to technical debt we introducedmaintenanceTasks that are planned to be done as part of the regular maintenance of the project.Tasks that are planned to be done as part of the regular maintenance of the project.peras
Description
We need a proper interface for the block header in order to make it safer and get rid of BHeaderView:
class EraBlockHeader h era | era -> h where
blockHeaderSizeBHeaderL :: SimpleGetter (Block h era) BHeaderView
blockIssuerBHeaderL :: LensSimpleGetter (Block h era) (KeyHash BlockIssuer)
blockBodySizeBHeaderL :: Lens' (Block h era) BHeaderView
...Then there would be separate type classes:
class EraBlockHeader h era => ShelleyEraBlockHeader h era where
prevEpochNonceBHeaderL :: Lens' (Block h era) PrevEpochNonce
class EraBlockHeader h era => DijkstraEraBlockHeader h era where
--- Peras related lensesThis would prevent ugliness like this: https://github.com/IntersectMBO/ouroboros-consensus/blob/1940605fbbfb50032ab78e2268b85065c703cd2a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Protocol/Praos.hs#L196-L202
Where we have a bottom in bhviewPrevEpochNonce
And ugliness like this: #5467 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
💳 technical-debtIssues related to technical debt we introducedIssues related to technical debt we introducedmaintenanceTasks that are planned to be done as part of the regular maintenance of the project.Tasks that are planned to be done as part of the regular maintenance of the project.peras
Type
Projects
Status
In Progress