Skip to content

Add Dijkstra ledger era #1567

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-ledger
tag: b44ce911475794a15f908ad27a6f497d6a27e8ba
--sha256: sha256-MXaVKKH9siUsmOnJmYyL6if48dx11zugux7AWGPABfA=
tag: 4cf709f11b21452785b0569d3eeed4fb290f8470
--sha256: sha256-Tq2h+yiv1e4+Z7mzpIctEnkjbJUF+SKo9VH02MiRd8k=
subdir:
eras/allegra/impl
eras/alonzo/impl
Expand All @@ -82,6 +82,8 @@ source-repository-package
eras/byron/ledger/impl
eras/conway/impl
eras/conway/test-suite
eras/dijkstra/
eras/dijkstra/test-suite
eras/mary/impl
eras/shelley/impl
eras/shelley-ma/test-suite
Expand Down
44 changes: 21 additions & 23 deletions docs/website/contents/for-developers/AddingAnEra.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,20 @@ be adding is the Alonzo era, which comes after the Mary era.
the `cabal.project` file. You will have to add it to some other cabal files
too, let the compiler tell you which ones.

## `ouroboros-consensus-shelley`
## `ouroboros-consensus-cardano`

* Define `StandardAlonzo` in `Ouroboros.Consensus.Shelley.Eras` and add any
missing instances to that module, update the export list appropriately.

* In `Ouroboros.Consensus.Shelley.Node`, define `ProtocolParamsAlonzo` just like
the existing ones. In case the era in question needs extra parameters (e.g., a
new genesis config?), they can be added here.

## `ouroboros-consensus-shelley-test`

* In `Test.Consensus.Shelley.Examples`, define an `examplesAlonzo` similar to
how `examplesMary` is defined. If necessary, i.e., when new type families have
been created in the ledger (e.g., `TxOut`), the `examples` function might have
to take more arguments. This is where the golden test examples are defined,
but only the Shelley ones are tested as part of this test suite. The others
are only tested as part of the `ouroboros-consensus-cardano-test` test suite.

## `ouroboros-consensus-cardano`

* In `Ouroboros.Consensus.Cardano.Block`, include `AlonzoEra` in
`CardanoShelleyEras`. Update all the pattern synonyms in the module with the
new era. Don't forget to update the comments, the `COMPLETE` pragmas, and the
* In `Ouroboros.Consensus.Cardano.Block`, include `AlonzoEra` in `CardanoShelleyEras` and
`ShelleyBasedLedgerEras`. Update all the pattern synonyms in the module with the new era.
Don't forget to update the comments, the `COMPLETE` pragmas, and the
export lists. It's easy to forget a case and the compiler will likely not warn
you, you'll notice it when trying to use the pattern synonyms.

* In `Ouroboros.Consensus.Cardano.Ledger`, add new data constructors to `CardanoTxOut`.
Follow the pattern-matching failures to update the use sites.

* In `Ouroboros.Consensus.Cardano.CanHardFork`, update
`CardanoHardForkConstraints`, add additional translations to the `CanHardFork`
instance.
Expand All @@ -92,6 +80,8 @@ be adding is the Alonzo era, which comes after the Mary era.
add the extra arguments needed for `protocolInfoCardano` to the
`ProtocolCardano` constructor. Update `protocolInfo` accordingly.

* In `Cardano.Node.Types`, add a field for the new era into the `NodeHardForkProtocolConfiguration` record.

### `test`

* In `Test.Consensus.Cardano.Serialisation`, update `testCodecCfg` and
Expand All @@ -107,15 +97,23 @@ be adding is the Alonzo era, which comes after the Mary era.

* Run the golden tests
(`cabal run ouroboros-consensus-cardano:cardano-test -- -p /Golden/`).
Golden test results should have been created for the new Cardano versions.
Golden test results should have been created for the new Cardano versions.
Don't forget to commit those files, otherwise they will be recreated on each
run in CI and not compared against the previous results, rendering them
useless.
run in CI and not compared against the previous results, rendering them
useless.

* Extend `Test.ThreadNet.Cardano` with the new era.

#### `unstable-shelley-testlib`

* In `Test.Consensus.Shelley.Examples`, define an `examplesAlonzo` similar to
how `examplesMary` is defined. If necessary, i.e., when new type families have
been created in the ledger (e.g., `TxOut`), the `examples` function might have
to take more arguments. This is where the golden test examples are defined,
but only the Shelley ones are tested as part of this test suite. The others
are only tested as part of the `ouroboros-consensus-cardano-test` test suite.

### `unstable-cardano-testlib`
#### `unstable-cardano-testlib`

* In `Test.Consensus.Cardano.Generators`, update `arbitraryNodeToNode`,
`arbitraryNodeToClient`. Try to understand the logic of these two, you will
Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ library
cardano-ledger-byron ^>=1.2,
cardano-ledger-conway ^>=1.20,
cardano-ledger-core ^>=1.18,
cardano-ledger-dijkstra ^>=0.1,
cardano-ledger-mary ^>=1.9,
cardano-ledger-shelley ^>=1.17,
cardano-prelude,
Expand Down Expand Up @@ -316,6 +317,7 @@ library unstable-shelley-testlib
cardano-ledger-babbage-test,
cardano-ledger-conway-test >=1.3.1,
cardano-ledger-core:{cardano-ledger-core, testlib},
cardano-ledger-dijkstra-test ^>=1.3.1.1,
cardano-ledger-mary,
cardano-ledger-shelley:{cardano-ledger-shelley, testlib},
cardano-ledger-shelley-ma-test,
Expand Down Expand Up @@ -359,6 +361,7 @@ test-suite shelley-test
cardano-ledger-babbage-test,
cardano-ledger-conway:testlib,
cardano-ledger-core,
cardano-ledger-dijkstra:testlib,
cardano-ledger-shelley,
cardano-protocol-tpraos,
cardano-slotting,
Expand Down Expand Up @@ -410,6 +413,7 @@ library unstable-cardano-testlib
cardano-ledger-conway:testlib,
cardano-ledger-conway-test ^>=1.3,
cardano-ledger-core:{cardano-ledger-core, testlib},
cardano-ledger-dijkstra:testlib,
cardano-ledger-shelley,
cardano-protocol-tpraos,
cardano-slotting,
Expand Down Expand Up @@ -471,6 +475,7 @@ test-suite cardano-test
cardano-ledger-conway:testlib,
cardano-ledger-core:{cardano-ledger-core, testlib},
cardano-ledger-mary:testlib,
cardano-ledger-dijkstra:testlib,
cardano-ledger-shelley,
cardano-ledger-shelley:testlib,
cardano-ledger-shelley-test,
Expand Down
Loading
Loading