diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fb597460e..7260452b37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,6 +138,22 @@ jobs: - name: Build projects [build] run: cabal build all -j + - name: Install cddlc + run: gem install cddlc + + - name: Clone cuddle with validator + uses: actions/checkout + with: + repo: 'input-output-hk/cuddle' + ref: 'js/validator' + path: 'cuddle' + + - name: Install cuddle + run: | + ( cd $GITHUB_WORKSPACE/cuddle + cabal install --ignore-project exe:cuddle + ) + - name: Test if: matrix.test-set == 'all' run: cabal test all -j --test-show-details=streaming diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..6bddba2884 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cardano-blueprint"] + path = cardano-blueprint + url = git@github.com:cardano-scaling/cardano-blueprint.git diff --git a/cabal.project b/cabal.project index fb9f3afc16..510e4f45ee 100644 --- a/cabal.project +++ b/cabal.project @@ -14,9 +14,9 @@ repository cardano-haskell-packages -- update either of these. index-state: -- Bump this if you need newer packages from Hackage - , hackage.haskell.org 2025-05-15T07:59:00Z + , hackage.haskell.org 2025-05-26T13:28:18Z -- Bump this if you need newer packages from CHaP - , cardano-haskell-packages 2025-05-15T08:36:14Z + , cardano-haskell-packages 2025-05-26T19:51:53Z packages: ouroboros-consensus @@ -40,11 +40,6 @@ package ouroboros-network -- https://github.com/IntersectMBO/ouroboros-network/issues/4927 for context). flags: -txsubmission-delay --- We need to disable bitvec's SIMD for now, as it breaks during cross compilation. -if(os(windows)) - constraints: - bitvec -simd - if impl (ghc >= 9.12) allow-newer: -- Bounds will be relaxed in next release @@ -54,13 +49,46 @@ if impl (ghc >= 9.12) , ouroboros-network-protocols:base , ouroboros-network:base - -- https://github.com/phadej/vec/issues/118 - , bin:base - , fin:base - , ral:base - - -- https://github.com/haskellari/tree-diff/issues/97 - , tree-diff:base - -- https://github.com/kapralVV/Unique/issues/11 , Unique:hashable + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-network + tag: 3e8d3b4b8c87ead794876c62d7fe25f32efb5142 + -- sha256: sha256-uKrxpHhcNGzKUSeA4zIdkslfDFIJjkCsHUg+FUef1yE= + subdir: + ouroboros-network-api + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger + tag: 75656430492b34e2300704eafeb77e1d5001671a + --sha256: sha256-m/Glsryh4aJBsI4ifIe4H3ZkcX6K7EGLEHCGGVzOzyI= + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/alonzo/test-suite + eras/babbage/impl + eras/babbage/test-suite + eras/byron/chain/executable-spec + eras/byron/crypto + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/conway/impl + eras/conway/test-suite + eras/mary/impl + eras/shelley/impl + eras/shelley-ma/test-suite + eras/shelley/test-suite + libs/cardano-data + libs/cardano-ledger-api + libs/cardano-ledger-binary + libs/cardano-ledger-core + libs/cardano-ledger-test + libs/cardano-protocol-tpraos + libs/constrained-generators + libs/non-integral + libs/set-algebra + libs/small-steps + libs/vector-map diff --git a/cardano-blueprint b/cardano-blueprint new file mode 160000 index 0000000000..1b15ab4fd1 --- /dev/null +++ b/cardano-blueprint @@ -0,0 +1 @@ +Subproject commit 1b15ab4fd14311748d31d984fa47e7591d09957f diff --git a/flake.lock b/flake.lock index 6cee1ce4af..00ea61ef28 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1747299417, - "narHash": "sha256-VRwq8JRAMnIgoxfgR60ppz37Wo6NixL9BbzwVhBveik=", + "lastModified": 1748374249, + "narHash": "sha256-iAJWaAgkiJK91YdBt0S0+3iKrqkYe+WL0C9xkfaCHdc=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "10ebc8624f5440c245112f2e3dbf0e123e7e99e5", + "rev": "cbe82aade546ac7e76c063aadf6952dbefbad7c7", "type": "github" }, "original": { @@ -254,11 +254,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1748305560, - "narHash": "sha256-J8BLsahPnMUwl5kAS/ZXW6Vm3StgrqX+9mBz5mhoRek=", + "lastModified": 1748391995, + "narHash": "sha256-diuPkHXikUjwj2y/Rmhnsyceav5hDP06oCc9ggcbDVU=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "afdd91ab1d70e276b5e46e21fa7e0d6c21a6dead", + "rev": "cafa34a4591d2a7aaea4bacbae6e7333c70de343", "type": "github" }, "original": { diff --git a/nix/shell.nix b/nix/shell.nix index 9905bef3e7..fa3cbb48b3 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -16,6 +16,10 @@ hsPkgs.shellFor { pkgs.ghcid pkgs.xrefcheck pkgs.fourmolu + pkgs.cuddle + + # testing cddls + pkgs.cddl # release management (pkgs.scriv.overridePythonAttrs (_oldAttrs: { diff --git a/nix/tools.nix b/nix/tools.nix index cd272bbd54..31b0d90aad 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -38,6 +38,15 @@ in fourmolu = tool "fourmolu" "0.18.0.0" { }; + cuddle = tool "cuddle" "git" { + src = final.fetchFromGitHub { + owner = "input-output-hk"; + repo = "cuddle"; + rev = "43050522b2c3326dc2bcb95a3fde852bce5bc729"; + hash = "sha256-S3GJBmvBmnbdb7tD2Fq9FNr9Z8iuT/eWwRpRxq9is10="; + }; + }; + haskellBuildUtils = prev.haskellBuildUtils.override { inherit (final.hsPkgs.args) compiler-nix-name; index-state = tool-index-state; diff --git a/ouroboros-consensus-cardano/cddl/base.cddl b/ouroboros-consensus-cardano/cddl/base.cddl new file mode 100644 index 0000000000..8d252b579d --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/base.cddl @@ -0,0 +1,53 @@ +telescope7 + = [pastEra, pastEra, pastEra, pastEra, pastEra, pastEra, currentEra] / + [pastEra, pastEra, pastEra, pastEra, pastEra, currentEra] / + [pastEra, pastEra, pastEra, pastEra, currentEra] / + [pastEra, pastEra, pastEra, currentEra] / + [pastEra, pastEra, currentEra] / + [pastEra, currentEra] / + [currentEra] + +ns7 + = [6, conway] / + [5, babbage] / + [4, alonzo] / + [3, mary] / + [2, allegra] / + [1, shelley] / + [0, byron] + +;; Blockchain types +pastEra = [bound, bound] +currentEra = [bound, st] +bound = [relativeTime, slotno, epochno] +eraIdx = word8 +individualPoolStake = [stake, hash] +nonce = [0] / [1, hash] +point = [] / [ slotno, hash ] +poolDistr = map +slotno = word64 +stake = rational + +withOrigin = [] / [v] +withOriginTH = [0] / [1, v] + +;; Collections +either = [0, x] / [1, y] +map = { * x => y } +maybe = [] / [x] +seq = [*23 x] / [24* x] ; encoded with indefinite-length encoding +set = #6.258([* x]) + +;; Types from other packages +blockno = word64 +epochno = word64 +coin = word64 +rational = [int, int] +keyhash = bstr .size 28 +hash = bstr .size 32 +relativeTime = int + +;; Base word types +word8 = uint .size 1 +word32 = uint .size 4 +word64 = uint .size 8 diff --git a/ouroboros-consensus-cardano/cddl/disk/block.cddl b/ouroboros-consensus-cardano/cddl/disk/block.cddl new file mode 100644 index 0000000000..68a0f3ad46 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/disk/block.cddl @@ -0,0 +1,15 @@ +cardanoBlock = byron.block + / [2, shelley.block] + / [3, allegra.block] + / [4, mary.block] + / [5, alonzo.block] + / [6, babbage.block] + / [7, conway.block] + +;# import byron as byron +;# import shelley as shelley +;# import allegra as allegra +;# import mary as mary +;# import alonzo as alonzo +;# import babbage as babbage +;# import conway as conway diff --git a/ouroboros-consensus-cardano/cddl/disk/snapshot.cddl b/ouroboros-consensus-cardano/cddl/disk/snapshot.cddl new file mode 100644 index 0000000000..25c790d729 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/disk/snapshot.cddl @@ -0,0 +1,9 @@ +ledgerStateSnapshot = + [snapshotEncodingVersion1, extLedgerState] + +snapshotEncodingVersion1 = 1 + +extLedgerState = [ledgerState, headerState] + +;# import ledgerstate +;# import headerstate diff --git a/ouroboros-consensus-cardano/cddl/disk/snapshot/headerstate.cddl b/ouroboros-consensus-cardano/cddl/disk/snapshot/headerstate.cddl new file mode 100644 index 0000000000..0687f6a584 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/disk/snapshot/headerstate.cddl @@ -0,0 +1,23 @@ +headerState = + [withOrigin, headerStateChainDep] + +headerStateTip = + ns7 + +byronAnnTip = [slotno, hash, blockno, bool] +annTip = [slotno, hash, blockno] + +headerStateChainDep = + telescope7 + +versionedPbftState = [serializationFormat1, {* keyhash => [* slotno]}] + +;# import base +;# import praos +;# import tpraos diff --git a/ouroboros-consensus-cardano/cddl/disk/snapshot/ledgerstate.cddl b/ouroboros-consensus-cardano/cddl/disk/snapshot/ledgerstate.cddl new file mode 100644 index 0000000000..d941cac2c1 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/disk/snapshot/ledgerstate.cddl @@ -0,0 +1,30 @@ +ledgerState = + telescope7, + versionedShelleyLedgerState, + versionedShelleyLedgerState, + versionedShelleyLedgerState, + versionedShelleyLedgerState, + versionedShelleyLedgerState> + +versionedShelleyLedgerState = [ shelleyVersion2, shelleyLedgerState ] + +shelleyVersion2 = 2 + +shelleyLedgerState = [ withOrigin, era, shelleyTransition ] + +shelleyTip = [slotno, blockno, hash] + +shelleyTransition = word32 + +; TODO these should be imports from the ledger however they do not +; provide these definitions yet. +byron.ledgerstate = any +shelley.ledgerstate = any +allegra.ledgerstate = any +mary.ledgerstate = any +alonzo.ledgerstate = any +babbage.ledgerstate = any +conway.ledgerstate = any + +;# import base diff --git a/ouroboros-consensus-cardano/cddl/disk/snapshot/praos.cddl b/ouroboros-consensus-cardano/cddl/disk/snapshot/praos.cddl new file mode 100644 index 0000000000..bddb7ad511 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/disk/snapshot/praos.cddl @@ -0,0 +1,13 @@ +versionedPraosState = [praosVersion, praosState] + +praosVersion = 0 + +praosState = [withOrigin, + {* keyhash => word64}, + nonce, + nonce, + nonce, + nonce, + nonce] + +;# import base diff --git a/ouroboros-consensus-cardano/cddl/disk/snapshot/tpraos.cddl b/ouroboros-consensus-cardano/cddl/disk/snapshot/tpraos.cddl new file mode 100644 index 0000000000..aa5cf974f9 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/disk/snapshot/tpraos.cddl @@ -0,0 +1,12 @@ +versionedTPraosState = + [serializationFormat1, [withOriginTH, tpraosState]] + +tpraosState = [prtclState, ticknState, nonce] + +prtclState = [{* keyhash => word64}, nonce, nonce] + +ticknState = [nonce, nonce] + +serializationFormat1 = 1 + +;# import base diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/blockfetch/block.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/blockfetch/block.cddl new file mode 100644 index 0000000000..02a1c1b584 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/blockfetch/block.cddl @@ -0,0 +1,3 @@ +serialisedCardanoBlock = #6.24(bytes .cbor cardanoBlock) + +;# import cardanoBlock from block diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/blockfetch/point.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/blockfetch/point.cddl new file mode 100644 index 0000000000..f2dee00e56 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/blockfetch/point.cddl @@ -0,0 +1,3 @@ +point = base.point + +;# import base as base diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/header.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/header.cddl new file mode 100644 index 0000000000..fce611726a --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/header.cddl @@ -0,0 +1,25 @@ +header + = ns7, + serialisedShelleyHeader, + serialisedShelleyHeader, + serialisedShelleyHeader, + serialisedShelleyHeader, + serialisedShelleyHeader> + +byronHeader = [byronRegularIdx, #6.24(bytes .cbor byron.blockhead)] + / [byronBoundaryIdx, #6.24(bytes .cbor byron.ebbhead)] + +byronBoundaryIdx = [0, word32] +byronRegularIdx = [1, word32] + +serialisedShelleyHeader = #6.24(bytes .cbor era) + +;# include byron as byron +;# include shelley as shelley +;# include allegra as allegra +;# include mary as mary +;# include alonzo as alonzo +;# include babbage as babbage +;# include conway as conway +;# import base diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/point.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/point.cddl new file mode 100644 index 0000000000..f2dee00e56 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/point.cddl @@ -0,0 +1,3 @@ +point = base.point + +;# import base as base diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/tip.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/tip.cddl new file mode 100644 index 0000000000..037167e892 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/chainsync/tip.cddl @@ -0,0 +1,3 @@ +tip = [ base.point, base.blockno ] + +;# import base as base diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/txsubmission2/tx.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/txsubmission2/tx.cddl new file mode 100644 index 0000000000..a9691ba136 --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/txsubmission2/tx.cddl @@ -0,0 +1,19 @@ +tx = + ns7, + serialisedShelleyTx, + serialisedShelleyTx, + serialisedShelleyTx, + serialisedShelleyTx, + serialisedShelleyTx> + +serialisedShelleyTx = #6.24(bytes .cbor era) + +;# include byron as byron +;# include shelley as shelley +;# include allegra as allegra +;# include mary as mary +;# include alonzo as alonzo +;# include babbage as babbage +;# include conway as conway +;# import base diff --git a/ouroboros-consensus-cardano/cddl/node-to-node/txsubmission2/txid.cddl b/ouroboros-consensus-cardano/cddl/node-to-node/txsubmission2/txid.cddl new file mode 100644 index 0000000000..71ebb3f3cb --- /dev/null +++ b/ouroboros-consensus-cardano/cddl/node-to-node/txsubmission2/txid.cddl @@ -0,0 +1,22 @@ +txId = + ns7 + +byronTxId = [0, byron.txid] + / [1, byron.certificateid] + / [2, byron.updid] + / [3, byron.voteid] + +;# include byron as byron +;# include shelley as shelley +;# include allegra as allegra +;# include mary as mary +;# include alonzo as alonzo +;# include babbage as babbage +;# include conway as conway +;# import base diff --git a/ouroboros-consensus-cardano/golden/byron/QueryVersion2/ByronNodeToClientVersion1/LedgerConfig b/ouroboros-consensus-cardano/golden/byron/QueryVersion2/ByronNodeToClientVersion1/LedgerConfig index 8279e0491b..416dbb6ace 100644 Binary files a/ouroboros-consensus-cardano/golden/byron/QueryVersion2/ByronNodeToClientVersion1/LedgerConfig and b/ouroboros-consensus-cardano/golden/byron/QueryVersion2/ByronNodeToClientVersion1/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/byron/QueryVersion3/ByronNodeToClientVersion1/LedgerConfig b/ouroboros-consensus-cardano/golden/byron/QueryVersion3/ByronNodeToClientVersion1/LedgerConfig index 8279e0491b..416dbb6ace 100644 Binary files a/ouroboros-consensus-cardano/golden/byron/QueryVersion3/ByronNodeToClientVersion1/LedgerConfig and b/ouroboros-consensus-cardano/golden/byron/QueryVersion3/ByronNodeToClientVersion1/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion12/LedgerConfig index bb0583694a..97d7bb9a0f 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/CardanoNodeToClientVersion13/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion13/LedgerConfig index bb0583694a..97d7bb9a0f 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/CardanoNodeToClientVersion14/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion14/LedgerConfig index bb0583694a..97d7bb9a0f 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/CardanoNodeToClientVersion15/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion2/CardanoNodeToClientVersion15/LedgerConfig index bb0583694a..97d7bb9a0f 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/QueryVersion3/CardanoNodeToClientVersion16/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion16/LedgerConfig index bb0583694a..97d7bb9a0f 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/CardanoNodeToClientVersion17/ApplyTxErr_Allegra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Allegra new file mode 100644 index 0000000000..df2444bf34 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Allegra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Alonzo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Alonzo new file mode 100644 index 0000000000..4637c62e4d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Alonzo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Babbage b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Babbage new file mode 100644 index 0000000000..736de5a8ef Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Babbage differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Byron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Byron new file mode 100644 index 0000000000..1728309622 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Byron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Conway b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Conway new file mode 100644 index 0000000000..7e36ce4445 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Conway @@ -0,0 +1 @@ +�������X�1���s��]k?�ժ�P�[{%A \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Mary b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Mary new file mode 100644 index 0000000000..b22d0e75ef Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Mary differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Shelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Shelley new file mode 100644 index 0000000000..ed31f2848b Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_Shelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_WrongEraByron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_WrongEraByron new file mode 100644 index 0000000000..9735c28d23 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_WrongEraByron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_WrongEraShelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_WrongEraShelley new file mode 100644 index 0000000000..43f2fa8267 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/ApplyTxErr_WrongEraShelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Allegra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Allegra new file mode 100644 index 0000000000..b525fa7868 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Allegra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Alonzo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Alonzo new file mode 100644 index 0000000000..dc3903d3a6 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Alonzo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Babbage b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Babbage new file mode 100644 index 0000000000..279d590c81 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Babbage differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Byron_EBB b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Byron_EBB new file mode 100644 index 0000000000..d2bc47fdf7 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Byron_EBB differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Byron_regular b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Byron_regular new file mode 100644 index 0000000000..ce89fa545b Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Byron_regular differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Conway b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Conway new file mode 100644 index 0000000000..5ae5c5065d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Conway differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Mary b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Mary new file mode 100644 index 0000000000..14d8281f93 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Mary differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Shelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Shelley new file mode 100644 index 0000000000..7d900c96a8 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Block_Shelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Allegra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Allegra new file mode 100644 index 0000000000..61ec98ae96 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Allegra @@ -0,0 +1,3 @@ +�X cA:^D ��d� +�u�S�|��� ]� +q� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Alonzo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Alonzo new file mode 100644 index 0000000000..6e6d3158a7 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Alonzo @@ -0,0 +1 @@ +�X ��3�? �G�Ca�\�ո��1�%E�g# diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Babbage b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Babbage new file mode 100644 index 0000000000..3c56b72b00 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Babbage @@ -0,0 +1 @@ +�X M~@)_ur7��WH5���O�2��$�h��� h \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Byron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Byron new file mode 100644 index 0000000000..a07d334baa Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Byron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Conway b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Conway new file mode 100644 index 0000000000..8f2268ce3f --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Conway @@ -0,0 +1 @@ +�X �K�8�aL�s��,��а�^�����"��5�J \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Mary b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Mary new file mode 100644 index 0000000000..1235567289 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Mary @@ -0,0 +1 @@ +�X �Ճ(x��.��x�_G��F��ߖ} Ԉh+ ޢ \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Shelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Shelley new file mode 100644 index 0000000000..667dbef8ea --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTxId_Shelley @@ -0,0 +1 @@ +�X ���np��+�t���3N��Ue�<Ҷ���=� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Allegra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Allegra new file mode 100644 index 0000000000..786e482302 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Allegra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Alonzo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Alonzo new file mode 100644 index 0000000000..558dfbcca8 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Alonzo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Babbage b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Babbage new file mode 100644 index 0000000000..0be195e3f1 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Babbage differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Byron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Byron new file mode 100644 index 0000000000..9c10e1bb39 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Byron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Conway b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Conway new file mode 100644 index 0000000000..9d1ce51c81 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Conway differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Mary b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Mary new file mode 100644 index 0000000000..1d7d61fa77 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Mary differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Shelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Shelley new file mode 100644 index 0000000000..d41c1aacc8 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/GenTx_Shelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig new file mode 100644 index 0000000000..97d7bb9a0f Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..bc0aee634c Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetCurrentPParams new file mode 100644 index 0000000000..4d12a7ad6b Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetEpochNo new file mode 100644 index 0000000000..1d07267558 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetGenesisConfig new file mode 100644 index 0000000000..6741a401cb Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetLedgerTip new file mode 100644 index 0000000000..6706725ac7 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..08c5c789e9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetStakeDistribution new file mode 100644 index 0000000000..b5f799b270 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Allegra_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..7312d4e726 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetCurrentPParams new file mode 100644 index 0000000000..046b306d4d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetEpochNo new file mode 100644 index 0000000000..a6f766751b Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetGenesisConfig new file mode 100644 index 0000000000..f701524d73 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetLedgerTip new file mode 100644 index 0000000000..d9a18e85a2 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..58e70d849d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetStakeDistribution new file mode 100644 index 0000000000..e5308b275a Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Alonzo_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_AnytimeByron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_AnytimeByron new file mode 100644 index 0000000000..6fd42d6043 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_AnytimeByron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_AnytimeShelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_AnytimeShelley new file mode 100644 index 0000000000..d82b9fc7f4 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_AnytimeShelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetCurrentPParams new file mode 100644 index 0000000000..cd6d53bc79 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetEpochNo new file mode 100644 index 0000000000..f5ea7bd085 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetGenesisConfig new file mode 100644 index 0000000000..e6ee8c45c4 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetLedgerTip new file mode 100644 index 0000000000..4d00b4e9fa Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..b5217dc67a Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetStakeDistribution new file mode 100644 index 0000000000..41aeabd30d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Babbage_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Byron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Byron new file mode 100644 index 0000000000..cfa4236d51 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Byron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetCurrentPParams new file mode 100644 index 0000000000..05f2ba9773 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetEpochNo new file mode 100644 index 0000000000..915b078647 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetGenesisConfig new file mode 100644 index 0000000000..70189500e9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetLedgerTip new file mode 100644 index 0000000000..7337b0de4e Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..b47684f4c3 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetStakeDistribution new file mode 100644 index 0000000000..89ed187e31 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Conway_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_HardFork b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_HardFork new file mode 100644 index 0000000000..64c266fdc5 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_HardFork differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..b3f0d169c0 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetCurrentPParams new file mode 100644 index 0000000000..7338cd7416 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetEpochNo new file mode 100644 index 0000000000..58e4767132 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetGenesisConfig new file mode 100644 index 0000000000..2306eb025e Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetLedgerTip new file mode 100644 index 0000000000..c5b7ef0497 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..72f3ff8f93 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetStakeDistribution new file mode 100644 index 0000000000..e63d41b76d Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Mary_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..95d62a50fd Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetBigLedgerPeerSnapshot differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetCurrentPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetCurrentPParams new file mode 100644 index 0000000000..cafc5b7290 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetCurrentPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetEpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetEpochNo new file mode 100644 index 0000000000..112bec95a3 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetEpochNo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetGenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetGenesisConfig new file mode 100644 index 0000000000..bca99cf254 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetGenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetLedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetLedgerTip new file mode 100644 index 0000000000..33dba00f05 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..57e64f50fb Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetStakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetStakeDistribution new file mode 100644 index 0000000000..8d50b1f974 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Query_Shelley_GetStakeDistribution differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_EmptyPParams new file mode 100644 index 0000000000..594a1696f9 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_EpochNo @@ -0,0 +1 @@ +� diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +����*��� +�� +��ҟ��� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_LedgerTip new file mode 100644 index 0000000000..e64ffada5d --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_LedgerTip @@ -0,0 +1 @@ +�� X �B!��)k�8� Pl��"����5����^ \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_StakeDistribution new file mode 100644 index 0000000000..968f15663d --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Allegra_StakeDistribution @@ -0,0 +1 @@ +��X�1���s��]k?�ժ�P�[{%A��X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_EmptyPParams new file mode 100644 index 0000000000..4759359364 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_EpochNo @@ -0,0 +1 @@ +� diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +����*��� +�� +��ҟ��� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_LedgerTip new file mode 100644 index 0000000000..a8d3ebca89 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_LedgerTip @@ -0,0 +1 @@ +�� X ����8����o�fo&&���&n�s�s$&� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_StakeDistribution new file mode 100644 index 0000000000..968f15663d --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Alonzo_StakeDistribution @@ -0,0 +1 @@ +��X�1���s��]k?�ժ�P�[{%A��X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_AnytimeByron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_AnytimeByron new file mode 100644 index 0000000000..070897ad04 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_AnytimeByron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_AnytimeShelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_AnytimeShelley new file mode 100644 index 0000000000..61dee1376e Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_AnytimeShelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_EmptyPParams new file mode 100644 index 0000000000..7bf204b84a Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_EpochNo @@ -0,0 +1 @@ +� diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_LedgerTip new file mode 100644 index 0000000000..c36241968e Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_LedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_StakeDistribution new file mode 100644 index 0000000000..968f15663d --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Babbage_StakeDistribution @@ -0,0 +1 @@ +��X�1���s��]k?�ժ�P�[{%A��X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Byron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Byron new file mode 100644 index 0000000000..d66107b64e Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Byron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_EmptyPParams new file mode 100644 index 0000000000..04416edc30 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_EpochNo @@ -0,0 +1 @@ +� diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_LedgerTip new file mode 100644 index 0000000000..2eeba1fbba --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_LedgerTip @@ -0,0 +1 @@ +�� X �M����7!SY�ǭ���dG��f�p�;���� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_StakeDistribution new file mode 100644 index 0000000000..967baf0b47 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Conway_StakeDistribution @@ -0,0 +1 @@ +��X�1���s��]k?�ժ�P�[{%A���X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_EraMismatchByron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_EraMismatchByron new file mode 100644 index 0000000000..9735c28d23 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_EraMismatchByron differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_EraMismatchShelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_EraMismatchShelley new file mode 100644 index 0000000000..43f2fa8267 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_EraMismatchShelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_HardFork b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_HardFork new file mode 100644 index 0000000000..84885abaa8 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_HardFork differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_EmptyPParams new file mode 100644 index 0000000000..da0c22d07a Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_EpochNo @@ -0,0 +1 @@ +� diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +����*��� +�� +��ҟ��� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_LedgerTip new file mode 100644 index 0000000000..6ec12660a7 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_LedgerTip @@ -0,0 +1 @@ +�� X ��E<���p���2W@Y��rJt=&��v��j \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_StakeDistribution new file mode 100644 index 0000000000..968f15663d --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Mary_StakeDistribution @@ -0,0 +1 @@ +��X�1���s��]k?�ժ�P�[{%A��X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_EmptyPParams b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_EmptyPParams new file mode 100644 index 0000000000..d641d5ba51 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_EpochNo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_EpochNo new file mode 100644 index 0000000000..b180370379 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_EpochNo @@ -0,0 +1 @@ +� diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_GenesisConfig b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_GenesisConfig new file mode 100644 index 0000000000..fead3d1dae Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..2c6a1843ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +����*��� +�� +��ҟ��� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_LedgerTip b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_LedgerTip new file mode 100644 index 0000000000..32d3f65a35 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_LedgerTip @@ -0,0 +1 @@ +�� X ��� u��'9Ki�(�׺y���C����)�l \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_NonMyopicMemberRewards new file mode 100644 index 0000000000..c47618c170 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_StakeDistribution b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_StakeDistribution new file mode 100644 index 0000000000..968f15663d --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/Result_Shelley_StakeDistribution @@ -0,0 +1 @@ +��X�1���s��]k?�ժ�P�[{%A��X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Allegra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Allegra new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Allegra @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Alonzo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Alonzo new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Alonzo @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Babbage b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Babbage new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Babbage @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Byron_EBB b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Byron_EBB new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Byron_EBB @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Byron_regular b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Byron_regular new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Byron_regular @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Conway b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Conway new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Conway @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Mary b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Mary new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Mary @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Shelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Shelley new file mode 100644 index 0000000000..6a5024d0dc --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SerialisedBlock_Shelley @@ -0,0 +1 @@ +�O \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Allegra b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Allegra new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Allegra @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Alonzo b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Alonzo new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Alonzo @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Babbage b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Babbage new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Babbage @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Byron b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Byron new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Byron @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Conway b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Conway new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Conway @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Mary b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Mary new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Mary @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Shelley b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Shelley new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/cardano/QueryVersion3/CardanoNodeToClientVersion17/SlotNo_Shelley @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Allegra b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Allegra index e5219707cd..11de67a73b 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Allegra and b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Allegra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Alonzo b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Alonzo index 57bfc0c5b8..fb6fe961f6 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Alonzo and b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Alonzo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Babbage b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Babbage index 8645e32b1c..622ee470ff 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Babbage and b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Babbage differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Mary b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Mary index 686aa6d513..2399a9e9c2 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Mary and b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Mary differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Shelley b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Shelley index a2f8d55327..d7a77382f3 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Shelley and b/ouroboros-consensus-cardano/golden/cardano/disk/ExtLedgerState_Shelley differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Allegra b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Allegra index 9e759bf391..df755fc208 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Allegra and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Allegra differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Alonzo b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Alonzo index a368a7aab1..36a48756d9 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Alonzo and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Alonzo differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Babbage b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Babbage index 37170e63d7..7e292c54f9 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Babbage and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Babbage differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Mary b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Mary index 2ee0a1f194..6b334c26be 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Mary and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Mary differ diff --git a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Shelley b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Shelley index 39ebba7d15..4e0d943de4 100644 Binary files a/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Shelley and b/ouroboros-consensus-cardano/golden/cardano/disk/LedgerState_Shelley differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion10/LedgerConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion10/LedgerConfig index df7a5f07b1..adc7a72d21 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion10/LedgerConfig and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion10/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion11/LedgerConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion11/LedgerConfig index df7a5f07b1..adc7a72d21 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion11/LedgerConfig and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion11/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion8/LedgerConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion8/LedgerConfig index df7a5f07b1..adc7a72d21 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion8/LedgerConfig and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion8/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion9/LedgerConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion9/LedgerConfig index df7a5f07b1..adc7a72d21 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion9/LedgerConfig and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion2/ShelleyNodeToClientVersion9/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion12/LedgerConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion12/LedgerConfig index df7a5f07b1..adc7a72d21 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion12/LedgerConfig and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion12/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/ApplyTxErr b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/ApplyTxErr new file mode 100644 index 0000000000..44847dcf07 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/ApplyTxErr differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Block b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Block new file mode 100644 index 0000000000..f49d79d20f Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Block differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/GenTx b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/GenTx new file mode 100644 index 0000000000..ddad98bf82 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/GenTx differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/GenTxId b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/GenTxId new file mode 100644 index 0000000000..b26e394526 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/GenTxId @@ -0,0 +1 @@ +X ���np��+�t���3N��Ue�<Ҷ���=� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/LedgerConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/LedgerConfig new file mode 100644 index 0000000000..adc7a72d21 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/LedgerConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..1799efd138 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetBigLedgerPeerSnapshot @@ -0,0 +1 @@ +�" \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetCurrentPParams b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetCurrentPParams new file mode 100644 index 0000000000..f05c5a13e1 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetCurrentPParams @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetEpochNo b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetEpochNo new file mode 100644 index 0000000000..17bb347215 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetEpochNo @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetGenesisConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetGenesisConfig new file mode 100644 index 0000000000..b9eb323e65 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetGenesisConfig @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetLedgerTip b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetLedgerTip new file mode 100644 index 0000000000..8b040ead36 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetLedgerTip differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetNonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetNonMyopicMemberRewards new file mode 100644 index 0000000000..2963a50540 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetNonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetStakeDistribution b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetStakeDistribution new file mode 100644 index 0000000000..34008b6588 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Query_GetStakeDistribution @@ -0,0 +1 @@ +� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_EmptyPParams b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_EmptyPParams new file mode 100644 index 0000000000..51f54233c5 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_EmptyPParams differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_EpochNo b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_EpochNo new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_EpochNo @@ -0,0 +1 @@ + diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_GenesisConfig b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_GenesisConfig new file mode 100644 index 0000000000..8d04764920 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_GenesisConfig differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_GetBigLedgerPeerSnapshot b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_GetBigLedgerPeerSnapshot new file mode 100644 index 0000000000..9fdbcecb87 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_GetBigLedgerPeerSnapshot @@ -0,0 +1,3 @@ +���*��� +�� +��ҟ��� \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_LedgerTip b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_LedgerTip new file mode 100644 index 0000000000..622a58e349 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_LedgerTip @@ -0,0 +1 @@ +� X ��� u��'9Ki�(�׺y���C����)�l \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_NonMyopicMemberRewards b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_NonMyopicMemberRewards new file mode 100644 index 0000000000..0cb4c8c211 Binary files /dev/null and b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_NonMyopicMemberRewards differ diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_StakeDistribution b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_StakeDistribution new file mode 100644 index 0000000000..12f9add46f --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/Result_StakeDistribution @@ -0,0 +1 @@ +�X�1���s��]k?�ժ�P�[{%A��X �����-�ò^46���R�>Žb�{L \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/SerialisedBlock b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/SerialisedBlock new file mode 100644 index 0000000000..558b48dd80 --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/SerialisedBlock @@ -0,0 +1 @@ +�G \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/SlotNo b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/SlotNo new file mode 100644 index 0000000000..d9ba7315ac --- /dev/null +++ b/ouroboros-consensus-cardano/golden/shelley/QueryVersion3/ShelleyNodeToClientVersion13/SlotNo @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/ouroboros-consensus-cardano/golden/shelley/disk/ExtLedgerState b/ouroboros-consensus-cardano/golden/shelley/disk/ExtLedgerState index b9e175b8b7..383887468b 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/disk/ExtLedgerState and b/ouroboros-consensus-cardano/golden/shelley/disk/ExtLedgerState differ diff --git a/ouroboros-consensus-cardano/golden/shelley/disk/LedgerState b/ouroboros-consensus-cardano/golden/shelley/disk/LedgerState index 745073544d..59543c6165 100644 Binary files a/ouroboros-consensus-cardano/golden/shelley/disk/LedgerState and b/ouroboros-consensus-cardano/golden/shelley/disk/LedgerState differ diff --git a/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal b/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal index 86fa8bfaf0..60a5d41347 100644 --- a/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal +++ b/ouroboros-consensus-cardano/ouroboros-consensus-cardano.cabal @@ -23,6 +23,9 @@ extra-doc-files: CHANGELOG.md README.md +data-files: + cddl/**/*.cddl + source-repository head type: git location: https://github.com/IntersectMBO/ouroboros-consensus @@ -112,6 +115,8 @@ library Ouroboros.Consensus.Shelley.Ledger.PeerSelection Ouroboros.Consensus.Shelley.Ledger.Protocol Ouroboros.Consensus.Shelley.Ledger.Query + Ouroboros.Consensus.Shelley.Ledger.Query.LegacyPParams + Ouroboros.Consensus.Shelley.Ledger.Query.LegacyShelleyGenesis Ouroboros.Consensus.Shelley.Ledger.Query.Types Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol Ouroboros.Consensus.Shelley.Node @@ -133,16 +138,16 @@ library cardano-crypto, cardano-crypto-class ^>=2.2, cardano-crypto-wrapper, - cardano-ledger-allegra ^>=1.7, - cardano-ledger-alonzo ^>=1.13, - cardano-ledger-api ^>=1.11, - cardano-ledger-babbage ^>=1.11, - cardano-ledger-binary ^>=1.6, - cardano-ledger-byron ^>=1.1, - cardano-ledger-conway ^>=1.19, - cardano-ledger-core ^>=1.17, - cardano-ledger-mary ^>=1.8, - cardano-ledger-shelley ^>=1.16, + cardano-ledger-allegra ^>=1.8, + cardano-ledger-alonzo ^>=1.14, + cardano-ledger-api ^>=1.12, + cardano-ledger-babbage ^>=1.12, + cardano-ledger-binary ^>=1.7, + cardano-ledger-byron ^>=1.2, + cardano-ledger-conway ^>=1.20, + cardano-ledger-core ^>=1.18, + cardano-ledger-mary ^>=1.9, + cardano-ledger-shelley ^>=1.17, cardano-prelude, cardano-protocol-tpraos ^>=1.4, cardano-slotting, @@ -195,7 +200,7 @@ library unstable-byronspec byron-spec-ledger, cardano-binary, cardano-ledger-binary, - cardano-ledger-byron-test, + cardano-ledger-byron:testlib, cborg >=0.2.2 && <0.3, containers >=0.5 && <0.8, mtl, @@ -233,8 +238,7 @@ library unstable-byron-testlib cardano-crypto-test, cardano-crypto-wrapper, cardano-ledger-binary:{cardano-ledger-binary, testlib}, - cardano-ledger-byron, - cardano-ledger-byron-test, + cardano-ledger-byron:{cardano-ledger-byron, testlib}, cardano-ledger-core, containers, hedgehog-quickcheck, @@ -269,8 +273,7 @@ test-suite byron-test cardano-crypto-class, cardano-crypto-wrapper, cardano-ledger-binary, - cardano-ledger-byron, - cardano-ledger-byron-test, + cardano-ledger-byron:{cardano-ledger-byron, testlib}, cardano-ledger-core, cardano-slotting:testlib, cborg, @@ -316,7 +319,7 @@ library unstable-shelley-testlib cardano-ledger-shelley:{cardano-ledger-shelley, testlib}, cardano-ledger-shelley-ma-test, cardano-ledger-shelley-test, - cardano-protocol-tpraos:{cardano-protocol-tpraos, testlib}, + cardano-protocol-tpraos, cardano-slotting, cardano-strict-containers, containers, @@ -435,6 +438,7 @@ test-suite cardano-test main-is: Main.hs other-modules: Test.Consensus.Cardano.DiffusionPipelining + Test.Consensus.Cardano.GenCDDLs Test.Consensus.Cardano.Golden Test.Consensus.Cardano.MiniProtocol.LocalTxSubmission.ByteStringTxParser Test.Consensus.Cardano.MiniProtocol.LocalTxSubmission.Server @@ -444,24 +448,31 @@ test-suite cardano-test Test.Consensus.Cardano.SupportsSanityCheck Test.Consensus.Cardano.Translation Test.ThreadNet.AllegraMary + Test.Consensus.Ledger.Query Test.ThreadNet.Cardano Test.ThreadNet.MaryAlonzo Test.ThreadNet.ShelleyAllegra + other-modules: Paths_ouroboros_consensus_cardano build-depends: QuickCheck, base, base16-bytestring, bytestring, + cardano-ledger-allegra:testlib, cardano-ledger-alonzo, + cardano-ledger-alonzo:testlib, cardano-ledger-alonzo-test, cardano-ledger-api, + cardano-ledger-babbage:testlib, cardano-ledger-babbage-test, cardano-ledger-binary:testlib, - cardano-ledger-byron, + cardano-ledger-byron:{cardano-ledger-byron, testlib}, cardano-ledger-conway:testlib, cardano-ledger-core:{cardano-ledger-core, testlib}, + cardano-ledger-mary:testlib, cardano-ledger-shelley, + cardano-ledger-shelley:testlib, cardano-ledger-shelley-test, cardano-protocol-tpraos, cardano-slotting, @@ -469,22 +480,29 @@ test-suite cardano-test constraints, containers, contra-tracer, + directory, filepath, + io-classes, microlens, - ouroboros-consensus:{ouroboros-consensus, unstable-consensus-testlib, unstable-mempool-test-utils}, ouroboros-consensus-cardano:{ouroboros-consensus-cardano, unstable-cardano-testlib}, + ouroboros-consensus-diffusion, ouroboros-consensus-diffusion:unstable-diffusion-testlib, ouroboros-consensus-protocol, + ouroboros-consensus:{ouroboros-consensus, unstable-consensus-testlib, unstable-mempool-test-utils}, + ouroboros-network, ouroboros-network-api, ouroboros-network-protocols:{ouroboros-network-protocols, testlib}, pretty-simple, + serialise, sop-core, sop-extras, strict-sop-core, tasty, tasty-hunit, tasty-quickcheck, + temporary, typed-protocols ^>=0.3, + typed-protocols-stateful, unstable-byron-testlib, unstable-cardano-testlib, unstable-shelley-testlib, 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 4b9016399f..d423b75081 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 @@ -41,6 +41,7 @@ module Ouroboros.Consensus.Cardano.Node , pattern CardanoNodeToClientVersion14 , pattern CardanoNodeToClientVersion15 , pattern CardanoNodeToClientVersion16 + , pattern CardanoNodeToClientVersion17 , pattern CardanoNodeToNodeVersion1 , pattern CardanoNodeToNodeVersion2 ) where @@ -354,6 +355,23 @@ pattern CardanoNodeToClientVersion16 = :* Nil ) +-- | The hard fork enabled, and the Shelley, Allegra, Mary, Alonzo and Babbage +-- and Conway eras enabled, using 'ShelleyNodeToClientVersion13' for the +-- Shelley-based eras. +pattern CardanoNodeToClientVersion17 :: BlockNodeToClientVersion (CardanoBlock c) +pattern CardanoNodeToClientVersion17 = + HardForkNodeToClientEnabled + HardForkSpecificNodeToClientVersion3 + ( EraNodeToClientEnabled ByronNodeToClientVersion1 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* EraNodeToClientEnabled ShelleyNodeToClientVersion13 + :* Nil + ) + instance CardanoHardForkConstraints c => SupportedNetworkProtocolVersion (CardanoBlock c) @@ -370,6 +388,7 @@ instance , (NodeToClientV_18, CardanoNodeToClientVersion14) , (NodeToClientV_19, CardanoNodeToClientVersion15) , (NodeToClientV_20, CardanoNodeToClientVersion16) + , (NodeToClientV_21, CardanoNodeToClientVersion17) ] latestReleasedNodeVersion _prx = (Just NodeToNodeV_14, Just NodeToClientV_20) 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 2c56e06130..64b9a0a10b 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs @@ -61,6 +61,7 @@ import qualified Cardano.Ledger.Conway.Rules as Conway import qualified Cardano.Ledger.Conway.Rules as SL ( ConwayLedgerPredFailure (..) ) +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.Mary (MaryEra) @@ -179,7 +180,7 @@ class getConwayEraGovDict :: proxy era -> Maybe (ConwayEraGovDict era) data ConwayEraGovDict era where - ConwayEraGovDict :: CG.ConwayEraGov era => ConwayEraGovDict era + ConwayEraGovDict :: (CG.ConwayEraGov era, CG.ConwayEraCertState era) => ConwayEraGovDict era isBeforeConway :: forall era. L.Era era => Proxy era -> Bool isBeforeConway _ = diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs index 17fdc985a5..cb0361db29 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs @@ -79,6 +79,7 @@ import Ouroboros.Consensus.Protocol.Praos.Common ) import Ouroboros.Consensus.Protocol.Signed (SignedHeader) import Ouroboros.Consensus.Shelley.Eras +import Ouroboros.Consensus.Shelley.Ledger.Query.LegacyPParams import Ouroboros.Consensus.Shelley.Protocol.Abstract ( ProtoCrypto , ProtocolHeaderSupportsEnvelope (pHeaderPrevHash) @@ -128,6 +129,9 @@ class HasPartialConsensusConfig proto , DecCBOR (SL.PState era) , Crypto (ProtoCrypto proto) + , -- Backwards compatibility + Plain.FromCBOR (LegacyPParams era) + , Plain.ToCBOR (LegacyPParams era) ) => ShelleyCompatible proto era diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs index 3971b41b96..ef1b79921b 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Ledger.hs @@ -630,11 +630,7 @@ applyHelper f cfg blk stBefore = do tickedShelleyLedgerState ( let b = shelleyBlockRaw blk h' = mkHeaderView (SL.bheader b) - in -- Jared Corduan explains that the " Unsafe " here ultimately only - -- means the value must not be serialized. We're only passing it to - -- 'STS.applyBlockOpts', which does not serialize it. So this is a - -- safe use. - SL.UnsafeUnserialisedBlock h' (SL.bbody b) + in SL.Block h' (SL.bbody b) ) let track :: diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs index 313757f6b8..ea7cc2e5a4 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/NetworkProtocolVersion.hs @@ -25,6 +25,8 @@ data ShelleyNodeToClientVersion | -- | New queries introduced: QueryStakePoolDefaultVote -- Queries deprecated: GetProposedPParamsUpdates ShelleyNodeToClientVersion12 + | -- | New encoder for PParams, CompactGenesis + ShelleyNodeToClientVersion13 deriving (Show, Eq, Ord, Enum, Bounded) instance HasNetworkProtocolVersion (ShelleyBlock proto era) where @@ -44,6 +46,7 @@ instance SupportedNetworkProtocolVersion (ShelleyBlock proto era) where , (NodeToClientV_18, ShelleyNodeToClientVersion10) , (NodeToClientV_19, ShelleyNodeToClientVersion11) , (NodeToClientV_20, ShelleyNodeToClientVersion12) + , (NodeToClientV_21, ShelleyNodeToClientVersion13) ] latestReleasedNodeVersion = latestReleasedNodeVersionDefault diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query.hs index 5241ac19cd..706b45be8a 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query.hs @@ -46,17 +46,15 @@ import Cardano.Binary ) import Cardano.Ledger.Address import qualified Cardano.Ledger.Api.State.Query as SL -import Cardano.Ledger.CertState (lookupDepositDState) -import qualified Cardano.Ledger.CertState as SL import Cardano.Ledger.Coin (Coin) import Cardano.Ledger.Compactible (Compactible (fromCompact)) import qualified Cardano.Ledger.Conway.Governance as CG +import qualified Cardano.Ledger.Conway.State as CG import qualified Cardano.Ledger.Core as SL import Cardano.Ledger.Credential (StakeCredential) import Cardano.Ledger.Keys (KeyHash, KeyRole (..)) import qualified Cardano.Ledger.Shelley.API as SL import qualified Cardano.Ledger.Shelley.Core as LC -import Cardano.Ledger.Shelley.LedgerState (AccountState) import qualified Cardano.Ledger.Shelley.RewardProvenance as SL ( RewardProvenance ) @@ -106,6 +104,8 @@ import Ouroboros.Consensus.Shelley.Ledger.NetworkProtocolVersion ( ShelleyNodeToClientVersion (..) ) import Ouroboros.Consensus.Shelley.Ledger.PeerSelection () +import Ouroboros.Consensus.Shelley.Ledger.Query.LegacyPParams +import Ouroboros.Consensus.Shelley.Ledger.Query.LegacyShelleyGenesis import Ouroboros.Consensus.Shelley.Ledger.Query.Types import Ouroboros.Consensus.Shelley.Protocol.Abstract (ProtoCrypto) import Ouroboros.Consensus.Storage.LedgerDB @@ -272,7 +272,7 @@ data instance BlockQuery (ShelleyBlock proto era) fp result where -- -- Not supported in eras before Conway. GetDRepState :: - CG.ConwayEraGov era => + (CG.ConwayEraGov era, CG.ConwayEraCertState era) => Set (SL.Credential 'DRepRole) -> BlockQuery (ShelleyBlock proto era) @@ -297,7 +297,7 @@ data instance BlockQuery (ShelleyBlock proto era) fp result where -- -- Not supported in eras before Conway. GetCommitteeMembersState :: - CG.ConwayEraGov era => + (CG.ConwayEraGov era, CG.ConwayEraCertState era) => Set (SL.Credential 'ColdCommitteeRole) -> Set (SL.Credential 'HotCommitteeRole) -> Set SL.MemberStatus -> @@ -308,7 +308,7 @@ data instance BlockQuery (ShelleyBlock proto era) fp result where Set (SL.Credential 'SL.Staking) -> BlockQuery (ShelleyBlock proto era) QFNoTables VoteDelegatees GetAccountState :: - BlockQuery (ShelleyBlock proto era) QFNoTables AccountState + BlockQuery (ShelleyBlock proto era) QFNoTables SL.ChainAccountState -- | Query the SPO voting stake distribution. -- This stake distribution is different from the one used in leader election. -- @@ -474,7 +474,7 @@ instance SL.calculatePoolDistr' (maybe (const True) (flip Set.member) mPoolIds) stakeSet GetStakeDelegDeposits stakeCreds -> let lookupDeposit = - lookupDepositDState (view SL.certDStateL $ SL.lsCertState $ SL.esLState $ SL.nesEs st) + SL.lookupDepositDState (view SL.certDStateL $ SL.lsCertState $ SL.esLState $ SL.nesEs st) lookupInsert acc cred = case lookupDeposit cred of Nothing -> acc @@ -493,7 +493,7 @@ instance GetFilteredVoteDelegatees stakeCreds -> getFilteredVoteDelegatees st stakeCreds GetAccountState -> - SL.queryAccountState st + SL.queryChainAccountState st GetSPOStakeDistr keys -> SL.querySPOStakeDistr st keys GetProposals gids -> @@ -914,7 +914,7 @@ decodeShelleyQuery = do requireCG :: forall s ans. - (CG.ConwayEraGov era => Decoder s ans) -> + ((CG.ConwayEraGov era, CG.ConwayEraCertState era) => Decoder s ans) -> Decoder s ans requireCG k = case SE.getConwayEraGovDict (Proxy @era) of Just SE.ConwayEraGovDict -> k @@ -971,19 +971,19 @@ encodeShelleyResult :: BlockQuery (ShelleyBlock proto era) fp result -> result -> Encoding -encodeShelleyResult _v query = case query of +encodeShelleyResult v query = case query of GetLedgerTip -> encodePoint encode GetEpochNo -> toCBOR GetNonMyopicMemberRewards{} -> toCBOR - GetCurrentPParams -> toCBOR GetProposedPParamsUpdates -> toCBOR + GetCurrentPParams -> fst $ currentPParamsEnDecoding v GetStakeDistribution -> LC.toEraCBOR @era GetUTxOByAddress{} -> toCBOR GetUTxOWhole -> toCBOR DebugEpochState -> toCBOR GetCBOR{} -> encode GetFilteredDelegationsAndRewardAccounts{} -> LC.toEraCBOR @era - GetGenesisConfig -> toCBOR + GetGenesisConfig -> fst $ genesisConfigEnDecoding v DebugNewEpochState -> toCBOR DebugChainDepState -> encode GetRewardProvenance -> LC.toEraCBOR @era @@ -1016,19 +1016,19 @@ decodeShelleyResult :: BlockQuery (ShelleyBlock proto era) fp result -> forall s. Decoder s result -decodeShelleyResult _v query = case query of +decodeShelleyResult v query = case query of GetLedgerTip -> decodePoint decode GetEpochNo -> fromCBOR GetNonMyopicMemberRewards{} -> fromCBOR - GetCurrentPParams -> fromCBOR GetProposedPParamsUpdates -> fromCBOR + GetCurrentPParams -> snd $ currentPParamsEnDecoding v GetStakeDistribution -> LC.fromEraCBOR @era GetUTxOByAddress{} -> fromCBOR GetUTxOWhole -> fromCBOR DebugEpochState -> fromCBOR GetCBOR{} -> decode GetFilteredDelegationsAndRewardAccounts{} -> LC.fromEraCBOR @era - GetGenesisConfig -> fromCBOR + GetGenesisConfig -> snd $ genesisConfigEnDecoding v DebugNewEpochState -> fromCBOR DebugChainDepState -> decode GetRewardProvenance -> LC.fromEraCBOR @era @@ -1054,6 +1054,31 @@ decodeShelleyResult _v query = case query of GetBigLedgerPeerSnapshot -> fromCBOR QueryStakePoolDefaultVote{} -> fromCBOR +currentPParamsEnDecoding :: + forall era s. + ( FromCBOR (LC.PParams era) + , ToCBOR (LC.PParams era) + , FromCBOR (LegacyPParams era) + , ToCBOR (LegacyPParams era) + ) => + ShelleyNodeToClientVersion -> + (LC.PParams era -> Encoding, Decoder s (LC.PParams era)) +currentPParamsEnDecoding v + | v >= ShelleyNodeToClientVersion13 = + (toCBOR, fromCBOR) + | otherwise = + (encodeLegacyPParams, decodeLegacyPParams) + +genesisConfigEnDecoding :: + forall s. + ShelleyNodeToClientVersion -> + (CompactGenesis -> Encoding, Decoder s CompactGenesis) +genesisConfigEnDecoding v + | v >= ShelleyNodeToClientVersion13 = + (toCBOR, fromCBOR) + | otherwise = + (encodeLegacyShelleyGenesis . getCompactGenesis, compactGenesis <$> decodeLegacyShelleyGenesis) + -- | The stake snapshot returns information about the mark, set, go ledger snapshots for a pool, -- plus the total active stake for each snapshot that can be used in a 'sigma' calculation. -- 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 new file mode 100644 index 0000000000..3b29f38940 --- /dev/null +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyPParams.hs @@ -0,0 +1,374 @@ +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeApplications #-} + +module Ouroboros.Consensus.Shelley.Ledger.Query.LegacyPParams + ( LegacyPParams (..) + , decodeLegacyPParams + , encodeLegacyPParams + ) where + +import Cardano.Ledger.Allegra +import Cardano.Ledger.Alonzo +import Cardano.Ledger.Alonzo.PParams +import Cardano.Ledger.Babbage +import Cardano.Ledger.Babbage.PParams +import Cardano.Ledger.BaseTypes +import Cardano.Ledger.Binary +import Cardano.Ledger.Binary.Coders +import qualified Cardano.Ledger.Binary.Plain as Plain +import Cardano.Ledger.Conway +import Cardano.Ledger.Core +import Cardano.Ledger.Mary +import Cardano.Ledger.Shelley +import Cardano.Ledger.Shelley.PParams +import Data.Functor.Identity + +-- | After node 10.5, Ledger started encoding the protocol version in a TList +-- instead of as two contiguous terms. These codecs respect the old version. +-- +-- This can be deleted once we cross a hard fork. +newtype LegacyPParams era = LegacyPParams + { unLegacyPParams :: PParams era + } + +encodeLegacyPParams :: ToCBOR (LegacyPParams era) => PParams era -> Plain.Encoding +encodeLegacyPParams pp = toCBOR (LegacyPParams pp) + +decodeLegacyPParams :: FromCBOR (LegacyPParams era) => Plain.Decoder s (PParams era) +decodeLegacyPParams = unLegacyPParams <$> fromCBOR + +instance ToCBOR (LegacyPParams ShelleyEra) where + toCBOR = toEraCBOR @ShelleyEra + +instance EncCBOR (LegacyPParams ShelleyEra) where + encCBOR (LegacyPParams (PParams ShelleyPParams{..})) = + encode + ( Rec mkLegacyShelleyPParams + !> To sppMinFeeA + !> To sppMinFeeB + !> To sppMaxBBSize + !> To sppMaxTxSize + !> To sppMaxBHSize + !> To sppKeyDeposit + !> To sppPoolDeposit + !> To sppEMax + !> To sppNOpt + !> To sppA0 + !> To sppRho + !> To sppTau + !> To sppD + !> To sppExtraEntropy + !> To (pvMajor sppProtocolVersion) + !> To (pvMinor sppProtocolVersion) + !> To sppMinUTxOValue + !> To sppMinPoolCost + ) + where + mkLegacyShelleyPParams a b c d e f g h i j k l m n o p q r = + LegacyPParams $ + PParams $ + ShelleyPParams @Identity @ShelleyEra a b c d e f g h i j k l m n (ProtVer o p) q r + +instance DecCBOR (LegacyPParams ShelleyEra) where + decCBOR = + decode + ( RecD mkLegacyShelleyPParams + To sppMinFeeA + !> To sppMinFeeB + !> To sppMaxBBSize + !> To sppMaxTxSize + !> To sppMaxBHSize + !> To sppKeyDeposit + !> To sppPoolDeposit + !> To sppEMax + !> To sppNOpt + !> To sppA0 + !> To sppRho + !> To sppTau + !> To sppD + !> To sppExtraEntropy + !> To (pvMajor sppProtocolVersion) + !> To (pvMinor sppProtocolVersion) + !> To sppMinUTxOValue + !> To sppMinPoolCost + ) + where + mkLegacyAllegraPParams a b c d e f g h i j k l m n o p q r = + LegacyPParams $ + PParams $ + ShelleyPParams @Identity @AllegraEra a b c d e f g h i j k l m n (ProtVer o p) q r + +instance FromCBOR (LegacyPParams AllegraEra) where + fromCBOR = + eraDecoder @AllegraEra $ + decode + ( RecD mkLegacyAllegraPParams + To sppMinFeeA + !> To sppMinFeeB + !> To sppMaxBBSize + !> To sppMaxTxSize + !> To sppMaxBHSize + !> To sppKeyDeposit + !> To sppPoolDeposit + !> To sppEMax + !> To sppNOpt + !> To sppA0 + !> To sppRho + !> To sppTau + !> To sppD + !> To sppExtraEntropy + !> To (pvMajor sppProtocolVersion) + !> To (pvMinor sppProtocolVersion) + !> To sppMinUTxOValue + !> To sppMinPoolCost + ) + where + mkLegacyMaryPParams a b c d e f g h i j k l m n o p q r = + LegacyPParams $ + PParams $ + ShelleyPParams @Identity @MaryEra a b c d e f g h i j k l m n (ProtVer o p) q r + +instance FromCBOR (LegacyPParams MaryEra) where + fromCBOR = + eraDecoder @MaryEra $ + decode + ( RecD mkLegacyMaryPParams + To appMinFeeA + !> To appMinFeeB + !> To appMaxBBSize + !> To appMaxTxSize + !> To appMaxBHSize + !> To appKeyDeposit + !> To appPoolDeposit + !> To appEMax + !> To appNOpt + !> To appA0 + !> To appRho + !> To appTau + !> To appD + !> To appExtraEntropy + !> To (pvMajor appProtocolVersion) + !> To (pvMinor appProtocolVersion) + !> To appMinPoolCost + -- new/updated for alonzo + !> To appCoinsPerUTxOWord + !> To appCostModels + !> To appPrices + !> To appMaxTxExUnits + !> To appMaxBlockExUnits + !> To appMaxValSize + !> To appCollateralPercentage + !> To appMaxCollateralInputs + ) + where + mkLegacyAlonzoPParams a b c d e f g h i j k l m n o p q r s t u v w x y = + LegacyPParams $ + PParams $ + AlonzoPParams @Identity @AlonzoEra a b c d e f g h i j k l m n (ProtVer o p) q r s t u v w x y + +instance FromCBOR (LegacyPParams AlonzoEra) where + fromCBOR = + eraDecoder @AlonzoEra $ + decode $ + RecD mkLegacyAlonzoPParams + To bppMinFeeA + !> To bppMinFeeB + !> To bppMaxBBSize + !> To bppMaxTxSize + !> To bppMaxBHSize + !> To bppKeyDeposit + !> To bppPoolDeposit + !> To bppEMax + !> To bppNOpt + !> To bppA0 + !> To bppRho + !> To bppTau + !> To (pvMajor bppProtocolVersion) + !> To (pvMinor bppProtocolVersion) + !> To bppMinPoolCost + !> To bppCoinsPerUTxOByte + !> To bppCostModels + !> To bppPrices + !> To bppMaxTxExUnits + !> To bppMaxBlockExUnits + !> To bppMaxValSize + !> To bppCollateralPercentage + !> To bppMaxCollateralInputs + ) + where + mkLegacyBabbagePParams a b c d e f g h i j k l m n o p q r s t u v w = + LegacyPParams $ + PParams $ + BabbagePParams @Identity @BabbageEra a b c d e f g h i j k l (ProtVer m n) o p q r s t u v w + +instance FromCBOR (LegacyPParams BabbageEra) where + fromCBOR = + eraDecoder @BabbageEra $ + decode $ + RecD mkLegacyBabbagePParams + fromCBOR diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyShelleyGenesis.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyShelleyGenesis.hs new file mode 100644 index 0000000000..fdbd91fbf1 --- /dev/null +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/LegacyShelleyGenesis.hs @@ -0,0 +1,101 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +module Ouroboros.Consensus.Shelley.Ledger.Query.LegacyShelleyGenesis + ( LegacyShelleyGenesis (..) + , encodeLegacyShelleyGenesis + , decodeLegacyShelleyGenesis + ) where + +import Cardano.Ledger.BaseTypes +import Cardano.Ledger.Binary +import qualified Cardano.Ledger.Binary.Plain as Plain +import Cardano.Ledger.Shelley.Genesis +import qualified Data.Text as Text +import Ouroboros.Consensus.Shelley.Ledger.Query.LegacyPParams + +-- | The encoding of the PParams changed in node 10.5. +-- +-- We can delete this once we cross a HF. +newtype LegacyShelleyGenesis = LegacyShelleyGenesis + { unLegacyShelleyGenesis :: ShelleyGenesis + } + +encodeLegacyShelleyGenesis :: ShelleyGenesis -> Plain.Encoding +encodeLegacyShelleyGenesis pp = toCBOR (LegacyShelleyGenesis pp) + +decodeLegacyShelleyGenesis :: Plain.Decoder s ShelleyGenesis +decodeLegacyShelleyGenesis = unLegacyShelleyGenesis <$> fromCBOR + +instance ToCBOR LegacyShelleyGenesis where + toCBOR + ( LegacyShelleyGenesis + ShelleyGenesis + { .. + } + ) = + toPlainEncoding shelleyProtVer $ + encodeListLen 15 + <> encCBOR sgSystemStart + <> encCBOR sgNetworkMagic + <> encCBOR sgNetworkId + <> activeSlotsCoeffEncCBOR sgActiveSlotsCoeff + <> encCBOR sgSecurityParam + <> encCBOR (unEpochSize sgEpochLength) + <> encCBOR sgSlotsPerKESPeriod + <> encCBOR sgMaxKESEvolutions + <> encCBOR sgSlotLength + <> encCBOR sgUpdateQuorum + <> encCBOR sgMaxLovelaceSupply + <> encCBOR (LegacyPParams sgProtocolParams) + <> encCBOR sgGenDelegs + <> encCBOR sgInitialFunds + <> encCBOR sgStaking + +instance FromCBOR LegacyShelleyGenesis where + fromCBOR = toPlainDecoder Nothing shelleyProtVer $ do + decodeRecordNamed "ShelleyGenesis" (const 15) $ do + sgSystemStart <- decCBOR + sgNetworkMagic <- decCBOR + sgNetworkId <- decCBOR + sgActiveSlotsCoeff <- activeSlotsCoeffDecCBOR + sgSecurityParam <- decCBOR + sgEpochLength <- decCBOR + sgSlotsPerKESPeriod <- decCBOR + sgMaxKESEvolutions <- decCBOR + sgSlotLength <- decCBOR + sgUpdateQuorum <- decCBOR + sgMaxLovelaceSupply <- decCBOR + (LegacyPParams sgProtocolParams) <- decCBOR + sgGenDelegs <- decCBOR + sgInitialFunds <- decCBOR + sgStaking <- decCBOR + pure $ + LegacyShelleyGenesis $ + ShelleyGenesis + sgSystemStart + sgNetworkMagic + sgNetworkId + sgActiveSlotsCoeff + sgSecurityParam + (EpochSize sgEpochLength) + sgSlotsPerKESPeriod + sgMaxKESEvolutions + sgSlotLength + sgUpdateQuorum + sgMaxLovelaceSupply + sgProtocolParams + sgGenDelegs + sgInitialFunds + sgStaking + +activeSlotsCoeffEncCBOR :: PositiveUnitInterval -> Encoding +activeSlotsCoeffEncCBOR = enforceEncodingVersion shelleyProtVer . encCBOR . unboundRational + +activeSlotsCoeffDecCBOR :: Decoder s PositiveUnitInterval +activeSlotsCoeffDecCBOR = do + r <- enforceDecoderVersion shelleyProtVer $ decodeRational + case boundRational r of + Nothing -> + cborError $ DecoderErrorCustom "ActiveSlotsCoeff (PositiveUnitInterval)" (Text.pack $ show r) + Just u -> pure u diff --git a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/Types.hs b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/Types.hs index 770cc018fa..5030eead79 100644 --- a/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/Types.hs +++ b/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Query/Types.hs @@ -2,8 +2,11 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} -- | This module contains copies of older versions of types from Ledger in order -- to retain backwards-compatibility. Eventually, types likes this should be @@ -19,12 +22,7 @@ module Ouroboros.Consensus.Shelley.Ledger.Query.Types import qualified Cardano.Crypto.Hash as Hash import qualified Cardano.Crypto.VRF as VRF import Cardano.Ledger.Binary - ( DecCBOR (..) - , EncCBOR (..) - , decodeRecordNamed - , encodeListLen - ) -import Cardano.Ledger.Hashes (HASH) +import Cardano.Ledger.Core import qualified Cardano.Ledger.Keys as SL import qualified Cardano.Ledger.State as SL import Cardano.Protocol.Crypto (Crypto, VRF) 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 f2187a7d6d..2973a72b1a 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 @@ -55,7 +55,6 @@ import Test.Cardano.Ledger.Alonzo.Arbitrary () import Test.Cardano.Ledger.Alonzo.Serialisation.Generators () import Test.Cardano.Ledger.Conway.Arbitrary () import Test.Consensus.Byron.Generators () -import Test.Consensus.Cardano.MockCrypto import Test.Consensus.Protocol.Serialisation.Generators () import Test.Consensus.Shelley.Generators import Test.Consensus.Shelley.MockCrypto (CanMock) @@ -70,14 +69,14 @@ import Test.Util.Serialisation.Roundtrip Disk -------------------------------------------------------------------------------} -instance Arbitrary (CardanoBlock MockCryptoCompatByron) where +instance Arbitrary (CardanoBlock StandardCrypto) where arbitrary = oneof $ catMaybes $ hcollapse generators where generators :: NP - (K (Maybe (Gen (CardanoBlock MockCryptoCompatByron)))) - (CardanoEras MockCryptoCompatByron) + (K (Maybe (Gen (CardanoBlock StandardCrypto)))) + (CardanoEras StandardCrypto) generators = mk BlockByron :* mk BlockShelley @@ -91,18 +90,18 @@ instance Arbitrary (CardanoBlock MockCryptoCompatByron) where mk :: forall a x. Arbitrary a => - (a -> CardanoBlock MockCryptoCompatByron) -> - K (Maybe (Gen (CardanoBlock MockCryptoCompatByron))) x + (a -> CardanoBlock StandardCrypto) -> + K (Maybe (Gen (CardanoBlock StandardCrypto))) x mk f = K $ Just $ f <$> arbitrary -instance Arbitrary (Coherent (CardanoBlock MockCryptoCompatByron)) where +instance Arbitrary (Coherent (CardanoBlock StandardCrypto)) where arbitrary = fmap Coherent $ oneof $ catMaybes $ hcollapse generators where generators :: NP - (K (Maybe (Gen (CardanoBlock MockCryptoCompatByron)))) - (CardanoEras MockCryptoCompatByron) + (K (Maybe (Gen (CardanoBlock StandardCrypto)))) + (CardanoEras StandardCrypto) generators = mk BlockByron :* mk BlockShelley @@ -116,11 +115,11 @@ instance Arbitrary (Coherent (CardanoBlock MockCryptoCompatByron)) where mk :: forall a x. Arbitrary (Coherent a) => - (a -> CardanoBlock MockCryptoCompatByron) -> - K (Maybe (Gen (CardanoBlock MockCryptoCompatByron))) x + (a -> CardanoBlock StandardCrypto) -> + K (Maybe (Gen (CardanoBlock StandardCrypto))) x mk f = K $ Just $ f . getCoherent <$> arbitrary -instance Arbitrary (CardanoHeader MockCryptoCompatByron) where +instance Arbitrary (CardanoHeader StandardCrypto) where arbitrary = getHeader <$> arbitrary instance @@ -139,7 +138,7 @@ instance aux = K . OneEraHash . toShortRawHash (Proxy @blk) . unwrapHeaderHash instance - (c ~ MockCryptoCompatByron, ShelleyBasedEra ShelleyEra) => + (c ~ StandardCrypto, ShelleyBasedEra ShelleyEra) => Arbitrary (AnnTip (CardanoBlock c)) where arbitrary = @@ -344,7 +343,7 @@ arbitraryNodeToNode injByron injShelley injAllegra injMary injAlonzo injBabbage x instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) @@ -362,7 +361,7 @@ instance injConway = mapSomeNestedCtxt (NCS . NCS . NCS . NCS . NCS . NCS . NCZ) instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) @@ -380,7 +379,7 @@ instance BlockConway instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) @@ -398,7 +397,7 @@ instance HeaderConway instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) @@ -416,7 +415,7 @@ instance GenTxConway instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToNodeVersion (CardanoEras c)) @@ -695,7 +694,7 @@ arbitraryNodeToClient injByron injShelley injAllegra injMary injAlonzo injBabbag ] instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToClientVersion (CardanoEras c)) @@ -713,7 +712,7 @@ instance BlockConway instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToClientVersion (CardanoEras c)) @@ -731,7 +730,7 @@ instance GenTxConway instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToClientVersion (CardanoEras c)) @@ -761,8 +760,8 @@ instance shrink = traverse aux where aux :: - CardanoApplyTxErr MockCryptoCompatByron -> - [CardanoApplyTxErr MockCryptoCompatByron] + CardanoApplyTxErr StandardCrypto -> + [CardanoApplyTxErr StandardCrypto] aux (HardForkApplyTxErrFromEra (OneEraApplyTxErr x)) = HardForkApplyTxErrFromEra . OneEraApplyTxErr <$> shrink x aux (HardForkApplyTxErrWrongEra x) = @@ -796,7 +795,7 @@ instance ] instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToClientVersion (CardanoEras c)) @@ -916,7 +915,7 @@ instance Arbitrary (EraIndex (CardanoEras c)) where Just ns -> return $ eraIndexFromNS ns instance - c ~ MockCryptoCompatByron => + c ~ StandardCrypto => Arbitrary ( WithVersion (HardForkNodeToClientVersion (CardanoEras c)) diff --git a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/ThreadNet/TxGen/Cardano.hs b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/ThreadNet/TxGen/Cardano.hs index 726ba6088f..55924c32a0 100644 --- a/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/ThreadNet/TxGen/Cardano.hs +++ b/ouroboros-consensus-cardano/src/unstable-cardano-testlib/Test/ThreadNet/TxGen/Cardano.hs @@ -22,6 +22,7 @@ import Cardano.Ledger.Keys (DSIGN) import qualified Cardano.Ledger.Keys.Bootstrap as SL (makeBootstrapWitness) import qualified Cardano.Ledger.Shelley.API as SL import qualified Cardano.Ledger.Shelley.Core as SL +import qualified Cardano.Ledger.Shelley.Tx as SL import Cardano.Ledger.Val ((<->)) import Cardano.Protocol.Crypto (VRF) import Control.Exception (assert) @@ -219,14 +220,9 @@ migrateUTxO migrationInfo curSlot lcfg lst then Nothing else (Just . GenTxShelley . mkShelleyTx) $ - SL.ShelleyTx - { SL.body = body - , SL.auxiliaryData = SL.SNothing - , SL.wits = - SL.mkBasicTxWits - & SL.addrTxWitsL .~ Set.fromList [delegWit, poolWit] - & SL.bootAddrTxWitsL .~ Set.singleton byronWit - } + SL.mkBasicTx body + & SL.witsShelleyTxL . SL.addrTxWitsL .~ Set.fromList [delegWit, poolWit] + & SL.witsShelleyTxL . SL.bootAddrTxWitsL .~ Set.singleton byronWit | otherwise = Nothing where mbUTxO :: Maybe (SL.UTxO ShelleyEra) 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 8ef78d4dd8..538723972f 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 @@ -51,7 +51,6 @@ import Test.Cardano.Ledger.Shelley.Serialisation.EraIndepGenerators ) import Test.Cardano.Ledger.Shelley.Serialisation.Generators () import Test.Cardano.Ledger.ShelleyMA.Serialisation.Generators () -import Test.Cardano.Protocol.TPraos.Arbitrary (genBlock) import Test.Consensus.Protocol.Serialisation.Generators () import Test.Consensus.Shelley.MockCrypto (CanMock) import Test.QuickCheck hiding (Result) @@ -79,7 +78,7 @@ instance allPoolKeys <- replicateM (fromIntegral $ numCoreNodes defaultConstants) $ genIssuerKeys defaultConstants - mkShelleyBlock <$> genBlock allPoolKeys + mkShelleyBlock <$> genCoherentBlock allPoolKeys instance (Praos.PraosCrypto crypto, CanMock (Praos crypto) era) => diff --git a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/ThreadNet/TxGen/Shelley.hs b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/ThreadNet/TxGen/Shelley.hs index dee1a49212..6002444574 100644 --- a/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/ThreadNet/TxGen/Shelley.hs +++ b/ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/ThreadNet/TxGen/Shelley.hs @@ -114,7 +114,7 @@ genTx _cfg slotNo TickedShelleyLedgerState{tickedShelleyLedgerState} genEnv = , ledgerSlotNo = slotNo , ledgerIx = minBound , ledgerPp = getPParams tickedShelleyLedgerState - , ledgerAccount = SL.esAccountState epochState + , ledgerAccount = SL.esChainAccountState epochState } utxoSt :: SL.UTxOState ShelleyEra diff --git a/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Golden.hs b/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Golden.hs index c704066c59..31bb6bc1b0 100644 --- a/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Golden.hs +++ b/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Golden.hs @@ -14,7 +14,7 @@ import Test.Util.Paths import Test.Util.Serialisation.Golden tests :: TestTree -tests = goldenTest_all codecConfig ($(getGoldenDir) "byron") examples +tests = goldenTest_all codecConfig ($(getGoldenDir) "byron") Nothing examples instance ToGoldenDirectory ByronNodeToNodeVersion diff --git a/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Serialisation.hs b/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Serialisation.hs index ddc746b449..fd5f292237 100644 --- a/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Serialisation.hs +++ b/ouroboros-consensus-cardano/test/byron-test/Test/Consensus/Byron/Serialisation.hs @@ -37,7 +37,7 @@ tests :: TestTree tests = testGroup "Byron" - [ roundtrip_all testCodecCfg dictNestedHdr + [ roundtrip_all testCodecCfg dictNestedHdr Nothing , testProperty "BinaryBlockInfo sanity check" prop_byronBinaryBlockInfo , testGroup "Integrity" diff --git a/ouroboros-consensus-cardano/test/cardano-test/Main.hs b/ouroboros-consensus-cardano/test/cardano-test/Main.hs index eefdc14769..f63c6c8b1a 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Main.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Main.hs @@ -2,6 +2,7 @@ module Main (main) where import System.IO (BufferMode (LineBuffering), hSetBuffering, stdout) import qualified Test.Consensus.Cardano.DiffusionPipelining +import Test.Consensus.Cardano.GenCDDLs import qualified Test.Consensus.Cardano.Golden import qualified Test.Consensus.Cardano.MiniProtocol.LocalTxSubmission.Server import qualified Test.Consensus.Cardano.Serialisation (tests) @@ -9,6 +10,7 @@ import qualified Test.Consensus.Cardano.Show () import qualified Test.Consensus.Cardano.SupportedNetworkProtocolVersion import qualified Test.Consensus.Cardano.SupportsSanityCheck import qualified Test.Consensus.Cardano.Translation (tests) +import qualified Test.Consensus.Ledger.Query (tests) import Test.Tasty import qualified Test.ThreadNet.AllegraMary import qualified Test.ThreadNet.Cardano @@ -29,8 +31,12 @@ tests = testGroup "cardano" [ Test.Consensus.Cardano.DiffusionPipelining.tests - , Test.Consensus.Cardano.Golden.tests - , Test.Consensus.Cardano.Serialisation.tests + , withCDDLs $ + testGroup + "Serialisation" + [ Test.Consensus.Cardano.Golden.tests + , Test.Consensus.Cardano.Serialisation.tests + ] , Test.Consensus.Cardano.SupportedNetworkProtocolVersion.tests , Test.Consensus.Cardano.SupportsSanityCheck.tests , Test.ThreadNet.AllegraMary.tests @@ -39,4 +45,5 @@ tests = , Test.ThreadNet.ShelleyAllegra.tests , Test.Consensus.Cardano.MiniProtocol.LocalTxSubmission.Server.tests , Test.Consensus.Cardano.Translation.tests + , Test.Consensus.Ledger.Query.tests ] diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/GenCDDLs.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/GenCDDLs.hs new file mode 100644 index 0000000000..81cd04d444 --- /dev/null +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/GenCDDLs.hs @@ -0,0 +1,192 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE ViewPatterns #-} + +module Test.Consensus.Cardano.GenCDDLs (withCDDLs) where + +import qualified Control.Monad as Monad +import qualified Data.ByteString as BS +import qualified Data.ByteString.Char8 as BS8 +import qualified Data.ByteString.Lazy as BSL +import qualified Data.List as L +import Data.Maybe (isNothing) +import Paths_ouroboros_consensus_cardano +import qualified System.Directory as D +import qualified System.Environment as E +import System.Exit +import qualified System.FilePath as F +import System.IO +import System.IO.Temp +import qualified System.Process.ByteString.Lazy as P +import qualified Test.Cardano.Chain.Binary.Cddl as Byron +import qualified Test.Cardano.Ledger.Allegra.Binary.Cddl as Allegra +import qualified Test.Cardano.Ledger.Alonzo.Binary.Cddl as Alonzo +import qualified Test.Cardano.Ledger.Babbage.Binary.Cddl as Babbage +import qualified Test.Cardano.Ledger.Conway.Binary.Cddl as Conway +import qualified Test.Cardano.Ledger.Mary.Binary.Cddl as Mary +import qualified Test.Cardano.Ledger.Shelley.Binary.Cddl as Shelley +import Test.Tasty + +newtype CDDLSpec = CDDLSpec {cddlSpec :: BS.ByteString} deriving Show + +-- | This function will run the provided test-tree after generating the node to +-- node cddls for Blocks and Headers. As more CDDLs are stabilized they will +-- have to be added here. Eventually we can have a datatype with one field for +-- each CDDL so that we know always what is available. +withCDDLs :: TestTree -> TestTree +withCDDLs f = + withResource + ( do + probeTools + setupCDDLCEnv + + ntnBlock <- cddlc "cddl/node-to-node/blockfetch/block.cddl" + ntnBlock' <- fixupBlockCDDL ntnBlock + BS.writeFile "ntnblock.cddl" . cddlSpec $ ntnBlock' + + ntnHeader <- cddlc "cddl/node-to-node/chainsync/header.cddl" + BS.writeFile "ntnheader.cddl" . cddlSpec $ ntnHeader + ) + ( \() -> do + D.removeFile "ntnblock.cddl" + D.removeFile "ntnheader.cddl" + ) + (\_ -> f) + +-- | The Ledger CDDL specs are not _exactly_ correct. Here we do some dirty +-- sed-replace to make them able to validate blocks. See cardano-ledger#5054. +fixupBlockCDDL :: CDDLSpec -> IO CDDLSpec +fixupBlockCDDL spec = + withTempFile "." "block-temp.cddl" $ \fp h -> do + hClose h + BS.writeFile fp . cddlSpec $ spec + -- For plutus, the type is actually `bytes`, but the distinct construct is + -- for forcing generation of different values. See cardano-ledger#5054 + sed fp ["-i", "s/\\(conway\\.distinct_VBytes = \\)/\\1 bytes ;\\//g"] + -- These 3 below are hardcoded for generation. See cardano-ledger#5054 + sed fp ["-i", "s/\\([yaoye]\\.address = \\)/\\1 bytes ;/g"] + sed fp ["-i", "s/\\(reward_account = \\)/\\1 bytes ;/g"] + sed + fp + [ "-i" + , "-z" + , "s/unit_interval = #6\\.30(\\[\\n\\s*1,\\n\\s*2,\\n\\])/unit_interval = #6.30([uint, uint])/g" + ] + CDDLSpec <$> BS.readFile fp + +-- | This sets the environment variables needed for `cddlc` to run properly. +setupCDDLCEnv :: IO () +setupCDDLCEnv = do + byron <- map takePath <$> Byron.readByronCddlFileNames + shelley <- map takePath <$> Shelley.readShelleyCddlFileNames + allegra <- map takePath <$> Allegra.readAllegraCddlFileNames + mary <- map takePath <$> Mary.readMaryCddlFileNames + alonzo <- map takePath <$> Alonzo.readAlonzoCddlFileNames + babbage <- map takePath <$> Babbage.readBabbageCddlFileNames + conway <- map takePath <$> Conway.readConwayCddlFileNames + + localDataDir <- takePath <$> getDataDir + let local_paths = + map + (localDataDir F.) + [ "cddl" + , "cddl/disk" + , "cddl/disk/snapshot" + , "cddl/node-to-client/localstatequery/byron" + , "cddl/node-to-client/localstatequery/consensus" + , "cddl/node-to-client/localstatequery/shelley" + , "cddl/node-to-client/txmonitor" + ] + + include_path = + mconcat $ + L.intersperse ":" $ + map (mconcat . L.intersperse ":") [byron, shelley, allegra, mary, alonzo, babbage, conway] + <> local_paths + + E.setEnv "CDDL_INCLUDE_PATH" (include_path <> ":") + +-- | Call @sed@ on the given file with the given args +sed :: FilePath -> [String] -> IO () +sed fp args = + Monad.void $ P.readProcessWithExitCode "sed" (args ++ [fp]) mempty + +{- FOURMOLU_DISABLE -} + +cddlc :: FilePath -> IO CDDLSpec +cddlc dataFile = do + putStrLn $ "Generating: " <> dataFile + path <- getDataFileName dataFile + (_, BSL.toStrict -> cddl, BSL.toStrict -> err) <- +#ifdef POSIX + P.readProcessWithExitCode "cddlc" ["-u", "-2", "-t", "cddl", path] mempty +#else + -- we cannot call @cddlc@ directly because it is not an executable in + -- Haskell eyes, but we can call @ruby@ and pass the @cddlc@ script path as + -- an argument + do + prefix <- E.getEnv "MSYSTEM_PREFIX" + P.readProcessWithExitCode "ruby" [prefix F. "bin/cddlc", "-u", "-2", "-t", "cddl", path] mempty +#endif + Monad.unless (BS.null err) $ red $ BS8.unpack err + return $ CDDLSpec cddl + where + red s = putStrLn $ "\ESC[31m" <> s <> "\ESC[0m" + +takePath :: FilePath -> FilePath +takePath x = +#ifdef POSIX + F.takeDirectory x +#else + -- @cddlc@ is not capable of using backlashes + -- + -- @cddlc@ mixes @C:@ with the separator in @CDDL_INCLUDE_PATH@, and it + -- doesn't understand @;@ as a separator. It works if we remove @C:@ and we + -- are running in the same drive as the cddl files. + let f = [ if c /= '\\' then c else '/' | c <- F.takeDirectory x ] + in if "C:" `L.isPrefixOf` f + then drop 2 f + else f +#endif + +probeTools :: IO () +probeTools = do + putStrLn "Probing tools:" +#ifdef POSIX + posixProbeTool "cddlc" "install the `cddlc` ruby gem" + where + posixProbeTool :: String -> Sring -> IO () + posixProbeTool tool suggestion = do + putStr $ "- " <> tool <> " " + exe <- D.findExecutable tool + if isNothing exe + then do + putStrLn "not found!" + putStrLn $ "Please " <> suggestion + exitFailure + else + putStrLn "found" +#else + -- On Windows, the cddl and cddlc files are POSIX scripts and therefore not + -- recognized as executables by @findExecutable@, so we need to do some dirty + -- tricks here. We check that ruby executable exists and then that there are + -- cddl and cddlc files in the binary folder of the MSYS2 installation. + putStr "- ruby " + rubyExe <- D.findExecutable "ruby" + if (isNothing rubyExe) + then do + putStrLn "not found!\nPlease install ruby" + exitFailure + else + putStrLn "found" + + putStr "- cddlc " + cddlcExe <- D.doesFileExist . (F. "bin/cddlc") =<< E.getEnv "MSYSTEM_PREFIX" + if cddlcExe + then putStrLn "found" + else do + putStrLn "not found!\nPlease install the `cddlc` ruby gem" + exitFailure + pure () +#endif + +{- FOURMOLU_ENABLE -} diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Golden.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Golden.hs index e749638889..504f61cbdb 100644 --- a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Golden.hs +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Cardano/Golden.hs @@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -16,10 +17,16 @@ import System.FilePath (()) import Test.Consensus.Cardano.Examples import Test.Tasty import Test.Util.Paths +import Test.Util.Serialisation.CDDL import Test.Util.Serialisation.Golden tests :: TestTree -tests = goldenTest_all codecConfig ($(getGoldenDir) "cardano") examples +tests = + goldenTest_all + codecConfig + ($(getGoldenDir) "cardano") + (Just $ CDDLsForNodeToNode ("ntnblock.cddl", "serialisedCardanoBlock") ("ntnheader.cddl", "header")) + examples instance CardanoHardForkConstraints c => @@ -41,4 +48,5 @@ instance CardanoNodeToClientVersion14 -> "CardanoNodeToClientVersion14" CardanoNodeToClientVersion15 -> "CardanoNodeToClientVersion15" CardanoNodeToClientVersion16 -> "CardanoNodeToClientVersion16" + CardanoNodeToClientVersion17 -> "CardanoNodeToClientVersion17" _ -> error $ "Unknown version: " <> show blockVersion 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 fa104caa50..6dbfee879b 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 @@ -1,6 +1,7 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} module Test.Consensus.Cardano.Serialisation (tests) where @@ -21,7 +22,6 @@ import Ouroboros.Network.Block (Serialised (..)) import Test.Consensus.Byron.Generators (epochSlots) import qualified Test.Consensus.Cardano.Examples as Cardano.Examples import Test.Consensus.Cardano.Generators () -import Test.Consensus.Cardano.MockCrypto (MockCryptoCompatByron) import Test.Tasty import Test.Tasty.QuickCheck (Property, testProperty, (===)) import Test.Util.Orphans.Arbitrary () @@ -33,7 +33,18 @@ tests = "Cardano" [ testGroup "Examples roundtrip" $ examplesRoundtrip Cardano.Examples.codecConfig Cardano.Examples.examples - , roundtrip_all_skipping result testCodecCfg dictNestedHdr + , roundtrip_all_skipping + result + testCodecCfg + dictNestedHdr + -- We would want to use this instead, but the generated blocks + -- do not quite validate yet or sometimes they are not + -- entirely coherent, so for now this is commented out. + -- + -- ( Just $ + -- CDDLsForNodeToNode ("ntnmockblock.cddl", "serialisedCardanoBlock") ("ntnheader.cddl", "header") + -- ) + Nothing , testProperty "BinaryBlockInfo sanity check" prop_CardanoBinaryBlockInfo ] where @@ -41,7 +52,7 @@ tests = result "roundtrip Result" = DoNotCheckCBORValidity result _ = CheckCBORValidity -testCodecCfg :: CardanoCodecConfig MockCryptoCompatByron +testCodecCfg :: CardanoCodecConfig StandardCrypto testCodecCfg = CardanoCodecConfig (ByronCodecConfig epochSlots) @@ -54,7 +65,7 @@ testCodecCfg = dictNestedHdr :: forall a. - NestedCtxt_ (CardanoBlock MockCryptoCompatByron) Header a -> + NestedCtxt_ (CardanoBlock StandardCrypto) Header a -> Dict (Eq a, Show a) dictNestedHdr = \case NCZ (CtxtByronBoundary{}) -> Dict @@ -70,7 +81,7 @@ dictNestedHdr = \case BinaryBlockInfo -------------------------------------------------------------------------------} -prop_CardanoBinaryBlockInfo :: CardanoBlock MockCryptoCompatByron -> Property +prop_CardanoBinaryBlockInfo :: CardanoBlock StandardCrypto -> Property prop_CardanoBinaryBlockInfo blk = encodedNestedHeader === extractedHeader where diff --git a/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Ledger/Query.hs b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Ledger/Query.hs new file mode 100644 index 0000000000..925407a80f --- /dev/null +++ b/ouroboros-consensus-cardano/test/cardano-test/Test/Consensus/Ledger/Query.hs @@ -0,0 +1,139 @@ +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE OverloadedStrings #-} + +-- | Serialization tests for local state queries and results. +module Test.Consensus.Ledger.Query (tests) where + +import Codec.CBOR.Read (DeserialiseFailure) +import Control.Monad.Class.MonadThrow (throwIO) +import qualified Data.ByteString as BS +import qualified Data.ByteString.Base16.Lazy as LBase16 +import qualified Data.ByteString.Lazy as LBS +import Network.TypedProtocol.Stateful.Codec (Codec (encode), SomeMessage (..), decode, runDecoder) +import qualified Network.TypedProtocol.Stateful.Codec as Stateful +import Ouroboros.Consensus.Block (Point) +import Ouroboros.Consensus.Cardano.Block (CardanoBlock, StandardCrypto) +import Ouroboros.Consensus.Cardano.Node () +import Ouroboros.Consensus.Ledger.Query (Query (GetSystemStart)) +import Ouroboros.Consensus.Network.NodeToClient (cStateQueryCodec, clientCodecs) +import Ouroboros.Consensus.Shelley.Ledger.SupportsProtocol () +import Ouroboros.Network.NodeToClient (NodeToClientVersion (NodeToClientV_20)) +import Ouroboros.Network.Protocol.LocalStateQuery.Type + ( LocalStateQuery + , Message (MsgQuery, MsgResult) + , SingLocalStateQuery (SingAcquired, SingQuerying) + , State (StateAcquired, StateQuerying) + ) +import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as LocalStateQuery +import System.IO.Temp (withSystemTempDirectory) +import Test.Cardano.Ledger.Binary.Cddl (validateCddlConformance) +import Test.Tasty (TestTree, testGroup) +import Test.Tasty.HUnit (assertEqual, testCase) + +type Block = CardanoBlock StandardCrypto + +-- | We only test the latest query version and n2c protocol version against the API. +stateQueryCodec :: + Stateful.Codec + (LocalStateQuery Block (Point Block) (Query Block)) + DeserialiseFailure + LocalStateQuery.State + IO + LBS.ByteString +stateQueryCodec = + cStateQueryCodec $ + clientCodecs mockCodecConfig mockBlockNodeToClientVersion latestN2CVersion + where + latestN2CVersion = NodeToClientV_20 + + -- NOTE: Not used for non-block queries + mockCodecConfig = error "CodecConfig used unexpectedly" + + -- NOTE: Not used for non-block queries + mockBlockNodeToClientVersion = error "BlockNodeToClientVersion used unexpectedly" + +tests :: TestTree +tests = + testGroup + "LocalStateQuery" + [ -- TODO: do this for all queries + -- TODO: reuse cddlRoundTripExpectation from cardano-ledger-binary? + testGroup + "getSystemStart" + [ testCase "Query example" $ do + -- Decode blueprint example query + exampleHex <- LBS.readFile $ blueprintDir "examples" "getSystemStart" "query.cddl" + decoder <- decode stateQueryCodec SingAcquired StateAcquired + runDecoder [LBase16.decodeLenient exampleHex] decoder >>= \case + Left err -> throwIO err + -- XXX: can't bind monadically into test case? + Right (SomeMessage (MsgQuery query)) -> do + -- Re-encode query + let encoded = encode stateQueryCodec StateAcquired (MsgQuery query) + -- Check whether re-encoded cbor is equal + -- NOTE: Using hex-encoded bytes for better debugging + assertEqual "re-encoded query" exampleHex (LBase16.encode encoded) + -- Validate against composed cddl + -- REVIEW: Do we want to use $sockets or the ;# include module extension? + protocolCddlBytes <- BS.readFile $ blueprintDir "local-state-query.cddl" + queryCddlBytes <- BS.readFile $ blueprintDir "getSystemStart.cddl" + withSystemTempDirectory "ouroboros-consensus-cardano-test" $ \dir -> do + let cddlFile = dir <> "/composed.cddl" + BS.writeFile cddlFile (protocolCddlBytes <> queryCddlBytes) + validateCddlConformance cddlFile encoded >>= either fail (const $ pure ()) + Right (SomeMessage _) -> fail "Decoded unexpected message" + , testCase "Query roundtrip" $ do + -- TODO: generate arbitrary query terms given cddl + -- TODO: decode with queryDecodeNodeToClient + -- TODO: encode query with queryEncodeNodeToClient + -- TODO: check whether cbor is equal + -- TODO: validate cbor against cddl + fail "TODO" + , testCase "Query conformance" $ do + -- TODO: generate arbitrary 'GetSystemStart :: Query Block SystemStart' values + -- TODO: encode with queryEncodeNodeToClient + -- TODO: validate cbor against cddl + fail "TODO" + , testCase "Result example" $ do + -- Decode blueprint example query + exampleHex <- LBS.readFile $ blueprintDir "local-state-query.cddl" + decoder <- decode stateQueryCodec SingQuerying (StateQuerying GetSystemStart) + result <- + runDecoder [LBase16.decodeLenient exampleHex] decoder >>= \case + Left err -> throwIO err + Right (SomeMessage (MsgResult result)) -> pure result + + -- Re-encode result + let encoded = encode stateQueryCodec (StateQuerying GetSystemStart) (MsgResult result) + -- Check whether re-encoded cbor is equal + -- NOTE: Using hex-encoded bytes for better debugging + -- FIXME: this fails because 'fromOrdinalDate' is used in 'FromCBOR UTCTime' + assertEqual "re-encoded result" exampleHex (LBase16.encode encoded) + + -- Validate against composed cddl + -- REVIEW: Do we want to use $sockets or the ;# include module extension? + protocolCddlBytes <- BS.readFile $ blueprintDir "local-state-query.cddl" + queryCddlBytes <- BS.readFile $ blueprintDir "getSystemStart.cddl" + withSystemTempDirectory "ouroboros-consensus-cardano-test" $ \dir -> do + let cddlFile = dir <> "/composed.cddl" + BS.writeFile cddlFile (protocolCddlBytes <> queryCddlBytes) + validateCddlConformance cddlFile encoded >>= either fail (const $ pure ()) + , testCase "Query roundtrip" $ do + -- TODO: generate arbitrary result terms given cddl + -- TODO: decode result with decodeResult + -- TODO: encode result with encodeResult + -- TODO: check whether cbor is equal + -- TODO: validate cbor against cddl + fail "TODO" + , testCase "Result conformance" $ do + -- TODO: generate arbitrary 'SystemStart' values + -- TODO: encode result with encodeResult + -- TODO: validate cbor against cddl + fail "TODO" + ] + ] + +blueprintDir :: FilePath +blueprintDir = "../cardano-blueprint/src/client/node-to-client/state-query" diff --git a/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Golden.hs b/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Golden.hs index acfab846ec..f3fb94e6c3 100644 --- a/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Golden.hs +++ b/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Golden.hs @@ -17,7 +17,7 @@ import Test.Util.Paths import Test.Util.Serialisation.Golden tests :: TestTree -tests = goldenTest_all codecConfig ($(getGoldenDir) "shelley") examplesShelley +tests = goldenTest_all codecConfig ($(getGoldenDir) "shelley") Nothing examplesShelley instance ToGoldenDirectory ShelleyNodeToNodeVersion diff --git a/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Serialisation.hs b/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Serialisation.hs index 4761357c58..b0aa8a53eb 100644 --- a/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Serialisation.hs +++ b/ouroboros-consensus-cardano/test/shelley-test/Test/Consensus/Shelley/Serialisation.hs @@ -31,7 +31,7 @@ tests :: TestTree tests = testGroup "Shelley" - [ roundtrip_all testCodecCfg dictNestedHdr + [ roundtrip_all testCodecCfg dictNestedHdr Nothing , -- Test for real crypto too testProperty "hashSize real crypto" $ prop_hashSize pReal , testProperty "ConvertRawHash real crypto" $ roundtrip_ConvertRawHash pReal diff --git a/ouroboros-consensus-diffusion/test/mock-test/Test/ThreadNet/BFT.hs b/ouroboros-consensus-diffusion/test/mock-test/Test/ThreadNet/BFT.hs index 26a34a87a1..3f82ec83e3 100644 --- a/ouroboros-consensus-diffusion/test/mock-test/Test/ThreadNet/BFT.hs +++ b/ouroboros-consensus-diffusion/test/mock-test/Test/ThreadNet/BFT.hs @@ -55,7 +55,7 @@ instance Arbitrary TestSetup where tests :: TestTree tests = testGroup "BFT" $ - [ roundtrip_all SimpleCodecConfig dictNestedHdr + [ roundtrip_all SimpleCodecConfig dictNestedHdr Nothing , testProperty "simple convergence" $ \setup -> prop_simple_bft_convergence setup ] diff --git a/ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal b/ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal index 1a1906df4f..f8c8f2b6b7 100644 --- a/ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal +++ b/ouroboros-consensus-protocol/ouroboros-consensus-protocol.cabal @@ -119,7 +119,7 @@ test-suite protocol-test base, cardano-crypto-class ^>=2.2, cardano-ledger-binary:testlib, - cardano-ledger-core ^>=1.17, + cardano-ledger-core ^>=1.18, cardano-protocol-tpraos ^>=1.4, containers, ouroboros-consensus:{ouroboros-consensus, unstable-consensus-testlib}, diff --git a/ouroboros-consensus/ouroboros-consensus.cabal b/ouroboros-consensus/ouroboros-consensus.cabal index fbbb34f972..c5fd09d558 100644 --- a/ouroboros-consensus/ouroboros-consensus.cabal +++ b/ouroboros-consensus/ouroboros-consensus.cabal @@ -303,7 +303,7 @@ library bytestring >=0.10 && <0.13, cardano-binary, cardano-crypto-class, - cardano-ledger-core ^>=1.17, + cardano-ledger-core ^>=1.18, cardano-lmdb >=0.4, cardano-lmdb-simple ^>=0.8, cardano-prelude, @@ -407,6 +407,7 @@ library unstable-consensus-testlib Test.Util.SOP Test.Util.SanityCheck Test.Util.Schedule + Test.Util.Serialisation.CDDL Test.Util.Serialisation.Examples Test.Util.Serialisation.Golden Test.Util.Serialisation.Roundtrip @@ -458,6 +459,7 @@ library unstable-consensus-testlib ouroboros-network-api, ouroboros-network-mock, pretty-simple, + process, quickcheck-instances, quickcheck-state-machine:no-vendored-treediff ^>=0.10, quiet, @@ -476,6 +478,7 @@ library unstable-consensus-testlib tasty-quickcheck >=0.11, tasty-rerun, template-haskell, + temporary, text, time, transformers-base, @@ -595,6 +598,8 @@ test-suite consensus-test async, base, base-deriving-via, + bytestring, + base16-bytestring, cardano-binary, cardano-crypto-class ^>=2.2, cardano-crypto-tests ^>=2.2, diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Simple.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Simple.hs index 12ea1f4814..5d90adb908 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Simple.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Simple.hs @@ -42,12 +42,12 @@ instance SerialiseNodeToClient blk TriggerHardFork where encodeNodeToClient _ _ triggerHardFork = case triggerHardFork of TriggerHardForkAtVersion v -> encodeListLen 2 <> encodeWord8 0 <> toCBOR v TriggerHardForkAtEpoch e -> encodeListLen 2 <> encodeWord8 1 <> toCBOR e - TriggerHardForkNotDuringThisExecution -> encodeListLen 2 <> encodeWord8 2 + TriggerHardForkNotDuringThisExecution -> encodeListLen 1 <> encodeWord8 2 decodeNodeToClient _ _ = do len <- decodeListLen tag <- decodeWord8 case (len, tag) of (2, 0) -> TriggerHardForkAtVersion <$> fromCBOR @Word16 (2, 1) -> TriggerHardForkAtEpoch <$> fromCBOR @EpochNo - (2, 2) -> pure TriggerHardForkNotDuringThisExecution + (1, 2) -> pure TriggerHardForkNotDuringThisExecution _ -> fail $ "TriggerHardFork: invalid (len, tag): " <> show (len, tag) diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query/Version.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query/Version.hs index a0980bb23f..8542ace485 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query/Version.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Ledger/Query/Version.hs @@ -26,3 +26,4 @@ nodeToClientVersionToQueryVersion x = case x of NodeToClientV_18 -> QueryVersion2 NodeToClientV_19 -> QueryVersion2 NodeToClientV_20 -> QueryVersion3 + NodeToClientV_21 -> QueryVersion3 diff --git a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/CDDL.hs b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/CDDL.hs new file mode 100644 index 0000000000..b79f25cbdb --- /dev/null +++ b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/CDDL.hs @@ -0,0 +1,45 @@ +{-# LANGUAGE LambdaCase #-} + +module Test.Util.Serialisation.CDDL (cddlTestCase, cddlTest, CDDLsForNodeToNode (..)) where + +import qualified Data.ByteString as BS +import qualified Data.Text as T +import System.Exit +import System.IO +import System.IO.Temp +import System.Process +import Test.Tasty +import Test.Tasty.HUnit + +-- | A Tasty test case running the @cuddle@ +cddlTestCase :: IO BS.ByteString -> FilePath -> T.Text -> TestTree +cddlTestCase cborM cddl rule = + testCase "CDDL compliance" $ + cddlTest cborM cddl rule >>= \case + Left err -> assertFailure err + Right _ -> pure () + +-- | Test the CDDL conformance of the given bytestring +cddlTest :: + IO BS.ByteString -> + String -> + T.Text -> + IO (Either String ()) +cddlTest cborM cddl rule = + withTempFile "." "testcase.cbor" $ \fp h -> do + bs <- cborM + BS.hPutStr h bs + hClose h + (code, _out, err) <- + readProcessWithExitCode "cuddle" ["validate-cbor", "-c", fp, "-r", T.unpack rule, cddl] mempty + case code of + ExitFailure _ -> do + BS.writeFile "failing.cbor" bs + pure (Left err) + ExitSuccess -> pure (Right ()) + +-- | A collection of CDDL spec and the relevant rule to use +data CDDLsForNodeToNode = CDDLsForNodeToNode + { blockCDDL :: (FilePath, T.Text) + , headerCDDL :: (FilePath, T.Text) + } diff --git a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs index 4ac613c046..f25e1dcbbc 100644 --- a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs +++ b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs @@ -47,6 +47,7 @@ import qualified Data.ByteString.UTF8 as BS.UTF8 import Data.List (nub) import qualified Data.Map.Strict as Map import Data.Proxy (Proxy (..)) +import qualified Data.Text as T import Data.TreeDiff import GHC.Stack (HasCallStack) import Ouroboros.Consensus.Block (CodecConfig) @@ -78,6 +79,7 @@ import System.FilePath (takeDirectory, ()) import Test.Cardano.Binary.TreeDiff (CBORBytes (..)) import Test.Tasty import Test.Tasty.Golden.Advanced (goldenTest) +import Test.Util.Serialisation.CDDL import Test.Util.Serialisation.Examples (Examples (..), Labelled) import Test.Util.Serialisation.SomeResult (SomeResult (..)) @@ -96,14 +98,27 @@ goldenTestCBOR :: (a -> Encoding) -> -- | Path to the file containing the golden output FilePath -> + -- | Path to the CDDL file that defines this CBOR, and the rule name + Maybe (FilePath, T.Text) -> TestTree -goldenTestCBOR testName example enc goldenFile = - goldenTest - testName - (Strict.readFile goldenFile) - (either exceptionToByteString id <$> try (evaluate actualValue)) - diff - updateGoldenFile +goldenTestCBOR testName example enc goldenFile mCddlPath = + testGroup testName $ + [ goldenTest + "Golden == actual" + (Strict.readFile goldenFile) + (either exceptionToByteString id <$> try (evaluate actualValue)) + diff + updateGoldenFile + ] + ++ ( case mCddlPath of + Nothing -> [] + Just (cddlPath, rule) -> + [ cddlTestCase + (Strict.readFile goldenFile) + cddlPath + rule + ] + ) where -- Copied from tasty-golden because it isn't exported updateGoldenFile :: Strict.ByteString -> IO () @@ -185,18 +200,19 @@ goldenTests :: (a -> Encoding) -> -- | Folder containing the golden files FilePath -> + Maybe (FilePath, T.Text) -> TestTree -goldenTests testName examples enc goldenFolder +goldenTests testName examples enc goldenFolder mCDDL | nub labels /= labels = error $ "Examples with the same label for " <> testName | [(Nothing, example)] <- examples = -- If there's just a single unlabelled example, no need for grouping, -- which makes the output more verbose. - goldenTestCBOR testName example enc (goldenFolder testName) + goldenTestCBOR testName example enc (goldenFolder testName) mCDDL | otherwise = testGroup testName - [ goldenTestCBOR testName' example enc (goldenFolder testName') + [ goldenTestCBOR testName' example enc (goldenFolder testName') mCDDL | (mbLabel, example) <- examples , let testName' = case mbLabel of Nothing -> testName @@ -212,18 +228,19 @@ goldenTests' :: Labelled (a, a -> Encoding) -> -- | Folder containing the golden files FilePath -> + Maybe (FilePath, T.Text) -> TestTree -goldenTests' testName examples goldenFolder +goldenTests' testName examples goldenFolder mCDDL | nub labels /= labels = error $ "Examples with the same label for " <> testName | [(Nothing, (example, exampleEncoder))] <- examples = -- If there's just a single unlabelled example, no need for grouping, -- which makes the output more verbose. - goldenTestCBOR testName example exampleEncoder (goldenFolder testName) + goldenTestCBOR testName example exampleEncoder (goldenFolder testName) mCDDL | otherwise = testGroup testName - [ goldenTestCBOR testName' example exampleEncoder (goldenFolder testName') + [ goldenTestCBOR testName' example exampleEncoder (goldenFolder testName') mCDDL | (mbLabel, (example, exampleEncoder)) <- examples , let testName' = case mbLabel of Nothing -> testName @@ -272,13 +289,14 @@ goldenTest_all :: -- | Path relative to the root of the repository that contains the golden -- files FilePath -> + Maybe CDDLsForNodeToNode -> Examples blk -> TestTree -goldenTest_all codecConfig goldenDir examples = +goldenTest_all codecConfig goldenDir mCDDLs examples = testGroup "Golden tests" [ goldenTest_SerialiseDisk codecConfig goldenDir examples - , goldenTest_SerialiseNodeToNode codecConfig goldenDir examples + , goldenTest_SerialiseNodeToNode codecConfig goldenDir mCDDLs examples , goldenTest_SerialiseNodeToClient codecConfig goldenDir examples ] @@ -312,6 +330,7 @@ goldenTest_SerialiseDisk codecConfig goldenDir Examples{..} = exampleValues enc (goldenDir "disk") + Nothing testLedgerTables :: TestTree testLedgerTables = @@ -323,6 +342,7 @@ goldenTest_SerialiseDisk codecConfig goldenDir Examples{..} = exampleLedgerState ) (goldenDir "disk") + Nothing encodeExt = encodeDiskExtLedgerState codecConfig @@ -337,9 +357,10 @@ goldenTest_SerialiseNodeToNode :: ) => CodecConfig blk -> FilePath -> + Maybe CDDLsForNodeToNode -> Examples blk -> TestTree -goldenTest_SerialiseNodeToNode codecConfig goldenDir Examples{..} = +goldenTest_SerialiseNodeToNode codecConfig goldenDir mCDDLs Examples{..} = testGroup "SerialiseNodeToNode" [ testVersion version @@ -350,15 +371,15 @@ goldenTest_SerialiseNodeToNode codecConfig goldenDir Examples{..} = testVersion version = testGroup (toGoldenDirectory version) - [ test "Block" exampleBlock - , test "Header" exampleHeader - , test "SerialisedBlock" exampleSerialisedBlock - , test "SerialisedHeader" exampleSerialisedHeader - , test "GenTx" exampleGenTx - , test "GenTxId" exampleGenTxId + [ test "Block" exampleBlock $ fmap blockCDDL mCDDLs + , test "Header" exampleHeader $ fmap headerCDDL mCDDLs + , test "SerialisedBlock" exampleSerialisedBlock Nothing + , test "SerialisedHeader" exampleSerialisedHeader Nothing + , test "GenTx" exampleGenTx Nothing + , test "GenTxId" exampleGenTxId Nothing ] where - test :: SerialiseNodeToNode blk a => TestName -> Labelled a -> TestTree + test :: SerialiseNodeToNode blk a => TestName -> Labelled a -> Maybe (FilePath, T.Text) -> TestTree test testName exampleValues = goldenTests testName @@ -416,6 +437,7 @@ goldenTest_SerialiseNodeToClient codecConfig goldenDir Examples{..} = exampleValues enc (goldenDir toGoldenDirectory versions) + Nothing {------------------------------------------------------------------------------- FlatTerm diff --git a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Roundtrip.hs b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Roundtrip.hs index 6130e7f9c4..64aa165f38 100644 --- a/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Roundtrip.hs +++ b/ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Roundtrip.hs @@ -6,6 +6,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE RankNTypes #-} @@ -48,6 +49,7 @@ import Codec.CBOR.Write (toLazyByteString) import Codec.Serialise (decode, encode) import Control.Arrow (left) import Control.Monad (unless, when) +import qualified Data.ByteString as BS import qualified Data.ByteString.Base16.Lazy as Base16 import qualified Data.ByteString.Lazy as Lazy import qualified Data.ByteString.Lazy.Char8 as Char8 @@ -55,7 +57,8 @@ import qualified Data.ByteString.Short as Short import Data.Constraint import Data.Function (on) import Data.Maybe (fromMaybe) -import qualified Data.Text.Lazy as T +import qualified Data.Text as T +import qualified Data.Text.Lazy as TL import Data.Typeable import GHC.Generics (Generic) import Ouroboros.Consensus.Block @@ -90,9 +93,11 @@ import Ouroboros.Network.Block , mkSerialised ) import Quiet (Quiet (..)) +import Test.QuickCheck.Monadic import Test.Tasty import Test.Tasty.QuickCheck import Test.Util.Orphans.Arbitrary () +import Test.Util.Serialisation.CDDL import Test.Util.Serialisation.Examples (Examples (..), Labelled) import Test.Util.Serialisation.SomeResult (SomeResult (..)) import Test.Util.TestEnv (adjustQuickCheckTests) @@ -103,9 +108,10 @@ import Text.Pretty.Simple (pShow) ------------------------------------------------------------------------------} roundtrip :: - (Eq a, Show a) => + (Eq a, Show a, Show e) => (a -> Encoding) -> (forall s. Decoder s a) -> + (BS.ByteString -> IO (Either e ())) -> a -> Property roundtrip enc dec = roundtrip' enc (const <$> dec) @@ -114,11 +120,12 @@ roundtrip enc dec = roundtrip' enc (const <$> dec) -- -- See 'roundtripAnd' roundtrip' :: - forall a. - (Eq a, Show a) => + forall a e. + (Eq a, Show a, Show e) => -- | @enc@ (a -> Encoding) -> (forall s. Decoder s (Lazy.ByteString -> a)) -> + (BS.ByteString -> IO (Either e ())) -> a -> Property roundtrip' = roundtripAnd CheckCBORValidity @@ -141,29 +148,38 @@ data ShouldCheckCBORValidity = CheckCBORValidity | DoNotCheckCBORValidity -- might happen is if the annotation is not canonical CBOR, but @enc@ does -- produce canonical CBOR. roundtripAnd :: - forall a. - (Eq a, Show a) => + forall a e. + (Eq a, Show a, Show e) => ShouldCheckCBORValidity -> -- | @enc@ (a -> Encoding) -> (forall s. Decoder s (Lazy.ByteString -> a)) -> + (BS.ByteString -> IO (Either e ())) -> a -> Property -roundtripAnd check enc dec a = checkRoundtripResult $ do +roundtripAnd check enc dec checkCddlValid a = let enc_a = enc a bs = toLazyByteString enc_a - - when (check == CheckCBORValidity) $ - (validFlatTerm (toFlatTerm enc_a) ?! "Encoded flat term is not valid: " <> show enc_a) - (bsRem, a') <- deserialiseFromBytes dec bs `onError` showByteString bs - Lazy.null bsRem ?! "Left-over bytes: " <> toBase16 bsRem - a == a' bs ?! pShowNeq a (a' bs) + cborValid = + throwLeft $ + when (check == CheckCBORValidity) $ + validFlatTerm (toFlatTerm enc_a) ?! "Encoded flat term is not valid: " <> show enc_a + doesRoundtrip = throwLeft $ do + (bsRem, a') <- deserialiseFromBytes dec bs `onError` showByteString bs + Lazy.null bsRem ?! "Left-over bytes: " <> toBase16 bsRem + a == a' bs ?! pShowNeq a (a' bs) + cddlValid = + monadicIO $ + run (checkCddlValid $ Lazy.toStrict bs) >>= \case + Left err -> assertWith False (show err) + Right _ -> pure () + in cborValid .&&. doesRoundtrip .&&. cddlValid where (?!) :: Bool -> String -> Either String () cond ?! msg = unless cond $ Left msg infix 1 ?! - pShowNeq x y = T.unpack (pShow x) <> "\n \t/= \n" <> T.unpack (pShow y) + pShowNeq x y = TL.unpack (pShow x) <> "\n \t/= \n" <> TL.unpack (pShow y) onError :: Either DeserialiseFailure (Char8.ByteString, Char8.ByteString -> a) -> @@ -182,9 +198,9 @@ roundtripAnd check enc dec a = checkRoundtripResult $ do toBase16 :: Lazy.ByteString -> String toBase16 = Char8.unpack . Base16.encode - checkRoundtripResult :: Either String () -> Property - checkRoundtripResult (Left str) = counterexample str False - checkRoundtripResult (Right ()) = property () + throwLeft :: Either String () -> Property + throwLeft (Left str) = counterexample str False + throwLeft (Right ()) = property () roundtripComparingEncoding :: (a -> Encoding) -> @@ -259,6 +275,7 @@ roundtrip_all :: ) => CodecConfig blk -> (forall a. NestedCtxt_ blk Header a -> Dict (Eq a, Show a)) -> + Maybe CDDLsForNodeToNode -> TestTree roundtrip_all = roundtrip_all_skipping (const CheckCBORValidity) @@ -304,12 +321,13 @@ roundtrip_all_skipping :: (TestName -> ShouldCheckCBORValidity) -> CodecConfig blk -> (forall a. NestedCtxt_ blk Header a -> Dict (Eq a, Show a)) -> + Maybe CDDLsForNodeToNode -> TestTree -roundtrip_all_skipping shouldCheckCBORvalidity ccfg dictNestedHdr = +roundtrip_all_skipping shouldCheckCBORvalidity ccfg dictNestedHdr mCDDLs = testGroup "Roundtrip" [ testGroup "SerialiseDisk" $ roundtrip_SerialiseDisk ccfg dictNestedHdr - , testGroup "SerialiseNodeToNode" $ roundtrip_SerialiseNodeToNode ccfg + , testGroup "SerialiseNodeToNode" $ roundtrip_SerialiseNodeToNode ccfg mCDDLs , testGroup "SerialiseNodeToClient" $ roundtrip_SerialiseNodeToClient shouldCheckCBORvalidity @@ -336,7 +354,7 @@ roundtrip_SerialiseDisk :: [TestTree] roundtrip_SerialiseDisk ccfg dictNestedHdr = [ testProperty "roundtrip block" $ - roundtrip' @blk (encodeDisk ccfg) (decodeDisk ccfg) + roundtrip' @blk (encodeDisk ccfg) (decodeDisk ccfg) (const $ pure (Right () :: Either () ())) , testProperty "roundtrip Header" $ \hdr -> case unnest hdr of DepPair ctxt nestedHdr -> case dictNestedHdr (flipNestedCtxt ctxt) of @@ -344,6 +362,7 @@ roundtrip_SerialiseDisk ccfg dictNestedHdr = roundtrip' (encodeDiskDep ccfg ctxt) (decodeDiskDep ccfg ctxt) + (const $ pure (Right () :: Either () ())) nestedHdr , -- Since the 'LedgerState' is a large data structure, we lower the -- number of tests to avoid slowing down the testsuite too much @@ -362,6 +381,7 @@ roundtrip_SerialiseDisk ccfg dictNestedHdr = roundtrip @a (encodeDisk ccfg) (decodeDisk ccfg) + (const $ pure (Right () :: Either () ())) -- | Used to generate arbitrary values for the serialisation roundtrip tests. -- As the serialisation format can change with the version, not all arbitrary @@ -481,12 +501,13 @@ roundtrip_SerialiseNodeToNode :: , DecodeDiskDep (NestedCtxt Header) blk ) => CodecConfig blk -> + Maybe CDDLsForNodeToNode -> [TestTree] -roundtrip_SerialiseNodeToNode ccfg = - [ rt (Proxy @blk) "blk" - , rt (Proxy @(Header blk)) "Header" - , rt (Proxy @(GenTx blk)) "GenTx" - , rt (Proxy @(GenTxId blk)) "GenTxId" +roundtrip_SerialiseNodeToNode ccfg mCDDLs = + [ rt (Proxy @blk) "blk" $ fmap blockCDDL mCDDLs + , rt (Proxy @(Header blk)) "Header" $ fmap blockCDDL mCDDLs + , rt (Proxy @(GenTx blk)) "GenTx" $ Nothing + , rt (Proxy @(GenTxId blk)) "GenTxId" $ Nothing , -- Roundtrip a @'Serialised' blk@ -- -- We generate a random @blk@, convert it to 'Serialised' (using @@ -498,6 +519,17 @@ roundtrip_SerialiseNodeToNode ccfg = roundtrip @blk (encodeThroughSerialised (encodeDisk ccfg) (enc version)) (decodeThroughSerialised (decodeDisk ccfg) (dec version)) + ( case fmap blockCDDL mCDDLs of + Nothing -> (const $ pure (Right ())) + Just (cddl, rule) -> + ( \bs -> + fmap (const ()) + <$> cddlTest + (pure bs) + cddl + rule + ) + ) blk , -- Same as above but for 'Header' testProperty "roundtrip Serialised Header" $ @@ -505,6 +537,7 @@ roundtrip_SerialiseNodeToNode ccfg = roundtrip @(Header blk) (enc version . SerialisedHeaderFromDepPair . encodeDepPair ccfg . unnest) (nest <$> (decodeDepPair ccfg . serialisedHeaderToDepPair =<< dec version)) + (const $ pure (Right () :: Either () ())) hdr , -- Check the compatibility between 'encodeNodeToNode' for @'Serialised' -- blk@ and 'decodeNodeToNode' for @blk@. @@ -513,6 +546,7 @@ roundtrip_SerialiseNodeToNode ccfg = roundtrip @blk (encodeThroughSerialised (encodeDisk ccfg) (enc version)) (dec version) + (const $ pure (Right () :: Either () ())) blk , -- Check the compatibility between 'encodeNodeToNode' for @blk@ and -- 'decodeNodeToNode' for @'Serialised' blk@. @@ -521,6 +555,7 @@ roundtrip_SerialiseNodeToNode ccfg = roundtrip @blk (enc version) (decodeThroughSerialised (decodeDisk ccfg) (dec version)) + (const $ pure (Right () :: Either () ())) blk , -- Same as above but for 'Header' testProperty "roundtrip Serialised Header compat 1" $ @@ -528,12 +563,14 @@ roundtrip_SerialiseNodeToNode ccfg = roundtrip @(Header blk) (enc version . SerialisedHeaderFromDepPair . encodeDepPair ccfg . unnest) (dec version) + (const $ pure (Right () :: Either () ())) hdr , testProperty "roundtrip Serialised Header compat 2" $ \(WithVersion version hdr) -> roundtrip @(Header blk) (enc version) (nest <$> (decodeDepPair ccfg . serialisedHeaderToDepPair =<< dec version)) + (const $ pure (Right () :: Either () ())) hdr ] where @@ -554,10 +591,22 @@ roundtrip_SerialiseNodeToNode ccfg = , Show a , SerialiseNodeToNode blk a ) => - Proxy a -> String -> TestTree - rt _ name = - testProperty ("roundtrip " <> name) $ \(WithVersion version x) -> - roundtrip @a (enc version) (dec version) x + Proxy a -> String -> Maybe (FilePath, T.Text) -> TestTree + rt _ name mCDDL = + testProperty ("roundtrip " <> name) $ \(WithVersion version x) -> do + roundtrip @a + (enc version) + (dec version) + ( case mCDDL of + Nothing -> const $ pure $ Right () + Just (cddl, rule) -> \bs -> + fmap (const ()) + <$> cddlTest + (pure bs) + cddl + rule + ) + x -- TODO how can we ensure that we have a test for each constraint listed in -- 'SerialiseNodeToClientConstraints'? @@ -616,6 +665,7 @@ roundtrip_SerialiseNodeToClient shouldCheckCBORvalidity ccfg = (shouldCheckCBORvalidity testLabel) (encodeThroughSerialised (encodeDisk ccfg) (enc version)) (const <$> decodeThroughSerialised (decodeDisk ccfg) (dec version)) + (const $ pure (Right () :: Either () ())) blk , -- See roundtrip_SerialiseNodeToNode for more info let testLabel = "roundtrip Serialised blk compat" @@ -625,6 +675,7 @@ roundtrip_SerialiseNodeToClient shouldCheckCBORvalidity ccfg = (shouldCheckCBORvalidity testLabel) (encodeThroughSerialised (encodeDisk ccfg) (enc version)) (const <$> dec version) + (const $ pure (Right () :: Either () ())) blk , let testLabel = "roundtrip Result" in testProperty testLabel $ @@ -633,6 +684,7 @@ roundtrip_SerialiseNodeToClient shouldCheckCBORvalidity ccfg = (shouldCheckCBORvalidity testLabel) (encodeBlockQueryResult ccfg version query) (const <$> decodeBlockQueryResult ccfg version query) + (const $ pure (Right () :: Either () ())) result ] where @@ -674,6 +726,7 @@ roundtrip_SerialiseNodeToClient shouldCheckCBORvalidity ccfg = (shouldCheckCBORvalidity testLabel) (enc' version) (const <$> dec' version) + (const $ pure (Right () :: Either () ())) a where testLabel = "roundtrip " <> name @@ -697,6 +750,7 @@ roundtrip_envelopes ccfg (WithVersion v (SomeSecond ctxt)) = roundtrip (encodeNodeToNode ccfg v . unBase16) (Base16 <$> decodeNodeToNode ccfg v) + (const (pure (Right () :: Either () ()))) (Base16 serialisedHeader) where serialisedHeader :: SerialisedHeader blk @@ -873,4 +927,4 @@ examplesRoundtrip codecConfig examples = mkTest exampleName example = testProperty (fromMaybe "" exampleName) $ once $ - roundtrip' enc dec example + roundtrip' enc dec (const $ pure (Right () :: Either () ())) example diff --git a/ouroboros-consensus/src/unstable-mock-block/Ouroboros/Consensus/Mock/Node/Serialisation.hs b/ouroboros-consensus/src/unstable-mock-block/Ouroboros/Consensus/Mock/Node/Serialisation.hs index dd1fa867b9..a3e240be29 100644 --- a/ouroboros-consensus/src/unstable-mock-block/Ouroboros/Consensus/Mock/Node/Serialisation.hs +++ b/ouroboros-consensus/src/unstable-mock-block/Ouroboros/Consensus/Mock/Node/Serialisation.hs @@ -35,6 +35,9 @@ import Ouroboros.Network.Block (Serialised) -- | Local shorthand to make the instances more readable type MockBlock ext = SimpleBlock SimpleMockCrypto ext +instance MockProtocolSpecific SimpleMockCrypto () where + type MockLedgerConfig SimpleMockCrypto () = () + {------------------------------------------------------------------------------- Disk diff --git a/scripts/cbor/unwrap24serialised.hs b/scripts/cbor/unwrap24serialised.hs new file mode 100644 index 0000000000..b6c62ff718 --- /dev/null +++ b/scripts/cbor/unwrap24serialised.hs @@ -0,0 +1,26 @@ +{- cabal: + build-depends: cborg, bytestring, base +-} + +-- | A simple script that unwraps a CBOR term serialized as +-- CBOR-in-CBOR. It gets input from stdin and emits on stdout. +-- +-- > cat pre.cbor | cabal run ./scripts/unwrap24serialised.hs > post.cbor +module Main where + +import Prelude hiding (interact) +import Data.ByteString +import Codec.CBOR.Term +import Codec.CBOR.Write +import Codec.CBOR.Read +import Data.ByteString.Lazy (fromStrict, toStrict) + +main = interact $ + toStrict + . toLazyByteString + . encodeTerm + . (\(Right (_, t)) -> t) + . deserialiseFromBytes decodeTerm + . (\(Right (_, TTagged _ (TBytes t))) -> fromStrict t) + . deserialiseFromBytes decodeTerm + . fromStrict