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

Change 4 PParam fields from EpochNo to EpochInterval #3876

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Nov 17, 2023

EpochNo represents a fixed point in time. Sometimes we want to talk about a positive delta in this space. We used to also use EpochNo for this purpose, but this was confusing, since the EpochNo used could be negative.

To Fix this we introduce the newtype EpochInterval, and the function
addEpochInterval :: EpochNo -> EpochInterval -> Epoch No

Fixes #3870

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! Thank you!

libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably was not to clear when I was explaining those bounds and versions. Hopefully my comments will clarify it a bit. Let me know if it still confusing and we can talk about it on Monday

eras/shelley/impl/cardano-ledger-shelley.cabal Outdated Show resolved Hide resolved
eras/allegra/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/allegra/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/allegra/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/allegra/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/conway/impl/CHANGELOG.md Outdated Show resolved Hide resolved
libs/cardano-ledger-core/cardano-ledger-core.cabal Outdated Show resolved Hide resolved
libs/cardano-ledger-core/CHANGELOG.md Outdated Show resolved Hide resolved
libs/cardano-ledger-core/CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more minor changes are still needed. Looking very nice though!

eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal Outdated Show resolved Hide resolved
eras/alonzo/test-suite/cardano-ledger-alonzo-test.cabal Outdated Show resolved Hide resolved
eras/babbage/test-suite/cardano-ledger-babbage-test.cabal Outdated Show resolved Hide resolved
eras/mary/impl/cardano-ledger-mary.cabal Outdated Show resolved Hide resolved
@TimSheard TimSheard force-pushed the ts-epoch-interval branch 2 times, most recently from a926282 to 78e3a8e Compare November 20, 2023 21:55
Changed 3 PParam fields from EpochNo to EpochInterval
Changed cabal versions
Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more things. Almost there.

eras/babbage/impl/CHANGELOG.md Show resolved Hide resolved
eras/babbage/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/babbage/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/babbage/impl/CHANGELOG.md Outdated Show resolved Hide resolved
eras/shelley/impl/CHANGELOG.md Show resolved Hide resolved
libs/cardano-ledger-api/CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Alexey Kuleshevich <alexey.kuleshevich@iohk.io>
Copy link
Contributor

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your patience and your work on this PR!

@lehins lehins merged commit c6467f7 into master Nov 21, 2023
10 of 22 checks passed
@iohk-bors iohk-bors bot deleted the ts-epoch-interval branch November 21, 2023 16:03
@lehins lehins changed the title Change 3 PParam fields from EpochNo to EpochInterval Change 4 PParam fields from EpochNo to EpochInterval Nov 21, 2023
lehins added a commit that referenced this pull request Nov 30, 2023
`cardano-ledger-alonzo-test-1.1.2.8` has not been released yet, so the
version bump in #3876 was incorrect
lehins added a commit that referenced this pull request Dec 5, 2023
`cardano-ledger-alonzo-test-1.1.2.8` has not been released yet, so the
version bump in #3876 was incorrect
lehins added a commit that referenced this pull request Dec 5, 2023
`cardano-ledger-alonzo-test-1.1.2.8` has not been released yet, so the
version bump in #3876 was incorrect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a newtype EpochInterval
2 participants