Skip to content
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

Consolidate ProtocolParams across eras #275

Closed
Tracked by #319
amesgen opened this issue Oct 27, 2022 · 0 comments
Closed
Tracked by #319

Consolidate ProtocolParams across eras #275

amesgen opened this issue Oct 27, 2022 · 0 comments
Assignees
Labels
technical debt Technical debt

Comments

@amesgen
Copy link
Member

amesgen commented Oct 27, 2022

Right now, the protocol parameters (ProtocolParamsByron, ProtocolParamsShelley, etc.) for different eras are unrelated data types. The goal of this ticket is to introduce a type/data family abstracting over these, and make use of it where appropriate.

As a concrete example, consider the type signature of protocolInfoCardano:
https://github.com/input-output-hk/ouroboros-network/blob/0aff5cf05f09bb56d4ac40f0090c636d5893dfb2/ouroboros-consensus-cardano/src/Ouroboros/Consensus/Cardano/Node.hs#L503-L517
After this change, this function would take sth like NP ProtocolParamsFamily (CardanoEras c) instead of the individual ProtocolParams* arguments.

A concrete benefit of this change would be that we could automatically extract the latest protocol version from this NP, making the approach of IntersectMBO/ouroboros-network#4111 even more robust (also see IntersectMBO/ouroboros-network#4111 (comment)).

@nfrisby nfrisby transferred this issue from IntersectMBO/ouroboros-network Aug 3, 2023
@jorisdral jorisdral self-assigned this Aug 8, 2023
github-merge-queue bot pushed a commit that referenced this issue Aug 16, 2023
# Description

Closes #275.

This PR adds a new `ProtocolParams` data family, with instances for all
Byron and Shelley blocks, and an instance for the Cardano block. This
simplies `protocolInfoCardano` because per-era protocol parameter
arguments are now bundled in the Cardano `ProtocolParams` type.

Tip: hiding whitespace should make the reviewable diff smaller.

See
#282 (review),
which discusses possible follow-up issues for other improvements to
`protocolInfoCardano`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt Technical debt
Projects
None yet
Development

No branches or pull requests

2 participants