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

Implement EraTransition #3737

Merged
merged 1 commit into from
Sep 22, 2023
Merged

Implement EraTransition #3737

merged 1 commit into from
Sep 22, 2023

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Sep 19, 2023

Description

Era Transition defines all of the configuration that is needed to transition from Shelley to a current era.

  • EraTransition type class can be used to deal with cumulative
    configuration necessary for getting to a particular era
  • It can also be used for testing and benchmarking to inject initial
    staking and funds into the initial state as well as fast forward the
    state into any era by translating it and upgrading PParams.
    This was done by migrating registerInitialFunds and
    registerInitialStaking functions from consensus:
  • Also additions to the cardano-ledger-api:
    • Add LatestKnownEra
    • Export EraTransition interface
    • Add mkLatestTransitionConfig that works for LatestKnownEra

Fixes #3337

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

@lehins lehins force-pushed the lehins/canStartFromGenesis branch 2 times, most recently from e18b499 to a2e0c5f Compare September 19, 2023 21:00
Copy link
Contributor

@aniketd aniketd left a comment

Choose a reason for hiding this comment

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

Awesome! 🙌

@lehins lehins force-pushed the lehins/canStartFromGenesis branch 4 times, most recently from ea5e4f3 to 37a86d9 Compare September 21, 2023 18:48
* `EraTransition` type class can be used to deal with cumulative
  configuration necessary for getting to a particular era
* It can also be used for testing and benchmarking to inject initial
  staking and funds into the initial state as well as fast forward the
  state into any era by translating it and upgrading PParams.
  This was done by migrating `registerInitialFunds` and
  `registerInitialStaking` functions from consensus:
* Also additions to the `cardano-ledger-api`:
  * Add `LatestKnownEra`
  * Export `EraTransition` interface
  * Add `mkLatestTransitionConfig` that works for `LatestKnownEra`
@lehins lehins merged commit 1876056 into master Sep 22, 2023
12 checks passed
@iohk-bors iohk-bors bot deleted the lehins/canStartFromGenesis branch September 22, 2023 12:11
amesgen added a commit to IntersectMBO/cardano-api that referenced this pull request Sep 26, 2023
mostly propagating the new Ledger `TransitionConfig` concept, see
IntersectMBO/cardano-ledger#3737
github-merge-queue bot pushed a commit to IntersectMBO/ouroboros-consensus that referenced this pull request Sep 27, 2023
Next major ledger release should be soon-ish and will likely be not too
different from what is being integrated here.

- Most of the diff is due to integrating the new `TransitionConfig`
concept from Ledger, see
IntersectMBO/cardano-ledger#3737.
- Every Shelley-based era `XEra c` has a `TransitionConfig (XEra c)`
that contains all Genesis information up until this era. In particular,
one can get all previous `TranslationContext`s and `TransitionConfig`s
up until this era from it.
- They can be used to register initial funds and staking (benchmarking
features whose implementation has now been moved to Ledger), and to
create initial Shelley ledger states for pure Shelley-based chains.
- We could keep the current interface to `protocolInfoCardano` the same
(by assembling a Conway `TransitionConfig` from the given
`TranslationContext`s), but Ledger wants to push the construction of the
`TransitionConfig` downwards to Node etc (eg in order to be able to add
more information to it, or even consolidate all Genesis files into one).
This also actually makes things easier on our end, as this allows us to
simplify the `ProtocolTransitionParams`.
- Ledger state serialization and the Conway Genesis file format changed.
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.

Improve CanStartFromGenesis as a concept
4 participants