From 431daad3460c03532f5afaaf64aad6b5f07973fd Mon Sep 17 00:00:00 2001 From: Nicholas Clarke Date: Mon, 3 May 2021 12:48:23 +0200 Subject: [PATCH 1/4] Prepare 1.27.0 release. --- cardano-api/ChangeLog.md | 5 +++ cardano-api/cardano-api.cabal | 2 +- cardano-cli/ChangeLog.md | 24 ++++++++++++++ cardano-cli/cardano-cli.cabal | 2 +- cardano-node/ChangeLog.md | 58 +++++++++++++++++++++++++++++++++ cardano-node/cardano-node.cabal | 2 +- 6 files changed, 90 insertions(+), 3 deletions(-) diff --git a/cardano-api/ChangeLog.md b/cardano-api/ChangeLog.md index 8431e228f56..7d240d70cba 100644 --- a/cardano-api/ChangeLog.md +++ b/cardano-api/ChangeLog.md @@ -1,5 +1,10 @@ # Changelog for cardano-api +## 1.27 -- April 2021 + +- Add initial support for the ledger state and folding over blocks to the API. + (#2633) + ## 1.26.1 -- March 2021 - The cardano-submit-api now takes transactions encoded as CBOR rather than diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index bed3e173e0f..6586bfc8249 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: cardano-api -version: 1.26.1 +version: 1.27.0 description: The cardano api author: IOHK maintainer: operations@iohk.io diff --git a/cardano-cli/ChangeLog.md b/cardano-cli/ChangeLog.md index 241f8a99a10..c230fd7ae7f 100644 --- a/cardano-cli/ChangeLog.md +++ b/cardano-cli/ChangeLog.md @@ -1,5 +1,29 @@ # Changelog for cardano-cli +## 1.27 -- April 2021 + +- The query tip now also returns the era (e.g. Shelley, Allegra, Alonzo). + (#2561, #2562, #2598) +- The `address build` command now incorporates the functionality of the script + address build command, which is now deprecated. (#2486, #2587) +- Add additional commands for creating MIR certificates to the CLI. This + supports the ability to transfer funds to the treasury for Catalyst projects. + (#2503) +- The transaction view command now additionally shows detailed of minted + non-native tokens. (#2550) +- Removed support for Byron addresses using the Bech32 encoding. The only + supported way to use Byron-era addresses is through a file, using the text + envelope format. (#2605) +- Add a new command which computes the minimum ADA value/deposit for a + multi-asset value. (#2612) +- Add two new query commands: + - `query stake-snapshot` allows querying the three stake snapshots for a given + stake pool. + - `query pool-params` returns the current and future parameters, as well as + the retiring information. + (#2560) +- Updated the CLI reference documentation. (#2665) + ## 1.26.1 -- March 2021 - It's no longer necessary to specify the era when making a CLI query. When not specified, the current era will be used as a default. (#2470) diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index db08e206e0e..4bf82063e54 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: cardano-cli -version: 1.26.1 +version: 1.27.0 description: The Cardano command-line interface. author: IOHK maintainer: operations@iohk.io diff --git a/cardano-node/ChangeLog.md b/cardano-node/ChangeLog.md index 6ed89e3c58b..f0f743f857f 100644 --- a/cardano-node/ChangeLog.md +++ b/cardano-node/ChangeLog.md @@ -1,5 +1,63 @@ # Changelog for cardano-node +## 1.27 -- April 2021 + +### node changes + +- Add an additional GC heap metric to RTS. (#2592) +- Add details about registering relays on-chain to SPO documentation. (#2591) +- Improved installation documentation. (#2624) +- Preparatory support for Alonzo. (#2547) +- Preparatory support for Voltaire. (#2498) +- Add a docker image option for downloading cardano-node. (#2632) +- Miscellaneous internal improvements. (#2644, #2645, #2646) + +### consensus changes + +- Some preparation for upcoming work on Voltaire. (#2978) +- Drop support for GHC 8.6.5. Note that support had already been dropped in the + node. (#3004) +- Introduce an option to configure the snapshot interval. This will primarily be + used by downstream teams for testing and benchmarking. (#2966, #3092) +- Preparatory work for the implementation of Ouroboros Genesis. (#3002) +- Test varying stake distributions in the automated tests. (#3072) +- Add a peer label to chain sync client traces, allowing us to view which peer + supplied which header and when. (#3091) +- Provide the ledger with the ability to perform slot to time conversion. This + will be needed for Plutus scripts in the upcoming Alonzo release. (#3036, #3098) +### ledger changes + +- Work on implementing the upcoming Alonzo era. (#2192, #2198, #2200, #2204, + #2210, #2211, #2212, #2214, #2215, #2216, #2218, #2220, #2221, #2222, #2225, + #2226, #2227, #2229, #2231, #2235, #2237, #2242, #2243, #2251, #2256, #2260, + #2264) +- Released the CDDL spec for Alonzo. (#2228) +- Add an optional network ID field to the transaction body. This will only come + into use in the Alonzo era. (#2219, #2254) +- Define a cardano-ledger-core package containing era-independent primitives. + (#2207) +- Fixes to the ShelleyMA formal specification. (#2181) +- Various internal refactorings and improvements. (#2191, #2202, #2206, #2217, + #2233, #2247, #2257) +- Fix a bug in reward update application which could have resulted in the wrong + amount of funds being added to the treasury. (#2238) +- Some work to reduce the extra CPU load at an epoch boundary, and reduce the + resulting "pause" in normal operation. (#2240, #2241, #2250, #2262) +- Added formal definitions for much of the crypto used to the Shelley spec. + (#2236, #2252) +- Expose AdaPots for use in downstream projects. (#2208) +- Some Byron-era serialisation testing. (#2217) +- Some preparation for upcoming work on Voltaire. (#2135) + +### network changes + +- Removed the deprecated 'KThxBye' message from the TxSubmission protocol. + (#2238) +- Introduce new representation for local root peers. This is in preparation for + P2P support. (#3006) +- Add a new KeepAlive codec that produces a valid CBOR encoding. (#3062) +- Various internal updates and refactorings. (#3003, #3077) + ## 1.26.1 -- March 2021 ### node changes diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 1ce485d2aaf..83b92a69108 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: cardano-node -version: 1.26.1 +version: 1.27.0 description: The cardano full node author: IOHK maintainer: operations@iohk.io From 392f3e427b85672fa2d7f0342984a977d63e0f81 Mon Sep 17 00:00:00 2001 From: Nicholas Clarke Date: Tue, 4 May 2021 10:30:19 +0200 Subject: [PATCH 2/4] Update versions for additional packages. --- cardano-node-chairman/cardano-node-chairman.cabal | 2 +- nix/workbench/cardano-topology/cardano-topology.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index 3eaed59b46a..69ffa740a65 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: cardano-node-chairman -version: 1.26.1 +version: 1.27.0 description: The cardano full node author: IOHK maintainer: operations@iohk.io diff --git a/nix/workbench/cardano-topology/cardano-topology.cabal b/nix/workbench/cardano-topology/cardano-topology.cabal index 1e3b3b93410..39c07636a81 100644 --- a/nix/workbench/cardano-topology/cardano-topology.cabal +++ b/nix/workbench/cardano-topology/cardano-topology.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 name: cardano-topology -version: 1.26.1 +version: 1.27.0 description: A cardano topology generator author: IOHK maintainer: operations@iohk.io From 3bcf65819c276af9443760d2d1be1946f49bc0fc Mon Sep 17 00:00:00 2001 From: Kosyrev Serge Date: Tue, 4 May 2021 23:44:57 +0300 Subject: [PATCH 3/4] workbench / shell.nix: simplify parametrisation and fix the non-autoStartCluster case --- Makefile | 4 +-- default.nix | 4 +-- flake.nix | 1 - nix/default.nix | 3 +- nix/pkgs.nix | 5 --- nix/supervisord-cluster/default.nix | 13 +++---- nix/workbench/default.nix | 18 ++++++---- nix/workbench/profiles/default.nix | 8 ++--- nix/workbench/profiles/node-services.nix | 3 +- nix/workbench/profiles/topology.nix | 2 +- nix/workbench/wb | 2 +- shell.nix | 44 ++++++++++++++---------- workbench-config.nix | 1 - 13 files changed, 55 insertions(+), 53 deletions(-) delete mode 100644 workbench-config.nix diff --git a/Makefile b/Makefile index 925fd5167d8..8324c446d7f 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,10 @@ CLUSTER_PROFILE = default-mary CLUSTER_ARGS_EXTRA = cluster-shell: - nix-shell --max-jobs 8 --cores 0 --argstr clusterProfile ${CLUSTER_PROFILE} --arg 'autoStartCluster' true --arg 'useCabalRun' true + nix-shell --max-jobs 8 --cores 0 --argstr clusterProfile ${CLUSTER_PROFILE} --arg 'autoStartCluster' true cluster-shell-dev: - nix-shell --max-jobs 8 --cores 0 --argstr clusterProfile ${CLUSTER_PROFILE} --arg 'autoStartCluster' true --arg 'useCabalRun' true --arg 'workbenchDevMode' true + nix-shell --max-jobs 8 --cores 0 --argstr clusterProfile ${CLUSTER_PROFILE} --arg 'autoStartCluster' true --arg 'workbenchDevMode' true cluster-shell-trace: CLUSTER_ARGS_EXTRA = --trace large-state-cluster-shell-trace: CLUSTER_ARGS_EXTRA = --trace diff --git a/default.nix b/default.nix index 4c9f8fcb74b..35aa3719305 100644 --- a/default.nix +++ b/default.nix @@ -26,7 +26,7 @@ let inherit haskellPackages cardano-node cardano-node-profiled cardano-node-eventlogged cardano-cli db-converter cardano-ping - scripts environments dockerImage submitApiDockerImage mkCluster bech32; + scripts environments dockerImage submitApiDockerImage bech32; nixosTests = recRecurseIntoAttrs nixosTests; @@ -51,8 +51,6 @@ let }; }; - profiles = (mkCluster customConfig).profilesJSON; - shell = import ./shell.nix { inherit pkgs; withHoogle = true; diff --git a/flake.nix b/flake.nix index 3d9a906c146..67cac4b688f 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,6 @@ cardano-lib (final: prev: { customConfig = import ./custom-config.nix; - workbenchConfig = import ./workbench-config.nix; gitrev = self.rev or "dirty"; commonLib = lib // iohkNix.lib diff --git a/nix/default.nix b/nix/default.nix index eb315d0093e..6f8b335e4c1 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,7 +4,6 @@ , customConfig ? import ./custom-config.nix , sourcesOverride ? {} , gitrev ? null -, workbenchConfig ? import ../workbench-config.nix }: let gitrev' = if gitrev == null @@ -38,7 +37,7 @@ let ++ [ (pkgs: _: with pkgs; { gitrev = gitrev'; - inherit customConfig workbenchConfig; + inherit customConfig; inherit (iohkNix) cardanoLib; # commonLib: mix pkgs.lib with iohk-nix utils and our own: diff --git a/nix/pkgs.nix b/nix/pkgs.nix index daaa6b71395..1791f6ef05a 100644 --- a/nix/pkgs.nix +++ b/nix/pkgs.nix @@ -69,8 +69,6 @@ final: prev: with final; inherit (cardanoNodeHaskellPackages.ouroboros-consensus-byron.components.exes) db-converter; inherit (cardanoNodeHaskellPackages.network-mux.components.exes) cardano-ping; - mkCluster = cfg: callPackage ./supervisord-cluster cfg; - cabal = haskell-nix.tool compiler "cabal" { version = "latest"; inherit (cardanoNodeProject) index-state; @@ -117,7 +115,4 @@ final: prev: with final; }; clusterTests = import ./supervisord-cluster/tests { inherit pkgs; }; - - workbench = callPackage ./workbench workbenchConfig; - inherit (workbench) runWorkbench runJq; } diff --git a/nix/supervisord-cluster/default.nix b/nix/supervisord-cluster/default.nix index 8cfc5415c63..943ba6fec8b 100644 --- a/nix/supervisord-cluster/default.nix +++ b/nix/supervisord-cluster/default.nix @@ -5,6 +5,7 @@ let profileNameDefault = "default-mary"; in { pkgs +, workbench , lib , bech32 , basePort ? basePortDefault @@ -29,7 +30,7 @@ let topologyForNode = { profile, nodeSpec }: let inherit (nodeSpec) name i; in - pkgs.runWorkbench "topology-${name}.json" + workbench.runWorkbench "topology-${name}.json" (if nodeSpec.isProducer then "topology for-local-node ${toString i} ${profile.topology.files} ${toString basePort}" else "topology for-local-observer ${profile.name} ${profile.topology.files} ${toString basePort}"); @@ -140,7 +141,7 @@ EOF basePort; }; - workbenchProfiles = pkgs.workbench.generateProfiles + workbenchProfiles = workbench.generateProfiles { inherit pkgs backend environment; }; in @@ -156,7 +157,7 @@ let ] ## In dev mode, call the script directly: ++ optionals (!workbenchDevMode) - [ pkgs.workbench.workbench ]; + [ workbench.workbench ]; start = pkgs.writeScriptBin "start-cluster" '' set -euo pipefail @@ -174,6 +175,8 @@ let wb local assert-stopped + workbench-prebuild-executables || return 1 + wb profile describe ${profileName} ${optionalString (stateDir != stateDirDefault) @@ -190,8 +193,6 @@ let ln -s ${profile.topology.files} "${stateDir}"/topology - workbench-prebuild-executables - genesis_args+=( ## Positionals: ${profile.JSON} @@ -227,7 +228,7 @@ let in { - inherit (pkgs) workbench; + inherit workbench; inherit (workbenchProfiles) profilesJSON; inherit profile stateDir start stop; } diff --git a/nix/workbench/default.nix b/nix/workbench/default.nix index 525e74ed121..56a5c80deab 100644 --- a/nix/workbench/default.nix +++ b/nix/workbench/default.nix @@ -71,7 +71,7 @@ let ''; exeCabalOp = op: exe: - toString [ "${cabal-install}/bin/cabal" "-v0" op "exe:${exe}" "--"]; + toString [ "${cabal-install}/bin/cabal" op "${exe}" "--"]; checkoutWbMode = if useCabalRun @@ -97,18 +97,20 @@ let ${optionalString useCabalRun '' + ./scripts/cabal-inside-nix-shell.sh + echo 'workbench: cabal-inside-nix-shell mode enabled, calling cardano-* via 'cabal run' (instead of using Nix store)' >&2 function cardano-cli() { - ${exeCabalOp "run" "cardano-cli"} "$@" + ${exeCabalOp "exec" "cardano-cli"} "$@" } function cardano-node() { - ${exeCabalOp "run" "cardano-node"} "$@" + ${exeCabalOp "exec" "cardano-node"} "$@" } function cardano-topology() { - ${exeCabalOp "run" "cardano-topology"} "$@" + ${exeCabalOp "exec" "cardano-topology"} "$@" } export -f cardano-cli cardano-node cardano-topology @@ -118,13 +120,14 @@ let function workbench-prebuild-executables() { ${optionalString useCabalRun '' - echo -n "workbench: prebuilding executables:" + echo -n "workbench: prebuilding executables (because of useCabalRun):" for exe in cardano-cli cardano-node cardano-topology do echo -n " $exe" - $exe --help >/dev/null || true + cabal -v0 build exe:$exe >/dev/null || return 1 done - ''} echo + ''} + true } export -f workbench-prebuild-executables @@ -153,6 +156,7 @@ let pkgs.callPackage ./profiles { inherit pkgs + runWorkbench runJq workbench backend environment profileName; diff --git a/nix/workbench/profiles/default.nix b/nix/workbench/profiles/default.nix index cb929ec7622..44dd1ca0bd5 100644 --- a/nix/workbench/profiles/default.nix +++ b/nix/workbench/profiles/default.nix @@ -1,5 +1,5 @@ { pkgs -, runCommand, runJq, runWorkbench, writeText +, runCommand, runWorkbench, runJq, workbench, writeText ## The backend is an attrset of AWS/supervisord-specific methods and parameters. , backend @@ -38,14 +38,14 @@ let inherit JSON value; topology = pkgs.callPackage - ./topology.nix { inherit profile; }; + ./topology.nix { inherit workbench profile; }; node-specs = pkgs.callPackage - ./node-specs.nix { inherit backend profile; }; + ./node-specs.nix { inherit runWorkbench profile backend; }; inherit (pkgs.callPackage ./node-services.nix - { inherit backend environment profile; }) + { inherit runJq runWorkbench backend environment profile; }) node-services; }; diff --git a/nix/workbench/profiles/node-services.nix b/nix/workbench/profiles/node-services.nix index 896f5b28a26..c57140ebea8 100644 --- a/nix/workbench/profiles/node-services.nix +++ b/nix/workbench/profiles/node-services.nix @@ -1,4 +1,5 @@ { pkgs +, runJq, runWorkbench ## The backend is an attrset of AWS/supervisord-specific methods and parameters. , backend @@ -122,8 +123,6 @@ let }; in eval.config.services.cardano-node; - inherit (pkgs) runJq runWorkbench; - ## ## node-services :: Map NodeName (NodeSpec, ServiceConfig, Service, NodeConfig, Script) ## diff --git a/nix/workbench/profiles/topology.nix b/nix/workbench/profiles/topology.nix index 63d5e83b7d6..aeb9402aa07 100644 --- a/nix/workbench/profiles/topology.nix +++ b/nix/workbench/profiles/topology.nix @@ -7,7 +7,7 @@ let files = runCommand "topology-${profile.name}" {} '' - ${workbench.workbench}/bin/wb topology make ${profile.JSON} $out + ${workbench}/bin/wb topology make ${profile.JSON} $out ''; in { diff --git a/nix/workbench/wb b/nix/workbench/wb index 7385a4bfccc..9b722535ae6 100755 --- a/nix/workbench/wb +++ b/nix/workbench/wb @@ -89,7 +89,7 @@ main() { run "$@";; local | loc | l ) local_ "$@";; - explain-mode ) + explain-mode | x ) explain-mode $global_mode;; ## Internals: diff --git a/shell.nix b/shell.nix index 556e1e083dc..2407c203138 100644 --- a/shell.nix +++ b/shell.nix @@ -7,12 +7,9 @@ , customConfig ? import ./custom-config.nix // { profileName = clusterProfile; } , autoStartCluster ? false -, useCabalRun ? false , workbenchDevMode ? false -, workbenchConfig ? import ./workbench-config.nix // - { inherit useCabalRun workbenchDevMode; } , pkgs ? import ./nix { - inherit config sourcesOverride customConfig workbenchConfig; + inherit config sourcesOverride customConfig; } }: with pkgs; @@ -35,8 +32,14 @@ let # NOTE: due to some cabal limitation, # you have to remove all `source-repository-package` entries from cabal.project # after entering nix-shell for cabal to use nix provided dependencies for them. - clusterCabal = mkCluster (lib.recursiveUpdate customConfig (workbenchConfig // { useCabalRun = true; })); - clusterNix = mkCluster (lib.recursiveUpdate customConfig (workbenchConfig // { useCabalRun = false; })); + mkCluster = + { useCabalRun }: + callPackage ./nix/supervisord-cluster + { inherit useCabalRun workbenchDevMode; + workbench = pkgs.callPackage ./nix/workbench + { inherit useCabalRun workbenchDevMode; }; + }; + ## inherit (workbench) runWorkbench runJq; nixWapped = writeShellScriptBin "nix" '' if [[ "$@" == "flake show"* ]] || [[ "$@" == "flake check"* ]]; then echo 'Temporary override `supported-systems.nix` original content to be able to use `nix flake show|check` on dev machines (workaround for https://github.com/NixOS/nix/issues/4265)' @@ -64,7 +67,9 @@ let ${cabal}/bin/cabal "$@" ''; - shell = cardanoNodeProject.shellFor { + shell = + let cluster = mkCluster { useCabalRun = true; }; + in cardanoNodeProject.shellFor { name = "cabal-dev-shell"; inherit withHoogle; @@ -101,14 +106,14 @@ let ## Workbench's main script is called directly in dev mode. ++ lib.optionals (!workbenchDevMode) [ - pkgs.workbench.workbench + cluster.workbench.workbench ] ## Local cluster not available on Darwin, ## because psmisc fails to build on Big Sur. ++ lib.optionals (!stdenv.isDarwin) [ - clusterCabal.start - clusterCabal.stop + cluster.start + cluster.stop ]; # Prevents cabal from choosing alternate plans, so that @@ -122,13 +127,13 @@ let then echo "workbench: stopping cluster (because 'autoStartCluster' implies this):" stop-cluster fi''} + ./scripts/cabal-inside-nix-shell.sh --restore } trap atexit EXIT - ${lib.optionalString (autoStartCluster && useCabalRun) '' + unset NIX_ENFORCE_PURITY - ''} - ${pkgs.workbench.shellHook} + ${cluster.workbench.shellHook} ${lib.optionalString autoStartCluster '' echo "workbench: starting cluster (because 'autoStartCluster' is true):" @@ -142,7 +147,8 @@ let }; devops = - stdenv.mkDerivation { + let cluster = mkCluster { useCabalRun = false; }; + in stdenv.mkDerivation { name = "devops-shell"; buildInputs = [ nixWapped @@ -151,10 +157,10 @@ let cardano-node python3Packages.supervisor python3Packages.ipython - clusterNix.start - clusterNix.stop + cluster.start + cluster.stop cardanolib-py - pkgs.workbench.workbench + cluster.workbench.workbench ]; shellHook = '' echo "DevOps Tools" \ @@ -163,11 +169,13 @@ let wb explain-mode + ${cluster.workbench.shellHook} + source <(cardano-cli --bash-completion-script cardano-cli) source <(cardano-node --bash-completion-script cardano-node) # Socket path default to first node launched by "start-cluster": - export CARDANO_NODE_SOCKET_PATH=$(wb local get-node-socket-path ${clusterNix.stateDir}) + export CARDANO_NODE_SOCKET_PATH=$(wb local get-node-socket-path ${cluster.stateDir}) # Unless using specific network: ${lib.optionalString (__hasAttr "network" customConfig) '' diff --git a/workbench-config.nix b/workbench-config.nix deleted file mode 100644 index 0967ef424bc..00000000000 --- a/workbench-config.nix +++ /dev/null @@ -1 +0,0 @@ -{} From 1a3cba06c033ebde55e41b7159d48cdc819a8642 Mon Sep 17 00:00:00 2001 From: Kosyrev Serge Date: Wed, 5 May 2021 03:09:57 +0300 Subject: [PATCH 4/4] cardano-api: mtl no longer required Fixes: : error: [-Wunused-packages, -Werror=unused-packages] The following packages were specified via -package or -package-id flags, but were not needed for compilation: - mtl-2.2.2 cabal: Failed to build cardano-api-1.27.0 (which is required by exe:cardano-cli from cardano-cli-1.27.0). --- cardano-api/cardano-api.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index 6586bfc8249..dfe93d19c17 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -114,7 +114,6 @@ library , formatting , iproute , memory - , mtl , network , nothunks , ouroboros-consensus