diff --git a/cabal.project b/cabal.project index de98dab224..bff3e1af50 100644 --- a/cabal.project +++ b/cabal.project @@ -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: ca8d451bbce11dde3b68e99782c79f9b4c1dfca5 + --sha256: sha256-YHIscWnp9GrFn0EYGM7xd8Ds8x0O00FWBAIZX22bWpA= subdir: eras/allegra/impl eras/alonzo/impl @@ -82,6 +82,7 @@ source-repository-package eras/byron/ledger/impl eras/conway/impl eras/conway/test-suite + eras/dijkstra/ eras/mary/impl eras/shelley/impl eras/shelley-ma/test-suite diff --git a/docs/website/contents/for-developers/AddingAnEra.md b/docs/website/contents/for-developers/AddingAnEra.md index 5f091477bd..cc7a75762f 100644 --- a/docs/website/contents/for-developers/AddingAnEra.md +++ b/docs/website/contents/for-developers/AddingAnEra.md @@ -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. @@ -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 @@ -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 diff --git a/ouroboros-consensus-cardano/changelog.d/20250707_101854_georgy.lukyanov_issue1544_dijkstra_era.md b/ouroboros-consensus-cardano/changelog.d/20250707_101854_georgy.lukyanov_issue1544_dijkstra_era.md new file mode 100644 index 0000000000..3133a7f75c --- /dev/null +++ b/ouroboros-consensus-cardano/changelog.d/20250707_101854_georgy.lukyanov_issue1544_dijkstra_era.md @@ -0,0 +1,18 @@ + + + +### Breaking + +- Add Dijkstra era +- Add dependency on the new Dijkstra Ledger package: + - `cardano-ledger-dijkstra`: `^>=0.1` diff --git a/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/Header_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/Header_Dijkstra new file mode 100644 index 0000000000..6c7e2226f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/Header_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/SerialisedHeader_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/SerialisedHeader_Dijkstra new file mode 100644 index 0000000000..9a6ea603af --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/CardanoNodeToNodeVersion2/SerialisedHeader_Dijkstra @@ -0,0 +1 @@ +H
\ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/ApplyTxErr_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/ApplyTxErr_Dijkstra new file mode 100644 index 0000000000..d5f974d809 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/ApplyTxErr_Dijkstra @@ -0,0 +1 @@ +X1s]k?ժP[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/LedgerConfig index 97d7bb9a0f..03be0c5ad6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/LedgerConfig and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetCurrentPParams new file mode 100644 index 0000000000..ce426ca3b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetEpochNo new file mode 100644 index 0000000000..98ed282c8c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetGenesisConfig new file mode 100644 index 0000000000..82ccacba13 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetLedgerTip new file mode 100644 index 0000000000..e7119780b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..75c7a2d982 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetStakeDistribution new file mode 100644 index 0000000000..619ef92924 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Query_Dijkstra_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_EmptyPParams new file mode 100644 index 0000000000..966ff72a48 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_GenesisConfig new file mode 100644 index 0000000000..10a12c2526 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_LedgerTip @@ -0,0 +1 @@ + X M7!SYǭdGfp; \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_StakeDistribution new file mode 100644 index 0000000000..967baf0b47 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/Result_Dijkstra_StakeDistribution @@ -0,0 +1 @@ +X1s]k?ժP[{%AX -ò^46R>Žb{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/SlotNo_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/SlotNo_Dijkstra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/SlotNo_Dijkstra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/ApplyTxErr_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/ApplyTxErr_Dijkstra new file mode 100644 index 0000000000..d5f974d809 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/ApplyTxErr_Dijkstra @@ -0,0 +1 @@ +X1s]k?ժP[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/LedgerConfig index 97d7bb9a0f..03be0c5ad6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/LedgerConfig and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetCurrentPParams new file mode 100644 index 0000000000..ce426ca3b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetEpochNo new file mode 100644 index 0000000000..98ed282c8c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetGenesisConfig new file mode 100644 index 0000000000..82ccacba13 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetLedgerTip new file mode 100644 index 0000000000..e7119780b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..75c7a2d982 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetStakeDistribution new file mode 100644 index 0000000000..619ef92924 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Query_Dijkstra_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_EmptyPParams new file mode 100644 index 0000000000..966ff72a48 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_GenesisConfig new file mode 100644 index 0000000000..10a12c2526 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_LedgerTip @@ -0,0 +1 @@ + X M7!SYǭdGfp; \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_StakeDistribution new file mode 100644 index 0000000000..967baf0b47 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/Result_Dijkstra_StakeDistribution @@ -0,0 +1 @@ +X1s]k?ժP[{%AX -ò^46R>Žb{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/SlotNo_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/SlotNo_Dijkstra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/SlotNo_Dijkstra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/ApplyTxErr_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/ApplyTxErr_Dijkstra new file mode 100644 index 0000000000..d5f974d809 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/ApplyTxErr_Dijkstra @@ -0,0 +1 @@ +X1s]k?ժP[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/LedgerConfig index 97d7bb9a0f..03be0c5ad6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/LedgerConfig and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetCurrentPParams new file mode 100644 index 0000000000..ce426ca3b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetEpochNo new file mode 100644 index 0000000000..98ed282c8c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetGenesisConfig new file mode 100644 index 0000000000..82ccacba13 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetLedgerTip new file mode 100644 index 0000000000..e7119780b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..75c7a2d982 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetStakeDistribution new file mode 100644 index 0000000000..619ef92924 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Query_Dijkstra_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_EmptyPParams new file mode 100644 index 0000000000..966ff72a48 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_GenesisConfig new file mode 100644 index 0000000000..10a12c2526 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_LedgerTip @@ -0,0 +1 @@ + X M7!SYǭdGfp; \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_StakeDistribution new file mode 100644 index 0000000000..967baf0b47 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/Result_Dijkstra_StakeDistribution @@ -0,0 +1 @@ +X1s]k?ժP[{%AX -ò^46R>Žb{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/SlotNo_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/SlotNo_Dijkstra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/SlotNo_Dijkstra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/ApplyTxErr_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/ApplyTxErr_Dijkstra new file mode 100644 index 0000000000..d5f974d809 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/ApplyTxErr_Dijkstra @@ -0,0 +1 @@ +X1s]k?ժP[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/LedgerConfig index 97d7bb9a0f..03be0c5ad6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/LedgerConfig and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..44e233b30d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetCurrentPParams new file mode 100644 index 0000000000..ce426ca3b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetEpochNo new file mode 100644 index 0000000000..98ed282c8c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetGenesisConfig new file mode 100644 index 0000000000..82ccacba13 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetLedgerTip new file mode 100644 index 0000000000..e7119780b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..75c7a2d982 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetStakeDistribution new file mode 100644 index 0000000000..619ef92924 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Query_Dijkstra_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_EmptyPParams new file mode 100644 index 0000000000..966ff72a48 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_GenesisConfig new file mode 100644 index 0000000000..10a12c2526 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +* + +ҟ \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_LedgerTip @@ -0,0 +1 @@ + X M7!SYǭdGfp; \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_StakeDistribution new file mode 100644 index 0000000000..967baf0b47 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/Result_Dijkstra_StakeDistribution @@ -0,0 +1 @@ +X1s]k?ժP[{%AX -ò^46R>Žb{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/SlotNo_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/SlotNo_Dijkstra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/SlotNo_Dijkstra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/ApplyTxErr_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/ApplyTxErr_Dijkstra new file mode 100644 index 0000000000..d5f974d809 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/ApplyTxErr_Dijkstra @@ -0,0 +1 @@ +X1s]k?ժP[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/LedgerConfig index 97d7bb9a0f..03be0c5ad6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/LedgerConfig and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..44e233b30d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetCurrentPParams new file mode 100644 index 0000000000..ce426ca3b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetEpochNo new file mode 100644 index 0000000000..98ed282c8c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetGenesisConfig new file mode 100644 index 0000000000..82ccacba13 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetLedgerTip new file mode 100644 index 0000000000..e7119780b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..75c7a2d982 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetStakeDistribution new file mode 100644 index 0000000000..619ef92924 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Query_Dijkstra_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_EmptyPParams new file mode 100644 index 0000000000..966ff72a48 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_GenesisConfig new file mode 100644 index 0000000000..10a12c2526 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +* + +ҟ \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_LedgerTip @@ -0,0 +1 @@ + X M7!SYǭdGfp; \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_StakeDistribution new file mode 100644 index 0000000000..967baf0b47 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/Result_Dijkstra_StakeDistribution @@ -0,0 +1 @@ +X1s]k?ժP[{%AX -ò^46R>Žb{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/SlotNo_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/SlotNo_Dijkstra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/SlotNo_Dijkstra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Dijkstra new file mode 100644 index 0000000000..d5f974d809 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Dijkstra @@ -0,0 +1 @@ +X1s]k?ժP[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Dijkstra new file mode 100644 index 0000000000..53b7df5b76 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Dijkstra new file mode 100644 index 0000000000..db785f94a5 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Dijkstra @@ -0,0 +1 @@ +X K8aLs,а^"5J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Dijkstra new file mode 100644 index 0000000000..deec95d4f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig index 97d7bb9a0f..03be0c5ad6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..44e233b30d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetCurrentPParams new file mode 100644 index 0000000000..ce426ca3b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetEpochNo new file mode 100644 index 0000000000..98ed282c8c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetGenesisConfig new file mode 100644 index 0000000000..82ccacba13 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetLedgerTip new file mode 100644 index 0000000000..e7119780b9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetMaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetMaxMajorProtocolVersion new file mode 100644 index 0000000000..05e7714f7f Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetMaxMajorProtocolVersion differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..75c7a2d982 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetStakeDistribution2 b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetStakeDistribution2 new file mode 100644 index 0000000000..25fd83c08f Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Dijkstra_GetStakeDistribution2 differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_MaxMajorProtocolVersion index 9d8dfa9eaf..faa05863ba 100644 --- a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_MaxMajorProtocolVersion index 9d8dfa9eaf..faa05863ba 100644 --- a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_MaxMajorProtocolVersion index 9d8dfa9eaf..faa05863ba 100644 --- a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_MaxMajorProtocolVersion index 9d8dfa9eaf..faa05863ba 100644 --- a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_EmptyPParams new file mode 100644 index 0000000000..966ff72a48 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +* + +ҟ \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_LedgerTip @@ -0,0 +1 @@ + X M7!SYǭdGfp; \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_MaxMajorProtocolVersion new file mode 100644 index 0000000000..faa05863ba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_MaxMajorProtocolVersion @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_StakeDistribution2 b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_StakeDistribution2 new file mode 100644 index 0000000000..4f8aa309f9 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Dijkstra_StakeDistribution2 @@ -0,0 +1 @@ +X1s]k?ժP[{%AX -ò^46R>Žb{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_MaxMajorProtocolVersion index 9d8dfa9eaf..faa05863ba 100644 --- a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_MaxMajorProtocolVersion index 9d8dfa9eaf..faa05863ba 100644 --- a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Dijkstra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Dijkstra @@ -0,0 +1 @@ +O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Dijkstra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Dijkstra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/AnnTip_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/AnnTip_Dijkstra new file mode 100644 index 0000000000..7d8e667c7e --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/disk/AnnTip_Dijkstra @@ -0,0 +1,2 @@ +X  +.uL9bW燆L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/Block_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/Block_Dijkstra new file mode 100644 index 0000000000..f648600705 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/disk/Block_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ChainDepState_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/ChainDepState_Dijkstra new file mode 100644 index 0000000000..8745a735ad Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/disk/ChainDepState_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Dijkstra new file mode 100644 index 0000000000..17c28d2643 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/HeaderHash_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/HeaderHash_Dijkstra new file mode 100644 index 0000000000..01b0ead20f --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/disk/HeaderHash_Dijkstra @@ -0,0 +1,2 @@ +X  +.uL9bW燆L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Dijkstra new file mode 100644 index 0000000000..9b28f7b338 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerTables_Dijkstra b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerTables_Dijkstra new file mode 100644 index 0000000000..40ac2a6b03 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerTables_Dijkstra differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_MaxMajorProtocolVersion b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_MaxMajorProtocolVersion index 8214d0ee07..67c3297611 100644 --- a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_MaxMajorProtocolVersion +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_MaxMajorProtocolVersion @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal b/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal index 41b714e2b4..3b4c4dd2e6 100644 --- a/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal +++ b/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal @@ -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, @@ -313,8 +314,7 @@ library unstable-shelley-testlib cardano-ledger-allegra, cardano-ledger-alonzo, cardano-ledger-alonzo-test, - cardano-ledger-babbage-test, - cardano-ledger-conway-test >=1.3.1, + cardano-ledger-api:testlib, cardano-ledger-core:{cardano-ledger-core, testlib}, cardano-ledger-mary, cardano-ledger-shelley:{cardano-ledger-shelley, testlib}, @@ -359,6 +359,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, @@ -404,12 +405,12 @@ library unstable-cardano-testlib cardano-crypto-wrapper, cardano-ledger-alonzo:testlib, cardano-ledger-alonzo-test, - cardano-ledger-api, + cardano-ledger-api:{cardano-ledger-api, testlib}, cardano-ledger-binary, cardano-ledger-byron, 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, @@ -463,17 +464,17 @@ test-suite cardano-test cardano-ledger-alonzo, cardano-ledger-alonzo:testlib, cardano-ledger-alonzo-test, - cardano-ledger-api, + cardano-ledger-api:{cardano-ledger-api, testlib}, cardano-ledger-babbage:testlib, cardano-ledger-babbage-test, cardano-ledger-binary:testlib, cardano-ledger-byron:{cardano-ledger-byron, testlib}, cardano-ledger-conway:testlib, cardano-ledger-core:{cardano-ledger-core, testlib}, + cardano-ledger-dijkstra:testlib, cardano-ledger-mary:testlib, cardano-ledger-shelley, cardano-ledger-shelley:testlib, - cardano-ledger-shelley-test, cardano-protocol-tpraos, cardano-slotting, cborg, diff --git a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Block.hs b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Block.hs index bdad075962..a9ccd4bfa0 100644 --- a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Block.hs +++ b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Block.hs @@ -30,6 +30,7 @@ module Ouroboros.Consensus.Cardano.Block , BlockShelley , BlockBabbage , BlockConway + , BlockDijkstra ) -- * Headers @@ -42,13 +43,23 @@ module Ouroboros.Consensus.Cardano.Block , HeaderShelley , HeaderBabbage , HeaderConway + , HeaderDijkstra ) -- * Generalised transactions , CardanoApplyTxErr , CardanoGenTx , CardanoGenTxId - , GenTx (GenTxAllegra, GenTxAlonzo, GenTxByron, GenTxMary, GenTxShelley, GenTxBabbage, GenTxConway) + , GenTx + ( GenTxAllegra + , GenTxAlonzo + , GenTxByron + , GenTxMary + , GenTxShelley + , GenTxBabbage + , GenTxConway + , GenTxDijkstra + ) , HardForkApplyTxErr ( ApplyTxErrAllegra , ApplyTxErrAlonzo @@ -58,6 +69,7 @@ module Ouroboros.Consensus.Cardano.Block , ApplyTxErrWrongEra , ApplyTxErrBabbage , ApplyTxErrConway + , ApplyTxErrDijkstra ) , TxId ( GenTxIdAllegra @@ -67,6 +79,7 @@ module Ouroboros.Consensus.Cardano.Block , GenTxIdShelley , GenTxIdBabbage , GenTxIdConway + , GenTxIdDijkstra ) -- * LedgerError @@ -80,6 +93,7 @@ module Ouroboros.Consensus.Cardano.Block , LedgerErrorWrongEra , LedgerErrorBabbage , LedgerErrorConway + , LedgerErrorDijkstra ) -- * OtherEnvelopeError @@ -93,6 +107,7 @@ module Ouroboros.Consensus.Cardano.Block , OtherHeaderEnvelopeErrorMary , OtherHeaderEnvelopeErrorShelley , OtherHeaderEnvelopeErrorWrongEra + , OtherHeaderEnvelopeErrorDijkstra ) -- * TipInfo @@ -105,6 +120,7 @@ module Ouroboros.Consensus.Cardano.Block , TipInfoConway , TipInfoMary , TipInfoShelley + , TipInfoDijkstra ) -- * Query @@ -116,6 +132,7 @@ module Ouroboros.Consensus.Cardano.Block , QueryAnytimeByron , QueryAnytimeMary , QueryAnytimeShelley + , QueryAnytimeDijkstra , QueryHardFork , QueryIfCurrentAllegra , QueryIfCurrentAlonzo @@ -124,6 +141,7 @@ module Ouroboros.Consensus.Cardano.Block , QueryIfCurrentByron , QueryIfCurrentMary , QueryIfCurrentShelley + , QueryIfCurrentDijkstra ) , CardanoQuery , CardanoQueryResult @@ -156,6 +174,7 @@ module Ouroboros.Consensus.Cardano.Block , LedgerStateAlonzo , LedgerStateBabbage , LedgerStateConway + , LedgerStateDijkstra , LedgerStateByron , LedgerStateMary , LedgerStateShelley @@ -168,6 +187,7 @@ module Ouroboros.Consensus.Cardano.Block , ChainDepStateAlonzo , ChainDepStateBabbage , ChainDepStateConway + , ChainDepStateDijkstra , ChainDepStateByron , ChainDepStateMary , ChainDepStateShelley @@ -223,6 +243,7 @@ type CardanoShelleyEras c = , ShelleyBlock (TPraos c) AlonzoEra , ShelleyBlock (Praos c) BabbageEra , ShelleyBlock (Praos c) ConwayEra + , ShelleyBlock (Praos c) DijkstraEra ] type ShelleyBasedLedgerEras :: Type -> [Type] @@ -233,6 +254,7 @@ type ShelleyBasedLedgerEras c = , AlonzoEra , BabbageEra , ConwayEra + , DijkstraEra ] {------------------------------------------------------------------------------- @@ -249,6 +271,7 @@ pattern TagMary :: f (ShelleyBlock (TPraos c) MaryEra) -> NS f (CardanoEras c) pattern TagAlonzo :: f (ShelleyBlock (TPraos c) AlonzoEra) -> NS f (CardanoEras c) pattern TagBabbage :: f (ShelleyBlock (Praos c) BabbageEra) -> NS f (CardanoEras c) pattern TagConway :: f (ShelleyBlock (Praos c) ConwayEra) -> NS f (CardanoEras c) +pattern TagDijkstra :: f (ShelleyBlock (Praos c) DijkstraEra) -> NS f (CardanoEras c) pattern TagByron x = Z x pattern TagShelley x = S (Z x) @@ -257,6 +280,7 @@ pattern TagMary x = S (S (S (Z x))) pattern TagAlonzo x = S (S (S (S (Z x)))) pattern TagBabbage x = S (S (S (S (S (Z x))))) pattern TagConway x = S (S (S (S (S (S (Z x)))))) +pattern TagDijkstra x = S (S (S (S (S (S (S (Z x))))))) {------------------------------------------------------------------------------- INTERNAL A telescope function for each era @@ -312,6 +336,17 @@ pattern TeleConway :: f (ShelleyBlock (Praos c) ConwayEra) -> Telescope g f (CardanoEras c) +pattern TeleDijkstra :: + g ByronBlock -> + g (ShelleyBlock (TPraos c) ShelleyEra) -> + g (ShelleyBlock (TPraos c) AllegraEra) -> + g (ShelleyBlock (TPraos c) MaryEra) -> + g (ShelleyBlock (TPraos c) AlonzoEra) -> + g (ShelleyBlock (Praos c) BabbageEra) -> + g (ShelleyBlock (Praos c) ConwayEra) -> + f (ShelleyBlock (Praos c) DijkstraEra) -> + Telescope g f (CardanoEras c) + -- Here we use layout and adjacency to make it obvious that we haven't -- miscounted. @@ -329,6 +364,8 @@ pattern TeleBabbage byron shelley allegra mary alonzo x = TS byron (TS shelley (TS allegra (TS mary (TS alonzo (TZ x))))) pattern TeleConway byron shelley allegra mary alonzo babbage x = TS byron (TS shelley (TS allegra (TS mary (TS alonzo (TS babbage (TZ x)))))) +pattern TeleDijkstra byron shelley allegra mary alonzo babbage conway x = + TS byron (TS shelley (TS allegra (TS mary (TS alonzo (TS babbage (TS conway (TZ x))))))) {------------------------------------------------------------------------------- The block type of the Cardano block chain @@ -368,6 +405,9 @@ pattern BlockBabbage b = HardForkBlock (OneEraBlock (TagBabbage (I b))) pattern BlockConway :: ShelleyBlock (Praos c) ConwayEra -> CardanoBlock c pattern BlockConway b = HardForkBlock (OneEraBlock (TagConway (I b))) +pattern BlockDijkstra :: ShelleyBlock (Praos c) DijkstraEra -> CardanoBlock c +pattern BlockDijkstra b = HardForkBlock (OneEraBlock (TagDijkstra (I b))) + {-# COMPLETE BlockByron , BlockShelley @@ -376,6 +416,7 @@ pattern BlockConway b = HardForkBlock (OneEraBlock (TagConway (I b))) , BlockAlonzo , BlockBabbage , BlockConway + , BlockDijkstra #-} {------------------------------------------------------------------------------- @@ -418,6 +459,11 @@ pattern HeaderConway :: CardanoHeader c pattern HeaderConway h = HardForkHeader (OneEraHeader (TagConway h)) +pattern HeaderDijkstra :: + Header (ShelleyBlock (Praos c) DijkstraEra) -> + CardanoHeader c +pattern HeaderDijkstra h = HardForkHeader (OneEraHeader (TagDijkstra h)) + {-# COMPLETE HeaderByron , HeaderShelley @@ -426,6 +472,7 @@ pattern HeaderConway h = HardForkHeader (OneEraHeader (TagConway h)) , HeaderAlonzo , HeaderBabbage , HeaderConway + , HeaderDijkstra #-} {------------------------------------------------------------------------------- @@ -456,6 +503,9 @@ pattern GenTxBabbage tx = HardForkGenTx (OneEraGenTx (TagBabbage tx)) pattern GenTxConway :: GenTx (ShelleyBlock (Praos c) ConwayEra) -> CardanoGenTx c pattern GenTxConway tx = HardForkGenTx (OneEraGenTx (TagConway tx)) +pattern GenTxDijkstra :: GenTx (ShelleyBlock (Praos c) DijkstraEra) -> CardanoGenTx c +pattern GenTxDijkstra tx = HardForkGenTx (OneEraGenTx (TagDijkstra tx)) + {-# COMPLETE GenTxByron , GenTxShelley @@ -464,6 +514,7 @@ pattern GenTxConway tx = HardForkGenTx (OneEraGenTx (TagConway tx)) , GenTxAlonzo , GenTxBabbage , GenTxConway + , GenTxDijkstra #-} -- | The ID of a Cardano transaction. @@ -509,6 +560,12 @@ pattern GenTxIdConway :: pattern GenTxIdConway txid = HardForkGenTxId (OneEraGenTxId (TagConway (WrapGenTxId txid))) +pattern GenTxIdDijkstra :: + GenTxId (ShelleyBlock (Praos c) DijkstraEra) -> + CardanoGenTxId c +pattern GenTxIdDijkstra txid = + HardForkGenTxId (OneEraGenTxId (TagDijkstra (WrapGenTxId txid))) + {-# COMPLETE GenTxIdByron , GenTxIdShelley @@ -517,6 +574,7 @@ pattern GenTxIdConway txid = , GenTxIdAlonzo , GenTxIdBabbage , GenTxIdConway + , GenTxIdDijkstra #-} -- | An error resulting from applying a 'CardanoGenTx' to the ledger. @@ -576,6 +634,12 @@ pattern ApplyTxErrConway :: pattern ApplyTxErrConway err = HardForkApplyTxErrFromEra (OneEraApplyTxErr (TagConway (WrapApplyTxErr err))) +pattern ApplyTxErrDijkstra :: + ApplyTxErr (ShelleyBlock (Praos c) DijkstraEra) -> + CardanoApplyTxErr c +pattern ApplyTxErrDijkstra err = + HardForkApplyTxErrFromEra (OneEraApplyTxErr (TagDijkstra (WrapApplyTxErr err))) + pattern ApplyTxErrWrongEra :: EraMismatch -> CardanoApplyTxErr c pattern ApplyTxErrWrongEra eraMismatch <- HardForkApplyTxErrWrongEra (mkEraMismatch -> eraMismatch) @@ -589,6 +653,7 @@ pattern ApplyTxErrWrongEra eraMismatch <- , ApplyTxErrBabbage , ApplyTxErrConway , ApplyTxErrWrongEra + , ApplyTxErrDijkstra #-} {------------------------------------------------------------------------------- @@ -658,6 +723,13 @@ pattern LedgerErrorConway err = HardForkLedgerErrorFromEra (OneEraLedgerError (TagConway (WrapLedgerErr err))) +pattern LedgerErrorDijkstra :: + LedgerError (ShelleyBlock (Praos c) DijkstraEra) -> + CardanoLedgerError c +pattern LedgerErrorDijkstra err = + HardForkLedgerErrorFromEra + (OneEraLedgerError (TagDijkstra (WrapLedgerErr err))) + pattern LedgerErrorWrongEra :: EraMismatch -> CardanoLedgerError c pattern LedgerErrorWrongEra eraMismatch <- HardForkLedgerErrorWrongEra (mkEraMismatch -> eraMismatch) @@ -670,6 +742,7 @@ pattern LedgerErrorWrongEra eraMismatch <- , LedgerErrorAlonzo , LedgerErrorBabbage , LedgerErrorConway + , LedgerErrorDijkstra , LedgerErrorWrongEra #-} @@ -723,6 +796,12 @@ pattern OtherHeaderEnvelopeErrorConway :: pattern OtherHeaderEnvelopeErrorConway err = HardForkEnvelopeErrFromEra (OneEraEnvelopeErr (TagConway (WrapEnvelopeErr err))) +pattern OtherHeaderEnvelopeErrorDijkstra :: + OtherHeaderEnvelopeError (ShelleyBlock (Praos c) DijkstraEra) -> + CardanoOtherHeaderEnvelopeError c +pattern OtherHeaderEnvelopeErrorDijkstra err = + HardForkEnvelopeErrFromEra (OneEraEnvelopeErr (TagDijkstra (WrapEnvelopeErr err))) + pattern OtherHeaderEnvelopeErrorWrongEra :: EraMismatch -> CardanoOtherHeaderEnvelopeError c @@ -737,6 +816,7 @@ pattern OtherHeaderEnvelopeErrorWrongEra eraMismatch <- , OtherHeaderEnvelopeErrorAlonzo , OtherHeaderEnvelopeErrorBabbage , OtherHeaderEnvelopeErrorConway + , OtherHeaderEnvelopeErrorDijkstra , OtherHeaderEnvelopeErrorWrongEra #-} @@ -780,6 +860,11 @@ pattern TipInfoConway :: CardanoTipInfo c pattern TipInfoConway ti = OneEraTipInfo (TagConway (WrapTipInfo ti)) +pattern TipInfoDijkstra :: + TipInfo (ShelleyBlock (Praos c) DijkstraEra) -> + CardanoTipInfo c +pattern TipInfoDijkstra ti = OneEraTipInfo (TagDijkstra (WrapTipInfo ti)) + {-# COMPLETE TipInfoByron , TipInfoShelley @@ -788,6 +873,7 @@ pattern TipInfoConway ti = OneEraTipInfo (TagConway (WrapTipInfo ti)) , TipInfoAlonzo , TipInfoBabbage , TipInfoConway + , TipInfoDijkstra #-} {------------------------------------------------------------------------------- @@ -853,16 +939,27 @@ pattern QueryIfCurrentConway :: BlockQuery (ShelleyBlock (Praos c) ConwayEra) fp result -> CardanoQuery c fp a +-- | Conway-specific query that can only be answered when the ledger is in the +-- Conway era. +pattern QueryIfCurrentDijkstra :: + () => + CardanoQueryResult c result ~ a => + BlockQuery (ShelleyBlock (Praos c) DijkstraEra) fp result -> + CardanoQuery c fp a + -- Here we use layout and adjacency to make it obvious that we haven't -- miscounted. -pattern QueryIfCurrentByron q = QueryIfCurrent (QZ q) -pattern QueryIfCurrentShelley q = QueryIfCurrent (QS (QZ q)) -pattern QueryIfCurrentAllegra q = QueryIfCurrent (QS (QS (QZ q))) -pattern QueryIfCurrentMary q = QueryIfCurrent (QS (QS (QS (QZ q)))) -pattern QueryIfCurrentAlonzo q = QueryIfCurrent (QS (QS (QS (QS (QZ q))))) -pattern QueryIfCurrentBabbage q = QueryIfCurrent (QS (QS (QS (QS (QS (QZ q)))))) -pattern QueryIfCurrentConway q = QueryIfCurrent (QS (QS (QS (QS (QS (QS (QZ q))))))) +{- FOURMOLU_DISABLE -} +pattern QueryIfCurrentByron q = QueryIfCurrent (QZ q) +pattern QueryIfCurrentShelley q = QueryIfCurrent (QS (QZ q)) +pattern QueryIfCurrentAllegra q = QueryIfCurrent (QS (QS (QZ q))) +pattern QueryIfCurrentMary q = QueryIfCurrent (QS (QS (QS (QZ q)))) +pattern QueryIfCurrentAlonzo q = QueryIfCurrent (QS (QS (QS (QS (QZ q))))) +pattern QueryIfCurrentBabbage q = QueryIfCurrent (QS (QS (QS (QS (QS (QZ q)))))) +pattern QueryIfCurrentConway q = QueryIfCurrent (QS (QS (QS (QS (QS (QS (QZ q))))))) +pattern QueryIfCurrentDijkstra q = QueryIfCurrent (QS (QS (QS (QS (QS (QS (QS (QZ q)))))))) +{- FOURMOLU_ENABLE -} -- | Query about the Byron era that can be answered anytime, i.e., -- independent from where the tip of the ledger is. @@ -948,6 +1045,18 @@ pattern QueryAnytimeConway :: CardanoQuery c QFNoTables result pattern QueryAnytimeConway q = QueryAnytime q (EraIndex (TagConway (K ()))) +-- | Query about the Dijkstra era that can be answered anytime, i.e., independent +-- from where the tip of the ledger is. +-- +-- For example, to ask for the start of the Dijkstra era (whether the tip of the +-- ledger is in the Byron, Shelley, ... era), use: +-- +-- > QueryAnytimeDijkstra EraStart +pattern QueryAnytimeDijkstra :: + QueryAnytime result -> + CardanoQuery c QFNoTables result +pattern QueryAnytimeDijkstra q = QueryAnytime q (EraIndex (TagDijkstra (K ()))) + {-# COMPLETE QueryIfCurrentByron , QueryIfCurrentShelley @@ -962,6 +1071,7 @@ pattern QueryAnytimeConway q = QueryAnytime q (EraIndex (TagConway (K ()))) , QueryAnytimeAlonzo , QueryAnytimeBabbage , QueryAnytimeConway + , QueryAnytimeDijkstra , QueryHardFork #-} @@ -998,8 +1108,9 @@ pattern CardanoCodecConfig :: CodecConfig (ShelleyBlock (TPraos c) AlonzoEra) -> CodecConfig (ShelleyBlock (Praos c) BabbageEra) -> CodecConfig (ShelleyBlock (Praos c) ConwayEra) -> + CodecConfig (ShelleyBlock (Praos c) DijkstraEra) -> CardanoCodecConfig c -pattern CardanoCodecConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway = +pattern CardanoCodecConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway cfgDijkstra = HardForkCodecConfig { hardForkCodecConfigPerEra = PerEraCodecConfig @@ -1010,6 +1121,7 @@ pattern CardanoCodecConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgB :* cfgAlonzo :* cfgBabbage :* cfgConway + :* cfgDijkstra :* Nil ) } @@ -1034,8 +1146,9 @@ pattern CardanoBlockConfig :: BlockConfig (ShelleyBlock (TPraos c) AlonzoEra) -> BlockConfig (ShelleyBlock (Praos c) BabbageEra) -> BlockConfig (ShelleyBlock (Praos c) ConwayEra) -> + BlockConfig (ShelleyBlock (Praos c) DijkstraEra) -> CardanoBlockConfig c -pattern CardanoBlockConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway = +pattern CardanoBlockConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway cfgDijkstra = HardForkBlockConfig { hardForkBlockConfigPerEra = PerEraBlockConfig @@ -1046,6 +1159,7 @@ pattern CardanoBlockConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgB :* cfgAlonzo :* cfgBabbage :* cfgConway + :* cfgDijkstra :* Nil ) } @@ -1070,8 +1184,9 @@ pattern CardanoStorageConfig :: StorageConfig (ShelleyBlock (TPraos c) AlonzoEra) -> StorageConfig (ShelleyBlock (Praos c) BabbageEra) -> StorageConfig (ShelleyBlock (Praos c) ConwayEra) -> + StorageConfig (ShelleyBlock (Praos c) DijkstraEra) -> CardanoStorageConfig c -pattern CardanoStorageConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway = +pattern CardanoStorageConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway cfgDijkstra = HardForkStorageConfig { hardForkStorageConfigPerEra = PerEraStorageConfig @@ -1082,6 +1197,7 @@ pattern CardanoStorageConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cf :* cfgAlonzo :* cfgBabbage :* cfgConway + :* cfgDijkstra :* Nil ) } @@ -1109,8 +1225,9 @@ pattern CardanoConsensusConfig :: PartialConsensusConfig (BlockProtocol (ShelleyBlock (TPraos c) AlonzoEra)) -> PartialConsensusConfig (BlockProtocol (ShelleyBlock (Praos c) BabbageEra)) -> PartialConsensusConfig (BlockProtocol (ShelleyBlock (Praos c) ConwayEra)) -> + PartialConsensusConfig (BlockProtocol (ShelleyBlock (Praos c) DijkstraEra)) -> CardanoConsensusConfig c -pattern CardanoConsensusConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway <- +pattern CardanoConsensusConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway cfgDijkstra <- HardForkConsensusConfig { hardForkConsensusConfigPerEra = PerEraConsensusConfig @@ -1121,6 +1238,7 @@ pattern CardanoConsensusConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo :* WrapPartialConsensusConfig cfgAlonzo :* WrapPartialConsensusConfig cfgBabbage :* WrapPartialConsensusConfig cfgConway + :* WrapPartialConsensusConfig cfgDijkstra :* Nil ) } @@ -1147,8 +1265,9 @@ pattern CardanoLedgerConfig :: PartialLedgerConfig (ShelleyBlock (TPraos c) AlonzoEra) -> PartialLedgerConfig (ShelleyBlock (Praos c) BabbageEra) -> PartialLedgerConfig (ShelleyBlock (Praos c) ConwayEra) -> + PartialLedgerConfig (ShelleyBlock (Praos c) DijkstraEra) -> CardanoLedgerConfig c -pattern CardanoLedgerConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway <- +pattern CardanoLedgerConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfgBabbage cfgConway cfgDijkstra <- HardForkLedgerConfig { hardForkLedgerConfigPerEra = PerEraLedgerConfig @@ -1159,6 +1278,7 @@ pattern CardanoLedgerConfig cfgByron cfgShelley cfgAllegra cfgMary cfgAlonzo cfg :* WrapPartialLedgerConfig cfgAlonzo :* WrapPartialLedgerConfig cfgBabbage :* WrapPartialLedgerConfig cfgConway + :* WrapPartialLedgerConfig cfgDijkstra :* Nil ) } @@ -1240,6 +1360,15 @@ pattern LedgerStateConway st <- (TeleConway _ _ _ _ _ _ (State.Current{currentState = Flip st})) ) +pattern LedgerStateDijkstra :: + LedgerState (ShelleyBlock (Praos c) DijkstraEra) mk -> + CardanoLedgerState c mk +pattern LedgerStateDijkstra st <- + HardForkLedgerState + ( State.HardForkState + (TeleDijkstra _ _ _ _ _ _ _ (State.Current{currentState = Flip st})) + ) + {-# COMPLETE LedgerStateByron , LedgerStateShelley @@ -1248,6 +1377,7 @@ pattern LedgerStateConway st <- , LedgerStateAlonzo , LedgerStateBabbage , LedgerStateConway + , LedgerStateDijkstra #-} {------------------------------------------------------------------------------- @@ -1311,6 +1441,13 @@ pattern ChainDepStateConway st <- State.HardForkState (TeleConway _ _ _ _ _ _ (State.Current{currentState = WrapChainDepState st})) +pattern ChainDepStateDijkstra :: + ChainDepState (BlockProtocol (ShelleyBlock (Praos c) DijkstraEra)) -> + CardanoChainDepState c +pattern ChainDepStateDijkstra st <- + State.HardForkState + (TeleDijkstra _ _ _ _ _ _ _ (State.Current{currentState = WrapChainDepState st})) + {-# COMPLETE ChainDepStateByron , ChainDepStateShelley @@ -1319,4 +1456,5 @@ pattern ChainDepStateConway st <- , ChainDepStateAlonzo , ChainDepStateBabbage , ChainDepStateConway + , ChainDepStateDijkstra #-} diff --git a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/CanHardFork.hs b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/CanHardFork.hs index 583e33a5f4..68d665b6da 100644 --- a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/CanHardFork.hs +++ b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/CanHardFork.hs @@ -25,6 +25,7 @@ module Ouroboros.Consensus.Cardano.CanHardFork -- * Exposed for testing , getConwayTranslationContext + , getDijkstraTranslationContext ) where import Cardano.Ledger.Allegra.Translation @@ -112,6 +113,8 @@ type CardanoHardForkConstraints c = , LedgerSupportsProtocol (ShelleyBlock (Praos c) BabbageEra) , ShelleyCompatible (Praos c) ConwayEra , LedgerSupportsProtocol (ShelleyBlock (Praos c) ConwayEra) + , ShelleyCompatible (Praos c) DijkstraEra + , LedgerSupportsProtocol (ShelleyBlock (Praos c) DijkstraEra) ) -- | When performing era translations, two eras have special behaviours on the @@ -136,7 +139,8 @@ instance CardanoHardForkConstraints c => CanHardFork (CardanoEras c) where PCons translateLedgerStateMaryToAlonzoWrapper $ PCons translateLedgerStateAlonzoToBabbageWrapper $ PCons translateLedgerStateBabbageToConwayWrapper $ - PNil + PCons translateLedgerStateConwayToDijkstraWrapper $ + PNil , translateLedgerTables = PCons translateLedgerTablesByronToShelleyWrapper $ PCons translateLedgerTablesShelleyToAllegraWrapper $ @@ -144,7 +148,8 @@ instance CardanoHardForkConstraints c => CanHardFork (CardanoEras c) where PCons translateLedgerTablesMaryToAlonzoWrapper $ PCons translateLedgerTablesAlonzoToBabbageWrapper $ PCons translateLedgerTablesBabbageToConwayWrapper $ - PNil + PCons translateLedgerTablesConwayToDijkstraWrapper $ + PNil , translateChainDepState = PCons translateChainDepStateByronToShelleyWrapper $ PCons translateChainDepStateAcrossShelley $ @@ -152,7 +157,8 @@ instance CardanoHardForkConstraints c => CanHardFork (CardanoEras c) where PCons translateChainDepStateAcrossShelley $ PCons translateChainDepStateAcrossShelley $ PCons translateChainDepStateAcrossShelley $ - PNil + PCons translateChainDepStateAcrossShelley $ + PNil , crossEraForecast = PCons crossEraForecastByronToShelleyWrapper $ PCons crossEraForecastAcrossShelley $ @@ -160,7 +166,8 @@ instance CardanoHardForkConstraints c => CanHardFork (CardanoEras c) where PCons crossEraForecastAcrossShelley $ PCons crossEraForecastAcrossShelley $ PCons crossEraForecastAcrossShelley $ - PNil + PCons crossEraForecastAcrossShelley $ + PNil } hardForkChainSel = -- Byron <-> Shelley, ... @@ -203,6 +210,14 @@ instance CardanoHardForkConstraints c => CanHardFork (CardanoEras c) where (translateTxBabbageToConwayWrapper ctxt) (translateValidatedTxBabbageToConwayWrapper ctxt) ) + $ PCons + ( RequireBoth $ \_cfgConway cfgDijkstra -> + -- TODO(geo2a): do we need cfgConway? Seems like we do not. + let ctxt = getDijkstraTranslationContext cfgDijkstra + in Pair2 + (translateTxConwayToDijkstraWrapper ctxt) + (translateValidatedTxConwayToDijkstraWrapper ctxt) + ) $ PNil hardForkInjTxMeasure = @@ -213,6 +228,7 @@ instance CardanoHardForkConstraints c => CanHardFork (CardanoEras c) where `o` fromAlonzo `o` fromConway `o` fromConway + `o` fromConway `o` nil where nil :: SOP.NS f '[] -> a @@ -741,3 +757,60 @@ translateValidatedTxBabbageToConwayWrapper :: translateValidatedTxBabbageToConwayWrapper ctxt = InjectValidatedTx $ fmap unComp . eitherToMaybe . runExcept . SL.translateEra ctxt . Comp + +{------------------------------------------------------------------------------- + Translation from Conway to Dijkstra +-------------------------------------------------------------------------------} + +translateLedgerStateConwayToDijkstraWrapper :: + RequiringBoth + WrapLedgerConfig + TranslateLedgerState + (ShelleyBlock (Praos c) ConwayEra) + (ShelleyBlock (Praos c) DijkstraEra) +translateLedgerStateConwayToDijkstraWrapper = + RequireBoth $ \_cfgConway cfgDijkstra -> + TranslateLedgerState + { translateLedgerStateWith = \_epochNo -> + noNewTickingDiffs + . unFlip + . unComp + . SL.translateEra' (getDijkstraTranslationContext cfgDijkstra) + . Comp + . Flip + } + +translateLedgerTablesConwayToDijkstraWrapper :: + TranslateLedgerTables + (ShelleyBlock (Praos c) ConwayEra) + (ShelleyBlock (Praos c) DijkstraEra) +translateLedgerTablesConwayToDijkstraWrapper = + TranslateLedgerTables + { translateTxInWith = coerce + , translateTxOutWith = SL.upgradeTxOut + } + +getDijkstraTranslationContext :: + WrapLedgerConfig (ShelleyBlock (Praos c) DijkstraEra) -> + SL.TranslationContext DijkstraEra +getDijkstraTranslationContext = + shelleyLedgerTranslationContext . unwrapLedgerConfig + +translateTxConwayToDijkstraWrapper :: + SL.TranslationContext DijkstraEra -> + InjectTx + (ShelleyBlock (Praos c) ConwayEra) + (ShelleyBlock (Praos c) DijkstraEra) +translateTxConwayToDijkstraWrapper ctxt = + InjectTx $ + fmap unComp . eitherToMaybe . runExcept . SL.translateEra ctxt . Comp + +translateValidatedTxConwayToDijkstraWrapper :: + forall c. + SL.TranslationContext DijkstraEra -> + InjectValidatedTx + (ShelleyBlock (Praos c) ConwayEra) + (ShelleyBlock (Praos c) DijkstraEra) +translateValidatedTxConwayToDijkstraWrapper ctxt = + InjectValidatedTx $ + fmap unComp . eitherToMaybe . runExcept . SL.translateEra ctxt . Comp diff --git a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Ledger.hs b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Ledger.hs index 8eaadc707d..36661f9fbe 100644 --- a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Ledger.hs +++ b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Ledger.hs @@ -84,7 +84,8 @@ instance IS (IS (IS IZ)) -> CardanoTxIn shelleyTxIn IS (IS (IS (IS IZ))) -> CardanoTxIn shelleyTxIn IS (IS (IS (IS (IS IZ)))) -> CardanoTxIn shelleyTxIn - IS (IS (IS (IS (IS (IS idx'))))) -> case idx' of {} + IS (IS (IS (IS (IS (IS IZ))))) -> CardanoTxIn shelleyTxIn + IS (IS (IS (IS (IS (IS (IS idx')))))) -> case idx' of {} ejectCanonicalTxIn IZ _ = error "ejectCanonicalTxIn: Byron has no TxIns" @@ -95,7 +96,8 @@ instance IS (IS (IS IZ)) -> getCardanoTxIn cardanoTxIn IS (IS (IS (IS IZ))) -> getCardanoTxIn cardanoTxIn IS (IS (IS (IS (IS IZ)))) -> getCardanoTxIn cardanoTxIn - IS (IS (IS (IS (IS (IS idx'))))) -> case idx' of {} + IS (IS (IS (IS (IS (IS IZ))))) -> getCardanoTxIn cardanoTxIn + IS (IS (IS (IS (IS (IS (IS idx')))))) -> case idx' of {} instance CardanoHardForkConstraints c => MemPack (CanonicalTxIn (CardanoEras c)) where packM = packM . getCardanoTxIn @@ -109,6 +111,7 @@ data CardanoTxOut c | AlonzoTxOut !(TxOut (LedgerState (ShelleyBlock (TPraos c) AlonzoEra))) | BabbageTxOut !(TxOut (LedgerState (ShelleyBlock (Praos c) BabbageEra))) | ConwayTxOut !(TxOut (LedgerState (ShelleyBlock (Praos c) ConwayEra))) + | DijkstraTxOut !(TxOut (LedgerState (ShelleyBlock (Praos c) DijkstraEra))) deriving stock (Show, Eq, Generic) deriving anyclass NoThunks @@ -133,6 +136,7 @@ eliminateCardanoTxOut f = \case AlonzoTxOut txout -> f (IS (IS (IS (IS IZ)))) txout BabbageTxOut txout -> f (IS (IS (IS (IS (IS IZ))))) txout ConwayTxOut txout -> f (IS (IS (IS (IS (IS (IS IZ)))))) txout + DijkstraTxOut txout -> f (IS (IS (IS (IS (IS (IS (IS IZ))))))) txout instance CardanoHardForkConstraints c => HasHardForkTxOut (CardanoEras c) where type HardForkTxOut (CardanoEras c) = CardanoTxOut c @@ -144,7 +148,8 @@ instance CardanoHardForkConstraints c => HasHardForkTxOut (CardanoEras c) where IS (IS (IS (IS IZ))) -> AlonzoTxOut txOut IS (IS (IS (IS (IS IZ)))) -> BabbageTxOut txOut IS (IS (IS (IS (IS (IS IZ))))) -> ConwayTxOut txOut - IS (IS (IS (IS (IS (IS (IS idx')))))) -> case idx' of {} + IS (IS (IS (IS (IS (IS (IS IZ)))))) -> DijkstraTxOut txOut + IS (IS (IS (IS (IS (IS (IS (IS idx'))))))) -> case idx' of {} ejectHardForkTxOut :: forall y. @@ -179,6 +184,7 @@ instance :* (Fn $ const $ Comp $ K . AlonzoTxOut <$> unpackM) :* (Fn $ const $ Comp $ K . BabbageTxOut <$> unpackM) :* (Fn $ const $ Comp $ K . ConwayTxOut <$> unpackM) + :* (Fn $ const $ Comp $ K . DijkstraTxOut <$> unpackM) :* Nil ) hcollapse <$> (hsequence' $ hap np $ Telescope.tip idx) @@ -199,6 +205,7 @@ instance :* (Fn $ const $ K $ encOne (Proxy @AlonzoEra)) :* (Fn $ const $ K $ encOne (Proxy @BabbageEra)) :* (Fn $ const $ K $ encOne (Proxy @ConwayEra)) + :* (Fn $ const $ K $ encOne (Proxy @DijkstraEra)) :* Nil in hcollapse $ hap np $ Telescope.tip idx @@ -229,6 +236,7 @@ instance :* (Fn $ Comp . fmap K . getOne AlonzoTxOut . unFlip . currentState) :* (Fn $ Comp . fmap K . getOne BabbageTxOut . unFlip . currentState) :* (Fn $ Comp . fmap K . getOne ConwayTxOut . unFlip . currentState) + :* (Fn $ Comp . fmap K . getOne DijkstraTxOut . unFlip . currentState) :* Nil in hcollapse <$> (hsequence' $ hap np $ Telescope.tip idx) diff --git a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs index 33b8a12dde..50ff0b1650 100644 --- a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs +++ b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs @@ -28,6 +28,7 @@ module Ouroboros.Consensus.Cardano.Node , triggerHardForkAlonzo , triggerHardForkBabbage , triggerHardForkConway + , triggerHardForkDijkstra ) , CardanoProtocolParams (..) , MaxMajorProtVer (..) @@ -154,33 +155,55 @@ import Ouroboros.Consensus.Util.IOLike -- For more details, see: -- instance CardanoHardForkConstraints c => SerialiseHFC (CardanoEras c) where - encodeDiskHfcBlock (CardanoCodecConfig ccfgByron ccfgShelley ccfgAllegra ccfgMary ccfgAlonzo ccfgBabbage ccfgConway) = \case - -- We are backwards compatible with Byron and thus use the exact same - -- encoding. - BlockByron blockByron -> encodeDisk ccfgByron blockByron - -- For Shelley and later eras, we need to prepend the hard fork envelope. - BlockShelley blockShelley -> prependTag 2 $ encodeDisk ccfgShelley blockShelley - BlockAllegra blockAllegra -> prependTag 3 $ encodeDisk ccfgAllegra blockAllegra - BlockMary blockMary -> prependTag 4 $ encodeDisk ccfgMary blockMary - BlockAlonzo blockAlonzo -> prependTag 5 $ encodeDisk ccfgAlonzo blockAlonzo - BlockBabbage blockBabbage -> prependTag 6 $ encodeDisk ccfgBabbage blockBabbage - BlockConway blockConway -> prependTag 7 $ encodeDisk ccfgConway blockConway - decodeDiskHfcBlock (CardanoCodecConfig ccfgByron ccfgShelley ccfgAllegra ccfgMary ccfgAlonzo ccfgBabbage ccfgConway) = do - enforceSize "CardanoBlock" 2 - CBOR.decodeWord >>= \case - 0 -> fmap BlockByron <$> Byron.decodeByronBoundaryBlock epochSlots - 1 -> fmap BlockByron <$> Byron.decodeByronRegularBlock epochSlots - -- We don't have to drop the first two bytes from the 'ByteString' - -- passed to the decoder as slicing already takes care of this. - 2 -> fmap BlockShelley <$> decodeDisk ccfgShelley - 3 -> fmap BlockAllegra <$> decodeDisk ccfgAllegra - 4 -> fmap BlockMary <$> decodeDisk ccfgMary - 5 -> fmap BlockAlonzo <$> decodeDisk ccfgAlonzo - 6 -> fmap BlockBabbage <$> decodeDisk ccfgBabbage - 7 -> fmap BlockConway <$> decodeDisk ccfgConway - t -> cborError $ DecoderErrorUnknownTag "CardanoBlock" (fromIntegral t) - where - epochSlots = Byron.getByronEpochSlots ccfgByron + encodeDiskHfcBlock + ( CardanoCodecConfig + ccfgByron + ccfgShelley + ccfgAllegra + ccfgMary + ccfgAlonzo + ccfgBabbage + ccfgConway + ccfgDijkstra + ) = \case + -- We are backwards compatible with Byron and thus use the exact same + -- encoding. + BlockByron blockByron -> encodeDisk ccfgByron blockByron + -- For Shelley and later eras, we need to prepend the hard fork envelope. + BlockShelley blockShelley -> prependTag 2 $ encodeDisk ccfgShelley blockShelley + BlockAllegra blockAllegra -> prependTag 3 $ encodeDisk ccfgAllegra blockAllegra + BlockMary blockMary -> prependTag 4 $ encodeDisk ccfgMary blockMary + BlockAlonzo blockAlonzo -> prependTag 5 $ encodeDisk ccfgAlonzo blockAlonzo + BlockBabbage blockBabbage -> prependTag 6 $ encodeDisk ccfgBabbage blockBabbage + BlockConway blockConway -> prependTag 7 $ encodeDisk ccfgConway blockConway + BlockDijkstra blockDijkstra -> prependTag 8 $ encodeDisk ccfgDijkstra blockDijkstra + decodeDiskHfcBlock + ( CardanoCodecConfig + ccfgByron + ccfgShelley + ccfgAllegra + ccfgMary + ccfgAlonzo + ccfgBabbage + ccfgConway + ccfgDijkstra + ) = do + enforceSize "CardanoBlock" 2 + CBOR.decodeWord >>= \case + 0 -> fmap BlockByron <$> Byron.decodeByronBoundaryBlock epochSlots + 1 -> fmap BlockByron <$> Byron.decodeByronRegularBlock epochSlots + -- We don't have to drop the first two bytes from the 'ByteString' + -- passed to the decoder as slicing already takes care of this. + 2 -> fmap BlockShelley <$> decodeDisk ccfgShelley + 3 -> fmap BlockAllegra <$> decodeDisk ccfgAllegra + 4 -> fmap BlockMary <$> decodeDisk ccfgMary + 5 -> fmap BlockAlonzo <$> decodeDisk ccfgAlonzo + 6 -> fmap BlockBabbage <$> decodeDisk ccfgBabbage + 7 -> fmap BlockConway <$> decodeDisk ccfgConway + 8 -> fmap BlockDijkstra <$> decodeDisk ccfgDijkstra + t -> cborError $ DecoderErrorUnknownTag "CardanoBlock" (fromIntegral t) + where + epochSlots = Byron.getByronEpochSlots ccfgByron reconstructHfcPrefixLen _ = PrefixLen 2 @@ -194,6 +217,7 @@ instance CardanoHardForkConstraints c => SerialiseHFC (CardanoEras c) where 5 -> SomeSecond $ NestedCtxt (NCS (NCS (NCS (NCS (NCZ Shelley.CtxtShelley))))) 6 -> SomeSecond $ NestedCtxt (NCS (NCS (NCS (NCS (NCS (NCZ Shelley.CtxtShelley)))))) 7 -> SomeSecond $ NestedCtxt (NCS (NCS (NCS (NCS (NCS (NCS (NCZ Shelley.CtxtShelley))))))) + 8 -> SomeSecond $ NestedCtxt (NCS (NCS (NCS (NCS (NCS (NCS (NCS (NCZ Shelley.CtxtShelley)))))))) _ -> error $ "CardanoBlock: invalid prefix " <> show prefix getHfcBinaryBlockInfo = \case @@ -213,6 +237,8 @@ instance CardanoHardForkConstraints c => SerialiseHFC (CardanoEras c) where shiftHeaderOffset 2 $ getBinaryBlockInfo blockBabbage BlockConway blockConway -> shiftHeaderOffset 2 $ getBinaryBlockInfo blockConway + BlockDijkstra blockDijkstra -> + shiftHeaderOffset 2 $ getBinaryBlockInfo blockDijkstra where shiftHeaderOffset :: Word16 -> BinaryBlockInfo -> BinaryBlockInfo shiftHeaderOffset shift binfo = @@ -230,6 +256,7 @@ instance CardanoHardForkConstraints c => SerialiseHFC (CardanoEras c) where HeaderAlonzo headerAlonzo -> estimateBlockSize headerAlonzo + 2 HeaderBabbage headerBabbage -> estimateBlockSize headerBabbage + 2 HeaderConway headerConway -> estimateBlockSize headerConway + 2 + HeaderDijkstra headerDijkstra -> estimateBlockSize headerDijkstra + 2 -- | Prepend the given tag by creating a CBOR 2-tuple with the tag as the -- first element and the given 'Encoding' as the second. @@ -267,11 +294,12 @@ pattern CardanoNodeToNodeVersion2 = :* WrapNodeToNodeVersion ShelleyNodeToNodeVersion1 :* WrapNodeToNodeVersion ShelleyNodeToNodeVersion1 :* WrapNodeToNodeVersion ShelleyNodeToNodeVersion1 + :* WrapNodeToNodeVersion ShelleyNodeToNodeVersion1 :* Nil ) --- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage --- and Conway eras enabled, using 'ShelleyNodeToClientVersion8' for the +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo, Babbage, +-- Conway and Dijkstra eras enabled, using 'ShelleyNodeToClientVersion8' for the -- Shelley-based eras. pattern CardanoNodeToClientVersion12 :: BlockNodeToClientVersion (CardanoBlock c) pattern CardanoNodeToClientVersion12 = @@ -284,11 +312,12 @@ pattern CardanoNodeToClientVersion12 = :* EraNodeToClientEnabled ShelleyNodeToClientVersion8 :* EraNodeToClientEnabled ShelleyNodeToClientVersion8 :* EraNodeToClientEnabled ShelleyNodeToClientVersion8 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion8 :* Nil ) --- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage --- and Conway eras enabled, using 'ShelleyNodeToClientVersion9' for the +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo, Babbage, +-- Conway and Dijkstra eras enabled, using 'ShelleyNodeToClientVersion9' for the -- Shelley-based eras. pattern CardanoNodeToClientVersion13 :: BlockNodeToClientVersion (CardanoBlock c) pattern CardanoNodeToClientVersion13 = @@ -301,11 +330,12 @@ pattern CardanoNodeToClientVersion13 = :* EraNodeToClientEnabled ShelleyNodeToClientVersion9 :* EraNodeToClientEnabled ShelleyNodeToClientVersion9 :* EraNodeToClientEnabled ShelleyNodeToClientVersion9 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion9 :* Nil ) --- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage --- and Conway eras enabled, using 'ShelleyNodeToClientVersion10' for the +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo, Babbage, +-- Conway and Dijkstra eras enabled, using 'ShelleyNodeToClientVersion10' for the -- Shelley-based eras. pattern CardanoNodeToClientVersion14 :: BlockNodeToClientVersion (CardanoBlock c) pattern CardanoNodeToClientVersion14 = @@ -318,11 +348,12 @@ pattern CardanoNodeToClientVersion14 = :* EraNodeToClientEnabled ShelleyNodeToClientVersion10 :* EraNodeToClientEnabled ShelleyNodeToClientVersion10 :* EraNodeToClientEnabled ShelleyNodeToClientVersion10 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion10 :* Nil ) --- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage --- and Conway eras enabled, using 'ShelleyNodeToClientVersion11' for the +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo, Babbage, +-- Conway and Dijkstra eras enabled, using 'ShelleyNodeToClientVersion11' for the -- Shelley-based eras. pattern CardanoNodeToClientVersion15 :: BlockNodeToClientVersion (CardanoBlock c) pattern CardanoNodeToClientVersion15 = @@ -335,11 +366,12 @@ pattern CardanoNodeToClientVersion15 = :* EraNodeToClientEnabled ShelleyNodeToClientVersion11 :* EraNodeToClientEnabled ShelleyNodeToClientVersion11 :* EraNodeToClientEnabled ShelleyNodeToClientVersion11 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion11 :* Nil ) --- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage --- and Conway eras enabled, using 'ShelleyNodeToClientVersion12' for the +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo, Babbage, +-- Conway and Dijkstra eras enabled, using 'ShelleyNodeToClientVersion12' for the -- Shelley-based eras. pattern CardanoNodeToClientVersion16 :: BlockNodeToClientVersion (CardanoBlock c) pattern CardanoNodeToClientVersion16 = @@ -352,11 +384,12 @@ pattern CardanoNodeToClientVersion16 = :* EraNodeToClientEnabled ShelleyNodeToClientVersion12 :* EraNodeToClientEnabled ShelleyNodeToClientVersion12 :* EraNodeToClientEnabled ShelleyNodeToClientVersion12 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion12 :* Nil ) --- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage --- and Conway eras enabled, using 'ShelleyNodeToClientVersion13' for the +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo, Babbage, +-- Conway and Dijkstra eras enabled, using 'ShelleyNodeToClientVersion13' for the -- Shelley-based eras. pattern CardanoNodeToClientVersion17 :: BlockNodeToClientVersion (CardanoBlock c) pattern CardanoNodeToClientVersion17 = @@ -369,6 +402,7 @@ pattern CardanoNodeToClientVersion17 = :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 :* Nil ) @@ -436,6 +470,7 @@ pattern CardanoHardForkTriggers' :: CardanoHardForkTrigger (ShelleyBlock (TPraos c) AlonzoEra) -> CardanoHardForkTrigger (ShelleyBlock (Praos c) BabbageEra) -> CardanoHardForkTrigger (ShelleyBlock (Praos c) ConwayEra) -> + CardanoHardForkTrigger (ShelleyBlock (Praos c) DijkstraEra) -> CardanoHardForkTriggers pattern CardanoHardForkTriggers' { triggerHardForkShelley @@ -444,6 +479,7 @@ pattern CardanoHardForkTriggers' , triggerHardForkAlonzo , triggerHardForkBabbage , triggerHardForkConway + , triggerHardForkDijkstra } = CardanoHardForkTriggers ( triggerHardForkShelley @@ -452,6 +488,7 @@ pattern CardanoHardForkTriggers' :* triggerHardForkAlonzo :* triggerHardForkBabbage :* triggerHardForkConway + :* triggerHardForkDijkstra :* Nil ) {-# COMPLETE CardanoHardForkTriggers' #-} @@ -567,7 +604,8 @@ protocolInfoCardano paramsCardano transitionConfigMary = transitionConfigAlonzo ^. L.tcPreviousEraConfigL transitionConfigAlonzo = transitionConfigBabbage ^. L.tcPreviousEraConfigL transitionConfigBabbage = transitionConfigConway ^. L.tcPreviousEraConfigL - transitionConfigConway = cardanoLedgerTransitionConfig + transitionConfigConway = transitionConfigDijkstra ^. L.tcPreviousEraConfigL + transitionConfigDijkstra = cardanoLedgerTransitionConfig -- The major protocol version of the last era is the maximum major protocol -- version we support. @@ -754,6 +792,25 @@ protocolInfoCardano paramsCardano transitionConfigConway TriggerHardForkNotDuringThisExecution + -- Dijkstra + + blockConfigDijkstra :: BlockConfig (ShelleyBlock (Praos c) DijkstraEra) + blockConfigDijkstra = + Shelley.mkShelleyBlockConfig + cardanoProtocolVersion + genesisShelley + (shelleyBlockIssuerVKey <$> credssShelleyBased) + + partialConsensusConfigDijkstra :: + PartialConsensusConfig (BlockProtocol (ShelleyBlock (Praos c) DijkstraEra)) + partialConsensusConfigDijkstra = praosParams + + partialLedgerConfigDijkstra :: PartialLedgerConfig (ShelleyBlock (Praos c) DijkstraEra) + partialLedgerConfigDijkstra = + mkPartialLedgerConfigShelley + transitionConfigDijkstra + TriggerHardForkNotDuringThisExecution + -- Cardano k :: SecurityParam @@ -770,6 +827,7 @@ protocolInfoCardano paramsCardano :* K (Shelley.shelleyEraParams genesisShelley) :* K (Shelley.shelleyEraParams genesisShelley) :* K (Shelley.shelleyEraParams genesisShelley) + :* K (Shelley.shelleyEraParams genesisShelley) :* Nil cfg :: TopLevelConfig (CardanoBlock c) @@ -788,6 +846,7 @@ protocolInfoCardano paramsCardano :* WrapPartialConsensusConfig partialConsensusConfigAlonzo :* WrapPartialConsensusConfig partialConsensusConfigBabbage :* WrapPartialConsensusConfig partialConsensusConfigConway + :* WrapPartialConsensusConfig partialConsensusConfigDijkstra :* Nil ) } @@ -803,6 +862,7 @@ protocolInfoCardano paramsCardano :* WrapPartialLedgerConfig partialLedgerConfigAlonzo :* WrapPartialLedgerConfig partialLedgerConfigBabbage :* WrapPartialLedgerConfig partialLedgerConfigConway + :* WrapPartialLedgerConfig partialLedgerConfigDijkstra :* Nil ) } @@ -815,6 +875,7 @@ protocolInfoCardano paramsCardano blockConfigAlonzo blockConfigBabbage blockConfigConway + blockConfigDijkstra , topLevelConfigCodec = CardanoCodecConfig (configCodec topLevelConfigByron) @@ -824,6 +885,7 @@ protocolInfoCardano paramsCardano Shelley.ShelleyCodecConfig Shelley.ShelleyCodecConfig Shelley.ShelleyCodecConfig + Shelley.ShelleyCodecConfig , topLevelConfigStorage = CardanoStorageConfig (configStorage topLevelConfigByron) @@ -833,6 +895,7 @@ protocolInfoCardano paramsCardano (Shelley.ShelleyStorageConfig tpraosSlotsPerKESPeriod k) (Shelley.ShelleyStorageConfig tpraosSlotsPerKESPeriod k) (Shelley.ShelleyStorageConfig tpraosSlotsPerKESPeriod k) + (Shelley.ShelleyStorageConfig tpraosSlotsPerKESPeriod k) , topLevelConfigCheckpoints = cardanoCheckpoints } @@ -865,6 +928,7 @@ protocolInfoCardano paramsCardano :* WrapTransitionConfig transitionConfigAlonzo :* WrapTransitionConfig transitionConfigBabbage :* WrapTransitionConfig transitionConfigConway + :* WrapTransitionConfig transitionConfigDijkstra :* Nil injectIntoTestState :: @@ -970,6 +1034,7 @@ protocolInfoCardano paramsCardano :* tpraos :* praos :* praos + :* praos :* Nil protocolClientInfoCardano :: @@ -988,6 +1053,7 @@ protocolClientInfoCardano epochSlots = (pClientInfoCodecConfig protocolClientInfoShelley) (pClientInfoCodecConfig protocolClientInfoShelley) (pClientInfoCodecConfig protocolClientInfoShelley) + (pClientInfoCodecConfig protocolClientInfoShelley) } {------------------------------------------------------------------------------- diff --git a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/QueryHF.hs b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/QueryHF.hs index 889ad87061..bfed11149c 100644 --- a/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/QueryHF.hs +++ b/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/QueryHF.hs @@ -119,7 +119,8 @@ instance CardanoHardForkConstraints c => BlockSupportsHFLedgerQuery (CardanoEras IS (IS (IS (IS IZ))) -> shelleyCardanoFilter q IS (IS (IS (IS (IS IZ)))) -> shelleyCardanoFilter q IS (IS (IS (IS (IS (IS IZ))))) -> shelleyCardanoFilter q - IS (IS (IS (IS (IS (IS (IS idx')))))) -> case idx' of {} + IS (IS (IS (IS (IS (IS (IS IZ)))))) -> shelleyCardanoFilter q + IS (IS (IS (IS (IS (IS (IS (IS idx'))))))) -> case idx' of {} byronCardanoFilter :: BlockQuery ByronBlock QFTraverseTables result -> diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs index 30d9f1b465..c77481b0f2 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs @@ -21,14 +21,7 @@ module Ouroboros.Consensus.Shelley.Eras , ConwayEra , MaryEra , ShelleyEra - - -- * Eras instantiated with standard crypto - , StandardAllegra - , StandardAlonzo - , StandardBabbage - , StandardConway - , StandardMary - , StandardShelley + , DijkstraEra -- * Shelley-based era , ConwayEraGovDict (..) @@ -64,6 +57,8 @@ import qualified Cardano.Ledger.Conway.Rules as SL import qualified Cardano.Ledger.Conway.State as CG import qualified Cardano.Ledger.Conway.Translation as Conway import Cardano.Ledger.Core as Core +import Cardano.Ledger.Dijkstra (DijkstraEra) +import qualified Cardano.Ledger.Dijkstra.Translation as Dijkstra import Cardano.Ledger.Mary (MaryEra) import Cardano.Ledger.Mary.Translation () import Cardano.Ledger.Shelley (ShelleyEra) @@ -83,40 +78,6 @@ import Ouroboros.Consensus.Ledger.SupportsMempool ) import Ouroboros.Consensus.Protocol.TPraos (StandardCrypto) -{------------------------------------------------------------------------------- - Eras instantiated with standard crypto --------------------------------------------------------------------------------} - --- | The Shelley era with standard crypto -type StandardShelley = ShelleyEra - -{-# DEPRECATED StandardShelley "In favor of `ShelleyEra`" #-} - --- | The Allegra era with standard crypto -type StandardAllegra = AllegraEra - -{-# DEPRECATED StandardAllegra "In favor of `AllegraEra`" #-} - --- | The Mary era with standard crypto -type StandardMary = MaryEra - -{-# DEPRECATED StandardMary "In favor of `MaryEra`" #-} - --- | The Alonzo era with standard crypto -type StandardAlonzo = AlonzoEra - -{-# DEPRECATED StandardAlonzo "In favor of `AlonzoEra`" #-} - --- | The Babbage era with standard crypto -type StandardBabbage = BabbageEra - -{-# DEPRECATED StandardBabbage "In favor of `BabbageEra`" #-} - --- | The Conway era with standard crypto -type StandardConway = ConwayEra - -{-# DEPRECATED StandardConway "In favor of `ConwayEra`" #-} - {------------------------------------------------------------------------------- Era polymorphism -------------------------------------------------------------------------------} @@ -241,6 +202,11 @@ instance ShelleyBasedEra ConwayEra where getConwayEraGovDict _ = Just ConwayEraGovDict +instance ShelleyBasedEra DijkstraEra where + applyShelleyBasedTx = applyAlonzoBasedTx + + getConwayEraGovDict _ = Just ConwayEraGovDict + applyAlonzoBasedTx :: forall era. ( ShelleyBasedEra era @@ -357,6 +323,20 @@ instance SupportsTwoPhaseValidation ConwayEra where ) -> True _ -> False +instance SupportsTwoPhaseValidation DijkstraEra where + -- TODO(geo2a): I do not understand this code. Do I need to? + isIncorrectClaimedFlag _ = \case + SL.ConwayUtxowFailure + ( Conway.UtxoFailure + ( Conway.UtxosFailure + ( Conway.ValidationTagMismatch + (Alonzo.IsValid _claimedFlag) + _validationErrs + ) + ) + ) -> True + _ -> False + {------------------------------------------------------------------------------- Tx family wrapper -------------------------------------------------------------------------------} @@ -404,3 +384,11 @@ instance Core.TranslateEra ConwayEra WrapTx where . Core.translateEra @ConwayEra ctxt . Conway.Tx . unwrapTx + +instance Core.TranslateEra DijkstraEra WrapTx where + type TranslationError DijkstraEra WrapTx = Core.TranslationError DijkstraEra Dijkstra.Tx + translateEra ctxt = + fmap (WrapTx . Dijkstra.unTx) + . Core.translateEra @DijkstraEra ctxt + . Dijkstra.Tx + . unwrapTx diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/HFEras.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/HFEras.hs index 6bc612845f..1118b3b86e 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/HFEras.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/HFEras.hs @@ -13,6 +13,7 @@ module Ouroboros.Consensus.Shelley.HFEras , StandardAlonzoBlock , StandardBabbageBlock , StandardConwayBlock + , StandardDijkstraBlock , StandardMaryBlock , StandardShelleyBlock ) where @@ -26,6 +27,7 @@ import Ouroboros.Consensus.Shelley.Eras , AlonzoEra , BabbageEra , ConwayEra + , DijkstraEra , MaryEra , ShelleyEra ) @@ -54,6 +56,8 @@ type StandardBabbageBlock = ShelleyBlock (Praos StandardCrypto) BabbageEra type StandardConwayBlock = ShelleyBlock (Praos StandardCrypto) ConwayEra +type StandardDijkstraBlock = ShelleyBlock (Praos StandardCrypto) DijkstraEra + {------------------------------------------------------------------------------- ShelleyCompatible -------------------------------------------------------------------------------} @@ -91,3 +95,12 @@ instance ShelleyCompatible (TPraos c) ConwayEra instance Praos.PraosCrypto c => ShelleyCompatible (Praos c) ConwayEra + +-- This instance is required since the ledger view forecast function for +-- Praos/Dijkstra still goes through the forecast for TPraos. Once this is +-- addressed, we could remove this instance. +instance + (Praos.PraosCrypto c, TPraos.PraosCrypto c) => + ShelleyCompatible (TPraos c) DijkstraEra + +instance Praos.PraosCrypto c => ShelleyCompatible (Praos c) DijkstraEra diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Mempool.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Mempool.hs index 40293d786c..a3a226d07d 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Mempool.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Mempool.hs @@ -468,6 +468,17 @@ instance MaxTxSizeUTxO ConwayEra where , mismatchExpected = txSizeLimit } +instance MaxTxSizeUTxO DijkstraEra where + maxTxSizeUTxO txSize txSizeLimit = + SL.ApplyTxError . pure $ + ConwayEra.ConwayUtxowFailure $ + ConwayEra.UtxoFailure $ + ConwayEra.MaxTxSizeUTxO $ + L.Mismatch + { mismatchSupplied = txSize + , mismatchExpected = txSizeLimit + } + ----- instance ShelleyCompatible p ShelleyEra => TxLimits (ShelleyBlock p ShelleyEra) where @@ -594,6 +605,17 @@ instance ExUnitsTooBigUTxO ConwayEra where , mismatchExpected = limit } +instance ExUnitsTooBigUTxO DijkstraEra where + exUnitsTooBigUTxO txsz limit = + SL.ApplyTxError . pure $ + ConwayEra.ConwayUtxowFailure $ + ConwayEra.UtxoFailure $ + ConwayEra.ExUnitsTooBigUTxO $ + L.Mismatch + { mismatchSupplied = txsz + , mismatchExpected = limit + } + ----- instance @@ -690,6 +712,15 @@ instance TxRefScriptsSizeTooBig ConwayEra where , mismatchExpected = limit } +instance TxRefScriptsSizeTooBig DijkstraEra where + txRefScriptsSizeTooBig txsz limit = + SL.ApplyTxError . pure $ + ConwayEra.ConwayTxRefScriptsSizeTooBig $ + L.Mismatch + { mismatchSupplied = txsz + , mismatchExpected = limit + } + ----- txMeasureBabbage :: @@ -733,3 +764,11 @@ instance type TxMeasure (ShelleyBlock p ConwayEra) = ConwayMeasure txMeasure _cfg st tx = runValidation $ txMeasureConway st tx blockCapacityTxMeasure _cfg = blockCapacityConwayMeasure + +instance + ShelleyCompatible p DijkstraEra => + TxLimits (ShelleyBlock p DijkstraEra) + where + type TxMeasure (ShelleyBlock p DijkstraEra) = ConwayMeasure + txMeasure _cfg st tx = runValidation $ txMeasureConway st tx + blockCapacityTxMeasure _cfg = blockCapacityConwayMeasure diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyPParams.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyPParams.hs index 3b29f38940..5eecb9b6ac 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyPParams.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyPParams.hs @@ -20,6 +20,7 @@ import Cardano.Ledger.Binary.Coders import qualified Cardano.Ledger.Binary.Plain as Plain import Cardano.Ledger.Conway import Cardano.Ledger.Core +import Cardano.Ledger.Dijkstra import Cardano.Ledger.Mary import Cardano.Ledger.Shelley import Cardano.Ledger.Shelley.PParams @@ -372,3 +373,9 @@ instance ToCBOR (LegacyPParams ConwayEra) where instance FromCBOR (LegacyPParams ConwayEra) where fromCBOR = LegacyPParams <$> fromCBOR + +instance ToCBOR (LegacyPParams DijkstraEra) where + toCBOR = toCBOR . unLegacyPParams + +instance FromCBOR (LegacyPParams DijkstraEra) where + fromCBOR = LegacyPParams <$> fromCBOR diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Examples.hs b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Examples.hs index 9ca61c302a..d2fd8a5a31 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Examples.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Examples.hs @@ -87,6 +87,7 @@ eraExamples = :* Shelley.examplesAlonzo :* Shelley.examplesBabbage :* Shelley.examplesConway + :* Shelley.examplesDijkstra :* Nil -- | By using this function, we can't forget to update this test when adding a @@ -164,7 +165,10 @@ combineEras perEraExamples = (ShelleyPartialLedgerConfig lcAlonzo (TriggerHardForkAtEpoch (History.boundEpoch babbageStartBound))) :* WrapPartialLedgerConfig (ShelleyPartialLedgerConfig lcBabbage (TriggerHardForkAtEpoch (History.boundEpoch conwayStartBound))) - :* WrapPartialLedgerConfig (ShelleyPartialLedgerConfig lcConway TriggerHardForkNotDuringThisExecution) + :* WrapPartialLedgerConfig + (ShelleyPartialLedgerConfig lcConway (TriggerHardForkAtEpoch (History.boundEpoch dijkstraStartBound))) + :* WrapPartialLedgerConfig + (ShelleyPartialLedgerConfig lcDijkstra TriggerHardForkNotDuringThisExecution) :* Nil ) ) @@ -176,6 +180,7 @@ combineEras perEraExamples = , WrapLedgerConfig lcAlonzo <- labelledLcAlonzo , WrapLedgerConfig lcBabbage <- labelledLcBabbage , WrapLedgerConfig lcConway <- labelledLcConway + , WrapLedgerConfig lcDijkstra <- labelledLcDijkstra ] where ( Comp labelledLcByron @@ -185,6 +190,7 @@ combineEras perEraExamples = :* Comp labelledLcAlonzo :* Comp labelledLcBabbage :* Comp labelledLcConway + :* Comp labelledLcDijkstra :* Nil ) = hmap (Comp . fmap (WrapLedgerConfig . snd) . exampleLedgerConfig) perEraExamples @@ -270,9 +276,12 @@ babbageEraParams = Shelley.shelleyEraParams Shelley.testShelleyGenesis conwayEraParams :: History.EraParams conwayEraParams = Shelley.shelleyEraParams Shelley.testShelleyGenesis +dijkstraEraParams :: History.EraParams +dijkstraEraParams = Shelley.shelleyEraParams Shelley.testShelleyGenesis + -- | We use 10, 20, 30, 40, ... as the transition epochs shelleyTransitionEpoch :: EpochNo -shelleyTransitionEpoch = 10 +shelleyTransitionEpoch = EpochNo 10 byronStartBound :: History.Bound byronStartBound = History.initBound @@ -289,35 +298,42 @@ allegraStartBound = History.mkUpperBound shelleyEraParams shelleyStartBound - 20 + (EpochNo 20) maryStartBound :: History.Bound maryStartBound = History.mkUpperBound allegraEraParams allegraStartBound - 30 + (EpochNo 30) alonzoStartBound :: History.Bound alonzoStartBound = History.mkUpperBound maryEraParams maryStartBound - 40 + (EpochNo 40) babbageStartBound :: History.Bound babbageStartBound = History.mkUpperBound alonzoEraParams alonzoStartBound - 50 + (EpochNo 50) conwayStartBound :: History.Bound conwayStartBound = History.mkUpperBound alonzoEraParams alonzoStartBound - 60 + (EpochNo 60) + +dijkstraStartBound :: History.Bound +dijkstraStartBound = + History.mkUpperBound + alonzoEraParams + alonzoStartBound + (EpochNo 70) exampleStartBounds :: Exactly (CardanoEras Crypto) History.Bound exampleStartBounds = @@ -329,6 +345,7 @@ exampleStartBounds = :* K alonzoStartBound :* K babbageStartBound :* K conwayStartBound + :* K dijkstraStartBound :* Nil ) @@ -343,6 +360,7 @@ cardanoShape = :* K alonzoEraParams :* K babbageEraParams :* K conwayEraParams + :* K dijkstraEraParams :* Nil ) @@ -371,6 +389,7 @@ codecConfig = Shelley.ShelleyCodecConfig Shelley.ShelleyCodecConfig Shelley.ShelleyCodecConfig + Shelley.ShelleyCodecConfig ledgerStateByron :: LedgerState ByronBlock mk -> diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Generators.hs b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Generators.hs index 2973a72b1a..73f75e29b1 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Generators.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/Generators.hs @@ -54,6 +54,7 @@ import Ouroboros.Consensus.TypeFamilyWrappers import Test.Cardano.Ledger.Alonzo.Arbitrary () import Test.Cardano.Ledger.Alonzo.Serialisation.Generators () import Test.Cardano.Ledger.Conway.Arbitrary () +import Test.Cardano.Ledger.Dijkstra.Arbitrary () import Test.Consensus.Byron.Generators () import Test.Consensus.Protocol.Serialisation.Generators () import Test.Consensus.Shelley.Generators @@ -85,6 +86,7 @@ instance Arbitrary (CardanoBlock StandardCrypto) where :* mk BlockAlonzo :* mk BlockBabbage :* mk BlockConway + :* mk BlockDijkstra :* Nil mk :: @@ -110,6 +112,7 @@ instance Arbitrary (Coherent (CardanoBlock StandardCrypto)) where :* mk BlockAlonzo :* mk BlockBabbage :* mk BlockConway + :* mk BlockDijkstra :* Nil mk :: @@ -170,6 +173,7 @@ arbitraryNodeToNode :: , Arbitrary (WithVersion ShelleyNodeToNodeVersion alonzo) , Arbitrary (WithVersion ShelleyNodeToNodeVersion babbage) , Arbitrary (WithVersion ShelleyNodeToNodeVersion conway) + , Arbitrary (WithVersion ShelleyNodeToNodeVersion dijkstra) ) => (byron -> cardano) -> (shelley -> cardano) -> @@ -178,8 +182,9 @@ arbitraryNodeToNode :: (alonzo -> cardano) -> (babbage -> cardano) -> (conway -> cardano) -> + (dijkstra -> cardano) -> Gen (WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) cardano) -arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage injConway = +arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage injConway injDijkstra = oneof [ -- Byron before HFC ( \(WithVersion versionByron b) -> @@ -190,7 +195,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <$> arbitrary , -- Note that any value generated by the V1 Byron generator is also fine -- when using Byron V2. - ( \(WithVersion versionByron x) versionShelley versionAllegra versionMary versionAlonzo versionBabbage versionConway -> + ( \(WithVersion versionByron x) versionShelley versionAllegra versionMary versionAlonzo versionBabbage versionConway versionDijkstra -> distrib versionByron versionShelley @@ -199,6 +204,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injByron x) ) <$> arbitrary @@ -208,7 +214,8 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary - , ( \versionByron (WithVersion versionShelley x) versionAllegra versionMary versionAlonzo versionBabbage versionConway -> + <*> arbitrary + , ( \versionByron (WithVersion versionShelley x) versionAllegra versionMary versionAlonzo versionBabbage versionConway versionDijkstra -> distrib versionByron versionShelley @@ -217,6 +224,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injShelley x) ) <$> arbitrary @@ -226,7 +234,8 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary - , ( \versionByron versionShelley (WithVersion versionAllegra x) versionMary versionAlonzo versionBabbage versionConway -> + <*> arbitrary + , ( \versionByron versionShelley (WithVersion versionAllegra x) versionMary versionAlonzo versionBabbage versionConway versionDijkstra -> distrib versionByron versionShelley @@ -235,6 +244,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injAllegra x) ) <$> arbitrary @@ -244,7 +254,8 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary - , ( \versionByron versionShelley versionAllegra (WithVersion versionMary x) versionAlonzo versionBabbage versionConway -> + <*> arbitrary + , ( \versionByron versionShelley versionAllegra (WithVersion versionMary x) versionAlonzo versionBabbage versionConway versionDijkstra -> distrib versionByron versionShelley @@ -253,6 +264,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injMary x) ) <$> arbitrary @@ -262,7 +274,8 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary - , ( \versionByron versionShelley versionAllegra versionMary (WithVersion versionAlonzo x) versionBabbage versionConway -> + <*> arbitrary + , ( \versionByron versionShelley versionAllegra versionMary (WithVersion versionAlonzo x) versionBabbage versionConway versionDijkstra -> distrib versionByron versionShelley @@ -271,6 +284,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injAlonzo x) ) <$> arbitrary @@ -280,7 +294,8 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary - , ( \versionByron versionShelley versionAllegra versionMary versionAlonzo (WithVersion versionBabbage x) versionConway -> + <*> arbitrary + , ( \versionByron versionShelley versionAllegra versionMary versionAlonzo (WithVersion versionBabbage x) versionConway versionDijkstra -> distrib versionByron versionShelley @@ -289,6 +304,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injBabbage x) ) <$> arbitrary @@ -298,7 +314,8 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary - , ( \versionByron versionShelley versionAllegra versionMary versionAlonzo versionBabbage (WithVersion versionConway x) -> + <*> arbitrary + , ( \versionByron versionShelley versionAllegra versionMary versionAlonzo versionBabbage (WithVersion versionConway x) versionDijkstra -> distrib versionByron versionShelley @@ -307,6 +324,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra (injConway x) ) <$> arbitrary @@ -316,6 +334,27 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary + , ( \versionByron versionShelley versionAllegra versionMary versionAlonzo versionBabbage versionConway (WithVersion versionDijkstra x) -> + distrib + versionByron + versionShelley + versionAllegra + versionMary + versionAlonzo + versionBabbage + versionConway + versionDijkstra + (injDijkstra x) + ) + <$> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary ] where distrib @@ -326,6 +365,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage versionAlonzo versionBabbage versionConway + versionDijkstra x = WithVersion ( HardForkNodeToNodeEnabled @@ -337,6 +377,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage :* WrapNodeToNodeVersion versionAlonzo :* WrapNodeToNodeVersion versionBabbage :* WrapNodeToNodeVersion versionConway + :* WrapNodeToNodeVersion versionDijkstra :* Nil ) ) @@ -350,7 +391,16 @@ instance (SomeSecond (NestedCtxt Header) (CardanoBlock c)) ) where - arbitrary = arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage injConway + arbitrary = + arbitraryNodeToNode + injByron + injShelley + injAllegra + injMary + injAlonzo + injBabbage + injConway + injDijkstra where injByron = mapSomeNestedCtxt NCZ injShelley = mapSomeNestedCtxt (NCS . NCZ) @@ -359,6 +409,7 @@ instance injAlonzo = mapSomeNestedCtxt (NCS . NCS . NCS . NCS . NCZ) injBabbage = mapSomeNestedCtxt (NCS . NCS . NCS . NCS . NCS . NCZ) injConway = mapSomeNestedCtxt (NCS . NCS . NCS . NCS . NCS . NCS . NCZ) + injDijkstra = mapSomeNestedCtxt (NCS . NCS . NCS . NCS . NCS . NCS . NCS . NCZ) instance c ~ StandardCrypto => @@ -377,6 +428,7 @@ instance BlockAlonzo BlockBabbage BlockConway + BlockDijkstra instance c ~ StandardCrypto => @@ -395,6 +447,7 @@ instance HeaderAlonzo HeaderBabbage HeaderConway + HeaderDijkstra instance c ~ StandardCrypto => @@ -413,6 +466,7 @@ instance GenTxAlonzo GenTxBabbage GenTxConway + GenTxDijkstra instance c ~ StandardCrypto => @@ -431,6 +485,7 @@ instance GenTxIdAlonzo GenTxIdBabbage GenTxIdConway + GenTxIdDijkstra {------------------------------------------------------------------------------- NodeToClient @@ -505,6 +560,7 @@ arbitraryNodeToClient :: , Arbitrary (WithVersion ShelleyNodeToClientVersion alonzo) , Arbitrary (WithVersion ShelleyNodeToClientVersion babbage) , Arbitrary (WithVersion ShelleyNodeToClientVersion conway) + , Arbitrary (WithVersion ShelleyNodeToClientVersion dijkstra) ) => (byron -> cardano) -> (shelley -> cardano) -> @@ -513,8 +569,9 @@ arbitraryNodeToClient :: (alonzo -> cardano) -> (babbage -> cardano) -> (conway -> cardano) -> + (dijkstra -> cardano) -> Gen (WithVersion (HardForkNodeToClientVersion (CardanoEras c)) cardano) -arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbage injConway = +arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbage injConway injDijkstra = oneof -- Byron + HardFork disabled [ ( \(WithVersion versionByron b) -> @@ -524,7 +581,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag ) <$> arbitrary , -- Byron + HardFork enabled. - ( \(WithVersion versionByron b) versionShelley versionAllegra versionMary versionAlonzo versionBabbage versionConway -> + ( \(WithVersion versionByron b) versionShelley versionAllegra versionMary versionAlonzo versionBabbage versionConway versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -535,6 +592,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* versionAlonzo :* versionBabbage :* versionConway + :* versionDijkstra :* Nil ) ) @@ -547,8 +605,9 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary , -- Shelley + HardFork enabled - ( \versionByron (WithVersion versionShelley s) versionAllegra versionMary versionAlonzo versionBabbage versionConway -> + ( \versionByron (WithVersion versionShelley s) versionAllegra versionMary versionAlonzo versionBabbage versionConway versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -559,6 +618,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* versionAlonzo :* versionBabbage :* versionConway + :* versionDijkstra :* Nil ) ) @@ -571,8 +631,9 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary , -- Allegra + HardFork enabled - ( \versionByron versionShelley (WithVersion versionAllegra a) versionMary versionAlonzo versionBabbage versionConway -> + ( \versionByron versionShelley (WithVersion versionAllegra a) versionMary versionAlonzo versionBabbage versionConway versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -583,6 +644,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* versionAlonzo :* versionBabbage :* versionConway + :* versionDijkstra :* Nil ) ) @@ -595,8 +657,9 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary , -- Mary + HardFork enabled - ( \versionByron versionShelley versionAllegra (WithVersion versionMary m) versionAlonzo versionBabbage versionConway -> + ( \versionByron versionShelley versionAllegra (WithVersion versionMary m) versionAlonzo versionBabbage versionConway versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -607,6 +670,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* versionAlonzo :* versionBabbage :* versionConway + :* versionDijkstra :* Nil ) ) @@ -619,8 +683,9 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary , -- Alonzo + HardFork enabled - ( \versionByron versionShelley versionAllegra versionMary (WithVersion versionAlonzo a) versionBabbage versionConway -> + ( \versionByron versionShelley versionAllegra versionMary (WithVersion versionAlonzo a) versionBabbage versionConway versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -631,6 +696,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* EraNodeToClientEnabled versionAlonzo :* versionBabbage :* versionConway + :* versionDijkstra :* Nil ) ) @@ -643,8 +709,9 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary , -- Babbage + HardFork enabled - ( \versionByron versionShelley versionAllegra versionMary versionAlonzo (WithVersion versionBabbage a) versionConway -> + ( \versionByron versionShelley versionAllegra versionMary versionAlonzo (WithVersion versionBabbage a) versionConway versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -655,6 +722,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* EraNodeToClientEnabled versionAlonzo :* EraNodeToClientEnabled versionBabbage :* versionConway + :* versionDijkstra :* Nil ) ) @@ -667,8 +735,9 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary , -- Conway + HardFork enabled - ( \versionByron versionShelley versionAllegra versionMary versionAlonzo versionBabbage (WithVersion versionConway a) -> + ( \versionByron versionShelley versionAllegra versionMary versionAlonzo versionBabbage (WithVersion versionConway a) versionDijkstra -> WithVersion ( HardForkNodeToClientEnabled maxBound @@ -679,6 +748,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag :* EraNodeToClientEnabled versionAlonzo :* EraNodeToClientEnabled versionBabbage :* EraNodeToClientEnabled versionConway + :* versionDijkstra :* Nil ) ) @@ -691,6 +761,33 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag <*> arbitrary <*> arbitrary <*> arbitrary + <*> arbitrary + , -- Dijkstra + HardFork enabled + ( \versionByron versionShelley versionAllegra versionMary versionAlonzo versionBabbage versionConway (WithVersion versionDijkstra a) -> + WithVersion + ( HardForkNodeToClientEnabled + maxBound + ( EraNodeToClientEnabled versionByron + :* EraNodeToClientEnabled versionShelley + :* EraNodeToClientEnabled versionAllegra + :* EraNodeToClientEnabled versionMary + :* EraNodeToClientEnabled versionAlonzo + :* EraNodeToClientEnabled versionBabbage + :* EraNodeToClientEnabled versionConway + :* EraNodeToClientEnabled versionDijkstra + :* Nil + ) + ) + (injDijkstra a) + ) + <$> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary + <*> arbitrary ] instance @@ -710,6 +807,7 @@ instance BlockAlonzo BlockBabbage BlockConway + BlockDijkstra instance c ~ StandardCrypto => @@ -728,6 +826,7 @@ instance GenTxAlonzo GenTxBabbage GenTxConway + GenTxDijkstra instance c ~ StandardCrypto => @@ -749,6 +848,7 @@ instance ApplyTxErrAlonzo ApplyTxErrBabbage ApplyTxErrConway + ApplyTxErrDijkstra ) , ( 2 @@ -804,7 +904,18 @@ instance where arbitrary = frequency - [ (1, arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbage injConway) + [ + ( 1 + , arbitraryNodeToClient + injByron + injShelley + injAllegra + injMary + injAlonzo + injBabbage + injConway + injDijkstra + ) , ( 1 , WithVersion @@ -847,6 +958,12 @@ instance <$> (getHardForkEnabledNodeToClientVersion <$> arbitrary) <*> (injAnytimeConway <$> arbitrary) ) + , + ( 1 + , WithVersion + <$> (getHardForkEnabledNodeToClientVersion <$> arbitrary) + <*> (injAnytimeDijkstra <$> arbitrary) + ) , (1, fmap injHardFork <$> arbitrary) ] where @@ -857,6 +974,7 @@ instance injAlonzo (SomeBlockQuery query) = SomeBlockQuery (QueryIfCurrentAlonzo query) injBabbage (SomeBlockQuery query) = SomeBlockQuery (QueryIfCurrentBabbage query) injConway (SomeBlockQuery query) = SomeBlockQuery (QueryIfCurrentConway query) + injDijkstra (SomeBlockQuery query) = SomeBlockQuery (QueryIfCurrentDijkstra query) injAnytimeByron (Some query) = SomeBlockQuery (QueryAnytimeByron query) injAnytimeShelley (Some query) = SomeBlockQuery (QueryAnytimeShelley query) injAnytimeAllegra (Some query) = SomeBlockQuery (QueryAnytimeAllegra query) @@ -864,6 +982,7 @@ instance injAnytimeAlonzo (Some query) = SomeBlockQuery (QueryAnytimeAlonzo query) injAnytimeBabbage (Some query) = SomeBlockQuery (QueryAnytimeBabbage query) injAnytimeConway (Some query) = SomeBlockQuery (QueryAnytimeConway query) + injAnytimeDijkstra (Some query) = SomeBlockQuery (QueryAnytimeDijkstra query) injHardFork (Some query) = SomeBlockQuery (QueryHardFork query) instance Arbitrary History.EraEnd where @@ -924,7 +1043,18 @@ instance where arbitrary = frequency - [ (1, arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbage injConway) + [ + ( 1 + , arbitraryNodeToClient + injByron + injShelley + injAllegra + injMary + injAlonzo + injBabbage + injConway + injDijkstra + ) , ( 1 , WithVersion @@ -973,6 +1103,12 @@ instance <$> (getHardForkEnabledNodeToClientVersion <$> arbitrary) <*> genQueryAnytimeResultConway ) + , + ( 1 + , WithVersion + <$> (getHardForkEnabledNodeToClientVersion <$> arbitrary) + <*> genQueryAnytimeResultDijkstra + ) , (1, genQueryHardForkResult) ] where @@ -983,6 +1119,7 @@ instance injAlonzo (SomeResult q r) = SomeResult (QueryIfCurrentAlonzo q) (QueryResultSuccess r) injBabbage (SomeResult q r) = SomeResult (QueryIfCurrentBabbage q) (QueryResultSuccess r) injConway (SomeResult q r) = SomeResult (QueryIfCurrentConway q) (QueryResultSuccess r) + injDijkstra (SomeResult q r) = SomeResult (QueryIfCurrentDijkstra q) (QueryResultSuccess r) -- In practice, when sending a Byron query you'll never get a mismatch -- saying that your query is from the Shelley era while the ledger is @@ -1027,6 +1164,11 @@ instance ) <$> arbitrary <*> arbitrary + , ( \(SomeResult q (_ :: result)) mismatch -> + SomeResult (QueryIfCurrentDijkstra q) (Left @_ @result mismatch) + ) + <$> arbitrary + <*> arbitrary ] genQueryAnytimeResultByron :: Gen (SomeResult (CardanoBlock c)) @@ -1057,6 +1199,10 @@ instance genQueryAnytimeResultConway = SomeResult (QueryAnytimeConway GetEraStart) <$> arbitrary + genQueryAnytimeResultDijkstra :: Gen (SomeResult (CardanoBlock c)) + genQueryAnytimeResultDijkstra = + SomeResult (QueryAnytimeDijkstra GetEraStart) <$> arbitrary + genQueryHardForkResult :: Gen ( WithVersion diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs index a2193e65e9..aeb4aca3d3 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/Consensus/Cardano/ProtocolInfo.hs @@ -66,8 +66,8 @@ import Ouroboros.Consensus.Shelley.Node , ShelleyLeaderCredentials ) import Ouroboros.Consensus.Util.IOLike (IOLike) -import qualified Test.Cardano.Ledger.Alonzo.Examples.Consensus as SL -import qualified Test.Cardano.Ledger.Conway.Examples.Consensus as SL +import qualified Test.Cardano.Ledger.Api.Examples.Consensus.Alonzo as SL +import qualified Test.Cardano.Ledger.Api.Examples.Consensus.Conway as SL import qualified Test.ThreadNet.Infra.Byron as Byron import qualified Test.ThreadNet.Infra.Shelley as Shelley import Test.ThreadNet.Util.Seed (Seed (Seed), runGen) diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol.hs index ca47c6ec72..48a91c1442 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol.hs @@ -36,6 +36,7 @@ mkConsensusProtocol ncProtocolConfig mProtocolFiles = shelleyConfig alonzoConfig conwayConfig + dijkstraConfig hardForkConfig -> firstExceptT CardanoProtocolInstantiationError $ mkSomeConsensusProtocolCardano @@ -43,6 +44,7 @@ mkConsensusProtocol ncProtocolConfig mProtocolFiles = shelleyConfig alonzoConfig conwayConfig + dijkstraConfig hardForkConfig mProtocolFiles diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol/Cardano.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol/Cardano.hs index b4b662c695..82c9b1a226 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol/Cardano.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Protocol/Cardano.hs @@ -58,11 +58,12 @@ mkSomeConsensusProtocolCardano :: NodeShelleyProtocolConfiguration -> NodeAlonzoProtocolConfiguration -> NodeConwayProtocolConfiguration -> + NodeDijkstraProtocolConfiguration -> NodeHardForkProtocolConfiguration -> Maybe ProtocolFilepaths -> ExceptT CardanoProtocolInstantiationError IO SomeConsensusProtocol -mkSomeConsensusProtocolCardano nbpc nspc napc ncpc nhpc files = do - params <- mkConsensusProtocolCardano nbpc nspc napc ncpc nhpc files +mkSomeConsensusProtocolCardano nbpc nspc napc ncpc ndpc nhpc files = do + params <- mkConsensusProtocolCardano nbpc nspc napc ncpc ndpc nhpc files return $! SomeConsensusProtocol CardanoBlockType $ ProtocolInfoArgsCardano params @@ -72,6 +73,7 @@ mkConsensusProtocolCardano :: NodeShelleyProtocolConfiguration -> NodeAlonzoProtocolConfiguration -> NodeConwayProtocolConfiguration -> + NodeDijkstraProtocolConfiguration -> NodeHardForkProtocolConfiguration -> Maybe ProtocolFilepaths -> ExceptT CardanoProtocolInstantiationError IO (CardanoProtocolParams StandardCrypto) @@ -99,6 +101,7 @@ mkConsensusProtocolCardano { npcConwayGenesisFile , npcConwayGenesisFileHash } + NodeDijkstraProtocolConfiguration{} NodeHardForkProtocolConfiguration { npcTestEnableDevelopmentHardForkEras = _ , -- During testing of the latest unreleased era, we conditionally @@ -112,6 +115,7 @@ mkConsensusProtocolCardano , npcTestAlonzoHardForkAtEpoch , npcTestBabbageHardForkAtEpoch , npcTestConwayHardForkAtEpoch + , npcTestDijkstraHardForkAtEpoch } files = do byronGenesis <- @@ -238,6 +242,11 @@ mkConsensusProtocolCardano case npcTestConwayHardForkAtEpoch of Nothing -> Consensus.CardanoTriggerHardForkAtDefaultVersion Just epochNo -> Consensus.CardanoTriggerHardForkAtEpoch epochNo + , -- Conway to Dijkstra hard fork parameters + triggerHardForkDijkstra = + case npcTestDijkstraHardForkAtEpoch of + Nothing -> Consensus.CardanoTriggerHardForkAtDefaultVersion + Just epochNo -> Consensus.CardanoTriggerHardForkAtEpoch epochNo } transitionLedgerConfig emptyCheckpointsMap diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Types.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Types.hs index c833cfe5fb..0d8195b4b0 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Types.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Node/Types.hs @@ -23,6 +23,7 @@ module Cardano.Node.Types , NodeAlonzoProtocolConfiguration (..) , NodeByronProtocolConfiguration (..) , NodeConwayProtocolConfiguration (..) + , NodeDijkstraProtocolConfiguration (..) , NodeHardForkProtocolConfiguration (..) , NodeProtocolConfiguration (..) , NodeShelleyProtocolConfiguration (..) @@ -122,6 +123,7 @@ data NodeProtocolConfiguration NodeShelleyProtocolConfiguration NodeAlonzoProtocolConfiguration NodeConwayProtocolConfiguration + NodeDijkstraProtocolConfiguration NodeHardForkProtocolConfiguration deriving (Eq, Show) @@ -172,6 +174,13 @@ data NodeConwayProtocolConfiguration } deriving (Eq, Show) +data NodeDijkstraProtocolConfiguration + = NodeDijkstraProtocolConfiguration + { npcDijkstraGenesisFile :: !GenesisFile + , npcDijkstraGenesisFileHash :: !(Maybe GenesisHash) + } + deriving (Eq, Show) + -- | Configuration relating to a hard forks themselves, not the specific eras. data NodeHardForkProtocolConfiguration = NodeHardForkProtocolConfiguration @@ -216,6 +225,7 @@ data NodeHardForkProtocolConfiguration -- configured the same, or they will disagree. , npcTestBabbageHardForkAtEpoch :: Maybe EpochNo , npcTestConwayHardForkAtEpoch :: Maybe EpochNo + , npcTestDijkstraHardForkAtEpoch :: Maybe EpochNo } deriving (Eq, Show) @@ -224,12 +234,13 @@ instance AdjustFilePaths NodeProtocolConfiguration where NodeProtocolConfigurationByron (adjustFilePaths f pc) adjustFilePaths f (NodeProtocolConfigurationShelley pc) = NodeProtocolConfigurationShelley (adjustFilePaths f pc) - adjustFilePaths f (NodeProtocolConfigurationCardano pcb pcs pca pcc pch) = + adjustFilePaths f (NodeProtocolConfigurationCardano pcb pcs pca pcc pcd pch) = NodeProtocolConfigurationCardano (adjustFilePaths f pcb) (adjustFilePaths f pcs) (adjustFilePaths f pca) (adjustFilePaths f pcc) + (adjustFilePaths f pcd) pch instance AdjustFilePaths NodeByronProtocolConfiguration where @@ -264,6 +275,14 @@ instance AdjustFilePaths NodeConwayProtocolConfiguration where } = x{npcConwayGenesisFile = adjustFilePaths f npcConwayGenesisFile} +instance AdjustFilePaths NodeDijkstraProtocolConfiguration where + adjustFilePaths + f + x@NodeDijkstraProtocolConfiguration + { npcDijkstraGenesisFile + } = + x{npcDijkstraGenesisFile = adjustFilePaths f npcDijkstraGenesisFile} + instance AdjustFilePaths GenesisFile where adjustFilePaths f (GenesisFile p) = GenesisFile (f p) diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Cardano.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Cardano.hs index 784f861e83..ca3c148baa 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Cardano.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Cardano.hs @@ -337,6 +337,7 @@ dispatch cardanoSt fByron fShelley = :* fn k_fShelley :* fn k_fShelley :* fn k_fShelley + :* fn k_fShelley :* Nil ) (hardForkLedgerStatePerEra cardanoSt) diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Shelley.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Shelley.hs index b029e04cc7..4f71e054d1 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Shelley.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBAnalyser/Block/Shelley.hs @@ -37,7 +37,7 @@ import Lens.Micro ((^.)) import Lens.Micro.Extras (view) import Ouroboros.Consensus.Node.ProtocolInfo import Ouroboros.Consensus.Protocol.TPraos (TPraos) -import Ouroboros.Consensus.Shelley.Eras (StandardCrypto) +import Ouroboros.Consensus.Shelley.Eras (DijkstraEra, StandardCrypto) import Ouroboros.Consensus.Shelley.HFEras () import Ouroboros.Consensus.Shelley.Ledger ( ShelleyCompatible @@ -128,6 +128,11 @@ instance PerEraAnalysis ConwayEra where let (Alonzo.ExUnits _mem steps) = Alonzo.totExUnits tx in toEnum $ fromEnum steps +instance PerEraAnalysis DijkstraEra where + txExUnitsSteps = Just $ \tx -> + let (Alonzo.ExUnits _mem steps) = Alonzo.totExUnits tx + in toEnum $ fromEnum steps + -- | Shelley-era specific instance HasProtocolInfo (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) where data Args (ShelleyBlock (TPraos StandardCrypto) ShelleyEra) = ShelleyBlockArgs diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Orphans.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Orphans.hs index c8828ea369..d1ce637a67 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Orphans.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Orphans.hs @@ -34,6 +34,7 @@ instance FromJSON NodeConfigStub where <*> v .: "ShelleyGenesisFile" <*> v .: "ByronGenesisFile" <*> v .: "ConwayGenesisFile" + <*> v .: "DijkstraGenesisFile" instance AdjustFilePaths NodeConfigStub where adjustFilePaths f nc = @@ -42,6 +43,7 @@ instance AdjustFilePaths NodeConfigStub where , ncsShelleyGenesisFile = f $ ncsShelleyGenesisFile nc , ncsByronGenesisFile = f $ ncsByronGenesisFile nc , ncsConwayGenesisFile = f $ ncsConwayGenesisFile nc + , ncsDijkstraGenesisFile = f $ ncsDijkstraGenesisFile nc } instance AdjustFilePaths NodeCredentials where @@ -67,6 +69,7 @@ instance FromJSON NodeHardForkProtocolConfiguration where <*> v .:? "TestAlonzoHardForkAtEpoch" <*> v .:? "TestBabbageHardForkAtEpoch" <*> v .:? "TestConwayHardForkAtEpoch" + <*> v .:? "TestDijkstraHardForkAtEpoch" instance FromJSON NodeByronProtocolConfiguration where parseJSON = withObject "NodeByronProtocolConfiguration" $ \v -> diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Run.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Run.hs index 3d43e12733..c327c8ab9a 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Run.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Run.hs @@ -110,12 +110,14 @@ initialize NodeFilePaths{nfpConfig, nfpChainDB} creds synthOptions = do shelleyConfig alonzoConfig conwayConfig + dijkstraConfig hfConfig (Just confProtocolCredentials) where shelleyConfig = NodeShelleyProtocolConfiguration (GenesisFile $ ncsShelleyGenesisFile confConfigStub) Nothing alonzoConfig = NodeAlonzoProtocolConfiguration (GenesisFile $ ncsAlonzoGenesisFile confConfigStub) Nothing conwayConfig = NodeConwayProtocolConfiguration (GenesisFile $ ncsConwayGenesisFile confConfigStub) Nothing + dijkstraConfig = NodeDijkstraProtocolConfiguration (GenesisFile $ ncsDijkstraGenesisFile confConfigStub) Nothing hfConfig_ = eitherParseJson $ ncsNodeConfig confConfigStub byConfig_ = eitherParseJson $ ncsNodeConfig confConfigStub diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Types.hs b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Types.hs index abf734dd2f..36abd183c6 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Types.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-tools/Cardano/Tools/DBSynthesizer/Types.hs @@ -12,6 +12,7 @@ data NodeConfigStub = NodeConfigStub , ncsShelleyGenesisFile :: !FilePath , ncsByronGenesisFile :: !FilePath , ncsConwayGenesisFile :: !FilePath + , ncsDijkstraGenesisFile :: !FilePath } deriving Show diff --git a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs index e33c77309b..528702c316 100644 --- a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs +++ b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs @@ -17,6 +17,7 @@ module Test.Consensus.Shelley.Examples , examplesAlonzo , examplesBabbage , examplesConway + , examplesDijkstra , examplesMary , examplesShelley ) where @@ -63,22 +64,25 @@ import Ouroboros.Consensus.Util.Time (secondsToNominalDiffTime) import Ouroboros.Network.Block (Serialised (..)) import Ouroboros.Network.PeerSelection.LedgerPeers.Type import Ouroboros.Network.PeerSelection.RelayAccessPoint -import Test.Cardano.Ledger.Allegra.Examples.Consensus +import Test.Cardano.Ledger.Api.Examples.Consensus.Allegra ( ledgerExamplesAllegra ) -import Test.Cardano.Ledger.Alonzo.Examples.Consensus +import Test.Cardano.Ledger.Api.Examples.Consensus.Alonzo ( ledgerExamplesAlonzo ) -import Test.Cardano.Ledger.Babbage.Examples.Consensus +import Test.Cardano.Ledger.Api.Examples.Consensus.Babbage ( ledgerExamplesBabbage ) -import Test.Cardano.Ledger.Conway.Examples.Consensus +import Test.Cardano.Ledger.Api.Examples.Consensus.Conway ( ledgerExamplesConway ) -import Test.Cardano.Ledger.Mary.Examples.Consensus +import Test.Cardano.Ledger.Api.Examples.Consensus.Dijkstra + ( ledgerExamplesDijkstra + ) +import Test.Cardano.Ledger.Api.Examples.Consensus.Mary ( ledgerExamplesMary ) -import Test.Cardano.Ledger.Shelley.Examples.Consensus +import Test.Cardano.Ledger.Api.Examples.Consensus.Shelley ( ShelleyLedgerExamples (..) , ShelleyResultExamples (..) , ledgerExamplesShelley @@ -178,7 +182,7 @@ fromShelleyLedgerExamples results = labelled [ ("LedgerTip", SomeResult GetLedgerTip (blockPoint blk)) - , ("EpochNo", SomeResult GetEpochNo 10) + , ("EpochNo", SomeResult GetEpochNo (EpochNo 10)) , ("EmptyPParams", SomeResult GetCurrentPParams srePParams) , ("StakeDistribution", SomeResult GetStakeDistribution $ fromLedgerPoolDistr srePoolDistr) , @@ -314,7 +318,7 @@ fromShelleyLedgerExamplesPraos results = labelled [ ("LedgerTip", SomeResult GetLedgerTip (blockPoint blk)) - , ("EpochNo", SomeResult GetEpochNo 10) + , ("EpochNo", SomeResult GetEpochNo (EpochNo 10)) , ("EmptyPParams", SomeResult GetCurrentPParams srePParams) , ("StakeDistribution", SomeResult GetStakeDistribution $ fromLedgerPoolDistr srePoolDistr) , @@ -395,6 +399,9 @@ examplesBabbage = fromShelleyLedgerExamplesPraos ledgerExamplesBabbage examplesConway :: Examples StandardConwayBlock examplesConway = fromShelleyLedgerExamplesPraos ledgerExamplesConway +examplesDijkstra :: Examples StandardDijkstraBlock +examplesDijkstra = fromShelleyLedgerExamplesPraos ledgerExamplesDijkstra + exampleShelleyLedgerConfig :: TranslationContext era -> ShelleyLedgerConfig era exampleShelleyLedgerConfig translationContext = ShelleyLedgerConfig diff --git a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Generators.hs b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Generators.hs index cfb67ec255..e38d47665d 100644 --- a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Generators.hs +++ b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Generators.hs @@ -11,9 +11,7 @@ module Test.Consensus.Shelley.Generators (SomeResult (..)) where import Cardano.Ledger.Core (TranslationContext, toTxSeq) -import Cardano.Ledger.Genesis import qualified Cardano.Ledger.Shelley.API as SL -import Cardano.Ledger.Shelley.Translation import Cardano.Ledger.State (InstantStake) import Cardano.Protocol.Crypto (Crypto) import qualified Cardano.Protocol.TPraos.API as SL @@ -303,12 +301,6 @@ arbitraryGlobalsWithFixedEpochInfo = arbitraryFixedEpochInfo :: Monad m => Gen (EpochInfo m) arbitraryFixedEpochInfo = fixedEpochInfo <$> arbitrary <*> arbitrary -instance Arbitrary (NoGenesis era) where - arbitrary = pure NoGenesis - -instance Arbitrary FromByronTranslationContext where - arbitrary = FromByronTranslationContext <$> arbitrary <*> arbitrary <*> arbitrary - {------------------------------------------------------------------------------- Generators for cardano-ledger-specs -------------------------------------------------------------------------------} diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/MiniProtocol/LocalTxSubmission/ByteStringTxParser.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/MiniProtocol/LocalTxSubmission/ByteStringTxParser.hs index 44ba7f3df4..4a3176e309 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/MiniProtocol/LocalTxSubmission/ByteStringTxParser.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/MiniProtocol/LocalTxSubmission/ByteStringTxParser.hs @@ -46,6 +46,7 @@ cardanoCodecCfg = ShelleyCodecConfig ShelleyCodecConfig ShelleyCodecConfig + ShelleyCodecConfig deserialiseTx :: BL.ByteString -> diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Serialisation.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Serialisation.hs index 857b5cc9c6..1ca838cfdb 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Serialisation.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Serialisation.hs @@ -65,6 +65,7 @@ testCodecCfg = ShelleyCodecConfig ShelleyCodecConfig ShelleyCodecConfig + ShelleyCodecConfig dictNestedHdr :: forall a. @@ -79,6 +80,7 @@ dictNestedHdr = \case NCS (NCS (NCS (NCS (NCZ CtxtShelley)))) -> Dict NCS (NCS (NCS (NCS (NCS (NCZ CtxtShelley))))) -> Dict NCS (NCS (NCS (NCS (NCS (NCS (NCZ CtxtShelley)))))) -> Dict + NCS (NCS (NCS (NCS (NCS (NCS (NCS (NCZ CtxtShelley))))))) -> Dict {------------------------------------------------------------------------------- BinaryBlockInfo diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Translation.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Translation.hs index 98188ec7ac..bafb48705d 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Translation.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Translation.hs @@ -80,9 +80,10 @@ import Ouroboros.Consensus.Shelley.Ledger import Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol () import Ouroboros.Consensus.TypeFamilyWrappers import Test.Cardano.Ledger.Alonzo.Serialisation.Generators () +import Test.Cardano.Ledger.Api.Examples.Consensus.Shelley import Test.Cardano.Ledger.Babbage.Serialisation.Generators () import Test.Cardano.Ledger.Conway.Arbitrary () -import Test.Cardano.Ledger.Shelley.Examples.Consensus +import Test.Cardano.Ledger.Dijkstra.Arbitrary () import Test.Consensus.Byron.Generators ( genByronLedgerConfig , genByronLedgerState @@ -141,6 +142,11 @@ tests = babbageToConwayLedgerStateTranslation utxoTablesAreEmpty (\st -> cover 50 (nonEmptyUtxosShelley st) "UTxO set is not empty") + , testTablesTranslation + "Conway to Dijkstra" + conwayToDijkstraLedgerStateTranslation + utxoTablesAreEmpty + (\st -> cover 50 (nonEmptyUtxosShelley st) "UTxO set is not empty") ] {------------------------------------------------------------------------------- @@ -179,6 +185,12 @@ alonzoToBabbageLedgerStateTranslation :: TranslateLedgerState (ShelleyBlock (TPraos Crypto) AlonzoEra) (ShelleyBlock (Praos Crypto) BabbageEra) +babbageToConwayLedgerStateTranslation :: + RequiringBoth + WrapLedgerConfig + TranslateLedgerState + (ShelleyBlock (Praos Crypto) BabbageEra) + (ShelleyBlock (Praos Crypto) ConwayEra) PCons byronToShelleyLedgerStateTranslation ( PCons @@ -190,8 +202,11 @@ PCons ( PCons alonzoToBabbageLedgerStateTranslation ( PCons - _ - PNil + babbageToConwayLedgerStateTranslation + ( PCons + _ + PNil + ) ) ) ) @@ -204,32 +219,47 @@ PCons (CardanoEras Crypto) tls = translateLedgerState hardForkEraTranslation -babbageToConwayLedgerStateTranslation :: +conwayToDijkstraLedgerStateTranslation :: RequiringBoth WrapLedgerConfig TranslateLedgerState - (ShelleyBlock (Praos Crypto) BabbageEra) (ShelleyBlock (Praos Crypto) ConwayEra) -babbageToConwayLedgerStateTranslation = translateLedgerStateBabbageToConwayWrapper + (ShelleyBlock (Praos Crypto) DijkstraEra) +conwayToDijkstraLedgerStateTranslation = translateLedgerStateConwayToDijkstraWrapper -- | Tech debt: The babbage to conway translation performs a tick, and we would -- need to create a reasonable ledger state. Instead this is just a copy-paste -- of the code without the tick. -- -- This should be fixed once the real translation is fixed. -translateLedgerStateBabbageToConwayWrapper :: +-- translateLedgerStateBabbageToConwayWrapper :: +-- RequiringBoth +-- WrapLedgerConfig +-- TranslateLedgerState +-- (ShelleyBlock (Praos Crypto) BabbageEra) +-- (ShelleyBlock (Praos Crypto) ConwayEra) +-- translateLedgerStateBabbageToConwayWrapper = +-- RequireBoth $ \_ cfgConway -> +-- TranslateLedgerState $ \_ -> +-- noNewTickingDiffs +-- . unFlip +-- . unComp +-- . Core.translateEra' (getConwayTranslationContext cfgConway) +-- . Comp +-- . Flip +translateLedgerStateConwayToDijkstraWrapper :: RequiringBoth WrapLedgerConfig TranslateLedgerState - (ShelleyBlock (Praos Crypto) BabbageEra) (ShelleyBlock (Praos Crypto) ConwayEra) -translateLedgerStateBabbageToConwayWrapper = - RequireBoth $ \_ cfgConway -> + (ShelleyBlock (Praos Crypto) DijkstraEra) +translateLedgerStateConwayToDijkstraWrapper = + RequireBoth $ \_ cfgDijkstra -> TranslateLedgerState $ \_ -> noNewTickingDiffs . unFlip . unComp - . Core.translateEra' (getConwayTranslationContext cfgConway) + . Core.translateEra' (getDijkstraTranslationContext cfgDijkstra) . Comp . Flip @@ -443,6 +473,20 @@ instance <*> arbitrary <*> (EpochNo <$> arbitrary) +instance + Arbitrary + ( TestSetup + (ShelleyBlock (Praos Crypto) ConwayEra) + (ShelleyBlock (Praos Crypto) DijkstraEra) + ) + where + arbitrary = + TestSetup + <$> (fixedShelleyLedgerConfig <$> arbitrary) + <*> (fixedShelleyLedgerConfig <$> arbitrary) + <*> arbitrary + <*> (EpochNo <$> arbitrary) + {------------------------------------------------------------------------------- Generators -------------------------------------------------------------------------------} diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/MaryAlonzo.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/MaryAlonzo.hs index a5cb0d1e05..b857faab35 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/MaryAlonzo.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/MaryAlonzo.hs @@ -51,7 +51,7 @@ import Ouroboros.Consensus.Shelley.Node ( ProtocolParamsShelleyBased (..) , ShelleyGenesis (..) ) -import qualified Test.Cardano.Ledger.Alonzo.Examples.Consensus as SL +import qualified Test.Cardano.Ledger.Api.Examples.Consensus.Alonzo as SL import Test.Consensus.Shelley.MockCrypto (MockCrypto) import Test.QuickCheck import Test.Tasty diff --git a/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/LedgerTables.hs b/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/LedgerTables.hs index 2f994709eb..15224a362d 100644 --- a/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/LedgerTables.hs +++ b/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/LedgerTables.hs @@ -25,6 +25,7 @@ import Test.Cardano.Ledger.Alonzo.Serialisation.Generators () import Test.Cardano.Ledger.Babbage.Arbitrary () import Test.Cardano.Ledger.Babbage.Serialisation.Generators () import Test.Cardano.Ledger.Conway.Arbitrary () +import Test.Cardano.Ledger.Dijkstra.Arbitrary () import Test.Consensus.Shelley.Generators () import Test.Consensus.Shelley.MockCrypto (CanMock) import Test.LedgerTables diff --git a/ouroboros-consensus-cardano/test/tools-test/disk/config/config.json b/ouroboros-consensus-cardano/test/tools-test/disk/config/config.json index 8e2a16450a..2dc14f69ca 100644 --- a/ouroboros-consensus-cardano/test/tools-test/disk/config/config.json +++ b/ouroboros-consensus-cardano/test/tools-test/disk/config/config.json @@ -9,6 +9,7 @@ "ApplicationVersion": 0, "ByronGenesisFile": "byron-genesis.json", "ConwayGenesisFile": "conway-genesis.json", + "DijkstraGenesisFile": "dijkstra-genesis.json", "EnableP2P": false, "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, diff --git a/ouroboros-consensus-cardano/test/tools-test/disk/config/dijkstra-genesis.json b/ouroboros-consensus-cardano/test/tools-test/disk/config/dijkstra-genesis.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/ouroboros-consensus-cardano/test/tools-test/disk/config/dijkstra-genesis.json @@ -0,0 +1 @@ +{}