From 0a3e6d73d3b5c028b2f7fe0381b338bdfbabbe01 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Fri, 6 Feb 2026 10:45:36 +0100 Subject: [PATCH 01/54] [wip] Bump Hackage and CHaP index states, add SRPs --- cabal.project | 22 +++++++++++++++++++--- flake.lock | 12 ++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/cabal.project b/cabal.project index 1a821ddc7db..a996ba728dc 100644 --- a/cabal.project +++ b/cabal.project @@ -13,8 +13,8 @@ repository cardano-haskell-packages -- See CONTRIBUTING for information about these, including some Nix commands -- you need to run if you change them index-state: - , hackage.haskell.org 2026-02-06T20:27:32Z - , cardano-haskell-packages 2026-03-03T10:50:34Z + , hackage.haskell.org 2026-02-17T10:15:41Z + , cardano-haskell-packages 2026-03-17T16:28:00Z constraints: -- haskell.nix patch does not work for 1.6.8 @@ -41,7 +41,7 @@ packages: extra-packages: alex program-options - ghc-options: -Werror + -- ghc-options: -Werror test-show-details: direct @@ -77,3 +77,19 @@ if impl(ghc >= 9.12) -- IMPORTANT -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-api + tag: 95686930a5d6bc5fa75df62fa1a27618e189d402 + --sha256: sha256-DYTTajLfkYRsXO/QGwnB1dPq2REl1jj0HbSvHxQ8hZ4= + subdir: + cardano-api + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-cli + tag: c4cb83020f8b26f67219193d4251d59376b6d5f2 + --sha256: sha256-9FK+/1Q59yn/f02LDK5xNFkeEpKz48S7vAYTKwQGMME= + subdir: + cardano-cli diff --git a/flake.lock b/flake.lock index 7c09d075789..fb5da695363 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1772623894, - "narHash": "sha256-95NCPKIcDnQ+vja6ofTsnFJKoH9AjT0opOj8zdGvWSw=", + "lastModified": 1773767585, + "narHash": "sha256-51V6NaYu6rTqiy9h3itovXJFab5ehkgGiwgq3uSkKFc=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "e140e457e9c9db8591f0d8b0c35597ffb65955fc", + "rev": "38ac4a748aa186310e3c114208597eb979354296", "type": "github" }, "original": { @@ -273,11 +273,11 @@ "hackageNix_2": { "flake": false, "locked": { - "lastModified": 1772713531, - "narHash": "sha256-XPoLj/4nHhOc8tPEkrOhpmCjDvNZ7ZYcda0e4TY2RI4=", + "lastModified": 1771502057, + "narHash": "sha256-XwoLg6wftnU50KPn5jY4jtuGulyNPyspB4lSDSrmR1g=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "ee54e2182f57a1e937b33eb64bcce67b81722ef7", + "rev": "e6bb05af1f45a616f534798263a5a13f2299e3bc", "type": "github" }, "original": { From 3d5a1596ee0c04e735c08beeee110b0c452985bd Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Feb 2026 19:36:32 +0100 Subject: [PATCH 02/54] Use `cardano-crypto-class-2.3.*` --- cardano-node-chairman/cardano-node-chairman.cabal | 2 +- cardano-submit-api/cardano-submit-api.cabal | 4 ++-- cardano-testnet/cardano-testnet.cabal | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index 3a2c9e630e1..fb580394619 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -69,7 +69,7 @@ test-suite chairman-tests build-depends: , cardano-api , cardano-testnet - , cardano-crypto-class ^>=2.2.3.2 + , cardano-crypto-class ^>=2.3 , data-default-class , filepath , hedgehog diff --git a/cardano-submit-api/cardano-submit-api.cabal b/cardano-submit-api/cardano-submit-api.cabal index b7cb0bd700f..015a0448125 100644 --- a/cardano-submit-api/cardano-submit-api.cabal +++ b/cardano-submit-api/cardano-submit-api.cabal @@ -42,7 +42,7 @@ library , cardano-api ^>= 10.24.1 , cardano-binary , cardano-cli ^>= 10.15.0.1 - , cardano-crypto-class ^>=2.2.3.2 + , cardano-crypto-class ^>=2.3 , containers , ekg-core , http-media @@ -99,4 +99,4 @@ test-suite unit main-is: test.hs hs-source-dirs: test build-depends: base - , cardano-crypto-class ^>=2.2.3.2 + , cardano-crypto-class ^>=2.3 diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index a959470b641..58690b327ec 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -43,7 +43,7 @@ library , bytestring , cardano-api ^>= 10.24.1 , cardano-cli:{cardano-cli, cardano-cli-test-lib} ^>= 10.15.0.1 - , cardano-crypto-class ^>=2.2.3.2 + , cardano-crypto-class ^>=2.3 , cardano-crypto-wrapper , cardano-git-rev ^>= 0.2.2 , cardano-ledger-alonzo @@ -153,7 +153,7 @@ executable cardano-testnet main-is: cardano-testnet.hs - build-depends: cardano-crypto-class ^>=2.2.3.2 + build-depends: cardano-crypto-class ^>=2.3 , cardano-cli , cardano-testnet , optparse-applicative-fork From 6fee683ecf499f341b33bb98379ada82e1803b41 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Feb 2026 19:36:48 +0100 Subject: [PATCH 03/54] Use `typed-protocols-1.2.*` --- cardano-node/cardano-node.cabal | 2 +- trace-forward/trace-forward.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 9f463f9b347..a1a9e7b90c5 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -214,7 +214,7 @@ library , tracer-transformers , transformers , transformers-except - , typed-protocols:{typed-protocols, stateful} >= 1.0 + , typed-protocols:{typed-protocols, stateful} >= 1.2 , yaml executable cardano-node diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index 9302f4a8d25..d185f08ff19 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -77,7 +77,7 @@ library , stm , text , trace-dispatcher - , typed-protocols:{typed-protocols, cborg} ^>= 1.0 + , typed-protocols:{typed-protocols, cborg} ^>= 1.2 test-suite test import: project-config From 390beb879bc66bdf779a04a2a02e9ab59754189a Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Mon, 5 Jan 2026 14:52:58 +0100 Subject: [PATCH 04/54] Bump Plutus and API --- cardano-node-chairman/cardano-node-chairman.cabal | 4 ++-- cardano-node/cardano-node.cabal | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index fb580394619..cf70935a963 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -44,12 +44,12 @@ executable cardano-node-chairman build-depends: cardano-api , cardano-crypto-class , cardano-git-rev ^>= 0.2.2 - , cardano-ledger-core ^>= 1.18 + , cardano-ledger-core ^>= 1.19 , cardano-node ^>= 10.6 , cardano-prelude , containers , contra-tracer - , io-classes:{io-classes, strict-stm, si-timers} + , io-classes:{io-classes, strict-stm, si-timers} ^>= 1.8 , optparse-applicative , ouroboros-consensus , ouroboros-consensus-cardano diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index a1a9e7b90c5..412434bfc79 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -139,7 +139,7 @@ library , base16-bytestring , bytestring , cardano-api ^>= 10.24.1 - , cardano-crypto-class ^>=2.2.3.2 + , cardano-crypto-class ^>=2.3 , cardano-crypto-wrapper , cardano-git-rev ^>=0.2.2 , cardano-ledger-alonzo @@ -169,7 +169,7 @@ library , generic-data , hashable , hostname - , io-classes:{io-classes,strict-stm,si-timers} >= 1.5 + , io-classes:{io-classes,strict-stm,si-timers} ^>= 1.8 , iohk-monitoring ^>= 0.2 , kes-agent ^>=0.2 , microlens From 85e17b85a47aae1d6e2900fd847c5fcfd01ed939 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Fri, 6 Feb 2026 10:50:10 +0100 Subject: [PATCH 05/54] Bump Network and Consensus packages, adapt to new structure - remove Nix overrides for ouroboros-network-framework and ouroboros-consensus-cardano that do not exist anymore, as the were renamed --- bench/locli/locli.cabal | 4 ++-- bench/tx-generator/tx-generator.cabal | 10 +++------- .../cardano-node-chairman.cabal | 6 ++---- cardano-node/cardano-node.cabal | 18 +++++------------- cardano-submit-api/cardano-submit-api.cabal | 4 ++-- cardano-testnet/cardano-testnet.cabal | 6 +++--- cardano-tracer/cardano-tracer.cabal | 17 ++++++----------- flake.nix | 2 +- nix/haskell.nix | 8 -------- nix/workbench/shell.nix | 2 +- trace-forward/trace-forward.cabal | 6 ++---- 11 files changed, 27 insertions(+), 56 deletions(-) diff --git a/bench/locli/locli.cabal b/bench/locli/locli.cabal index 21b5d941ee3..90335b330cf 100644 --- a/bench/locli/locli.cabal +++ b/bench/locli/locli.cabal @@ -126,8 +126,8 @@ library , fingertree == 0.1.5.0 , hashable , optparse-applicative - , ouroboros-consensus - , ouroboros-network-api ^>= 0.16 + , ouroboros-consensus:ouroboros-consensus + , ouroboros-network:api ^>= 1.0 , sop-core , split , sqlite-easy >= 1.1.0.1 diff --git a/bench/tx-generator/tx-generator.cabal b/bench/tx-generator/tx-generator.cabal index c18c68ddcb0..a7db05b4d7c 100644 --- a/bench/tx-generator/tx-generator.cabal +++ b/bench/tx-generator/tx-generator.cabal @@ -114,6 +114,7 @@ library , cardano-crypto-class , cardano-crypto-wrapper , cardano-data + , cardano-diffusion ^>= 1.0 , cardano-git-rev ^>= 0.2.2 , cardano-ledger-alonzo , cardano-ledger-api @@ -137,13 +138,8 @@ library , network , network-mux , optparse-applicative - , ouroboros-consensus >= 0.6 - , ouroboros-consensus-cardano >= 0.5 - , ouroboros-consensus-diffusion >= 0.7.0 - , ouroboros-network - , ouroboros-network-api - , ouroboros-network-framework - , ouroboros-network-protocols + , ouroboros-consensus:{ouroboros-consensus, cardano, diffusion} >= 1.0 + , ouroboros-network:{api, framework, framework-tracing, ouroboros-network, protocols} , plutus-ledger-api , plutus-tx , random diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index cf70935a963..487e00bb2aa 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -51,10 +51,8 @@ executable cardano-node-chairman , contra-tracer , io-classes:{io-classes, strict-stm, si-timers} ^>= 1.8 , optparse-applicative - , ouroboros-consensus - , ouroboros-consensus-cardano - , ouroboros-network-api - , ouroboros-network-protocols + , ouroboros-consensus:{ouroboros-consensus, cardano} + , ouroboros-network:{api, protocols} , text , time diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 412434bfc79..e9f25a8e1e2 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -185,14 +185,9 @@ library , network-mux >= 0.8 , nothunks , optparse-applicative - , ouroboros-consensus >=0.30.0.1 && <0.31 - , ouroboros-consensus-cardano ^>= 0.26 - , ouroboros-consensus-diffusion ^>= 0.26 - , ouroboros-consensus-protocol - , ouroboros-network-api ^>= 0.16 - , ouroboros-network:{ouroboros-network, cardano-diffusion, orphan-instances} ^>= 0.22.6 - , ouroboros-network-framework ^>= 0.19.3 - , ouroboros-network-protocols ^>= 0.15.2 + , ouroboros-consensus:{ouroboros-consensus, lmdb, lsm, cardano, diffusion, protocol} ^>= 1.0 + , ouroboros-network:{api, ouroboros-network, orphan-instances, framework, protocols, framework-tracing, tracing} ^>= 1.0 + , cardano-diffusion:{api, cardano-diffusion, orphan-instances, tracing} ^>=1.0 , prettyprinter , prettyprinter-ansi-terminal , psqueues @@ -263,11 +258,8 @@ test-suite cardano-node-test , hedgehog-extras ^>= 0.10 , iproute , mtl - , ouroboros-consensus - , ouroboros-consensus-cardano - , ouroboros-consensus-diffusion - , ouroboros-network:{ouroboros-network, cardano-diffusion} - , ouroboros-network-api + , ouroboros-consensus:{ouroboros-consensus, cardano, diffusion} + , ouroboros-network:{api, ouroboros-network} , strict-sop-core , text , trace-dispatcher diff --git a/cardano-submit-api/cardano-submit-api.cabal b/cardano-submit-api/cardano-submit-api.cabal index 015a0448125..e42f6744964 100644 --- a/cardano-submit-api/cardano-submit-api.cabal +++ b/cardano-submit-api/cardano-submit-api.cabal @@ -49,8 +49,8 @@ library , mtl , network , optparse-applicative-fork - , ouroboros-consensus-cardano - , ouroboros-network-protocols + , ouroboros-consensus:cardano + , ouroboros-network:{protocols} , prometheus >= 2.2.4 , ekg-prometheus-adapter , safe-exceptions diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index 58690b327ec..12e0c3811ba 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -57,7 +57,7 @@ library , cardano-ledger-dijkstra , cardano-ledger-shelley , cardano-node - , cardano-ping ^>= 0.9 + , cardano-ping ^>= 0.10 , cardano-prelude , contra-tracer , containers @@ -84,8 +84,8 @@ library , network , network-mux , optparse-applicative-fork - , ouroboros-network ^>= 0.22.6 - , ouroboros-network-api + , ouroboros-network:{api, ouroboros-network} ^>= 1.0 + , cardano-diffusion:{api, cardano-diffusion} ^>= 1.0 , prettyprinter , process , resourcet diff --git a/cardano-tracer/cardano-tracer.cabal b/cardano-tracer/cardano-tracer.cabal index 33f5cd51571..6b821b8f9c4 100644 --- a/cardano-tracer/cardano-tracer.cabal +++ b/cardano-tracer/cardano-tracer.cabal @@ -172,6 +172,7 @@ library , bimap , blaze-html , bytestring + , cardano-diffusion ^>= 1.0 , cborg ^>= 0.2.4 , containers , contra-tracer @@ -186,9 +187,7 @@ library , network , network-mux >= 0.8 , optparse-applicative - , ouroboros-network ^>= 0.22.6 - , ouroboros-network-api ^>= 0.16 - , ouroboros-network-framework + , ouroboros-network:{api, framework} ^>= 1.0 , signal , slugify , smtp-mail ^>= 0.5 @@ -254,8 +253,7 @@ library demo-forwarder-lib , network , network-mux , optparse-applicative - , ouroboros-network-api - , ouroboros-network-framework + , ouroboros-network:{api, framework} , tasty-quickcheck , text , time @@ -299,7 +297,7 @@ library demo-acceptor-lib , filepath , generic-data , optparse-applicative - , ouroboros-network-api + , ouroboros-network:api , stm <2.5.2 || >=2.5.3 , tasty-quickcheck , text @@ -360,8 +358,7 @@ test-suite cardano-tracer-test , network , network-mux , optparse-applicative - , ouroboros-network-api - , ouroboros-network-framework + , ouroboros-network:{api, framework} , stm <2.5.2 || >=2.5.3 , tasty , tasty-quickcheck @@ -420,9 +417,7 @@ test-suite cardano-tracer-test-ext , network , network-mux , optparse-applicative - , ouroboros-network ^>= 0.22.6 - , ouroboros-network-api - , ouroboros-network-framework + , ouroboros-network:{api, framework, ouroboros-network} ^>= 1.0 , process , QuickCheck , tasty diff --git a/flake.nix b/flake.nix index edfb1e89323..0636e6fe72e 100644 --- a/flake.nix +++ b/flake.nix @@ -126,7 +126,7 @@ // (with project.hsPkgs; { # Add some executables from other relevant packages inherit (bech32.components.exes) bech32; - inherit (ouroboros-consensus-cardano.components.exes) db-analyser db-synthesizer db-truncater snapshot-converter; + inherit (ouroboros-consensus.components.exes) db-analyser db-synthesizer db-truncater snapshot-converter; # Add cardano-node, cardano-cli and tx-generator with their git revision stamp. # Keep available an alternative without the git revision, like the other # passthru (profiled and asserted in nix/haskell.nix) that diff --git a/nix/haskell.nix b/nix/haskell.nix index fcb73320ab1..ae1593eb1ec 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -138,7 +138,6 @@ let packages.cardano-ledger-conway.components.library.doHaddock = false; packages.cardano-ledger-shelley.components.library.doHaddock = false; packages.cardano-protocol-tpraos.components.library.doHaddock = false; - packages.ouroboros-consensus-cardano.components.library.doHaddock = false; packages.ouroboros-consensus.components.library.doHaddock = false; packages.ouroboros-network.components.library.doHaddock = false; # Currently broken packages.plutus-ledger-api.components.library.doHaddock = false; @@ -359,12 +358,6 @@ let packages.terminal-size.components.library.build-tools = lib.mkForce [ ]; packages.network.components.library.build-tools = lib.mkForce [ ]; }) - ({ ... }: { - # TODO: requires - # https://github.com/input-output-hk/ouroboros-network/pull/4673 or - # a newer ghc - packages.ouroboros-network-framework.doHaddock = false; - }) # TODO add flags to packages (like cs-ledger) so we can turn off tests that will # not build for windows on a per package bases (rather than using --disable-tests). # configureArgs = lib.optionalString stdenv.hostPlatform.isWindows "--disable-tests"; @@ -397,7 +390,6 @@ project.appendOverlays (with haskellLib.projectOverlays; [ modules = [{ packages = lib.genAttrs [ "ouroboros-consensus" - "ouroboros-consensus-cardano" "ouroboros-network" "network-mux" ] diff --git a/nix/workbench/shell.nix b/nix/workbench/shell.nix index 9a66740e0d1..1f3f426cd7a 100644 --- a/nix/workbench/shell.nix +++ b/nix/workbench/shell.nix @@ -151,7 +151,7 @@ project.shellFor { ++ (with project.hsPkgs; [ # A `notGitRev` version, faster to enter a workbench after a new commit. cardano-cli.components.exes.cardano-cli - ouroboros-consensus-cardano.components.exes.db-analyser + ouroboros-consensus.components.exes.db-analyser ]) ++ (with workbench-runner; [ workbench-interactive-start diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index d185f08ff19..e1f7ec7a7c0 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -68,11 +68,10 @@ library , io-classes , network , network-mux - , ouroboros-network-api + , ouroboros-network:{api, framework} ^>= 1.0 , ekg-core , ekg-forward >= 1.0 , singletons ^>= 3.0 - , ouroboros-network-framework ^>= 0.19.2 , serialise , stm , text @@ -104,8 +103,7 @@ test-suite test , contra-tracer , io-classes , io-sim - , ouroboros-network-api - , ouroboros-network-framework + , ouroboros-network:{api, framework} , trace-forward , QuickCheck , serialise From 7fb9286a257e737b254596926354c603a2efb9a0 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Fri, 6 Feb 2026 11:01:54 +0100 Subject: [PATCH 06/54] Bump kes-agent --- cardano-node/cardano-node.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index e9f25a8e1e2..730ced8dc22 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -171,7 +171,7 @@ library , hostname , io-classes:{io-classes,strict-stm,si-timers} ^>= 1.8 , iohk-monitoring ^>= 0.2 - , kes-agent ^>=0.2 + , kes-agent ^>=1.1 , microlens , mmap , network-mux From 2424f0b89c819ce73d48a2ef6a4b81e7c0038635 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 10 Mar 2026 09:20:59 +0100 Subject: [PATCH 07/54] Bump ekg-forward --- cardano-tracer/cardano-tracer.cabal | 2 +- trace-forward/trace-forward.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano-tracer/cardano-tracer.cabal b/cardano-tracer/cardano-tracer.cabal index 6b821b8f9c4..66691de8f35 100644 --- a/cardano-tracer/cardano-tracer.cabal +++ b/cardano-tracer/cardano-tracer.cabal @@ -178,7 +178,7 @@ library , contra-tracer , directory , ekg-core - , ekg-forward >= 1.0 + , ekg-forward >= 1.2 , ekg-wai , extra , filepath diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index e1f7ec7a7c0..ffb324fe4aa 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -70,7 +70,7 @@ library , network-mux , ouroboros-network:{api, framework} ^>= 1.0 , ekg-core - , ekg-forward >= 1.0 + , ekg-forward >= 1.2 , singletons ^>= 3.0 , serialise , stm From ce6a0cebbc80574b9cfbc8cd1d7a9cf08bb2e930 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 10 Feb 2026 11:57:21 +0100 Subject: [PATCH 08/54] trace-forward: add new Network tracers --- trace-forward/src/Trace/Forward/Forwarding.hs | 2 ++ trace-forward/src/Trace/Forward/Utils/Version.hs | 12 ++++++++++-- trace-forward/trace-forward.cabal | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/trace-forward/src/Trace/Forward/Forwarding.hs b/trace-forward/src/Trace/Forward/Forwarding.hs index fae115607c2..2960db6c85d 100644 --- a/trace-forward/src/Trace/Forward/Forwarding.hs +++ b/trace-forward/src/Trace/Forward/Forwarding.hs @@ -328,6 +328,8 @@ doListenToAcceptor magic snocket makeBearer configureSocket address timeLimits ekgConfig tfConfig dpfConfig sink ekgStore dpStore = void $ Server.with snocket + nullTracer + Mux.nullTracers makeBearer configureSocket address diff --git a/trace-forward/src/Trace/Forward/Utils/Version.hs b/trace-forward/src/Trace/Forward/Utils/Version.hs index 5ec494a22a7..881347b5897 100644 --- a/trace-forward/src/Trace/Forward/Utils/Version.hs +++ b/trace-forward/src/Trace/Forward/Utils/Version.hs @@ -1,3 +1,7 @@ +{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE GeneralisedNewtypeDeriving #-} {-# LANGUAGE NamedFieldPuns #-} module Trace.Forward.Utils.Version @@ -13,13 +17,16 @@ import Ouroboros.Network.Protocol.Handshake.Version (Accept (..), Acce Queryable (..)) import qualified Codec.CBOR.Term as CBOR +import Control.DeepSeq (NFData) import Data.Text (Text) import qualified Data.Text as T +import GHC.Generics (Generic) data ForwardingVersion = ForwardingV_1 | ForwardingV_2 - deriving (Eq, Ord, Enum, Bounded, Show) + deriving stock (Eq, Ord, Enum, Bounded, Show, Generic) + deriving anyclass (NFData) forwardingVersionCodec :: CodecCBORTerm (Text, Maybe Int) ForwardingVersion forwardingVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm } @@ -38,7 +45,8 @@ forwardingVersionCodec = CodecCBORTerm { encodeTerm, decodeTerm } newtype ForwardingVersionData = ForwardingVersionData { networkMagic :: NetworkMagic - } deriving (Eq, Show) + } deriving stock (Eq, Show) + deriving newtype (NFData) instance Acceptable ForwardingVersionData where acceptableVersion local remote diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index ffb324fe4aa..e71d773cc00 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -64,6 +64,7 @@ library , cborg , containers , contra-tracer + , deepseq , extra , io-classes , network From 09a56e5453c4a4c1a1db073b3b9c74cf1285fb47 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 10 Feb 2026 12:34:22 +0100 Subject: [PATCH 09/54] Rename Network imports --- bench/tx-generator/src/Cardano/Benchmarking/Command.hs | 2 +- .../src/Cardano/Benchmarking/GeneratorTx/NodeToNode.hs | 6 +++--- .../tx-generator/src/Cardano/Benchmarking/LogTypes.hs | 2 +- .../src/Cardano/Benchmarking/Script/Env.hs | 2 +- cardano-node/src/Cardano/Node/Configuration/Socket.hs | 2 +- .../src/Cardano/Node/Configuration/TopologyP2P.hs | 4 ++-- cardano-node/src/Cardano/Node/Queries.hs | 4 ++-- cardano-node/src/Cardano/Node/Run.hs | 4 ++-- cardano-node/src/Cardano/Node/Startup.hs | 4 ++-- cardano-node/src/Cardano/Node/Tracing/API.hs | 4 ++-- cardano-node/src/Cardano/Node/Tracing/Consistency.hs | 9 ++++----- cardano-node/src/Cardano/Node/Tracing/Documentation.hs | 4 ++-- cardano-node/src/Cardano/Node/Tracing/Tracers.hs | 2 -- cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs | 2 +- .../src/Cardano/Node/Tracing/Tracers/Startup.hs | 4 ++-- cardano-node/src/Cardano/Node/Types.hs | 2 +- .../src/Cardano/Tracing/OrphanInstances/Network.hs | 10 +++++----- cardano-node/src/Cardano/Tracing/Tracers.hs | 4 ++-- cardano-node/test/Test/Cardano/Node/Gen.hs | 2 +- cardano-node/test/Test/Cardano/Node/POM.hs | 4 ++-- cardano-testnet/src/Testnet/Defaults.hs | 2 +- .../src/Cardano/Tracer/Handlers/ReForwarder.hs | 2 +- cardano-tracer/test/cardano-tracer-test-ext.hs | 2 +- 23 files changed, 40 insertions(+), 43 deletions(-) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Command.hs b/bench/tx-generator/src/Cardano/Benchmarking/Command.hs index 87066f4a121..e1a8bdb1781 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Command.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Command.hs @@ -35,7 +35,7 @@ import Data.Foldable (for_) import Data.Maybe (catMaybes) import qualified Data.Text.IO as Text import Options.Applicative as Opt -import Ouroboros.Network.NodeToClient (IOManager, withIOManager) +import Cardano.Network.NodeToClient (IOManager, withIOManager) import System.Exit diff --git a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/NodeToNode.hs b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/NodeToNode.hs index d15da29a231..0769317bdf3 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/NodeToNode.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/GeneratorTx/NodeToNode.hs @@ -48,9 +48,9 @@ import Ouroboros.Network.KeepAlive import Ouroboros.Network.Magic import Ouroboros.Network.Mux (MiniProtocolCb (..), OuroborosApplication (..), OuroborosBundle, RunMiniProtocol (..)) -import Ouroboros.Network.NodeToClient (chainSyncPeerNull) -import Ouroboros.Network.NodeToNode (NetworkConnectTracers (..)) -import qualified Ouroboros.Network.NodeToNode as NtN +import Cardano.Network.NodeToClient (chainSyncPeerNull) +import Cardano.Network.NodeToNode (NetworkConnectTracers (..)) +import qualified Cardano.Network.NodeToNode as NtN import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) import Ouroboros.Network.PeerSelection.PeerSharing.Codec (decodeRemoteAddress, encodeRemoteAddress) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/LogTypes.hs b/bench/tx-generator/src/Cardano/Benchmarking/LogTypes.hs index 67e5fa75aac..8f8ee238e55 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/LogTypes.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/LogTypes.hs @@ -39,7 +39,7 @@ import Cardano.TxGenerator.Types (TPSRate) import Ouroboros.Consensus.Ledger.SupportsMempool (GenTxId) import Ouroboros.Network.Driver (TraceSendRecv (..)) import Ouroboros.Network.IOManager (IOManager) -import Ouroboros.Network.NodeToNode (NodeToNodeVersion, RemoteConnectionId) +import Cardano.Network.NodeToNode (NodeToNodeVersion, RemoteConnectionId) import Ouroboros.Network.Protocol.Handshake.Type (Handshake) import Ouroboros.Network.Protocol.TxSubmission2.Type (TxSubmission2) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Script/Env.hs b/bench/tx-generator/src/Cardano/Benchmarking/Script/Env.hs index 4f82cfb6d1f..8eec3e43321 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Script/Env.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Script/Env.hs @@ -76,7 +76,7 @@ import Cardano.Node.Protocol.Types (SomeConsensusProtocol) import Cardano.TxGenerator.PlutusContext (PlutusBudgetSummary) import Cardano.TxGenerator.Setup.NixService as Nix (NixServiceOptions) import Cardano.TxGenerator.Types (TxGenError (..)) -import Ouroboros.Network.NodeToClient (IOManager) +import Cardano.Network.NodeToClient (IOManager) import Prelude diff --git a/cardano-node/src/Cardano/Node/Configuration/Socket.hs b/cardano-node/src/Cardano/Node/Configuration/Socket.hs index f0de1bbb3f2..ed15f8661ed 100644 --- a/cardano-node/src/Cardano/Node/Configuration/Socket.hs +++ b/cardano-node/src/Cardano/Node/Configuration/Socket.hs @@ -26,7 +26,7 @@ import qualified Network.Socket as Socket import Cardano.Node.Configuration.NodeAddress -import Ouroboros.Network.NodeToClient (LocalAddress (..), LocalSocket (..)) +import Cardano.Network.NodeToClient (LocalAddress (..), LocalSocket (..)) #if !defined(mingw32_HOST_OS) import System.Directory (removeFile) diff --git a/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs b/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs index 201c3aa499b..0f6d2085a23 100644 --- a/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs +++ b/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs @@ -47,7 +47,7 @@ import Cardano.Node.Configuration.POM (NodeConfiguration (..)) import Cardano.Node.Startup (StartupTrace (..)) import Cardano.Node.Types import Cardano.Tracing.OrphanInstances.Network () -import Ouroboros.Network.NodeToNode (DiffusionMode (..), PeerAdvertise (..)) +import Cardano.Network.NodeToNode (DiffusionMode (..), PeerAdvertise (..)) import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSnapshot (..), UseLedgerPeers (..), RelayAccessPoint (..)) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (..), @@ -320,7 +320,7 @@ readTopologyFile NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, "Bootstrap peers (field 'bootstrapPeers') are not compatible " <> "with Genesis syncing mode, reverting to 'DontUseBootstrapPeers'. " <> "Big ledger peers will be leveraged for decentralized syncing - it " - <> "is recommened to provide an up-to-date big ledger peer snapshot file " + <> "is recommended to provide an up-to-date big ledger peer snapshot file " <> "(field 'peerSnapshotFile' in topology configuration) to facilitate " <> "this process." handlerBootstrap :: Text diff --git a/cardano-node/src/Cardano/Node/Queries.hs b/cardano-node/src/Cardano/Node/Queries.hs index 7bb1c364f3e..dfb5623a290 100644 --- a/cardano-node/src/Cardano/Node/Queries.hs +++ b/cardano-node/src/Cardano/Node/Queries.hs @@ -71,8 +71,8 @@ import qualified Ouroboros.Consensus.Storage.ChainDB as ChainDB import Ouroboros.Consensus.TypeFamilyWrappers import Ouroboros.Consensus.Util.Orphans () import qualified Ouroboros.Network.AnchoredFragment as AF -import Ouroboros.Network.NodeToClient (LocalConnectionId) -import Ouroboros.Network.NodeToNode (RemoteAddress, RemoteConnectionId) +import Cardano.Network.NodeToClient (LocalConnectionId) +import Cardano.Network.NodeToNode (RemoteAddress, RemoteConnectionId) import Control.Monad.STM (atomically) import Data.ByteString (ByteString) diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index edc43f58078..417a2068155 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -107,8 +107,8 @@ import qualified Ouroboros.Network.Diffusion as Diffusion import qualified Ouroboros.Network.Diffusion.Types as Diffusion import qualified Ouroboros.Network.Diffusion.Configuration as Configuration import Ouroboros.Network.Mux (noBindForkPolicy, responderForkPolicy, ForkPolicy) -import Ouroboros.Network.NodeToClient (LocalAddress (..), LocalSocket (..)) -import Ouroboros.Network.NodeToNode (AcceptedConnectionsLimit (..), ConnectionId, +import Cardano.Network.NodeToClient (LocalAddress (..), LocalSocket (..)) +import Cardano.Network.NodeToNode (AcceptedConnectionsLimit (..), ConnectionId, PeerSelectionTargets (..), RemoteAddress) import Ouroboros.Network.PeerSelection.Governor.Types (PeerSelectionState, PublicPeerSelectionState, makePublicPeerSelectionStateVar, BootstrapPeersCriticalTimeoutError) diff --git a/cardano-node/src/Cardano/Node/Startup.hs b/cardano-node/src/Cardano/Node/Startup.hs index e6ec33a8d74..c0a570b7fef 100644 --- a/cardano-node/src/Cardano/Node/Startup.hs +++ b/cardano-node/src/Cardano/Node/Startup.hs @@ -40,8 +40,8 @@ import Ouroboros.Consensus.Node.NetworkProtocolVersion (BlockNodeToCli BlockNodeToNodeVersion) import Ouroboros.Consensus.Shelley.Ledger.Ledger (shelleyLedgerGenesis) import Ouroboros.Network.Magic (NetworkMagic (..)) -import Ouroboros.Network.NodeToClient (NodeToClientVersion) -import Ouroboros.Network.NodeToNode (DiffusionMode (..), NodeToNodeVersion, PeerAdvertise) +import Cardano.Network.NodeToClient (NodeToClientVersion) +import Cardano.Network.NodeToNode (DiffusionMode (..), NodeToNodeVersion, PeerAdvertise) import Ouroboros.Network.PeerSelection.LedgerPeers.Type (UseLedgerPeers) import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency, WarmValency) diff --git a/cardano-node/src/Cardano/Node/Tracing/API.hs b/cardano-node/src/Cardano/Node/Tracing/API.hs index e33d1c88915..be3d35535fb 100644 --- a/cardano-node/src/Cardano/Node/Tracing/API.hs +++ b/cardano-node/src/Cardano/Node/Tracing/API.hs @@ -32,8 +32,8 @@ import Ouroboros.Consensus.Node.GSM import Ouroboros.Network.Block import Ouroboros.Network.ConnectionId (ConnectionId) import Ouroboros.Network.Magic (NetworkMagic) -import Ouroboros.Network.NodeToClient (LocalAddress, withIOManager) -import Ouroboros.Network.NodeToNode (RemoteAddress) +import Cardano.Network.NodeToClient (LocalAddress, withIOManager) +import Cardano.Network.NodeToNode (RemoteAddress) import Prelude diff --git a/cardano-node/src/Cardano/Node/Tracing/Consistency.hs b/cardano-node/src/Cardano/Node/Tracing/Consistency.hs index 8f1a4f3da4c..a3213ff21b1 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Consistency.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Consistency.hs @@ -68,12 +68,12 @@ import Ouroboros.Network.Driver.Simple (TraceSendRecv) import qualified Ouroboros.Network.Driver.Stateful as Stateful (TraceSendRecv) import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) -import qualified Ouroboros.Network.NodeToClient as NtC -import Ouroboros.Network.NodeToNode (RemoteAddress) -import qualified Ouroboros.Network.NodeToNode as NtN +import Cardano.Network.NodeToNode (RemoteAddress) +import qualified Cardano.Network.NodeToNode as NtN import Ouroboros.Network.PeerSelection.Churn (ChurnCounters) import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), - PeerSelectionCounters, TracePeerSelection (..)) + PeerSelectionCounters) +import Ouroboros.Network.PeerSelection.Governor.Types (TracePeerSelection) import Ouroboros.Network.PeerSelection.LedgerPeers (TraceLedgerPeers) import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..)) import Ouroboros.Network.PeerSelection.RootPeersDNS.LocalRootPeers @@ -96,7 +96,6 @@ import Ouroboros.Network.TxSubmission.Inbound (TraceTxSubmissionInboun import Ouroboros.Network.TxSubmission.Outbound (TraceTxSubmissionOutbound) import qualified Data.Text as T -import qualified Network.Mux as Mux import qualified Network.Socket as Socket diff --git a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs index 1658bed634d..4fa07dbb9bd 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs @@ -82,8 +82,8 @@ import Ouroboros.Network.Driver.Simple (TraceSendRecv) import qualified Ouroboros.Network.Driver.Stateful as Stateful (TraceSendRecv) import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) -import Ouroboros.Network.NodeToNode (RemoteAddress) -import qualified Ouroboros.Network.NodeToNode as NtN +import Cardano.Network.NodeToNode (RemoteAddress) +import qualified Cardano.Network.NodeToNode as NtN import Ouroboros.Network.PeerSelection.Churn (ChurnCounters (..)) import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), PeerSelectionCounters, TracePeerSelection (..)) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers.hs index 485d28e71f0..249ea520156 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers.hs @@ -53,8 +53,6 @@ import Ouroboros.Network.Block import qualified Ouroboros.Network.BlockFetch.ClientState as BlockFetch import Ouroboros.Network.ConnectionId (ConnectionId) import qualified Ouroboros.Network.Diffusion as Diffusion -import Ouroboros.Network.NodeToClient (LocalAddress) -import Ouroboros.Network.NodeToNode (RemoteAddress) import Codec.CBOR.Read (DeserialiseFailure) import Control.Monad (unless) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs index 709beae76b4..7142b3c07f6 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs @@ -28,7 +28,7 @@ import qualified Ouroboros.Network.ConnectionManager.Types as ConnectionManager import Ouroboros.Network.InboundGovernor as InboundGovernor (Trace (..)) import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.InboundGovernor.State as InboundGovernor (Counters (..)) -import qualified Ouroboros.Network.NodeToNode as NtN +import qualified Cardano.Network.NodeToNode as NtN import Ouroboros.Network.OrphanInstances () import Ouroboros.Network.PeerSelection.Churn (ChurnCounters (..)) import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs index 379d7820f77..7f877112caa 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs @@ -40,8 +40,8 @@ import Ouroboros.Consensus.HardFork.Combinator.Degenerate (HardForkLed import Ouroboros.Consensus.Node.NetworkProtocolVersion import Ouroboros.Consensus.Node.ProtocolInfo (ProtocolInfo (..)) import Ouroboros.Consensus.Shelley.Ledger.Ledger (shelleyLedgerGenesis) -import Ouroboros.Network.NodeToClient (LocalAddress (..)) -import Ouroboros.Network.NodeToNode (DiffusionMode (..)) +import Cardano.Network.NodeToClient (LocalAddress (..)) +import Cardano.Network.NodeToNode (DiffusionMode (..)) import Ouroboros.Network.PeerSelection.LedgerPeers.Type (AfterSlot (..), UseLedgerPeers (..)) diff --git a/cardano-node/src/Cardano/Node/Types.hs b/cardano-node/src/Cardano/Node/Types.hs index 321d038cdc1..240a8f4def1 100644 --- a/cardano-node/src/Cardano/Node/Types.hs +++ b/cardano-node/src/Cardano/Node/Types.hs @@ -47,7 +47,7 @@ import qualified Cardano.Crypto.Hash as Crypto import Cardano.Network.ConsensusMode (ConsensusMode (..)) import Cardano.Node.Configuration.Socket (SocketConfig (..)) import Cardano.Node.Orphans () -import Ouroboros.Network.NodeToNode (DiffusionMode (..)) +import Cardano.Network.NodeToNode (DiffusionMode (..)) import Control.Exception import Data.Aeson diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs index f77dc4092aa..8cb0df80666 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @@ -23,7 +23,7 @@ module Cardano.Tracing.OrphanInstances.Network import Cardano.Network.Diffusion (CardanoDebugPeerSelection, CardanoPeerSelectionCounters, CardanoTraceLocalRootPeers, CardanoTracePeerSelection, TraceChurnMode (..)) -import Cardano.Network.OrphanInstances () +import Ouroboros.Network.OrphanInstances () import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano.PublicRootPeers import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionState as Cardano import qualified Cardano.Network.PeerSelection.Governor.Types as Cardano @@ -55,11 +55,11 @@ import qualified Ouroboros.Network.Driver.Stateful as Stateful import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import qualified Ouroboros.Network.InboundGovernor.State as InboundGovernor import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) -import Ouroboros.Network.NodeToClient (NodeToClientVersion (..)) -import qualified Ouroboros.Network.NodeToClient as NtC -import Ouroboros.Network.NodeToNode (NodeToNodeVersion (..), RemoteAddress, +import Cardano.Network.NodeToClient (NodeToClientVersion (..)) +import qualified Cardano.Network.NodeToClient as NtC +import Cardano.Network.NodeToNode (NodeToNodeVersion (..), RemoteAddress, TraceSendRecv (..)) -import qualified Ouroboros.Network.NodeToNode as NtN +import qualified Cardano.Network.NodeToNode as NtN import Ouroboros.Network.OrphanInstances () import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), DebugPeerSelectionState (..), PeerSelectionCounters, PeerSelectionState (..), diff --git a/cardano-node/src/Cardano/Tracing/Tracers.hs b/cardano-node/src/Cardano/Tracing/Tracers.hs index 869a3015eed..953b089cce5 100644 --- a/cardano-node/src/Cardano/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Tracing/Tracers.hs @@ -101,8 +101,8 @@ import qualified Ouroboros.Network.Diffusion as Diffusion import qualified Ouroboros.Network.Driver.Stateful as Stateful import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.InboundGovernor.State as InboundGovernor -import Ouroboros.Network.NodeToClient (LocalAddress) -import Ouroboros.Network.NodeToNode (RemoteAddress) +import Cardano.Network.NodeToClient (LocalAddress) +import Cardano.Network.NodeToNode (RemoteAddress) import Ouroboros.Network.PeerSelection.Churn (ChurnCounters (..)) import Ouroboros.Network.PeerSelection.Governor ( PeerSelectionView (..)) diff --git a/cardano-node/test/Test/Cardano/Node/Gen.hs b/cardano-node/test/Test/Cardano/Node/Gen.hs index d2fd8220b49..d62cfc7b31c 100644 --- a/cardano-node/test/Test/Cardano/Node/Gen.hs +++ b/cardano-node/test/Test/Cardano/Node/Gen.hs @@ -29,7 +29,7 @@ import Cardano.Node.Configuration.TopologyP2P (LocalRootPeersGroup (.. PeerAdvertise (..), PublicRootPeers (..), RootConfig (..)) import Cardano.Node.Types import Cardano.Slotting.Slot (SlotNo (..)) -import Ouroboros.Network.NodeToNode.Version +import Cardano.Network.NodeToNode.Version import Ouroboros.Network.PeerSelection.LedgerPeers.Type (AfterSlot (..), UseLedgerPeers (..)) import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) diff --git a/cardano-node/test/Test/Cardano/Node/POM.hs b/cardano-node/test/Test/Cardano/Node/POM.hs index d4de440fbd7..b3ac51bb555 100644 --- a/cardano-node/test/Test/Cardano/Node/POM.hs +++ b/cardano-node/test/Test/Cardano/Node/POM.hs @@ -22,8 +22,8 @@ import Ouroboros.Consensus.Storage.LedgerDB.Args import Ouroboros.Consensus.Storage.LedgerDB.Snapshots (NumOfDiskSnapshots (..), SnapshotInterval (..)) import Ouroboros.Network.Block (SlotNo (..)) -import Ouroboros.Network.Diffusion.Configuration (ConsensusMode (..)) -import Ouroboros.Network.NodeToNode (AcceptedConnectionsLimit (..), +import Cardano.Network.ConsensusMode (ConsensusMode (..)) +import Cardano.Network.NodeToNode (AcceptedConnectionsLimit (..), DiffusionMode (InitiatorAndResponderDiffusionMode)) import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) diff --git a/cardano-testnet/src/Testnet/Defaults.hs b/cardano-testnet/src/Testnet/Defaults.hs index e93e7b17aa1..bfdaa4cf6c0 100644 --- a/cardano-testnet/src/Testnet/Defaults.hs +++ b/cardano-testnet/src/Testnet/Defaults.hs @@ -71,7 +71,7 @@ import Cardano.Node.Configuration.TopologyP2P (LocalRootPeersGroup (.. import qualified Cardano.Node.Configuration.TopologyP2P as P2P import qualified Cardano.Node.Configuration.TopologyP2P as Topology import Cardano.Tracing.Config -import Ouroboros.Network.NodeToNode (DiffusionMode (..)) +import Cardano.Network.NodeToNode (DiffusionMode (..)) import Ouroboros.Network.PeerSelection (AfterSlot (..), PeerAdvertise (..), RelayAccessPoint (..), UseLedgerPeers (..)) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (..), diff --git a/cardano-tracer/src/Cardano/Tracer/Handlers/ReForwarder.hs b/cardano-tracer/src/Cardano/Tracer/Handlers/ReForwarder.hs index b94e072ab29..b3ca20a6a6e 100644 --- a/cardano-tracer/src/Cardano/Tracer/Handlers/ReForwarder.hs +++ b/cardano-tracer/src/Cardano/Tracer/Handlers/ReForwarder.hs @@ -24,7 +24,7 @@ import Cardano.Tracer.Configuration import Cardano.Tracer.Handlers.Utils (normalizeNamespace) import Cardano.Tracer.MetaTrace import Ouroboros.Network.Magic (NetworkMagic (..)) -import Ouroboros.Network.NodeToClient (withIOManager) +import Cardano.Network.NodeToClient (withIOManager) import Control.Exception (SomeException (..)) import Control.Monad (when) diff --git a/cardano-tracer/test/cardano-tracer-test-ext.hs b/cardano-tracer/test/cardano-tracer-test-ext.hs index 244e6b8c65f..2341361362b 100644 --- a/cardano-tracer/test/cardano-tracer-test-ext.hs +++ b/cardano-tracer/test/cardano-tracer-test-ext.hs @@ -9,7 +9,7 @@ import Cardano.Tracer.Test.ForwardingStressTest.Script import Cardano.Tracer.Test.ForwardingStressTest.Types import Cardano.Tracer.Test.Utils import Ouroboros.Network.Magic (NetworkMagic (..)) -import Ouroboros.Network.NodeToClient (withIOManager) +import Cardano.Network.NodeToClient (withIOManager) import Control.Concurrent (threadDelay) import Control.Exception From f53cfc74fced27e671184702813e4776f6563f6e Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 6 Jan 2026 10:04:21 +0100 Subject: [PATCH 10/54] Integrate tracing changes - Use keyrole types instead of promoted constructors - tracing: remove ouroboros-network:framework-tracing Network.Mux - tracing: remove ouroboros-network:framework-tracing Ouroboros.Network - tracing: remove ouroboros-network:tracing - integrate new Ledger traces - use ToJSON to get ToObject for ApplyTxError - Add instance ToObject TxDecision - Fill in LSM traces and reason for switch (#6469) Co-authored-by: Federico Mastellone Co-authored-by: Javier Sagredo --- cardano-node/app/cardano-node.hs | 1 + cardano-node/cardano-node.cabal | 3 +- .../Cardano/Node/Configuration/LedgerDB.hs | 76 +- .../src/Cardano/Node/Configuration/POM.hs | 13 +- .../src/Cardano/Node/Protocol/Byron.hs | 7 +- .../src/Cardano/Node/Protocol/Cardano.hs | 1 + .../src/Cardano/Node/Protocol/Shelley.hs | 3 + .../src/Cardano/Node/Protocol/Types.hs | 4 + cardano-node/src/Cardano/Node/Run.hs | 26 +- .../src/Cardano/Node/TraceConstraints.hs | 16 +- cardano-node/src/Cardano/Node/Tracing/API.hs | 1 + .../src/Cardano/Node/Tracing/Consistency.hs | 34 +- .../src/Cardano/Node/Tracing/Documentation.hs | 36 +- .../src/Cardano/Node/Tracing/Era/HardFork.hs | 12 +- .../src/Cardano/Node/Tracing/Era/Shelley.hs | 134 +- .../src/Cardano/Node/Tracing/Render.hs | 21 +- .../src/Cardano/Node/Tracing/StateRep.hs | 2 +- .../src/Cardano/Node/Tracing/Tracers.hs | 67 +- .../Cardano/Node/Tracing/Tracers/ChainDB.hs | 778 ++++-- .../Cardano/Node/Tracing/Tracers/Consensus.hs | 166 +- .../Cardano/Node/Tracing/Tracers/Diffusion.hs | 979 +------- .../Node/Tracing/Tracers/LedgerMetrics.hs | 6 +- .../Node/Tracing/Tracers/NodeToClient.hs | 137 +- .../Node/Tracing/Tracers/NodeToNode.hs | 4 - .../src/Cardano/Node/Tracing/Tracers/P2P.hs | 2104 ----------------- .../Cardano/Node/Tracing/Tracers/Startup.hs | 1 + cardano-node/src/Cardano/Tracing/Config.hs | 18 + cardano-node/src/Cardano/Tracing/HasIssuer.hs | 4 +- .../Tracing/OrphanInstances/Consensus.hs | 98 +- .../Tracing/OrphanInstances/HardFork.hs | 12 +- .../Tracing/OrphanInstances/Network.hs | 224 +- .../Tracing/OrphanInstances/Shelley.hs | 126 +- cardano-node/src/Cardano/Tracing/Tracers.hs | 108 +- 33 files changed, 1262 insertions(+), 3960 deletions(-) delete mode 100644 cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs diff --git a/cardano-node/app/cardano-node.hs b/cardano-node/app/cardano-node.hs index f18175f9497..08d3fd5dcae 100644 --- a/cardano-node/app/cardano-node.hs +++ b/cardano-node/app/cardano-node.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TemplateHaskell #-} diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 730ced8dc22..12e9dce2fac 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -111,7 +111,6 @@ library Cardano.Node.Tracing.Tracers.NodeToClient Cardano.Node.Tracing.Tracers.NodeToNode Cardano.Node.Tracing.Tracers.NodeVersion - Cardano.Node.Tracing.Tracers.P2P Cardano.Node.Tracing.Tracers.Resources Cardano.Node.Tracing.Tracers.Shutdown Cardano.Node.Tracing.Tracers.Startup @@ -139,6 +138,7 @@ library , base16-bytestring , bytestring , cardano-api ^>= 10.24.1 + , cardano-data , cardano-crypto-class ^>=2.3 , cardano-crypto-wrapper , cardano-git-rev ^>=0.2.2 @@ -165,7 +165,6 @@ library , ekg-wai , ekg-core , filepath - , formatting , generic-data , hashable , hostname diff --git a/cardano-node/src/Cardano/Node/Configuration/LedgerDB.hs b/cardano-node/src/Cardano/Node/Configuration/LedgerDB.hs index f43c5029725..32ea7e9143c 100644 --- a/cardano-node/src/Cardano/Node/Configuration/LedgerDB.hs +++ b/cardano-node/src/Cardano/Node/Configuration/LedgerDB.hs @@ -1,28 +1,35 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralisedNewtypeDeriving #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeApplications #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Node.Configuration.LedgerDB ( - DeprecatedOptions (..) - , LedgerDbConfiguration (..) - , LedgerDbSelectorFlag(..) - , Gigabytes - , noDeprecatedOptions - , selectorToArgs - ) where + DeprecatedOptions (..), + LedgerDbConfiguration (..), + LedgerDbSelectorFlag (..), + Gigabytes, + noDeprecatedOptions, + selectorToArgs, +) where +import Ouroboros.Consensus.Ledger.SupportsProtocol +import Ouroboros.Consensus.Storage.LedgerDB.API import Ouroboros.Consensus.Storage.LedgerDB.Args import Ouroboros.Consensus.Storage.LedgerDB.Snapshots import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.Args as V1 -import Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB (LMDBLimits (..)) -import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.Args as V2 -import Ouroboros.Consensus.Util.Args +import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB as LMDB +import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory as InMemory +import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.LSM as LSM import qualified Data.Aeson.Types as Aeson (FromJSON) import Data.Maybe (fromMaybe) -import Data.SOP.Dict +import Data.Proxy +import System.FilePath +import System.Random (StdGen) -- | Choose the LedgerDB Backend -- @@ -34,21 +41,25 @@ import Data.SOP.Dict -- -- - 'V1LMDB': uses less memory but is somewhat slower. -- --- - 'V1InMemory': Not intended for production. It is an in-memory reproduction --- of the LMDB implementation. +-- - 'V2LSM': Uses the LSM backend. data LedgerDbSelectorFlag = V1LMDB V1.FlushFrequency -- ^ The frequency at which changes are flushed to the disk. (Maybe FilePath) - -- ^ Path for the live tables. + -- ^ Path for the live tables. If not provided the default will be used + -- (@/lmdb@). (Maybe Gigabytes) -- ^ A map size can be specified, this is the maximum disk space the LMDB -- database can fill. If not provided, the default of 16GB will be used. (Maybe Int) -- ^ An override to the max number of readers. - | V1InMemory V1.FlushFrequency | V2InMemory + | V2LSM + (Maybe FilePath) + -- ^ Maybe a custom path to the LSM database. If not provided the default + -- will be used (@/lsm@). + deriving (Eq, Show) -- | Some options that existed in the TopLevel were now moved to a @@ -118,24 +129,23 @@ toBytes (Gigabytes x) = x * 1024 * 1024 * 1024 -- * The @lmdb-simple@ and @haskell-lmdb@ forked repositories. -- * The official LMDB API documentation at -- . -defaultLMDBLimits :: LMDBLimits -defaultLMDBLimits = LMDBLimits { - lmdbMapSize = 16 * 1024 * 1024 * 1024 - , lmdbMaxDatabases = 10 - , lmdbMaxReaders = 16 +defaultLMDBLimits :: LMDB.LMDBLimits +defaultLMDBLimits = LMDB.LMDBLimits { + LMDB.lmdbMapSize = 16 * 1024 * 1024 * 1024 + , LMDB.lmdbMaxDatabases = 10 + , LMDB.lmdbMaxReaders = 16 } -defaultLMDBPath :: FilePath -defaultLMDBPath = "mainnet/db/lmdb" +defaultLMDBPath :: FilePath -> FilePath +defaultLMDBPath = ( "lmdb") -selectorToArgs :: LedgerDbSelectorFlag -> Complete LedgerDbFlavorArgs IO -selectorToArgs (V1InMemory ff) = LedgerDbFlavorArgsV1 $ V1.V1Args ff V1.InMemoryBackingStoreArgs -selectorToArgs V2InMemory = LedgerDbFlavorArgsV2 $ V2.V2Args V2.InMemoryHandleArgs -selectorToArgs (V1LMDB ff fp l mxReaders) = - LedgerDbFlavorArgsV1 - $ V1.V1Args ff - $ V1.LMDBBackingStoreArgs - (fromMaybe defaultLMDBPath fp) - (maybe id (\overrideMaxReaders lim -> lim { lmdbMaxReaders = overrideMaxReaders }) mxReaders - $ maybe id (\ll lim -> lim { lmdbMapSize = toBytes ll }) l defaultLMDBLimits) - Dict +selectorToArgs :: forall blk. (LedgerSupportsProtocol blk, LedgerSupportsLedgerDB blk) => LedgerDbSelectorFlag -> FilePath -> StdGen -> (LedgerDbBackendArgs IO blk, StdGen) +selectorToArgs V2InMemory _ = InMemory.mkInMemoryArgs +selectorToArgs (V1LMDB ff fp l mxReaders) fastStoragePath = + LMDB.mkLMDBArgs + ff + (fromMaybe (defaultLMDBPath fastStoragePath) fp) + ( maybe id (\overrideMaxReaders lim -> lim{LMDB.lmdbMaxReaders = overrideMaxReaders}) mxReaders $ + maybe id (\ll lim -> lim{LMDB.lmdbMapSize = toBytes ll}) l defaultLMDBLimits + ) +selectorToArgs (V2LSM fp) fastStoragePath = LSM.mkLSMArgs (Proxy @blk) (fromMaybe "lsm" fp) fastStoragePath diff --git a/cardano-node/src/Cardano/Node/Configuration/POM.hs b/cardano-node/src/Cardano/Node/Configuration/POM.hs index 13f9052837d..b0c488e3dd3 100644 --- a/cardano-node/src/Cardano/Node/Configuration/POM.hs +++ b/cardano-node/src/Cardano/Node/Configuration/POM.hs @@ -28,7 +28,8 @@ where import Cardano.Crypto (RequiresNetworkMagic (..)) import Cardano.Logging.Types import qualified Cardano.Network.Diffusion.Configuration as Cardano -import Cardano.Network.Types (NumberOfBigLedgerPeers (..)) +import Cardano.Network.PeerSelection (NumberOfBigLedgerPeers (..)) +import Cardano.Network.ConsensusMode (ConsensusMode(..), defaultConsensusMode) import Cardano.Node.Configuration.LedgerDB import Cardano.Node.Configuration.Socket (SocketConfig (..)) import Cardano.Node.Handlers.Shutdown @@ -500,9 +501,6 @@ instance FromJSON PartialNodeConfiguration where qsize <- (fmap RequestedQueryBatchSize <$> o .:? "QueryBatchSize") .!= DefaultQueryBatchSize backend <- o .:? "Backend" .!= "V2InMemory" selector <- case backend of - "V1InMemory" -> do - flush <- (fmap RequestedFlushFrequency <$> o .:? "FlushFrequency") .!= DefaultFlushFrequency - return $ V1InMemory flush "V1LMDB" -> do flush <- (fmap RequestedFlushFrequency <$> o .:? "FlushFrequency") .!= DefaultFlushFrequency mapSize :: Maybe Gigabytes <- o .:? "MapSize" @@ -510,6 +508,9 @@ instance FromJSON PartialNodeConfiguration where mxReaders :: Maybe Int <- o .:? "MaxReaders" return $ V1LMDB flush lmdbPath mapSize mxReaders "V2InMemory" -> return V2InMemory + "V2LSM" -> do + lsmPath :: Maybe FilePath <- o .:? "LSMDatabasePath" + pure $ V2LSM lsmPath _ -> fail $ "Malformed LedgerDB Backend: " <> backend pure $ Just $ LedgerDbConfiguration ldbSnapNum ldbSnapInterval qsize selector deprecatedOpts @@ -717,7 +718,7 @@ defaultPartialNodeConfiguration = , pncMinBigLedgerPeersForTrustedState = Last (Just Cardano.defaultNumberOfBigLedgerPeers) -- https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/cardano-diffusion/Cardano-Network-Diffusion-Configuration.html#v:defaultNumberOfBigLedgerPeers - , pncConsensusMode = Last (Just Ouroboros.defaultConsensusMode) + , pncConsensusMode = Last (Just defaultConsensusMode) -- https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/Ouroboros-Network-Diffusion-Configuration.html#v:defaultConsensusMode , pncPeerSharing = mempty -- the default is defined in `makeNodeConfiguration` @@ -821,7 +822,7 @@ makeNodeConfiguration pnc = do , getLast (pncMempoolTimeoutHard pnc) , getLast (pncMempoolTimeoutCapacity pnc) ) - (ncMempoolTimeoutSoft, ncMempoolTimeoutHard, ncMempoolTimeoutCapacity) <- + (ncMempoolTimeoutSoft, ncMempoolTimeoutHard, ncMempoolTimeoutCapacity) <- case mempoolTimeouts of (Just s, Just h, Just c) -> pure (s, h, c) (Nothing, Nothing, Nothing) -> pure (1, 1.5, 5) diff --git a/cardano-node/src/Cardano/Node/Protocol/Byron.hs b/cardano-node/src/Cardano/Node/Protocol/Byron.hs index 7b53ff28e4c..50155342fd6 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Byron.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Byron.hs @@ -1,5 +1,6 @@ -{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE NamedFieldPuns #-} module Cardano.Node.Protocol.Byron @@ -35,12 +36,12 @@ import Cardano.Tracing.OrphanInstances.HardFork () import Cardano.Tracing.OrphanInstances.Shelley () import Ouroboros.Consensus.Cardano import qualified Ouroboros.Consensus.Cardano as Consensus +import Ouroboros.Consensus.HardFork.Combinator.AcrossEras () import Control.Exception import qualified Data.ByteString.Lazy as LB import Data.Maybe (fromMaybe) - ------------------------------------------------------------------------------ -- Byron protocol -- @@ -167,7 +168,7 @@ data ByronProtocolInstantiationError = | SigningKeyFilepathNotSpecified deriving Show -instance Exception ByronProtocolInstantiationError where +instance Exception ByronProtocolInstantiationError where displayException = docToString . prettyError instance Error ByronProtocolInstantiationError where diff --git a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs index e4efea5ab0a..513465bbe65 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs @@ -37,6 +37,7 @@ import qualified Ouroboros.Consensus.Cardano as Consensus import Ouroboros.Consensus.Cardano.Condense () import qualified Ouroboros.Consensus.Cardano.Node as Consensus import Ouroboros.Consensus.HardFork.Combinator.Condense () +import Ouroboros.Consensus.HardFork.Combinator.AcrossEras () import Prelude diff --git a/cardano-node/src/Cardano/Node/Protocol/Shelley.hs b/cardano-node/src/Cardano/Node/Protocol/Shelley.hs index 4cec1a0f8e3..e52d6f39324 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Shelley.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Shelley.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NamedFieldPuns #-} @@ -42,6 +43,7 @@ import qualified Ouroboros.Consensus.Cardano as Consensus import Ouroboros.Consensus.Protocol.Praos.Common (PraosCanBeLeader (..), PraosCredentialsSource (..)) import Ouroboros.Consensus.Shelley.Node (Nonce (..), ProtocolParamsShelleyBased (..), ShelleyLeaderCredentials (..)) +import Ouroboros.Consensus.HardFork.Combinator.AcrossEras () import Control.Exception (IOException) import Control.Monad @@ -51,6 +53,7 @@ import qualified Data.Text as T import System.Directory (getFileSize) import qualified System.IO.MMap as MMap + ------------------------------------------------------------------------------ -- Shelley protocol -- diff --git a/cardano-node/src/Cardano/Node/Protocol/Types.hs b/cardano-node/src/Cardano/Node/Protocol/Types.hs index 26220b9999f..a62c23d4cbf 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Types.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Types.hs @@ -17,6 +17,8 @@ import Cardano.Node.Orphans () import Cardano.Node.Queries (HasKESInfo, HasKESMetricsData) import Cardano.Node.TraceConstraints (TraceConstraints) +import Ouroboros.Network.Block (HeaderHash) + import Control.DeepSeq (NFData) import Data.Aeson import GHC.Generics (Generic) @@ -45,6 +47,8 @@ data SomeConsensusProtocol where , HasKESMetricsData blk , HasKESInfo blk , TraceConstraints blk + , Api.ToCBOR (HeaderHash blk) + , Api.FromCBOR (HeaderHash blk) ) => Api.BlockType blk -> Api.ProtocolInfoArgs blk diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 417a2068155..3102f6018c0 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} @@ -64,11 +65,12 @@ import Cardano.Prelude (ExitCode (..), FatalError (..), bool, (:~:) (. import Cardano.Slotting.Slot (WithOrigin (..)) import Cardano.Tracing.Config (TraceOptions (..), TraceSelection (..)) import Cardano.Tracing.Tracers +import Cardano.Logging.Types (LogFormatting) import qualified Ouroboros.Consensus.Config as Consensus import Ouroboros.Consensus.Config.SupportsNode (ConfigSupportsNode (..)) import Ouroboros.Consensus.Node (SnapshotPolicyArgs (..), - NodeDatabasePaths (..), RunNodeArgs (..), StdRunNodeArgs (..)) + NodeDatabasePaths (..), nonImmutableDbPath, RunNodeArgs (..), StdRunNodeArgs (..)) import Ouroboros.Consensus.Protocol.Praos.AgentClient (KESAgentClientTrace) import Ouroboros.Consensus.Ledger.SupportsMempool (GenTxId) import Ouroboros.Consensus.Node (RunNodeArgs (..), @@ -79,7 +81,6 @@ import Ouroboros.Consensus.Node.NetworkProtocolVersion import Ouroboros.Consensus.Node.ProtocolInfo import qualified Ouroboros.Consensus.Node.Tracers as Consensus import qualified Ouroboros.Consensus.Storage.LedgerDB.Args as LDBArgs -import Ouroboros.Consensus.Storage.LedgerDB.V2.Args import Ouroboros.Consensus.Util.Args import Ouroboros.Consensus.Util.Orphans () @@ -100,8 +101,9 @@ import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionActions as import qualified Cardano.Network.LedgerPeerConsensusInterface as Cardano import qualified Cardano.Network.PeerSelection.PeerSelectionActions as Cardano import qualified Cardano.Network.PeerSelection.Churn as Cardano.Churn -import Cardano.Network.Types (NumberOfBigLedgerPeers (..)) +import Cardano.Network.PeerSelection (NumberOfBigLedgerPeers (..)) +import Ouroboros.Network.Block (HeaderHash) import Ouroboros.Network.BlockFetch (FetchMode) import qualified Ouroboros.Network.Diffusion as Diffusion import qualified Ouroboros.Network.Diffusion.Types as Diffusion @@ -113,7 +115,7 @@ import Cardano.Network.NodeToNode (AcceptedConnectionsLimit (..), Conn import Ouroboros.Network.PeerSelection.Governor.Types (PeerSelectionState, PublicPeerSelectionState, makePublicPeerSelectionStateVar, BootstrapPeersCriticalTimeoutError) import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSnapshot (..), - UseLedgerPeers (..), AfterSlot (..)) + UseLedgerPeers (..), AfterSlot (..), LedgerPeersKind(..)) import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) import Ouroboros.Network.PeerSelection.RootPeersDNS.PublicRootPeers (TracePublicRootPeers) @@ -515,7 +517,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do let diffusionNodeArguments :: Cardano.Diffusion.CardanoNodeArguments IO diffusionNodeArguments = Cardano.Diffusion.CardanoNodeArguments { Cardano.Diffusion.consensusMode = ncConsensusMode nc, - Cardano.Diffusion.genesisPeerTargets = + Cardano.Diffusion.genesisPeerSelectionTargets = PeerSelectionTargets { targetNumberOfRootPeers = ncSyncTargetOfRootPeers nc, targetNumberOfKnownPeers = ncSyncTargetOfKnownPeers nc, @@ -566,7 +568,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do , srnChainSyncIdleTimeout = customizeChainSyncTimeout , srnSnapshotPolicyArgs = snapshotPolicyArgs , srnQueryBatchSize = queryBatchSize - , srnLdbFlavorArgs = selectorToArgs ldbBackend + , srnLedgerDbBackendArgs = selectorToArgs ldbBackend (nonImmutableDbPath dbPath) } where customizeChainSyncTimeout :: ChainSyncIdleTimeout @@ -649,7 +651,7 @@ installSigHUPHandler :: Tracer IO (StartupTrace blk) -> StrictTVar IO UseLedgerPeers -> StrictTVar IO UseBootstrapPeers -> StrictTVar IO (Maybe PeerSnapshotFile) - -> StrictTVar IO (Maybe LedgerPeerSnapshot) + -> StrictTVar IO (Maybe (LedgerPeerSnapshot BigLedgerPeers)) -> IO () #ifndef UNIX installSigHUPHandler _ _ _ _ _ _ _ _ _ _ _ = return () @@ -762,8 +764,8 @@ updateLedgerPeerSnapshot :: Tracer IO (StartupTrace blk) -> NodeConfiguration -> STM IO (Maybe PeerSnapshotFile) -> STM IO UseLedgerPeers - -> (Maybe LedgerPeerSnapshot -> STM IO ()) - -> IO (Maybe LedgerPeerSnapshot) + -> (Maybe (LedgerPeerSnapshot BigLedgerPeers) -> STM IO ()) + -> IO (Maybe (LedgerPeerSnapshot BigLedgerPeers)) updateLedgerPeerSnapshot startupTracer (NodeConfiguration {ncConsensusMode}) readLedgerPeerPath readUseLedgerVar writeVar = do (mPeerSnapshotFile, useLedgerPeers) <- atomically $ (,) <$> readLedgerPeerPath <*> readUseLedgerVar @@ -778,7 +780,7 @@ updateLedgerPeerSnapshot startupTracer (NodeConfiguration {ncConsensusMode}) rea snapshotFile <- hoistMaybe mPeerSnapshotFile eSnapshot <- liftIO $ readPeerSnapshotFile snapshotFile - lps@(LedgerPeerSnapshot (wOrigin, _)) <- + lps@(LedgerPeerSnapshotV2 (wOrigin, _)) <- case ncConsensusMode of GenesisMode -> MaybeT $ hushM eSnapshot (trace . NetworkConfigUpdateError) @@ -874,7 +876,7 @@ mkDiffusionConfiguration -- valency of its group. -> STM IO (Map RelayAccessPoint PeerAdvertise) -> STM IO UseLedgerPeers - -> STM IO (Maybe LedgerPeerSnapshot) + -> STM IO (Maybe (LedgerPeerSnapshot BigLedgerPeers)) -> NodeConfiguration -> Cardano.Diffusion.CardanoConfiguration IO mkDiffusionConfiguration @@ -951,7 +953,7 @@ producerAddresses RealNodeTopology { ntLocalRootPeersGroups , LocalRootConfig { diffusionMode = rootDiffusionMode lrp, peerAdvertise, - extraFlags = trustable lrp + extraLocalRootFlags = trustable lrp, } ) ) diff --git a/cardano-node/src/Cardano/Node/TraceConstraints.hs b/cardano-node/src/Cardano/Node/TraceConstraints.hs index 59c84b7bb34..a17e7bf3772 100644 --- a/cardano-node/src/Cardano/Node/TraceConstraints.hs +++ b/cardano-node/src/Cardano/Node/TraceConstraints.hs @@ -17,7 +17,7 @@ import qualified Cardano.Node.Tracing.Tracers.Consensus as ConsensusTracers import Cardano.Protocol.Crypto (StandardCrypto) import Cardano.Tracing.HasIssuer (HasIssuer) import Ouroboros.Consensus.Block (BlockProtocol, CannotForge, ForgeStateUpdateError, - GetHeader, HasHeader, Header) + GetHeader, HasHeader, Header, HeaderHash) import Ouroboros.Consensus.HeaderValidation (OtherHeaderEnvelopeError) import Ouroboros.Consensus.Ledger.Abstract (LedgerError) import Ouroboros.Consensus.Ledger.Inspect (LedgerEvent, LedgerUpdate, LedgerWarning) @@ -25,7 +25,8 @@ import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, HasTxId import Ouroboros.Consensus.Node.NetworkProtocolVersion (HasNetworkProtocolVersion (BlockNodeToClientVersion, BlockNodeToNodeVersion)) import Ouroboros.Consensus.Node.Run (RunNode, SerialiseNodeToNodeConstraints) -import Ouroboros.Consensus.Protocol.Abstract (SelectView, ValidationErr) +import Ouroboros.Consensus.Peras.SelectView +import Ouroboros.Consensus.Protocol.Abstract (SelectView, ValidationErr, SelectViewReasonForSwitch, ReasonForSwitch, TiebreakerView) import Ouroboros.Consensus.Shelley.Ledger.Mempool (GenTx, TxId) import Ouroboros.Network.Block (Serialised) @@ -53,13 +54,14 @@ type TraceConstraints blk = , ToObject (LedgerError blk) , ToObject (LedgerEvent blk) , ToObject (OtherHeaderEnvelopeError blk) - , ToObject (SelectView (BlockProtocol blk)) + , ToObject (WeightedSelectView (BlockProtocol blk)) , ToObject (ValidationErr (BlockProtocol blk)) , ToObject (CannotForge blk) , ToObject (ForgeStateUpdateError blk) , ToJSON (BlockNodeToClientVersion blk) , ToJSON (BlockNodeToNodeVersion blk) + , ToJSON (HeaderHash blk) , LogFormatting (ApplyTxErr blk) , LogFormatting (GenTx blk) @@ -68,10 +70,12 @@ type TraceConstraints blk = , LogFormatting (LedgerUpdate blk) , LogFormatting (LedgerWarning blk) , LogFormatting (OtherHeaderEnvelopeError blk) - , LogFormatting (SelectView (BlockProtocol blk)) + , LogFormatting (WeightedSelectView (BlockProtocol blk)) , LogFormatting (ValidationErr (BlockProtocol blk)) , LogFormatting (CannotForge blk) , LogFormatting (ForgeStateUpdateError blk) - , LogFormatting (Set (Credential 'Staking)) - , LogFormatting (NonEmpty.NonEmpty (KeyHash 'Staking)) + , LogFormatting (Set (Credential Staking)) + , LogFormatting (NonEmpty.NonEmpty (KeyHash Staking)) + , LogFormatting (Either (WithEmptyFragmentReasonForSwitch (WeightedSelectView (BlockProtocol blk))) (SelectViewReasonForSwitch (BlockProtocol blk))) + , LogFormatting (ReasonForSwitch (TiebreakerView (BlockProtocol blk))) ) diff --git a/cardano-node/src/Cardano/Node/Tracing/API.hs b/cardano-node/src/Cardano/Node/Tracing/API.hs index be3d35535fb..26bf2ca58b0 100644 --- a/cardano-node/src/Cardano/Node/Tracing/API.hs +++ b/cardano-node/src/Cardano/Node/Tracing/API.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MonoLocalBinds #-} diff --git a/cardano-node/src/Cardano/Node/Tracing/Consistency.hs b/cardano-node/src/Cardano/Node/Tracing/Consistency.hs index a3213ff21b1..014083c5235 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Consistency.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Consistency.hs @@ -16,6 +16,11 @@ module Cardano.Node.Tracing.Consistency import Cardano.Logging import Cardano.Logging.Resources import Cardano.Logging.Resources.Types () +import Cardano.Network.NodeToNode (RemoteAddress) +import qualified Cardano.Network.NodeToNode as NtN +import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano.PublicRootPeers +import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionState as Cardano +import qualified Cardano.Network.PeerSelection.Governor.Types as Cardano import Cardano.Network.PeerSelection.PeerTrustable (PeerTrustable) import Cardano.Node.Handlers.Shutdown (ShutdownTrace) import Cardano.Node.Startup @@ -31,12 +36,8 @@ import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics) import Cardano.Node.Tracing.Tracers.NodeToClient () import Cardano.Node.Tracing.Tracers.NodeToNode () import Cardano.Node.Tracing.Tracers.NodeVersion (NodeVersionTrace) -import Cardano.Node.Tracing.Tracers.P2P () import Cardano.Node.Tracing.Tracers.Shutdown () import Cardano.Node.Tracing.Tracers.Startup () -import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionState as Cardano -import qualified Cardano.Network.PeerSelection.Governor.Types as Cardano -import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano.PublicRootPeers import Ouroboros.Consensus.Block.SupportsSanityCheck (SanityCheckIssue) import Ouroboros.Consensus.BlockchainTime.WallClock.Types (RelativeTime) import Ouroboros.Consensus.BlockchainTime.WallClock.Util (TraceBlockchainTimeEvent (..)) @@ -68,17 +69,14 @@ import Ouroboros.Network.Driver.Simple (TraceSendRecv) import qualified Ouroboros.Network.Driver.Stateful as Stateful (TraceSendRecv) import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) -import Cardano.Network.NodeToNode (RemoteAddress) -import qualified Cardano.Network.NodeToNode as NtN -import Ouroboros.Network.PeerSelection.Churn (ChurnCounters) import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), PeerSelectionCounters) import Ouroboros.Network.PeerSelection.Governor.Types (TracePeerSelection) import Ouroboros.Network.PeerSelection.LedgerPeers (TraceLedgerPeers) import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..)) +import Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions (DNSTrace (..)) import Ouroboros.Network.PeerSelection.RootPeersDNS.LocalRootPeers (TraceLocalRootPeers (..)) -import Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions (DNSTrace (..)) import Ouroboros.Network.PeerSelection.RootPeersDNS.PublicRootPeers (TracePublicRootPeers (..)) import Ouroboros.Network.Protocol.BlockFetch.Type (BlockFetch) @@ -92,10 +90,16 @@ import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS import Ouroboros.Network.Protocol.TxSubmission2.Type (TxSubmission2) import qualified Ouroboros.Network.Server as Server (Trace (..)) import Ouroboros.Network.Snocket (LocalAddress (..)) -import Ouroboros.Network.TxSubmission.Inbound (TraceTxSubmissionInbound) +import Ouroboros.Network.TxSubmission.Inbound.V2 (TraceTxSubmissionInbound) import Ouroboros.Network.TxSubmission.Outbound (TraceTxSubmissionOutbound) +import Ouroboros.Network.Tracing.PeerSelection () +import Cardano.Network.Tracing.PeerSelection () +import Cardano.Network.Tracing.PeerSelectionCounters () +import qualified Codec.CBOR.Term as CBOR import qualified Data.Text as T +import qualified Network.Mux as Mux +import Network.Mux.Tracing () import qualified Network.Socket as Socket @@ -282,12 +286,12 @@ getAllNamespaces = dtHandshakeNS = map (nsGetTuple . nsReplacePrefix ["Net", "Handshake", "Remote"]) (allNamespaces :: [Namespace - (NtN.HandshakeTr NtN.RemoteAddress NtN.NodeToNodeVersion)]) + (Mux.WithBearer (ConnectionId ntnAddr) (TraceSendRecv (NtN.Handshake ntnVersion CBOR.Term)))]) + dtLocalHandshakeNS = map (nsGetTuple . nsReplacePrefix ["Net", "Handshake", "Local"]) (allNamespaces :: [Namespace - (NtC.HandshakeTr LocalAddress - NtC.NodeToClientVersion)]) + (Mux.WithBearer (ConnectionId ntcAddr) (TraceSendRecv (NtN.Handshake ntcVersion CBOR.Term)))]) dtDiffusionInitializationNS = map (nsGetTuple . nsReplacePrefix ["Startup", "DiffusionInit"]) (allNamespaces :: [Namespace @@ -321,10 +325,7 @@ getAllNamespaces = peerSelectionCountersNS = map (nsGetTuple . nsReplacePrefix ["Net", "PeerSelection", "Counters"]) (allNamespaces :: [Namespace - (PeerSelectionCounters (Cardano.ExtraPeerSelectionSetsWithSizes Socket.SockAddr))]) - churnCountersNS = map (nsGetTuple . nsReplacePrefix - ["Net", "Churn"]) - (allNamespaces :: [Namespace ChurnCounters]) + (PeerSelectionCounters (Cardano.ViewExtraPeers (Cardano.PublicRootPeers.ExtraPeers Socket.SockAddr)))]) peerSelectionActionsNS = map (nsGetTuple . nsReplacePrefix ["Net", "PeerSelection", "Actions"]) (allNamespaces :: [Namespace @@ -439,7 +440,6 @@ getAllNamespaces = <> debugPeerSelectionNS <> debugPeerSelectionResponderNS <> peerSelectionCountersNS - <> churnCountersNS <> peerSelectionActionsNS <> connectionManagerNS <> connectionManagerTransitionsNS diff --git a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs index 4fa07dbb9bd..94300aa0813 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs @@ -1,9 +1,9 @@ +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} -{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} @@ -20,6 +20,11 @@ module Cardano.Node.Tracing.Documentation , docTracersFirstPhase ) where +import Ouroboros.Network.Tracing.TxSubmission.Inbound () +import Ouroboros.Network.Tracing.TxSubmission.Outbound () +import Ouroboros.Network.Tracing.PeerSelection () +import Cardano.Network.Tracing.PeerSelection () +import Cardano.Network.Tracing.PeerSelectionCounters () import Cardano.Git.Rev (gitRev) import Cardano.Logging as Logging import Cardano.Logging.Resources @@ -27,7 +32,6 @@ import Cardano.Logging.Resources.Types () import Cardano.Network.PeerSelection.PeerTrustable (PeerTrustable (..)) import Cardano.Node.Handlers.Shutdown (ShutdownTrace) import Cardano.Node.Startup -import Cardano.Node.TraceConstraints import Cardano.Node.Tracing.DefaultTraceConfig (defaultCardanoConfig) import Cardano.Node.Tracing.Formatting () import Cardano.Node.Tracing.NodeInfo () @@ -44,7 +48,6 @@ import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics) import Cardano.Node.Tracing.Tracers.NodeToClient () import Cardano.Node.Tracing.Tracers.NodeToNode () import Cardano.Node.Tracing.Tracers.NodeVersion (NodeVersionTrace) -import Cardano.Node.Tracing.Tracers.P2P () import Cardano.Node.Tracing.Tracers.Shutdown () import Cardano.Node.Tracing.Tracers.Startup () import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionState as Cardano @@ -84,9 +87,8 @@ import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) import Cardano.Network.NodeToNode (RemoteAddress) import qualified Cardano.Network.NodeToNode as NtN -import Ouroboros.Network.PeerSelection.Churn (ChurnCounters (..)) import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), - PeerSelectionCounters, TracePeerSelection (..)) + PeerSelectionCounters, TracePeerSelection) import Ouroboros.Network.PeerSelection.LedgerPeers (TraceLedgerPeers) import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..)) import Ouroboros.Network.PeerSelection.RootPeersDNS.LocalRootPeers @@ -104,8 +106,11 @@ import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS import Ouroboros.Network.Protocol.TxSubmission2.Type (TxSubmission2) import qualified Ouroboros.Network.Server as Server (Trace (..)) import Ouroboros.Network.Snocket (LocalAddress (..)) -import Ouroboros.Network.TxSubmission.Inbound (TraceTxSubmissionInbound) +import Ouroboros.Network.TxSubmission.Inbound.V2 (TraceTxSubmissionInbound) import Ouroboros.Network.TxSubmission.Outbound (TraceTxSubmissionOutbound) +import Ouroboros.Network.Tracing () +import Network.Mux.Tracing () +import qualified Network.Mux as Mux import Control.Monad (forM_) import Data.Aeson.Types (ToJSON) @@ -114,8 +119,6 @@ import Data.Text (pack) import qualified Data.Text.IO as T import Data.Time (getZonedTime) import Data.Version (showVersion) -import GHC.Generics (Generic) -import qualified Network.Mux as Mux import qualified Network.Socket as Socket import qualified Options.Applicative as Opt import System.IO @@ -161,9 +164,6 @@ parseTraceDocumentationCmd = ] ) -deriving instance Generic UnversionedProtocol -deriving instance Generic UnversionedProtocolData - instance ToJSON UnversionedProtocol instance ToJSON UnversionedProtocolData @@ -177,7 +177,7 @@ runTraceDocumentationCmd TraceDocumentationCmd{..} = do -- as the tracers are behind old tracer interface after construction in mkDispatchTracers. -- Can be changed, when old tracers have gone docTracers :: - FilePath + FilePath -> FilePath -> Maybe FilePath -> IO () @@ -190,8 +190,7 @@ docTracers configFileName outputFileName mbMetricsHelpFilename = do -- as the tracers are behind old tracer interface after construction in mkDispatchTracers. -- Can be changed, when old tracers have gone docTracersFirstPhase :: forall blk peer remotePeer. - ( TraceConstraints blk - , Proxy blk ~ Proxy (CardanoBlock StandardCrypto) + ( Proxy blk ~ Proxy (CardanoBlock StandardCrypto) , Proxy peer ~ Proxy (NtN.ConnectionId LocalAddress) , Proxy remotePeer ~ Proxy (NtN.ConnectionId NtN.RemoteAddress) ) @@ -606,13 +605,7 @@ docTracersFirstPhase condConfigFileName = do ["Net", "PeerSelection", "Counters"] configureTracers configReflection trConfig [peerSelectionCountersTr] peerSelectionCountersTrDoc <- documentTracer (peerSelectionCountersTr :: - Logging.Trace IO (PeerSelectionCounters (Cardano.ExtraPeerSelectionSetsWithSizes Socket.SockAddr))) - - churnCountersTr <- mkCardanoTracer - trBase trForward mbTrEKG - ["Net", "Churn"] - configureTracers configReflection trConfig [churnCountersTr] - churnCountersTrDoc <- documentTracer (churnCountersTr :: Logging.Trace IO ChurnCounters) + Logging.Trace IO (PeerSelectionCounters (Cardano.ViewExtraPeers (Cardano.PublicRootPeers.ExtraPeers Socket.SockAddr)))) peerSelectionActionsTr <- mkCardanoTracer trBase trForward mbTrEKG @@ -756,7 +749,6 @@ docTracersFirstPhase condConfigFileName = do <> debugPeerSelectionTrDoc <> debugPeerSelectionResponderTrDoc <> peerSelectionCountersTrDoc - <> churnCountersTrDoc <> peerSelectionActionsTrDoc <> connectionManagerTrDoc <> connectionManagerTransitionsTrDoc diff --git a/cardano-node/src/Cardano/Node/Tracing/Era/HardFork.hs b/cardano-node/src/Cardano/Node/Tracing/Era/HardFork.hs index 7e528ba3c2f..aebc3a1f721 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Era/HardFork.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Era/HardFork.hs @@ -19,7 +19,7 @@ import Cardano.Logging import Cardano.Slotting.Slot (EpochSize (..)) import Cardano.Tracing.OrphanInstances.HardFork () import Ouroboros.Consensus.Block (BlockProtocol, CannotForge, ForgeStateInfo, - ForgeStateUpdateError) + ForgeStateUpdateError, PerasWeight (..)) import Ouroboros.Consensus.BlockchainTime (getSlotLength) import Ouroboros.Consensus.Cardano.Condense () import Ouroboros.Consensus.HardFork.Combinator @@ -36,7 +36,8 @@ import Ouroboros.Consensus.HeaderValidation (OtherHeaderEnvelopeError) import Ouroboros.Consensus.Ledger.Abstract (LedgerError) import Ouroboros.Consensus.Ledger.Inspect (LedgerUpdate, LedgerWarning) import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr) -import Ouroboros.Consensus.Protocol.Abstract (ValidationErr, TiebreakerView, SelectView(..)) +import Ouroboros.Consensus.Peras.SelectView +import Ouroboros.Consensus.Protocol.Abstract (TiebreakerView, ValidationErr) import Ouroboros.Consensus.TypeFamilyWrappers import Ouroboros.Consensus.Util.Condense (Condense (..)) @@ -352,10 +353,11 @@ instance LogFormatting (ForgeStateUpdateError blk) => LogFormatting (WrapForgeSt instance All (LogFormatting `Compose` WrapTiebreakerView) xs => LogFormatting (HardForkTiebreakerView xs) where forMachine dtal = forMachine dtal . getHardForkTiebreakerView -instance LogFormatting (TiebreakerView protocol) => LogFormatting (SelectView protocol) where +instance LogFormatting (TiebreakerView protocol) => LogFormatting (WeightedSelectView protocol) where forMachine dtal sv = mconcat - [ "blockNo" .= svBlockNo sv - , forMachine dtal (svTiebreakerView sv) + [ "blockNo" .= wsvBlockNo sv + , "weightBoost" .= unPerasWeight (wsvWeightBoost sv) + , forMachine dtal (wsvTiebreaker sv) ] instance All (LogFormatting `Compose` WrapTiebreakerView) xs => LogFormatting (OneEraTiebreakerView xs) where diff --git a/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs b/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs index 0f76c298ab1..76e89e55ec8 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs @@ -36,13 +36,14 @@ import Cardano.Ledger.BaseTypes (Mismatch (..), activeSlotLog, strictM import Cardano.Ledger.Chain import Cardano.Ledger.Conway.Governance (govActionIdToText) import qualified Cardano.Ledger.Conway.Rules as Conway +import qualified Cardano.Ledger.Dijkstra.Rules as Dijkstra import qualified Cardano.Ledger.Core as Ledger import qualified Cardano.Ledger.Hashes as Hashes import Cardano.Ledger.Shelley.API import Cardano.Ledger.Shelley.Rules import Cardano.Logging import Cardano.Node.Tracing.Render (renderMissingRedeemers, renderScriptHash, - renderScriptIntegrityHash) + renderScriptIntegrityHash, renderIncompleteWithdrawals) import qualified Cardano.Protocol.Crypto as Ledger import Cardano.Protocol.TPraos.API (ChainTransitionError (ChainTransitionError)) import Cardano.Protocol.TPraos.BHeader (LastAppliedBlock, labBlockNo) @@ -69,13 +70,17 @@ import Ouroboros.Consensus.Util.Condense (condense) import Ouroboros.Network.Block (SlotNo (..), blockHash, blockNo, blockSlot) import Ouroboros.Network.Point (WithOrigin, withOriginToMaybe) +import qualified Data.Aeson.Types as Aeson import Data.Aeson (ToJSON (..), Value (..), (.=)) +import qualified Data.Aeson.Key as Aeson (fromText) import qualified Data.ByteString.Base16 as B16 import qualified Data.List.NonEmpty as NonEmpty import Data.Set (Set) import qualified Data.Set as Set +import qualified Data.Map as Map import Data.Text (Text) import qualified Data.Text.Encoding as Text +import qualified Data.Set.NonEmpty as NonEmptySet {- HLINT ignore "Use :" -} @@ -93,13 +98,13 @@ instance ( "txid" .= txId tx ) : [ "tx" .= condense tx | dtal == DDetailed ] -instance LogFormatting (Set (Credential 'Staking)) where +instance LogFormatting (Set (Credential Staking)) where forMachine _dtal creds = mconcat [ "kind" .= String "StakeCreds" , "stakeCreds" .= map toJSON (Set.toList creds) ] -instance LogFormatting (NonEmpty.NonEmpty (KeyHash 'Staking)) where +instance LogFormatting (NonEmpty.NonEmpty (KeyHash Staking)) where forMachine _dtal keyHashes = mconcat [ "kind" .= String "StakingKeyHashes" , "stakeKeyHashes" .= toJSON keyHashes @@ -176,8 +181,8 @@ instance LogFormatting (Conway.ConwayDelegPredFailure era) where , "amount" .= String (textShow credential) , "error" .= String "Stake key not registered" ] - Conway.StakeKeyHasNonZeroRewardAccountBalanceDELEG coin -> - [ "kind" .= String "StakeKeyHasNonZeroRewardAccountBalanceDELEG" + Conway.StakeKeyHasNonZeroAccountBalanceDELEG coin -> + [ "kind" .= String "StakeKeyHasNonZeroAccountBalanceDELEG" , "amount" .= coin , "error" .= String "Stake key has non-zero account balance" ] @@ -215,9 +220,13 @@ instance , LogFormatting (PredicateFailure (ShelleyUTXO era)) , LogFormatting (PredicateFailure (ShelleyUTXOW era)) , LogFormatting (PredicateFailure (Ledger.EraRule "LEDGER" era)) + , ToJSON (ApplyTxError era) ) => LogFormatting (ApplyTxError era) where - forMachine dtal (ApplyTxError predicateFailures) = - mconcat $ NonEmpty.toList $ fmap (forMachine dtal) predicateFailures + forMachine _dtal err = + mconcat + [ "kind" .= String "ApplyTxError" + , "reason" .= toJSON err + ] instance ( Ledger.Crypto era @@ -336,6 +345,15 @@ instance ) => LogFormatting (ShelleyLedgersPredFailure era) where forMachine dtal (LedgerFailure f) = forMachine dtal f +instance LogFormatting Withdrawals where + forMachine _dtal (Withdrawals ws) = + mconcat ["kind" .= String "Withdrawals" + , "withdrawals" .= Aeson.object (map renderTuple $ Map.toList ws) + ] + where + renderTuple :: (Ledger.AccountAddress, Coin) -> Aeson.Pair + renderTuple (address, mismatch) = + Aeson.fromText (Api.serialiseAddress $ Api.fromShelleyStakeAddr address) .= show mismatch instance ( Consensus.ShelleyBasedEra era @@ -347,6 +365,10 @@ instance forMachine dtal = \case UtxowFailure f -> forMachine dtal f DelegsFailure f -> forMachine dtal f + ShelleyWithdrawalsMissingAccounts withdrawals -> forMachine dtal withdrawals + ShelleyIncompleteWithdrawals payload -> + mconcat ["kind" .= String "ShelleyIncompleteWithdrawals" + , "withdrawals" .= renderIncompleteWithdrawals payload] instance ( Api.ShelleyLedgerEra era ~ ledgerera @@ -364,7 +386,7 @@ instance forMachine _ (MissingRequiredDatums required received) = mconcat [ "kind" .= String "MissingRequiredDatums" , "required" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) - (Set.toList required) + (NonEmptySet.toList required) , "received" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) (Set.toList received) ] @@ -375,11 +397,11 @@ instance ] forMachine _ (UnspendableUTxONoDatumHash txins) = mconcat [ "kind" .= String "MissingRequiredSigners" - , "txins" .= Set.toList txins + , "txins" .= NonEmptySet.toList txins ] forMachine _ (NotAllowedSupplementalDatums disallowed acceptable) = mconcat [ "kind" .= String "NotAllowedSupplementalDatums" - , "disallowed" .= Set.toList disallowed + , "disallowed" .= NonEmptySet.toList disallowed , "acceptable" .= Set.toList acceptable ] forMachine _ (ExtraRedeemers rdmrs) = @@ -388,7 +410,7 @@ instance (\alonzoOnwards -> mconcat [ "kind" .= String "ExtraRedeemers" - , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) rdmrs + , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) (NonEmpty.toList rdmrs) ] ) (Api.shelleyBasedEra :: Api.ShelleyBasedEra era) @@ -410,7 +432,7 @@ instance ) => LogFormatting (ShelleyUtxowPredFailure era) where forMachine _dtal (InvalidWitnessesUTXOW wits') = mconcat [ "kind" .= String "InvalidWitnessesUTXOW" - , "invalidWitnesses" .= map textShow wits' + , "invalidWitnesses" .= map textShow (NonEmpty.toList wits') ] forMachine _dtal (MissingVKeyWitnessesUTXOW wits') = mconcat [ "kind" .= String "MissingVKeyWitnessesUTXOW" @@ -448,7 +470,7 @@ instance ] forMachine _dtal (ExtraneousScriptWitnessesUTXOW scriptHashes) = mconcat [ "kind" .= String "ExtraneousScriptWitnessesUTXOW" - , "scriptHashes" .= Set.map renderScriptHash scriptHashes + , "scriptHashes" .= Set.map renderScriptHash (NonEmptySet.toSet scriptHashes) ] instance @@ -458,7 +480,7 @@ instance forMachine _dtal (BadInputsUTxO badInputs) = mconcat [ "kind" .= String "BadInputsUTxO" , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] forMachine _dtal (ExpiredUTxO Mismatch {mismatchSupplied, mismatchExpected}) = mconcat [ "kind" .= String "ExpiredUTxO" @@ -520,7 +542,7 @@ instance forMachine _dtal (Allegra.BadInputsUTxO badInputs) = mconcat [ "kind" .= String "BadInputsUTxO" , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] forMachine _dtal (Allegra.OutsideValidityIntervalUTxO validityInterval slot) = mconcat [ "kind" .= String "ExpiredUTxO" @@ -606,14 +628,6 @@ instance ( Consensus.ShelleyBasedEra era , LogFormatting (PredicateFailure (Ledger.EraRule "DELPL" era)) ) => LogFormatting (ShelleyDelegsPredFailure era) where - forMachine _dtal (DelegateeNotRegisteredDELEG targetPool) = - mconcat [ "kind" .= String "DelegateeNotRegisteredDELEG" - , "targetPool" .= targetPool - ] - forMachine _dtal (WithdrawalsNotInRewardsDELEGS incorrectWithdrawals) = - mconcat [ "kind" .= String "WithdrawalsNotInRewardsCERTS" - , "incorrectWithdrawals" .= unWithdrawals incorrectWithdrawals - ] forMachine dtal (DelplFailure f) = forMachine dtal f @@ -697,6 +711,10 @@ instance LogFormatting (ShelleyDelegPredFailure era) where TreasuryMIR -> "Treasury") , "coin" .= coin ] + forMachine _dtal (DelegateeNotRegisteredDELEG targetPool) = + mconcat [ "kind" .= String "DelegateeNotRegisteredDELEG" + , "targetPool" .= targetPool + ] instance LogFormatting (ShelleyPoolPredFailure era) where forMachine _dtal (StakePoolNotRegisteredOnKeyPOOL (KeyHash unregStakePool)) = @@ -877,8 +895,8 @@ instance ) => LogFormatting (AlonzoUtxoPredFailure era) where forMachine _dtal (Alonzo.BadInputsUTxO badInputs) = mconcat [ "kind" .= String "BadInputsUTxO" - , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "badInputs" .= NonEmptySet.toSet badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] forMachine _dtal (Alonzo.OutsideValidityIntervalUTxO validtyInterval slot) = mconcat [ "kind" .= String "ExpiredUTxO" @@ -1073,6 +1091,14 @@ instance , LogFormatting (PredicateFailure (Ledger.EraRule "CERTS" era)) ) => LogFormatting (Conway.ConwayLedgerPredFailure era) where forMachine v (Conway.ConwayUtxowFailure f) = forMachine v f + forMachine _ (Conway.ConwayWithdrawalsMissingAccounts missingWithdrawals) = + mconcat [ "kind" .= String "ConwayWithdrawalsMissingAccounts" + , "withdrawals" .= unWithdrawals missingWithdrawals + ] + forMachine _ (Conway.ConwayIncompleteWithdrawals incompleteWithdrawals) = + mconcat [ "kind" .= String "ConwayIncompleteWithdrawals" + , "withdrawals" .= renderIncompleteWithdrawals incompleteWithdrawals + ] forMachine _ (Conway.ConwayTxRefScriptsSizeTooBig Mismatch {mismatchSupplied, mismatchExpected}) = mconcat [ "kind" .= String "ConwayTxRefScriptsSizeTooBig" , "actual" .= mismatchSupplied @@ -1147,11 +1173,6 @@ instance , "protVer" .= mismatchSupplied , "prevProtVer" .= mismatchExpected ] - forMachine _ (Conway.InvalidPolicyHash actualPolicyHash expectedPolicyHash) = - mconcat [ "kind" .= String "InvalidPolicyHash" - , "actualPolicyHash" .= actualPolicyHash - , "expectedPolicyHash" .= expectedPolicyHash - ] forMachine _ (Conway.DisallowedProposalDuringBootstrap proposal) = mconcat [ "kind" .= String "DisallowedProposalDuringBootstrap" , "proposal" .= proposal @@ -1177,6 +1198,12 @@ instance mconcat [ "kind" .= String "UnelectedCommitteeVoters" , "unelectedCommitteeVoters" .= voters ] + forMachine _ (Conway.InvalidGuardrailsScriptHash actualPolicyHash expectedPolicyHash) = + mconcat [ "kind" .= String "InvalidPolicyHash" + , "actualPolicyHash" .= actualPolicyHash + , "expectedPolicyHash" .= expectedPolicyHash + ] + instance ( Consensus.ShelleyBasedEra era @@ -1189,6 +1216,37 @@ instance forMachine dtal (Conway.CertFailure certFailure) = forMachine dtal certFailure +instance + ( LogFormatting (PredicateFailure (Ledger.EraRule "CERTS" ledgerera)) + , LogFormatting (PredicateFailure (Ledger.EraRule "UTXOW" ledgerera)) + , LogFormatting (PredicateFailure (Ledger.EraRule "GOV" ledgerera)) + ) => LogFormatting (Dijkstra.DijkstraLedgerPredFailure ledgerera) where + forMachine _ = error "Dijkstra era is not active yet" + +instance + (LogFormatting (PredicateFailure (Ledger.EraRule "CERTS" ledgerera)) + ) => LogFormatting (Dijkstra.DijkstraGovCertPredFailure ledgerera) where + forMachine _ = error "Dijkstra era is not active yet" + +instance + (LogFormatting (PredicateFailure (Ledger.EraRule "CERTS" ledgerera)) + ) => LogFormatting (Dijkstra.DijkstraGovPredFailure ledgerera) where + forMachine _ = error "Dijkstra era is not active yet" + +instance + (LogFormatting (PredicateFailure (Ledger.EraRule "UTXOW" ledgerera)) + ) => LogFormatting (Dijkstra.DijkstraUtxowPredFailure ledgerera) where + forMachine _ = error "Dijkstra era is not active yet" + +instance + (LogFormatting (PredicateFailure (Ledger.EraRule "CERTS" ledgerera)) + ) => LogFormatting (Dijkstra.DijkstraBbodyPredFailure ledgerera) where + forMachine _ = error "Dijkstra era is not active yet" + +instance + (LogFormatting (PredicateFailure (Ledger.EraRule "CERTS" ledgerera)) + ) => LogFormatting (Dijkstra.DijkstraUtxoPredFailure ledgerera) where + forMachine _ = error "Dijkstra era is not active yet" instance ( Ledger.Crypto crypto @@ -1312,8 +1370,8 @@ instance Conway.UtxosFailure utxosPredFailure -> forMachine dtal utxosPredFailure Conway.BadInputsUTxO badInputs -> mconcat [ "kind" .= String "BadInputsUTxO" - , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "badInputs" .= NonEmptySet.toSet badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] Conway.OutsideValidityIntervalUTxO validityInterval slot -> mconcat [ "kind" .= String "ExpiredUTxO" @@ -1426,7 +1484,7 @@ instance Conway.UtxoFailure utxoPredFail -> forMachine dtal utxoPredFail Conway.InvalidWitnessesUTXOW ws -> mconcat [ "kind" .= String "InvalidWitnessesUTXOW" - , "invalidWitnesses" .= map textShow ws + , "invalidWitnesses" .= map textShow (NonEmpty.toList ws) ] Conway.MissingVKeyWitnessesUTXOW ws -> mconcat [ "kind" .= String "MissingVKeyWitnessesUTXOW" @@ -1458,7 +1516,7 @@ instance ] Conway.ExtraneousScriptWitnessesUTXOW scripts -> mconcat [ "kind" .= String "InvalidWitnessesUTXOW" - , "extraneousScripts" .= Set.map renderScriptHash scripts + , "extraneousScripts" .= Set.map renderScriptHash (NonEmptySet.toSet scripts) ] Conway.MissingRedeemers scripts -> mconcat [ "kind" .= String "MissingRedeemers" @@ -1467,13 +1525,13 @@ instance Conway.MissingRequiredDatums required received -> mconcat [ "kind" .= String "MissingRequiredDatums" , "required" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) - (Set.toList required) + (NonEmptySet.toList required) , "received" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) (Set.toList received) ] Conway.NotAllowedSupplementalDatums disallowed acceptable -> mconcat [ "kind" .= String "NotAllowedSupplementalDatums" - , "disallowed" .= Set.toList disallowed + , "disallowed" .= NonEmptySet.toList disallowed , "acceptable" .= Set.toList acceptable ] Conway.PPViewHashesDontMatch Mismatch {mismatchSupplied, mismatchExpected} -> @@ -1483,7 +1541,7 @@ instance ] Conway.UnspendableUTxONoDatumHash ins -> mconcat [ "kind" .= String "MissingRequiredSigners" - , "txins" .= Set.toList ins + , "txins" .= NonEmptySet.toList ins ] Conway.ExtraRedeemers rs -> Api.caseShelleyToMaryOrAlonzoEraOnwards @@ -1491,7 +1549,7 @@ instance (\alonzoOnwards -> mconcat [ "kind" .= String "ExtraRedeemers" - , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) rs + , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) (NonEmpty.toList rs) ] ) (Api.shelleyBasedEra :: Api.ShelleyBasedEra era) diff --git a/cardano-node/src/Cardano/Node/Tracing/Render.hs b/cardano-node/src/Cardano/Node/Tracing/Render.hs index 0c84e550b4b..686627899d9 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Render.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Render.hs @@ -28,6 +28,7 @@ module Cardano.Node.Tracing.Render , renderScriptIntegrityHash , renderScriptPurpose , renderMissingRedeemers + , renderIncompleteWithdrawals ) where import qualified Cardano.Api as Api @@ -50,6 +51,7 @@ import Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal (ChunkN import Ouroboros.Consensus.Util.Condense (Condense, condense) import Ouroboros.Network.Block (ChainHash (..), HeaderHash, StandardHash, Tip, getTipPoint) +import Cardano.Ledger.BaseTypes (Mismatch(..), Relation(..)) import Data.Aeson ((.=)) import qualified Data.Aeson as Aeson @@ -60,6 +62,11 @@ import Data.Proxy (Proxy (..)) import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Encoding as Text +import qualified Data.List.NonEmpty as NonEmpty +import Data.List.NonEmpty (NonEmpty) +import qualified Data.Map.NonEmpty as NonEmptyMap +import Data.Map.NonEmpty (NonEmptyMap) + condenseT :: Condense a => a -> Text condenseT = Text.pack . condense @@ -184,9 +191,9 @@ renderScriptIntegrityHash Nothing = Aeson.Null renderMissingRedeemers :: forall era. () => Api.ShelleyBasedEra era - -> [(PlutusPurpose AsItem (Api.ShelleyLedgerEra era), Ledger.ScriptHash)] + -> NonEmpty (PlutusPurpose AsItem (Api.ShelleyLedgerEra era), Ledger.ScriptHash) -> Aeson.Value -renderMissingRedeemers sbe scripts = Aeson.object $ map renderTuple scripts +renderMissingRedeemers sbe scripts = Aeson.object $ NonEmpty.toList $ NonEmpty.map renderTuple scripts where renderTuple :: () => (PlutusPurpose AsItem (Api.ShelleyLedgerEra era), Ledger.ScriptHash) @@ -194,6 +201,16 @@ renderMissingRedeemers sbe scripts = Aeson.object $ map renderTuple scripts renderTuple (scriptPurpose, sHash) = Aeson.fromText (renderScriptHash sHash) .= renderScriptPurpose sbe scriptPurpose +renderIncompleteWithdrawals :: forall payload. Show payload + => NonEmptyMap Ledger.AccountAddress (Mismatch RelEQ payload) + -> Aeson.Value +renderIncompleteWithdrawals payload = + Aeson.object $ map renderTuple $ NonEmptyMap.toList payload + where + renderTuple :: (Ledger.AccountAddress, Mismatch RelEQ payload) -> Aeson.Pair + renderTuple (address, mismatch) = + Aeson.fromText (Api.serialiseAddress $ Api.fromShelleyStakeAddr address) .= show mismatch + renderScriptHash :: Ledger.ScriptHash -> Text renderScriptHash = Api.serialiseToRawBytesHexText . Api.fromShelleyScriptHash diff --git a/cardano-node/src/Cardano/Node/Tracing/StateRep.hs b/cardano-node/src/Cardano/Node/Tracing/StateRep.hs index 4563ee4d819..019408164cc 100644 --- a/cardano-node/src/Cardano/Node/Tracing/StateRep.hs +++ b/cardano-node/src/Cardano/Node/Tracing/StateRep.hs @@ -298,7 +298,7 @@ traceNodeStateChainDB _scp tr ev = _ -> return () ChainDB.TraceAddBlockEvent ev' -> case ev' of - ChainDB.AddedToCurrentChain _ (ChainDB.SelectionChangedInfo currentTip ntEpoch sInEpoch _ _ _) _ _ -> do + ChainDB.AddedToCurrentChain _ (ChainDB.SelectionChangedInfo currentTip ntEpoch sInEpoch _ _ _) _ _ _ -> do -- The slot of the latest block consumed (our progress). let RP.RealPoint ourSlotSinceSystemStart _ = currentTip -- The slot corresponding to the latest wall-clock time (our target). diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers.hs index 249ea520156..bf91b58ca69 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers.hs @@ -18,6 +18,8 @@ module Cardano.Node.Tracing.Tracers import Cardano.Logging import qualified Cardano.Network.Diffusion as Cardano.Diffusion +import Cardano.Network.NodeToClient (LocalAddress) +import Cardano.Network.NodeToNode (RemoteAddress) import Cardano.Node.Protocol.Types (SomeConsensusProtocol) import Cardano.Node.Queries (NodeKernelData) import Cardano.Node.TraceConstraints @@ -35,7 +37,6 @@ import Cardano.Node.Tracing.Tracers.LedgerMetrics () import Cardano.Node.Tracing.Tracers.NodeToClient () import Cardano.Node.Tracing.Tracers.NodeToNode () import Cardano.Node.Tracing.Tracers.NodeVersion (getNodeVersion) -import Cardano.Node.Tracing.Tracers.P2P () import Cardano.Node.Tracing.Tracers.Shutdown () import Cardano.Node.Tracing.Tracers.Startup () import Ouroboros.Consensus.Ledger.Inspect (LedgerEvent) @@ -57,8 +58,11 @@ import qualified Ouroboros.Network.Diffusion as Diffusion import Codec.CBOR.Read (DeserialiseFailure) import Control.Monad (unless) import "contra-tracer" Control.Tracer (Tracer (..)) +import Data.Aeson (ToJSON) import Data.Proxy (Proxy (..)) import Network.Mux.Trace (TraceLabelPeer (..)) +import qualified Network.Mux.Trace as Mux +import Network.Mux.Tracing () -- | Construct tracers for all system components. -- @@ -72,6 +76,7 @@ mkDispatchTracers (ConnectionId RemoteAddress) (TraceChainSyncClientEvent blk)) , LogFormatting (TraceGsmEvent (Tip blk)) , MetaTrace (TraceGsmEvent (Tip blk)) + , ToJSON (HeaderHash blk) ) => NodeKernelData blk -> Trace IO FormattedMessage @@ -190,6 +195,7 @@ mkConsensusTracers :: forall blk. (ConnectionId RemoteAddress) (TraceChainSyncClientEvent blk)) , LogFormatting (TraceGsmEvent (Tip blk)) , MetaTrace (TraceGsmEvent (Tip blk)) + , ToJSON (HeaderHash blk) ) => ConfigReflection -> Trace IO FormattedMessage @@ -331,6 +337,16 @@ mkConsensusTracers configReflection trBase trForward mbTrEKG _trDataPoint trConf ["Consensus", "DevotedBlockFetch"] configureTracers configReflection trConfig [consensusDbfTr] + !txLogicTracer <- mkCardanoTracer + trBase trForward mbTrEKG + ["txLogic", "Remote"] + configureTracers configReflection trConfig [txLogicTracer] + + !txCountersTracer <- mkCardanoTracer + trBase trForward mbTrEKG + ["txCounters", "Remote"] + configureTracers configReflection trConfig [txCountersTracer] + pure $ Consensus.Tracers { Consensus.chainSyncClientTracer = Tracer $ traceWith chainSyncClientTr @@ -379,6 +395,10 @@ mkConsensusTracers configReflection trBase trForward mbTrEKG _trDataPoint trConf traceWith consensusDbfTr , Consensus.kesAgentTracer = Tracer $ traceWith consensusKesAgentTr + , Consensus.txLogicTracer = Tracer $ + traceWith txLogicTracer + , Consensus.txCountersTracer = Tracer $ + traceWith txCountersTracer } mkNodeToClientTracers :: forall blk. @@ -473,6 +493,11 @@ mkNodeToNodeTracers configReflection trBase trForward mbTrEKG _trDataPoint trCon ["PeerSharing", "Remote"] configureTracers configReflection trConfig [peerSharingTracer] + !txLogicTracer <- mkCardanoTracer + trBase trForward mbTrEKG + ["txLogic", "Remote"] + configureTracers configReflection trConfig [txLogicTracer] + pure $ NtN.Tracers { NtN.tChainSyncTracer = Tracer $ traceWith chainSyncTracer @@ -488,16 +513,24 @@ mkNodeToNodeTracers configReflection trBase trForward mbTrEKG _trDataPoint trCon traceWith keepAliveTracer , NtN.tPeerSharingTracer = Tracer $ traceWith peerSharingTracer + , NtN.tTxLogicTracer = Tracer $ + traceWith txLogicTracer } -mkDiffusionTracers - :: ConfigReflection - -> Trace IO FormattedMessage - -> Trace IO FormattedMessage - -> Maybe (Trace IO FormattedMessage) - -> Trace IO DataPoint - -> TraceConfig - -> IO (Cardano.Diffusion.CardanoTracers IO) +mkDiffusionTracers :: + ( LogFormatting + ( Mux.WithBearer + (ConnectionId RemoteAddress) + Mux.Trace + ) + ) => + ConfigReflection -> + Trace IO FormattedMessage -> + Trace IO FormattedMessage -> + Maybe (Trace IO FormattedMessage) -> + Trace IO DataPoint -> + TraceConfig -> + IO (Cardano.Diffusion.CardanoTracers IO) mkDiffusionTracers configReflection trBase trForward mbTrEKG _trDataPoint trConfig = do !dtMuxTr <- mkCardanoTracer @@ -565,21 +598,11 @@ mkDiffusionTracers configReflection trBase trForward mbTrEKG _trDataPoint trConf ["Net", "PeerSelection", "Initiator"] configureTracers configReflection trConfig [debugPeerSelectionTr] - !debugPeerSelectionResponderTr <- mkCardanoTracer - trBase trForward mbTrEKG - ["Net", "PeerSelection", "Responder"] - configureTracers configReflection trConfig [debugPeerSelectionResponderTr] - !peerSelectionCountersTr <- mkCardanoTracer trBase trForward mbTrEKG ["Net", "PeerSelection"] configureTracers configReflection trConfig [peerSelectionCountersTr] - !churnCountersTr <- mkCardanoTracer - trBase trForward mbTrEKG - ["Net", "Churn"] - configureTracers configReflection trConfig [churnCountersTr] - !peerSelectionActionsTr <- mkCardanoTracer trBase trForward mbTrEKG ["Net", "PeerSelection", "Actions"] @@ -660,14 +683,10 @@ mkDiffusionTracers configReflection trBase trForward mbTrEKG _trDataPoint trConf traceWith publicRootPeersTr , Diffusion.dtTracePeerSelectionTracer = Tracer $ traceWith peerSelectionTr - , Diffusion.dtDebugPeerSelectionInitiatorTracer = Tracer $ + , Diffusion.dtDebugPeerSelectionTracer = Tracer $ traceWith debugPeerSelectionTr - , Diffusion.dtDebugPeerSelectionInitiatorResponderTracer = Tracer $ - traceWith debugPeerSelectionResponderTr , Diffusion.dtTracePeerSelectionCounters = Tracer $ traceWith peerSelectionCountersTr - , Diffusion.dtTraceChurnCounters = Tracer $ - traceWith churnCountersTr , Diffusion.dtPeerSelectionActionsTracer = Tracer $ traceWith peerSelectionActionsTr , Diffusion.dtConnectionManagerTracer = Tracer $ diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs index a8b5f32dcf5..e06f4f08e89 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs @@ -22,13 +22,19 @@ import Cardano.Node.Tracing.Render import Cardano.Prelude (maximumDef) import Cardano.Tracing.HasIssuer import Ouroboros.Consensus.Block +import Ouroboros.Consensus.HardFork.Combinator.Abstract.CanHardFork +import Ouroboros.Consensus.HardFork.Combinator.Abstract.SingleEraBlock +import Ouroboros.Consensus.HardFork.Combinator.Info +import Ouroboros.Consensus.HardFork.Combinator.Protocol.ChainSel import Ouroboros.Consensus.HeaderValidation (HeaderEnvelopeError (..), HeaderError (..), OtherHeaderEnvelopeError) import Ouroboros.Consensus.Ledger.Abstract (LedgerError) +import Ouroboros.Consensus.Peras.SelectView +import Ouroboros.Consensus.Protocol.Praos.Common import Ouroboros.Consensus.Ledger.Extended (ExtValidationError (..)) import Ouroboros.Consensus.Ledger.Inspect (InspectLedger, LedgerEvent (..)) import Ouroboros.Consensus.Ledger.SupportsProtocol (LedgerSupportsProtocol) -import Ouroboros.Consensus.Protocol.Abstract (SelectView, ValidationErr) +import Ouroboros.Consensus.Protocol.Abstract (ValidationErr, SelectViewReasonForSwitch(..), Comparing(..), ReasonForSwitch, TiebreakerView) import qualified Ouroboros.Consensus.Protocol.PBFT as PBFT import qualified Ouroboros.Consensus.Storage.ChainDB as ChainDB import qualified Ouroboros.Consensus.Storage.ImmutableDB as ImmDB @@ -37,19 +43,27 @@ import qualified Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types as ImmDB import qualified Ouroboros.Consensus.Storage.LedgerDB as LedgerDB import qualified Ouroboros.Consensus.Storage.LedgerDB.Snapshots as LedgerDB import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore as V1 -import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.Args as V2 +import qualified Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB as LMDB +import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.Backend as V2 +import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.InMemory as InMemory +import qualified Ouroboros.Consensus.Storage.LedgerDB.V2.LSM as LSM +import qualified Ouroboros.Consensus.Storage.PerasCertDB.Impl as PerasCertDB import qualified Ouroboros.Consensus.Storage.VolatileDB as VolDB +import Ouroboros.Consensus.TypeFamilyWrappers import Ouroboros.Consensus.Util.Condense (condense) import Ouroboros.Consensus.Util.Enclose import qualified Ouroboros.Network.AnchoredFragment as AF import Ouroboros.Network.Block (MaxSlotNo (..)) -import Data.Aeson (Value (String), object, toJSON, (.=)) +import Data.Aeson (Value (String), object, toJSON, (.=), Object) import qualified Data.ByteString.Base16 as B16 import Data.Int (Int64) +import Data.SOP (K (..), hcmap, hcollapse, All) import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Encoding as Text +import Data.Typeable (Typeable, cast) +import Data.Void (absurd) import Data.Word (Word64) import Numeric (showFFloat) @@ -65,7 +79,7 @@ withAddedToCurrentChainEmptyLimited tr = do where selecting ltr - (ChainDB.TraceAddBlockEvent (ChainDB.AddedToCurrentChain events _ _ _)) = + (ChainDB.TraceAddBlockEvent (ChainDB.AddedToCurrentChain events _ _ _ _)) = if null events then pure ltr else pure tr @@ -79,12 +93,14 @@ withAddedToCurrentChainEmptyLimited tr = do instance ( LogFormatting (Header blk) , LogFormatting (LedgerEvent blk) , LogFormatting (RealPoint blk) - , LogFormatting (SelectView (BlockProtocol blk)) + , LogFormatting (WeightedSelectView (BlockProtocol blk)) , ConvertRawHash blk , ConvertRawHash (Header blk) , LedgerSupportsProtocol blk , InspectLedger blk , HasIssuer blk + , LogFormatting (ReasonForSwitch (TiebreakerView (BlockProtocol blk))) + ) => LogFormatting (ChainDB.TraceEvent blk) where forHuman ChainDB.TraceLastShutdownUnclean = "ChainDB is not clean. Validating all immutable chunks" @@ -103,6 +119,8 @@ instance ( LogFormatting (Header blk) "Chain Selection was starved." ChainDB.ChainSelStarvation (FallingEdgeWith pt) -> "Chain Selection was unstarved by " <> renderRealPoint pt + forHuman (ChainDB.TracePerasCertDbEvent ev) = forHuman ev + forHuman (ChainDB.TraceAddPerasCertEvent ev) = forHuman ev forMachine _ ChainDB.TraceLastShutdownUnclean = mconcat [ "kind" .= String "LastShutdownUnclean" ] @@ -132,6 +150,11 @@ instance ( LogFormatting (Header blk) forMachine details v forMachine details (ChainDB.TraceVolatileDBEvent v) = forMachine details v + forMachine details (ChainDB.TracePerasCertDbEvent v) = + forMachine details v + forMachine details (ChainDB.TraceAddPerasCertEvent v) = + forMachine details v + asMetrics ChainDB.TraceLastShutdownUnclean = [] asMetrics (ChainDB.TraceChainSelStarvationEvent _) = [] @@ -145,6 +168,8 @@ instance ( LogFormatting (Header blk) asMetrics (ChainDB.TraceLedgerDBEvent v) = asMetrics v asMetrics (ChainDB.TraceImmutableDBEvent v) = asMetrics v asMetrics (ChainDB.TraceVolatileDBEvent v) = asMetrics v + asMetrics (ChainDB.TracePerasCertDbEvent v) = asMetrics v + asMetrics (ChainDB.TraceAddPerasCertEvent v) = asMetrics v instance MetaTrace (ChainDB.TraceEvent blk) where @@ -172,6 +197,10 @@ instance MetaTrace (ChainDB.TraceEvent blk) where nsPrependInner "ImmDbEvent" (namespaceFor ev) namespaceFor (ChainDB.TraceVolatileDBEvent ev) = nsPrependInner "VolatileDbEvent" (namespaceFor ev) + namespaceFor (ChainDB.TracePerasCertDbEvent ev) = + nsPrependInner "PerasCertDbEvent" (namespaceFor ev) + namespaceFor (ChainDB.TraceAddPerasCertEvent ev) = + nsPrependInner "AddPerasCertEvent" (namespaceFor ev) severityFor (Namespace _ ["LastShutdownUnclean"]) _ = Just Info severityFor (Namespace _ ["ChainSelStarvationEvent"]) _ = Just Debug @@ -215,6 +244,14 @@ instance MetaTrace (ChainDB.TraceEvent blk) where severityFor (Namespace out tl) (Just ev') severityFor (Namespace out ("VolatileDbEvent" : tl)) Nothing = severityFor (Namespace out tl :: Namespace (VolDB.TraceEvent blk)) Nothing + severityFor (Namespace out ("PerasCertDbEvent" : tl)) (Just (ChainDB.TracePerasCertDbEvent ev')) = + severityFor (Namespace out tl) (Just ev') + severityFor (Namespace out ("PerasCertDbEvent" : tl)) Nothing = + severityFor (Namespace out tl :: Namespace (PerasCertDB.TraceEvent blk)) Nothing + severityFor (Namespace out ("AddPerasCertEvent" : tl)) (Just (ChainDB.TraceAddPerasCertEvent ev')) = + severityFor (Namespace out tl) (Just ev') + severityFor (Namespace out ("AddPerasCertEvent" : tl)) Nothing = + severityFor (Namespace out tl :: Namespace (ChainDB.TraceAddPerasCertEvent blk)) Nothing severityFor _ns _ = Nothing privacyFor (Namespace _ ["LastShutdownUnclean"]) _ = Just Public @@ -259,6 +296,14 @@ instance MetaTrace (ChainDB.TraceEvent blk) where privacyFor (Namespace out tl) (Just ev') privacyFor (Namespace out ("VolatileDbEvent" : tl)) Nothing = privacyFor (Namespace out tl :: Namespace (VolDB.TraceEvent blk)) Nothing + privacyFor (Namespace out ("PerasCertDbEvent" : tl)) (Just (ChainDB.TracePerasCertDbEvent ev')) = + privacyFor (Namespace out tl) (Just ev') + privacyFor (Namespace out ("PerasCertDbEvent" : tl)) Nothing = + privacyFor (Namespace out tl :: Namespace (PerasCertDB.TraceEvent blk)) Nothing + privacyFor (Namespace out ("AddPerasCertEvent" : tl)) (Just (ChainDB.TraceAddPerasCertEvent ev')) = + privacyFor (Namespace out tl) (Just ev') + privacyFor (Namespace out ("AddPerasCertEvent" : tl)) Nothing = + privacyFor (Namespace out tl :: Namespace (ChainDB.TraceAddPerasCertEvent blk)) Nothing privacyFor _ _ = Nothing detailsFor (Namespace _ ["LastShutdownUnclean"]) _ = Just DNormal @@ -303,6 +348,14 @@ instance MetaTrace (ChainDB.TraceEvent blk) where detailsFor (Namespace out tl) (Just ev') detailsFor (Namespace out ("VolatileDbEvent" : tl)) Nothing = detailsFor (Namespace out tl :: (Namespace (VolDB.TraceEvent blk))) Nothing + detailsFor (Namespace out ("PerasCertDbEvent" : tl)) (Just (ChainDB.TracePerasCertDbEvent ev')) = + detailsFor (Namespace out tl) (Just ev') + detailsFor (Namespace out ("PerasCertDbEvent" : tl)) Nothing = + detailsFor (Namespace out tl :: Namespace (PerasCertDB.TraceEvent blk)) Nothing + detailsFor (Namespace out ("AddPerasCertEvent" : tl)) (Just (ChainDB.TraceAddPerasCertEvent ev')) = + detailsFor (Namespace out tl) (Just ev') + detailsFor (Namespace out ("AddPerasCertEvent" : tl)) Nothing = + detailsFor (Namespace out tl :: Namespace (ChainDB.TraceAddPerasCertEvent blk)) Nothing detailsFor _ _ = Nothing metricsDocFor (Namespace out ("AddBlockEvent" : tl)) = @@ -356,6 +409,10 @@ instance MetaTrace (ChainDB.TraceEvent blk) where documentFor (Namespace out tl :: Namespace (ImmDB.TraceEvent blk)) documentFor (Namespace out ("VolatileDbEvent" : tl)) = documentFor (Namespace out tl :: Namespace (VolDB.TraceEvent blk)) + documentFor (Namespace out ("PerasCertDbEvent" : tl)) = + documentFor (Namespace out tl :: Namespace (PerasCertDB.TraceEvent blk)) + documentFor (Namespace out ("AddPerasCertEvent" : tl)) = + documentFor (Namespace out tl :: Namespace (ChainDB.TraceAddPerasCertEvent blk)) documentFor _ = Nothing allNamespaces = @@ -381,6 +438,10 @@ instance MetaTrace (ChainDB.TraceEvent blk) where (allNamespaces :: [Namespace (ImmDB.TraceEvent blk)]) ++ map (nsPrependInner "VolatileDbEvent") (allNamespaces :: [Namespace (VolDB.TraceEvent blk)]) + ++ map (nsPrependInner "PerasCertDbEvent") + (allNamespaces :: [Namespace (PerasCertDB.TraceEvent blk)]) + ++ map (nsPrependInner "AddPerasCertEvent") + (allNamespaces :: [Namespace (ChainDB.TraceAddPerasCertEvent blk)]) ) @@ -388,11 +449,63 @@ instance MetaTrace (ChainDB.TraceEvent blk) where -- AddBlockEvent -------------------------------------------------------------------------------- +instance LogFormatting (PraosReasonForSwitch c) where + forHuman (HigherOCert (Comparing ref cand)) = + "candidate has higher OCert (" <> showT cand <> ") than our selection (" <> showT ref <> ")" + forHuman (VRFTiebreak (Comparing ref cand)) = + "candidate has lower VRF (" <> showT cand <> ") than our selection (" <> showT ref <> ")" + forMachine _dtal (HigherOCert (Comparing ref cand)) = + mconcat [ "reason" .= String "HigherOCert", "our" .= String (showT ref), "candidate" .= String (showT cand) ] + forMachine _dtal (VRFTiebreak (Comparing ref cand)) = + mconcat [ "reason" .= String "VRFTiebreak", "our" .= String (showT ref), "candidate" .= String (showT cand) ] + +class (LogFormatting (ReasonForSwitch (TiebreakerView (BlockProtocol a))), SingleEraBlock a) => LFTBV a +instance (LogFormatting (ReasonForSwitch (TiebreakerView (BlockProtocol a))), SingleEraBlock a) => LFTBV a + +instance (All LFTBV xs, CanHardFork xs) => LogFormatting (OneEraReasonForSwitch xs) where + forHuman (OneEraReasonForSwitch ns) = + hcollapse $ hcmap (Proxy @LFTBV) msg ns + where + msg :: forall era. LFTBV era => WrapReasonForSwitch era -> K Text era + msg (WrapReasonForSwitch rs) = K $ + "in era " <> singleEraName (singleEraInfo (Proxy @era)) <> ": " <> forHuman rs + forMachine dtal (OneEraReasonForSwitch ns) = + hcollapse $ hcmap (Proxy @LFTBV) msg ns + where + msg :: forall era. LFTBV era => WrapReasonForSwitch era -> K Object era + msg (WrapReasonForSwitch rs) = K $ + forMachine dtal rs <> mconcat [ "era" .= String (singleEraName (singleEraInfo (Proxy @era))) ] + +instance LogFormatting (ReasonForSwitch (TiebreakerView proto)) => + LogFormatting (WeightedSelectViewReasonForSwitch proto) where + forHuman (Heavier (Comparing ref cand)) = + "candidate is heavier (" <> showT cand <> ") than our selection (" <> showT ref <> ")" + forHuman (WeightedSelectViewTiebreak reason) = forHuman reason + forMachine _dtal (Heavier (Comparing ref cand)) = + mconcat [ "reason" .= String "HigherOCert", "our" .= String (showT ref), "candidate" .= String (showT cand) ] + forMachine dtal (WeightedSelectViewTiebreak reason) = + forMachine dtal reason + +instance LogFormatting (ReasonForSwitch (TiebreakerView proto)) => + LogFormatting (Either (WithEmptyFragmentReasonForSwitch + (WeightedSelectView proto)) (SelectViewReasonForSwitch proto)) where + forHuman (Left CandidateIsNonEmpty) = "candidate is an extension of our selection" + forHuman (Left (BothAreNonEmpty a)) = forHuman a + forHuman (Right (Longer (Comparing ref cand))) = + "candidate is longer (" <> showT cand <> ") than our selection (" <> showT ref <> ")" + forHuman (Right (SelectViewTiebreak a)) = forHuman a + forMachine _dtal (Left CandidateIsNonEmpty) = + mconcat [ "reason" .= String "extension" ] + forMachine dtal (Left (BothAreNonEmpty a)) = forMachine dtal a + forMachine _dtal (Right (Longer (Comparing ref cand))) = + mconcat [ "reason" .= String "Longer", "our" .= String (showT ref), "candidate" .= String (showT cand) ] + forMachine dtal (Right (SelectViewTiebreak a)) = forMachine dtal a instance ( LogFormatting (Header blk) , LogFormatting (LedgerEvent blk) , LogFormatting (RealPoint blk) - , LogFormatting (SelectView (BlockProtocol blk)) + , LogFormatting (WeightedSelectView (BlockProtocol blk)) + , LogFormatting (Either (WithEmptyFragmentReasonForSwitch (WeightedSelectView (BlockProtocol blk))) (SelectViewReasonForSwitch (BlockProtocol blk))) , ConvertRawHash blk , ConvertRawHash (Header blk) , LedgerSupportsProtocol blk @@ -423,12 +536,13 @@ instance ( LogFormatting (Header blk) "Block fits onto some fork: " <> renderRealPointAsPhrase pt forHuman (ChainDB.ChangingSelection pt) = "Changing selection to: " <> renderPointAsPhrase pt - forHuman (ChainDB.AddedToCurrentChain es _ _ c) = + forHuman (ChainDB.AddedToCurrentChain es _ _ c _) = "Chain extended, new tip: " <> renderPointAsPhrase (AF.headPoint c) <> Text.concat [ "\nEvent: " <> showT e | e <- es ] - forHuman (ChainDB.SwitchedToAFork es _ _ c) = + forHuman (ChainDB.SwitchedToAFork es _ _ c reasonForSwitch) = "Switched to a fork, new tip: " <> renderPointAsPhrase (AF.headPoint c) <> - Text.concat [ "\nEvent: " <> showT e | e <- es ] + Text.concat [ "\nEvent: " <> showT e | e <- es ] <> + "\nReason: " <> forHuman reasonForSwitch forHuman (ChainDB.AddBlockValidation ev') = forHuman ev' forHuman (ChainDB.AddedBlockToVolatileDB pt _ _ enclosing) = case enclosing of @@ -480,7 +594,7 @@ instance ( LogFormatting (Header blk) mconcat [ "kind" .= String "TraceAddBlockEvent.ChangingSelection" , "block" .= forMachine dtal pt ] - forMachine DDetailed (ChainDB.AddedToCurrentChain events selChangedInfo base extended) = + forMachine DDetailed (ChainDB.AddedToCurrentChain events selChangedInfo base extended _) = let ChainInformation { .. } = chainInformation selChangedInfo base extended 0 tipBlockIssuerVkHashText :: Text tipBlockIssuerVkHashText = @@ -491,10 +605,10 @@ instance ( LogFormatting (Header blk) in mconcat $ [ "kind" .= String "AddedToCurrentChain" , "newtip" .= renderPointForDetails DDetailed (AF.headPoint extended) - , "newTipSelectView" .= forMachine DDetailed (ChainDB.newTipSelectView selChangedInfo) + , "newSuffixSelectView" .= forMachine DDetailed (ChainDB.newSuffixSelectView selChangedInfo) ] - ++ [ "oldTipSelectView" .= forMachine DDetailed oldTipSelectView - | Just oldTipSelectView <- [ChainDB.oldTipSelectView selChangedInfo] + ++ [ "oldSuffixSelectView" .= forMachine DDetailed oldSuffixSelectView + | Just oldSuffixSelectView <- [ChainDB.oldSuffixSelectView selChangedInfo] ] ++ [ "headers" .= toJSON (forMachine DDetailed `map` addedHdrsNewChain base extended) ] @@ -503,19 +617,18 @@ instance ( LogFormatting (Header blk) ++ [ "tipBlockHash" .= tipBlockHash , "tipBlockParentHash" .= tipBlockParentHash , "tipBlockIssuerVKeyHash" .= tipBlockIssuerVkHashText] - forMachine dtal (ChainDB.AddedToCurrentChain events selChangedInfo _base extended) = + forMachine dtal (ChainDB.AddedToCurrentChain events selChangedInfo _base extended _) = mconcat $ [ "kind" .= String "AddedToCurrentChain" , "newtip" .= renderPointForDetails dtal (AF.headPoint extended) - , "newTipSelectView" .= forMachine dtal (ChainDB.newTipSelectView selChangedInfo) + , "newSuffixSelectView" .= forMachine dtal (ChainDB.newSuffixSelectView selChangedInfo) ] - ++ [ "oldTipSelectView" .= forMachine dtal oldTipSelectView - | Just oldTipSelectView <- [ChainDB.oldTipSelectView selChangedInfo] + ++ [ "oldSuffixSelectView" .= forMachine dtal oldSuffixSelectView + | Just oldSuffixSelectView <- [ChainDB.oldSuffixSelectView selChangedInfo] ] ++ [ "events" .= toJSON (map (forMachine dtal) events) | not (null events) ] - - forMachine DDetailed (ChainDB.SwitchedToAFork events selChangedInfo old new) = + forMachine DDetailed (ChainDB.SwitchedToAFork events selChangedInfo old new reasonForSwitch) = let ChainInformation { .. } = chainInformation selChangedInfo old new 0 tipBlockIssuerVkHashText :: Text tipBlockIssuerVkHashText = @@ -526,10 +639,10 @@ instance ( LogFormatting (Header blk) in mconcat $ [ "kind" .= String "TraceAddBlockEvent.SwitchedToAFork" , "newtip" .= renderPointForDetails DDetailed (AF.headPoint new) - , "newTipSelectView" .= forMachine DDetailed (ChainDB.newTipSelectView selChangedInfo) + , "newSuffixSelectView" .= forMachine DDetailed (ChainDB.newSuffixSelectView selChangedInfo) ] - ++ [ "oldTipSelectView" .= forMachine DDetailed oldTipSelectView - | Just oldTipSelectView <- [ChainDB.oldTipSelectView selChangedInfo] + ++ [ "oldSuffixSelectView" .= forMachine DDetailed oldSuffixSelectView + | Just oldSuffixSelectView <- [ChainDB.oldSuffixSelectView selChangedInfo] ] ++ [ "headers" .= toJSON (forMachine DDetailed `map` addedHdrsNewChain old new) ] @@ -538,17 +651,19 @@ instance ( LogFormatting (Header blk) ++ [ "tipBlockHash" .= tipBlockHash , "tipBlockParentHash" .= tipBlockParentHash , "tipBlockIssuerVKeyHash" .= tipBlockIssuerVkHashText] - forMachine dtal (ChainDB.SwitchedToAFork events selChangedInfo _old new) = + ++ [ "reason" .= forMachine DDetailed reasonForSwitch ] + forMachine dtal (ChainDB.SwitchedToAFork events selChangedInfo _old new reasonForSwitch) = mconcat $ [ "kind" .= String "TraceAddBlockEvent.SwitchedToAFork" , "newtip" .= renderPointForDetails dtal (AF.headPoint new) - , "newTipSelectView" .= forMachine dtal (ChainDB.newTipSelectView selChangedInfo) + , "newSuffixSelectView" .= forMachine dtal (ChainDB.newSuffixSelectView selChangedInfo) ] - ++ [ "oldTipSelectView" .= forMachine dtal oldTipSelectView - | Just oldTipSelectView <- [ChainDB.oldTipSelectView selChangedInfo] + ++ [ "oldSuffixSelectView" .= forMachine dtal oldSuffixSelectView + | Just oldSuffixSelectView <- [ChainDB.oldSuffixSelectView selChangedInfo] ] ++ [ "events" .= toJSON (map (forMachine dtal) events) | not (null events) ] + ++ [ "reason" .= forMachine dtal reasonForSwitch ] forMachine dtal (ChainDB.AddBlockValidation ev') = forMachine dtal ev' @@ -585,7 +700,7 @@ instance ( LogFormatting (Header blk) ] - asMetrics (ChainDB.SwitchedToAFork _warnings selChangedInfo oldChain newChain) = + asMetrics (ChainDB.SwitchedToAFork _warnings selChangedInfo oldChain newChain _) = let forkIt = not $ AF.withinFragmentBounds (AF.headPoint oldChain) newChain ChainInformation { .. } = chainInformation selChangedInfo oldChain newChain 0 @@ -604,7 +719,7 @@ instance ( LogFormatting (Header blk) ,("parent_hash",tipBlockParentHash) ,("issuer_VKey_hash", tipBlockIssuerVkHashText)] ] - asMetrics (ChainDB.AddedToCurrentChain _warnings selChangedInfo oldChain newChain) = + asMetrics (ChainDB.AddedToCurrentChain _warnings selChangedInfo oldChain newChain _) = let ChainInformation { .. } = chainInformation selChangedInfo oldChain newChain 0 tipBlockIssuerVkHashText = @@ -674,11 +789,11 @@ instance MetaTrace (ChainDB.TraceAddBlockEvent blk) where severityFor (Namespace _ ["StoreButDontChange"]) _ = Just Debug severityFor (Namespace _ ["ChangingSelection"]) _ = Just Debug severityFor (Namespace _ ["AddedToCurrentChain"]) - (Just (ChainDB.AddedToCurrentChain events _ _ _)) = + (Just (ChainDB.AddedToCurrentChain events _ _ _ _)) = Just $ maximumDef Notice (map sevLedgerEvent events) severityFor (Namespace _ ["AddedToCurrentChain"]) Nothing = Just Notice severityFor (Namespace _ ["SwitchedToAFork"]) - (Just (ChainDB.SwitchedToAFork events _ _ _)) = + (Just (ChainDB.SwitchedToAFork events _ _ _ _)) = Just $ maximumDef Notice (map sevLedgerEvent events) severityFor (Namespace _ ["SwitchedToAFork"]) _ = Just Notice @@ -1822,29 +1937,43 @@ instance LogFormatting LedgerDB.TraceForkerEventWithKey where "Forker " <> showT k <> ": " <> forHuman ev instance LogFormatting LedgerDB.TraceForkerEvent where - forMachine _dtals LedgerDB.ForkerOpen = mempty - forMachine _dtals LedgerDB.ForkerCloseUncommitted = mempty - forMachine _dtals LedgerDB.ForkerCloseCommitted = mempty - forMachine _dtals LedgerDB.ForkerReadTablesStart = mempty - forMachine _dtals LedgerDB.ForkerReadTablesEnd = mempty - forMachine _dtals LedgerDB.ForkerRangeReadTablesStart = mempty - forMachine _dtals LedgerDB.ForkerRangeReadTablesEnd = mempty + forMachine _dtals LedgerDB.ForkerOpen = + mconcat [ "kind" .= String "ForkerOpen" ] + forMachine _dtals (LedgerDB.ForkerReadTables e) = + mconcat [ "kind" .= String "ForkerReadTables" + , "edge" .= case e of + RisingEdge -> String "RisingEdge" + FallingEdgeWith t -> toJSON t + ] + forMachine _dtals (LedgerDB.ForkerRangeReadTables e) = + mconcat [ "kind" .= String "ForkerRangeReadTables" + , "edge" .= case e of + RisingEdge -> String "RisingEdge" + FallingEdgeWith t -> toJSON t + ] forMachine _dtals LedgerDB.ForkerReadStatistics = mempty - forMachine _dtals LedgerDB.ForkerPushStart = mempty - forMachine _dtals LedgerDB.ForkerPushEnd = mempty - forMachine _dtals LedgerDB.DanglingForkerClosed = mempty + forMachine _dtals (LedgerDB.ForkerPush e) = + mconcat [ "kind" .= String "ForkerPush" + , "edge" .= case e of + RisingEdge -> String "RisingEdge" + FallingEdgeWith t -> toJSON t + ] + forMachine _dtals (LedgerDB.ForkerClose wc) = + mconcat [ "kind" .= String "ForkerClose" + , "wasCommitted" .= toJSON (wc == LedgerDB.ForkerWasCommitted) + ] forHuman LedgerDB.ForkerOpen = "Opened forker" - forHuman LedgerDB.ForkerCloseUncommitted = "Forker closed without committing" - forHuman LedgerDB.ForkerCloseCommitted = "Forker closed after committing" - forHuman LedgerDB.ForkerReadTablesStart = "Started to read tables" - forHuman LedgerDB.ForkerReadTablesEnd = "Finish reading tables" - forHuman LedgerDB.ForkerRangeReadTablesStart = "Started to range read tables" - forHuman LedgerDB.ForkerRangeReadTablesEnd = "Finish range reading tables" - forHuman LedgerDB.ForkerReadStatistics = "Gathering statistics" - forHuman LedgerDB.ForkerPushStart = "Started to push" - forHuman LedgerDB.ForkerPushEnd = "Pushed" - forHuman LedgerDB.DanglingForkerClosed = "Closed dangling forker" + forHuman (LedgerDB.ForkerReadTables RisingEdge) = "Forker reading tables" + forHuman (LedgerDB.ForkerReadTables (FallingEdgeWith t)) = "Forker read tables, took " <> showT t + forHuman (LedgerDB.ForkerRangeReadTables RisingEdge) = "Forker range reading tables" + forHuman (LedgerDB.ForkerRangeReadTables (FallingEdgeWith t)) = "Forker range read tables, took " <> showT t + forHuman LedgerDB.ForkerReadStatistics = "Forker gathering statistics" + forHuman (LedgerDB.ForkerPush RisingEdge) = "Forker pushing" + forHuman (LedgerDB.ForkerPush (FallingEdgeWith t)) = "Forker pushed, took " <> showT t + forHuman (LedgerDB.ForkerClose wc) = "Closed forker, " <> case wc of + LedgerDB.ForkerWasCommitted -> "was committed" + LedgerDB.ForkerWasUncommitted -> "was discarded" instance MetaTrace LedgerDB.TraceForkerEventWithKey where namespaceFor (LedgerDB.TraceForkerEventWithKey _ ev) = @@ -1858,48 +1987,29 @@ instance MetaTrace LedgerDB.TraceForkerEventWithKey where instance MetaTrace LedgerDB.TraceForkerEvent where namespaceFor LedgerDB.ForkerOpen = Namespace [] ["Open"] - namespaceFor LedgerDB.ForkerCloseUncommitted = Namespace [] ["CloseUncommitted"] - namespaceFor LedgerDB.ForkerCloseCommitted = Namespace [] ["CloseCommitted"] - namespaceFor LedgerDB.ForkerReadTablesStart = Namespace [] ["StartRead"] - namespaceFor LedgerDB.ForkerReadTablesEnd = Namespace [] ["FinishRead"] - namespaceFor LedgerDB.ForkerRangeReadTablesStart = Namespace [] ["StartRangeRead"] - namespaceFor LedgerDB.ForkerRangeReadTablesEnd = Namespace [] ["FinishRangeRead"] + namespaceFor LedgerDB.ForkerReadTables{} = Namespace [] ["Read"] + namespaceFor LedgerDB.ForkerRangeReadTables{} = Namespace [] ["RangeRead"] namespaceFor LedgerDB.ForkerReadStatistics = Namespace [] ["Statistics"] - namespaceFor LedgerDB.ForkerPushStart = Namespace [] ["StartPush"] - namespaceFor LedgerDB.ForkerPushEnd = Namespace [] ["FinishPush"] - namespaceFor LedgerDB.DanglingForkerClosed = Namespace [] ["DanglingForkerClosed"] + namespaceFor LedgerDB.ForkerPush{} = Namespace [] ["Push"] + namespaceFor LedgerDB.ForkerClose{} = Namespace [] ["Close"] severityFor _ _ = Just Debug - documentFor (Namespace _ ("Open" : _tl)) = Just - "A forker is being opened" - documentFor (Namespace _ ("CloseUncommitted" : _tl)) = Just $ - mconcat [ "A forker was closed without being committed." - , " This is usually the case with forkers that are not opened for chain selection," - , " and for forkers on discarded forks"] - documentFor (Namespace _ ("CloseCommitted" : _tl)) = Just "A forker was committed (the LedgerDB was modified accordingly) and closed" - documentFor (Namespace _ ("StartRead" : _tl)) = Just "The process for reading ledger tables started" - documentFor (Namespace _ ("FinishRead" : _tl)) = Just "Values from the ledger tables were read" - documentFor (Namespace _ ("StartRangeRead" : _tl)) = Just "The process for range reading ledger tables started" - documentFor (Namespace _ ("FinishRangeRead" : _tl)) = Just "Values from the ledger tables were range-read" + documentFor (Namespace _ ("Open" : _tl)) = Just "A forker is being opened" + documentFor (Namespace _ ("Read" : _tl)) = Just "A forker is reading values" + documentFor (Namespace _ ("RangeRead" : _tl)) = Just "A forker is range reading values" documentFor (Namespace _ ("Statistics" : _tl)) = Just "Statistics were gathered from the forker" - documentFor (Namespace _ ("StartPush" : _tl)) = Just "A ledger state is going to be pushed to the forker" - documentFor (Namespace _ ("FinishPush" : _tl)) = Just "A ledger state was pushed to the forker" - documentFor (Namespace _ ("DanglingForkerClosed" : _tl)) = Just "A dangling forker was closed" + documentFor (Namespace _ ("Push" : _tl)) = Just "A forker is pushing a new ledger state" + documentFor (Namespace _ ("Close" : _tl)) = Just "A forker was closed" documentFor _ = Nothing allNamespaces = [ Namespace [] ["Open"] - , Namespace [] ["CloseUncommitted"] - , Namespace [] ["CloseCommitted"] - , Namespace [] ["StartRead"] - , Namespace [] ["FinishRead"] - , Namespace [] ["StartRangeRead"] - , Namespace [] ["FinishRangeRead"] + , Namespace [] ["Read"] + , Namespace [] ["RangeRead"] , Namespace [] ["Statistics"] - , Namespace [] ["StartPush"] - , Namespace [] ["FinishPush"] - , Namespace [] ["DanglingForkerClosed"] + , Namespace [] ["Push"] + , Namespace [] ["Close"] ] -------------------------------------------------------------------------------- @@ -1920,52 +2030,93 @@ instance MetaTrace LedgerDB.FlavorImplSpecificTrace where nsPrependInner "V2" (namespaceFor ev) severityFor (Namespace out ("V1" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTrace) Nothing + severityFor (Namespace out tl :: Namespace V1.SomeBackendTrace) Nothing severityFor (Namespace out ("V1" : tl)) (Just (LedgerDB.FlavorImplSpecificTraceV1 ev)) = - severityFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTrace) (Just ev) + severityFor (Namespace out tl :: Namespace V1.SomeBackendTrace) (Just ev) severityFor (Namespace out ("V2" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace V2.FlavorImplSpecificTrace) Nothing + severityFor (Namespace out tl :: Namespace V2.LedgerDBV2Trace) Nothing severityFor (Namespace out ("V2" : tl)) (Just (LedgerDB.FlavorImplSpecificTraceV2 ev)) = - severityFor (Namespace out tl :: Namespace V2.FlavorImplSpecificTrace) (Just ev) + severityFor (Namespace out tl :: Namespace V2.LedgerDBV2Trace) (Just ev) severityFor _ _ = Nothing documentFor (Namespace out ("V1" : tl)) = - documentFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTrace) + documentFor (Namespace out tl :: Namespace V1.SomeBackendTrace) documentFor (Namespace out ("V2" : tl)) = - documentFor (Namespace out tl :: Namespace V2.FlavorImplSpecificTrace) + documentFor (Namespace out tl :: Namespace V2.LedgerDBV2Trace) documentFor _ = Nothing allNamespaces = map (nsPrependInner "V1") - (allNamespaces :: [Namespace V1.FlavorImplSpecificTrace]) + (allNamespaces :: [Namespace V1.SomeBackendTrace]) ++ map (nsPrependInner "V2") - (allNamespaces :: [Namespace V2.FlavorImplSpecificTrace]) + (allNamespaces :: [Namespace V2.LedgerDBV2Trace]) -------------------------------------------------------------------------------- -- V1 -------------------------------------------------------------------------------- -instance LogFormatting V1.FlavorImplSpecificTrace where - forMachine dtal (V1.FlavorImplSpecificTraceInMemory ev) = forMachine dtal ev - forMachine dtal (V1.FlavorImplSpecificTraceOnDisk ev) = forMachine dtal ev +unwrapV1Trace :: forall a backend. Typeable backend => (V1.Trace LMDB.LMDB -> a) -> V1.Trace backend -> a +unwrapV1Trace g ev = + case cast @(V1.Trace backend) @(V1.Trace LMDB.LMDB) ev of + Just t -> g t + _ -> error "blah" - forHuman (V1.FlavorImplSpecificTraceInMemory ev) = forHuman ev - forHuman (V1.FlavorImplSpecificTraceOnDisk ev) = forHuman ev +instance LogFormatting V1.SomeBackendTrace where + forMachine dtal (V1.SomeBackendTrace ev) = + unwrapV1Trace (forMachine dtal) ev -instance LogFormatting V1.FlavorImplSpecificTraceInMemory where - forMachine _dtal V1.InMemoryBackingStoreInitialise = mempty - forMachine dtal (V1.InMemoryBackingStoreTrace ev) = forMachine dtal ev + forHuman (V1.SomeBackendTrace ev) = + unwrapV1Trace forHuman ev - forHuman V1.InMemoryBackingStoreInitialise = "Initializing in-memory backing store" - forHuman (V1.InMemoryBackingStoreTrace ev) = forHuman ev +instance MetaTrace V1.SomeBackendTrace where + namespaceFor (V1.SomeBackendTrace ev) = + unwrapV1Trace (nsPrependInner "LMDB" . namespaceFor) ev + + severityFor (Namespace out ("LMDB" : tl)) (Just (V1.SomeBackendTrace ev)) = + unwrapV1Trace (severityFor (Namespace out tl :: Namespace (V1.Trace LMDB.LMDB)) . Just) ev + severityFor (Namespace _ ("LMDB" : _)) Nothing = + Just Debug + severityFor _ _ = Nothing + + documentFor (Namespace _ ("LMDB" : _)) = + Just "An LMDB trace" + documentFor _ = Nothing + + allNamespaces = + map (nsPrependInner "LMDB") + (allNamespaces :: [Namespace (V1.Trace LMDB.LMDB)]) -instance LogFormatting V1.FlavorImplSpecificTraceOnDisk where - forMachine _dtal (V1.OnDiskBackingStoreInitialise limits) = - mconcat [ "limits" .= showT limits ] - forMachine dtal (V1.OnDiskBackingStoreTrace ev) = forMachine dtal ev +instance LogFormatting (V1.Trace LMDB.LMDB) where + forMachine _dtal (LMDB.OnDiskBackingStoreInitialise limits) = + mconcat [ "kind" .= String "LMDBBackingStoreInitialise", "limits" .= showT limits ] + forMachine dtal (LMDB.OnDiskBackingStoreTrace ev) = forMachine dtal ev - forHuman (V1.OnDiskBackingStoreInitialise limits) = "Initializing on-disk backing store with limits " <> showT limits - forHuman (V1.OnDiskBackingStoreTrace ev) = forHuman ev + forHuman (LMDB.OnDiskBackingStoreInitialise limits) = "Initializing LMDB backing store with limits " <> showT limits + forHuman (LMDB.OnDiskBackingStoreTrace ev) = forHuman ev + +instance MetaTrace (V1.Trace LMDB.LMDB) where + namespaceFor LMDB.OnDiskBackingStoreInitialise{} = + Namespace [] ["Initialise"] + namespaceFor (LMDB.OnDiskBackingStoreTrace ev) = + nsPrependInner "BackingStoreEvent" (namespaceFor ev) + + severityFor (Namespace _ ("Initialise" : _)) _ = Just Debug + severityFor (Namespace out ("BackingStoreEvent" : tl)) Nothing = + severityFor (Namespace out tl :: Namespace V1.BackingStoreTrace) Nothing + severityFor (Namespace out ("BackingStoreEvent" : tl)) (Just (LMDB.OnDiskBackingStoreTrace ev)) = + severityFor (Namespace out tl :: Namespace V1.BackingStoreTrace) (Just ev) + severityFor _ _ = Nothing + + documentFor (Namespace _ ("Initialise" : _)) = Just + "Backing store is being initialised" + documentFor (Namespace out ("BackingStoreEvent" : tl)) = + documentFor (Namespace out tl :: Namespace V1.BackingStoreTrace) + documentFor _ = Nothing + + allNamespaces = + Namespace [] ["Initialise"] + : map (nsPrependInner "BackingStoreEvent") + (allNamespaces :: [Namespace V1.BackingStoreTrace]) instance LogFormatting V1.BackingStoreTrace where forMachine _dtals V1.BSOpening = mempty @@ -2005,81 +2156,6 @@ instance LogFormatting V1.BackingStoreValueHandleTrace where forMachine _dtals V1.BSVHStatting = mempty forMachine _dtals V1.BSVHStatted = mempty -instance MetaTrace V1.FlavorImplSpecificTrace where - namespaceFor (V1.FlavorImplSpecificTraceInMemory ev) = - nsPrependInner "InMemory" (namespaceFor ev) - namespaceFor (V1.FlavorImplSpecificTraceOnDisk ev) = - nsPrependInner "OnDisk" (namespaceFor ev) - - severityFor (Namespace out ("InMemory" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTraceInMemory) Nothing - severityFor (Namespace out ("InMemory" : tl)) (Just (V1.FlavorImplSpecificTraceInMemory ev)) = - severityFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTraceInMemory) (Just ev) - severityFor (Namespace out ("OnDisk" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTraceOnDisk) Nothing - severityFor (Namespace out ("OnDisk" : tl)) (Just (V1.FlavorImplSpecificTraceOnDisk ev)) = - severityFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTraceOnDisk) (Just ev) - severityFor _ _ = Nothing - - documentFor (Namespace out ("InMemory" : tl)) = - documentFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTraceInMemory) - documentFor (Namespace out ("OnDisk" : tl)) = - documentFor (Namespace out tl :: Namespace V1.FlavorImplSpecificTraceOnDisk) - documentFor _ = Nothing - - allNamespaces = - map (nsPrependInner "InMemory") - (allNamespaces :: [Namespace V1.FlavorImplSpecificTraceInMemory]) - ++ map (nsPrependInner "OnDisk") - (allNamespaces :: [Namespace V1.FlavorImplSpecificTraceOnDisk]) - -instance MetaTrace V1.FlavorImplSpecificTraceInMemory where - namespaceFor V1.InMemoryBackingStoreInitialise = Namespace [] ["Initialise"] - namespaceFor (V1.InMemoryBackingStoreTrace bsTrace) = - nsPrependInner "BackingStoreEvent" (namespaceFor bsTrace) - - severityFor (Namespace _ ("Initialise" : _)) _ = Just Debug - severityFor (Namespace out ("BackingStoreEvent" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace V1.BackingStoreTrace) Nothing - severityFor (Namespace out ("BackingStoreEvent" : tl)) (Just (V1.InMemoryBackingStoreTrace ev)) = - severityFor (Namespace out tl :: Namespace V1.BackingStoreTrace) (Just ev) - severityFor _ _ = Nothing - - documentFor (Namespace _ ("Initialise" : _)) = Just - "Backing store is being initialised" - documentFor (Namespace out ("BackingStoreEvent" : tl)) = - documentFor (Namespace out tl :: Namespace V1.BackingStoreTrace) - documentFor _ = Nothing - - allNamespaces = - Namespace [] ["Initialise"] - : map (nsPrependInner "BackingStoreEvent") - (allNamespaces :: [Namespace V1.BackingStoreTrace]) - -instance MetaTrace V1.FlavorImplSpecificTraceOnDisk where - namespaceFor V1.OnDiskBackingStoreInitialise{} = - Namespace [] ["Initialise"] - namespaceFor (V1.OnDiskBackingStoreTrace ev) = - nsPrependInner "BackingStoreEvent" (namespaceFor ev) - - severityFor (Namespace _ ("Initialise" : _)) _ = Just Debug - severityFor (Namespace out ("BackingStoreEvent" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace V1.BackingStoreTrace) Nothing - severityFor (Namespace out ("BackingStoreEvent" : tl)) (Just (V1.OnDiskBackingStoreTrace ev)) = - severityFor (Namespace out tl :: Namespace V1.BackingStoreTrace) (Just ev) - severityFor _ _ = Nothing - - documentFor (Namespace _ ("Initialise" : _)) = Just - "Backing store is being initialised" - documentFor (Namespace out ("BackingStoreEvent" : tl)) = - documentFor (Namespace out tl :: Namespace V1.BackingStoreTrace) - documentFor _ = Nothing - - allNamespaces = - Namespace [] ["Initialise"] - : map (nsPrependInner "BackingStoreEvent") - (allNamespaces :: [Namespace V1.BackingStoreTrace]) - instance MetaTrace V1.BackingStoreTrace where namespaceFor V1.BSOpening = Namespace [] ["Opening"] namespaceFor V1.BSOpened{} = Namespace [] ["Opened"] @@ -2238,43 +2314,158 @@ instance MetaTrace V1.BackingStoreValueHandleTrace where , Namespace [] ["Statted"] ] -instance LogFormatting V2.FlavorImplSpecificTrace where - forMachine _dtal V2.TraceLedgerTablesHandleCreate = - mconcat [ "kind" .= String "LedgerTablesHandleCreate" ] - forMachine _dtal V2.TraceLedgerTablesHandleClose = - mconcat [ "kind" .= String "LedgerTablesHandleClose" ] - - forHuman V2.TraceLedgerTablesHandleCreate = - "Created a new 'LedgerTablesHandle', potentially by duplicating an existing one" - forHuman V2.TraceLedgerTablesHandleClose = - "Closed a 'LedgerTablesHandle'" - -instance MetaTrace V2.FlavorImplSpecificTrace where - namespaceFor V2.TraceLedgerTablesHandleCreate = +{------------------------------------------------------------------------------- + V2 +-------------------------------------------------------------------------------} + +instance LogFormatting EnclosingTimed where + forMachine _dtal RisingEdge = mconcat [ "edge" .= String "Starting" ] + forMachine _dtal (FallingEdgeWith a) = mconcat [ "edge" .= toJSON a ] + + forHuman RisingEdge = "Starting" + forHuman (FallingEdgeWith a) = "Completed in " <> showT a <> " seconds" + +instance LogFormatting V2.LedgerDBV2Trace where + forMachine dtal (V2.TraceLedgerTablesHandleCreate enc) = + mconcat [ "kind" .= String "LedgerTablesHandleCreate", "enclosing" .= forMachine dtal enc ] + forMachine dtal (V2.TraceLedgerTablesHandleClose enc) = + mconcat [ "kind" .= String "LedgerTablesHandleClose", "enclosing" .= forMachine dtal enc ] + forMachine dtal (V2.BackendTrace ev) = forMachine dtal ev + forMachine dtal (V2.TraceLedgerTablesHandleRead enc) = + mconcat [ "kind" .= String "LedgerTablesHandleRead", "enclosing" .= forMachine dtal enc ] + forMachine dtal (V2.TraceLedgerTablesHandleDuplicate enc) = + mconcat [ "kind" .= String "LedgerTablesHandleDuplicate", "enclosing" .= forMachine dtal enc ] + forMachine dtal (V2.TraceLedgerTablesHandleCreateFirst enc) = + mconcat [ "kind" .= String "LedgerTablesHandleCreateFirst", "enclosing" .= forMachine dtal enc ] + forMachine dtal (V2.TraceLedgerTablesHandlePush enc) = + mconcat [ "kind" .= String "LedgerTablesHandlePush", "enclosing" .= forMachine dtal enc ] + + forHuman (V2.TraceLedgerTablesHandleCreate enc) = "Created a new 'LedgerTablesHandle': " <> forHuman enc + forHuman (V2.TraceLedgerTablesHandleClose enc) = "Closed a 'LedgerTablesHandle': " <> forHuman enc + forHuman (V2.BackendTrace ev) = forHuman ev + forHuman (V2.TraceLedgerTablesHandleRead enc) = "Read from a 'LedgerTablesHandle': " <> forHuman enc + forHuman (V2.TraceLedgerTablesHandleDuplicate enc) = "Duplicating a 'LedgerTablesHandle': " <> forHuman enc + forHuman (V2.TraceLedgerTablesHandleCreateFirst enc) = "Creating the first 'LedgerTablesHandle': " <> forHuman enc + forHuman (V2.TraceLedgerTablesHandlePush enc) = "Pushing to 'LedgerTablesHandle': " <> forHuman enc + +instance MetaTrace V2.LedgerDBV2Trace where + namespaceFor V2.TraceLedgerTablesHandleCreate{} = Namespace [] ["LedgerTablesHandleCreate"] - namespaceFor V2.TraceLedgerTablesHandleClose = + namespaceFor V2.TraceLedgerTablesHandleClose{} = Namespace [] ["LedgerTablesHandleClose"] + namespaceFor (V2.BackendTrace ev) = nsPrependInner "BackendTrace" (namespaceFor ev) + namespaceFor V2.TraceLedgerTablesHandleRead{} = Namespace [] ["LedgerTablesHandleRead"] + namespaceFor V2.TraceLedgerTablesHandleDuplicate{} = Namespace [] ["LedgerTablesHandleDuplicate"] + namespaceFor V2.TraceLedgerTablesHandleCreateFirst{} = Namespace [] ["LedgerTablesHandleCreateFirst"] + namespaceFor V2.TraceLedgerTablesHandlePush{} = Namespace [] ["LedgerTablesHandlePush"] severityFor (Namespace _ ["LedgerTablesHandleCreate"]) _ = Just Debug severityFor (Namespace _ ["LedgerTablesHandleClose"]) _ = Just Debug + severityFor (Namespace _ ["LedgerTablesHandleRead"]) _ = Just Debug + severityFor (Namespace _ ["LedgerTablesHandleDuplicate"]) _ = Just Debug + severityFor (Namespace _ ["LedgerTablesHandleCreateFirst"]) _ = Just Debug + severityFor (Namespace _ ["LedgerTablesHandlePush"]) _ = Just Debug + severityFor (Namespace _ ("BackendTrace":_)) _ = Just Debug severityFor _ _ = Nothing - -- suspicious - privacyFor (Namespace _ ["LedgerTablesHandleCreate"]) _ = Just Public - privacyFor (Namespace _ ["LedgerTablesHandleClose"]) _ = Just Public - privacyFor _ _ = Just Public - documentFor (Namespace _ ["LedgerTablesHandleCreate"]) = - Just "An in-memory backing store event" + Just "Created a ledger tables handle" documentFor (Namespace _ ["LedgerTablesHandleClose"]) = - Just "An on-disk backing store event" + Just "Closed a ledger tables handle" + documentFor (Namespace _ ["LedgerTablesHandleRead"]) = + Just "Reading from ledger tables handle" + documentFor (Namespace _ ["LedgerTablesHandlePush"]) = + Just "Pushing to a ledger tables handle" + documentFor (Namespace _ ["LedgerTablesHandleCreateFirst"]) = + Just "Creating the first ledger tables handle" + documentFor (Namespace _ ["LedgerTablesHandleDuplicate"]) = + Just "Duplicating a ledger tables handle" documentFor _ = Nothing allNamespaces = [ Namespace [] ["LedgerTablesHandleCreate"] , Namespace [] ["LedgerTablesHandleClose"] + , Namespace [] ["LedgerTablesHandleRead"] + , Namespace [] ["LedgerTablesHandleDuplicate"] + , Namespace [] ["LedgerTablesHandleCreateFirst"] + , Namespace [] ["LedgerTablesHandlePush"] + ] ++ map (nsPrependInner "BackendTrace") (allNamespaces :: [Namespace V2.SomeBackendTrace]) + +instance LogFormatting V2.SomeBackendTrace where + forMachine dtal (V2.SomeBackendTrace ev) = unwrapV2Trace (forMachine dtal) ev + + forHuman (V2.SomeBackendTrace ev) = unwrapV2Trace forHuman ev + +instance MetaTrace V2.SomeBackendTrace where + namespaceFor (V2.SomeBackendTrace ev) = + unwrapV2Trace (nsPrependInner "LSM" . namespaceFor) ev + + severityFor (Namespace _ ("LSM" : _)) _ = Just Debug + severityFor _ _ = Nothing + + documentFor (Namespace out ("LSM" : tl)) = documentFor @(V2.Trace LSM.LSM) (Namespace out tl) + documentFor _ = Nothing + + allNamespaces = + map (nsPrependInner "LSM") (allNamespaces :: [Namespace (V2.Trace LSM.LSM)]) + +instance LogFormatting (V2.Trace LSM.LSM) where + forMachine _dtal (LSM.LSMTreeTrace ev) = mconcat [ "kind" .= String "LSMTreeTrace", "content" .= showT ev] + forMachine dtal (LSM.LSMLookup enc) = mconcat [ "kind" .= String "LSMLookup", "enclosing" .= forMachine dtal enc] + forMachine dtal (LSM.LSMUpdate enc) = mconcat [ "kind" .= String "LSMUpdate", "enclosing" .= forMachine dtal enc] + forMachine dtal (LSM.LSMSnap enc) = mconcat [ "kind" .= String "LSMSnap", "enclosing" .= forMachine dtal enc] + forMachine dtal (LSM.LSMOpenSession enc) = mconcat [ "kind" .= String "LSMOpenSession", "enclosing" .= forMachine dtal enc] + + forHuman (LSM.LSMTreeTrace ev) = showT ev + forHuman (LSM.LSMLookup enc) = "Looking up in LSM database: " <> forHuman enc + forHuman (LSM.LSMUpdate enc) = "Updating the LSM database: " <> forHuman enc + forHuman (LSM.LSMSnap enc) = "Snapshotting the LSM database: " <> forHuman enc + forHuman (LSM.LSMOpenSession enc) = "Opening the LSM session: " <> forHuman enc + + +instance MetaTrace (V2.Trace LSM.LSM) where + namespaceFor LSM.LSMTreeTrace{} = Namespace [] ["LSMTrace"] + namespaceFor LSM.LSMLookup {} = Namespace [] ["LSMLookup"] + namespaceFor LSM.LSMUpdate {} = Namespace [] ["LSMUpdate"] + namespaceFor LSM.LSMSnap {} = Namespace [] ["LSMSnap"] + namespaceFor LSM.LSMOpenSession {} = Namespace [] ["LSMOpenSession"] + + severityFor (Namespace _ ["LSMTrace"]) _ = Just Debug + severityFor (Namespace _ ["LSMLookup"]) _ = Just Debug + severityFor (Namespace _ ["LSMUpdate"]) _ = Just Debug + severityFor (Namespace _ ["LSMSnap"]) _ = Just Debug + severityFor (Namespace _ ["LSMOpenSession"]) _ = Just Debug + severityFor _ _ = Nothing + + documentFor (Namespace _ ["LSMTrace"]) = + Just "A trace from the LSM-trees backend" + documentFor (Namespace _ ["LSMLookup"]) = + Just "Looking up in the LSM-trees backend" + documentFor (Namespace _ ["LSMUpdate"]) = + Just "Updating the LSM-trees backend" + documentFor (Namespace _ ["LSMSnap"]) = + Just "Snapshotting the LSM-trees backend" + documentFor (Namespace _ ["LSMOpenSession"]) = + Just "Opening the LSM-trees backend session" + documentFor _ = Nothing + + allNamespaces = + [ Namespace [] ["LSMTrace"] + , Namespace [] ["LSMLookup"] + , Namespace [] ["LSMUpdate"] + , Namespace [] ["LSMSnap"] + , Namespace [] ["LSMOpenSession"] ] +unwrapV2Trace :: forall a backend. Typeable backend => (V2.Trace LSM.LSM -> a) -> V2.Trace backend -> a +unwrapV2Trace g ev = + case cast @(V2.Trace backend) @(V2.Trace InMemory.Mem) ev of + Just (InMemory.NoTrace v) -> absurd v + Nothing -> + case cast @(V2.Trace backend) @(V2.Trace LSM.LSM) ev of + Just t -> g t + _ -> error "blah" + -------------------------------------------------------------------------------- -- ImmDB.TraceEvent -------------------------------------------------------------------------------- @@ -2889,3 +3080,186 @@ instance (Show (PBFT.PBftVerKeyHash c)) [ "kind" .= String "PBftCannotForgeThresholdExceeded" , "numForged" .= numForged ] + +-- PerasCertDB.TraceEvent instances +instance LogFormatting (PerasCertDB.TraceEvent blk) where + forHuman (PerasCertDB.AddedPerasCert _cert _peer) = "Added Peras certificate to database" + forHuman (PerasCertDB.IgnoredCertAlreadyInDB _cert _peer) = "Ignored Peras certificate already in database" + forHuman PerasCertDB.OpenedPerasCertDB = "Opened Peras certificate database" + forHuman PerasCertDB.ClosedPerasCertDB = "Closed Peras certificate database" + forHuman (PerasCertDB.AddingPerasCert _cert _peer) = "Adding Peras certificate to database" + + forMachine _dtal (PerasCertDB.AddedPerasCert cert _peer) = + mconcat ["kind" .= String "AddedPerasCert", + "cert" .= String (Text.pack $ show cert)] + forMachine _dtal (PerasCertDB.IgnoredCertAlreadyInDB cert _peer) = + mconcat ["kind" .= String "IgnoredCertAlreadyInDB", + "cert" .= String (Text.pack $ show cert)] + forMachine _dtal PerasCertDB.OpenedPerasCertDB = + mconcat ["kind" .= String "OpenedPerasCertDB"] + forMachine _dtal PerasCertDB.ClosedPerasCertDB = + mconcat ["kind" .= String "ClosedPerasCertDB"] + forMachine _dtal (PerasCertDB.AddingPerasCert cert _peer) = + mconcat ["kind" .= String "AddingPerasCert", + "cert" .= String (Text.pack $ show cert)] + + asMetrics _ = [] + +-- ChainDB.TraceAddPerasCertEvent instances +instance ConvertRawHash blk => LogFormatting (ChainDB.TraceAddPerasCertEvent blk) where + forHuman (ChainDB.AddedPerasCertToQueue roundNo boostedBlock _queueSize) = + "Added Peras certificate for round " <> Text.pack (show roundNo) <> + " boosting block " <> renderPoint boostedBlock <> " to queue" + forHuman (ChainDB.PoppedPerasCertFromQueue roundNo boostedBlock) = + "Popped Peras certificate for round " <> Text.pack (show roundNo) <> + " boosting block " <> renderPoint boostedBlock <> " from queue" + forHuman (ChainDB.IgnorePerasCertTooOld roundNo boostedBlock immutableSlot) = + "Ignored Peras certificate for round " <> Text.pack (show roundNo) <> + " boosting block " <> renderPoint boostedBlock <> + " (too old, immutable slot: " <> renderPoint (AF.anchorToPoint immutableSlot) <> ")" + forHuman (ChainDB.PerasCertBoostsCurrentChain roundNo boostedBlock) = + "Peras certificate for round " <> Text.pack (show roundNo) <> + " boosts current chain block " <> renderPoint boostedBlock + forHuman (ChainDB.PerasCertBoostsGenesis roundNo) = + "Peras certificate for round " <> Text.pack (show roundNo) <> " boosts Genesis" + forHuman (ChainDB.PerasCertBoostsBlockNotYetReceived roundNo boostedBlock) = + "Peras certificate for round " <> Text.pack (show roundNo) <> + " boosts block " <> renderPoint boostedBlock <> " not yet received" + forHuman (ChainDB.ChainSelectionForBoostedBlock roundNo boostedBlock) = + "Chain selection for block " <> renderPoint boostedBlock <> + " boosted by Peras certificate from round " <> Text.pack (show roundNo) + + forMachine _dtal (ChainDB.AddedPerasCertToQueue roundNo boostedBlock queueSize) = + mconcat ["kind" .= String "AddedPerasCertToQueue", + "round" .= String (Text.pack $ show roundNo), + "boostedBlock" .= String (renderPoint boostedBlock), + "queueSize" .= toJSON queueSize] + forMachine _dtal (ChainDB.PoppedPerasCertFromQueue roundNo boostedBlock) = + mconcat ["kind" .= String "PoppedPerasCertFromQueue", + "round" .= String (Text.pack $ show roundNo), + "boostedBlock" .= String (renderPoint boostedBlock)] + forMachine _dtal (ChainDB.IgnorePerasCertTooOld roundNo boostedBlock immutableSlot) = + mconcat ["kind" .= String "IgnorePerasCertTooOld", + "round" .= String (Text.pack $ show roundNo), + "boostedBlock" .= String (renderPoint boostedBlock), + "immutableSlot" .= String (renderPoint (AF.anchorToPoint immutableSlot))] + forMachine _dtal (ChainDB.PerasCertBoostsCurrentChain roundNo boostedBlock) = + mconcat ["kind" .= String "PerasCertBoostsCurrentChain", + "round" .= String (Text.pack $ show roundNo), + "boostedBlock" .= String (renderPoint boostedBlock)] + forMachine _dtal (ChainDB.PerasCertBoostsGenesis roundNo) = + mconcat ["kind" .= String "PerasCertBoostsGenesis", + "round" .= String (Text.pack $ show roundNo)] + forMachine _dtal (ChainDB.PerasCertBoostsBlockNotYetReceived roundNo boostedBlock) = + mconcat ["kind" .= String "PerasCertBoostsBlockNotYetReceived", + "round" .= String (Text.pack $ show roundNo), + "boostedBlock" .= String (renderPoint boostedBlock)] + forMachine _dtal (ChainDB.ChainSelectionForBoostedBlock roundNo boostedBlock) = + mconcat ["kind" .= String "ChainSelectionForBoostedBlock", + "round" .= String (Text.pack $ show roundNo), + "boostedBlock" .= String (renderPoint boostedBlock)] + + asMetrics _ = [] + +-- PerasCertDB.TraceEvent MetaTrace instance +instance MetaTrace (PerasCertDB.TraceEvent blk) where + namespaceFor (PerasCertDB.AddedPerasCert _ _) = + Namespace [] ["AddedPerasCert"] + namespaceFor (PerasCertDB.IgnoredCertAlreadyInDB _ _) = + Namespace [] ["IgnoredCertAlreadyInDB"] + namespaceFor PerasCertDB.OpenedPerasCertDB = + Namespace [] ["OpenedPerasCertDB"] + namespaceFor PerasCertDB.ClosedPerasCertDB = + Namespace [] ["ClosedPerasCertDB"] + namespaceFor (PerasCertDB.AddingPerasCert _ _) = + Namespace [] ["AddingPerasCert"] + + severityFor (Namespace _ ["AddedPerasCert"]) _ = Just Info + severityFor (Namespace _ ["IgnoredCertAlreadyInDB"]) _ = Just Info + severityFor (Namespace _ ["OpenedPerasCertDB"]) _ = Just Info + severityFor (Namespace _ ["ClosedPerasCertDB"]) _ = Just Info + severityFor (Namespace _ ["AddingPerasCert"]) _ = Just Debug + severityFor _ _ = Nothing + + privacyFor (Namespace _ ["AddedPerasCert"]) _ = Just Public + privacyFor (Namespace _ ["IgnoredCertAlreadyInDB"]) _ = Just Public + privacyFor (Namespace _ ["OpenedPerasCertDB"]) _ = Just Public + privacyFor (Namespace _ ["ClosedPerasCertDB"]) _ = Just Public + privacyFor (Namespace _ ["AddingPerasCert"]) _ = Just Public + privacyFor _ _ = Nothing + + detailsFor (Namespace _ ["AddedPerasCert"]) _ = Just DNormal + detailsFor (Namespace _ ["IgnoredCertAlreadyInDB"]) _ = Just DNormal + detailsFor (Namespace _ ["OpenedPerasCertDB"]) _ = Just DNormal + detailsFor (Namespace _ ["ClosedPerasCertDB"]) _ = Just DNormal + detailsFor (Namespace _ ["AddingPerasCert"]) _ = Just DDetailed + detailsFor _ _ = Nothing + + documentFor (Namespace _ ["AddedPerasCert"]) = Just "Certificate added to Peras certificate database" + documentFor (Namespace _ ["IgnoredCertAlreadyInDB"]) = Just "Certificate ignored as it was already in the database" + documentFor (Namespace _ ["OpenedPerasCertDB"]) = Just "Peras certificate database opened" + documentFor (Namespace _ ["ClosedPerasCertDB"]) = Just "Peras certificate database closed" + documentFor (Namespace _ ["AddingPerasCert"]) = Just "Adding certificate to Peras certificate database" + documentFor _ = Nothing + + allNamespaces = + [Namespace [] ["AddedPerasCert"], + Namespace [] ["IgnoredCertAlreadyInDB"], + Namespace [] ["OpenedPerasCertDB"], + Namespace [] ["ClosedPerasCertDB"], + Namespace [] ["AddingPerasCert"]] + +-- ChainDB.TraceAddPerasCertEvent MetaTrace instance +instance MetaTrace (ChainDB.TraceAddPerasCertEvent blk) where + namespaceFor ChainDB.AddedPerasCertToQueue{} = Namespace [] ["AddedPerasCertToQueue"] + namespaceFor (ChainDB.PoppedPerasCertFromQueue _ _) = Namespace [] ["PoppedPerasCertFromQueue"] + namespaceFor ChainDB.IgnorePerasCertTooOld{} = Namespace [] ["IgnorePerasCertTooOld"] + namespaceFor (ChainDB.PerasCertBoostsCurrentChain _ _) = Namespace [] ["PerasCertBoostsCurrentChain"] + namespaceFor (ChainDB.PerasCertBoostsGenesis _) = Namespace [] ["PerasCertBoostsGenesis"] + namespaceFor (ChainDB.PerasCertBoostsBlockNotYetReceived _ _) = Namespace [] ["PerasCertBoostsBlockNotYetReceived"] + namespaceFor (ChainDB.ChainSelectionForBoostedBlock _ _) = Namespace [] ["ChainSelectionForBoostedBlock"] + + severityFor (Namespace _ ["AddedPerasCertToQueue"]) _ = Just Debug + severityFor (Namespace _ ["PoppedPerasCertFromQueue"]) _ = Just Debug + severityFor (Namespace _ ["IgnorePerasCertTooOld"]) _ = Just Info + severityFor (Namespace _ ["PerasCertBoostsCurrentChain"]) _ = Just Info + severityFor (Namespace _ ["PerasCertBoostsGenesis"]) _ = Just Info + severityFor (Namespace _ ["PerasCertBoostsBlockNotYetReceived"]) _ = Just Info + severityFor (Namespace _ ["ChainSelectionForBoostedBlock"]) _ = Just Info + severityFor _ _ = Nothing + + privacyFor (Namespace _ ["AddedPerasCertToQueue"]) _ = Just Public + privacyFor (Namespace _ ["PoppedPerasCertFromQueue"]) _ = Just Public + privacyFor (Namespace _ ["IgnorePerasCertTooOld"]) _ = Just Public + privacyFor (Namespace _ ["PerasCertBoostsCurrentChain"]) _ = Just Public + privacyFor (Namespace _ ["PerasCertBoostsGenesis"]) _ = Just Public + privacyFor (Namespace _ ["PerasCertBoostsBlockNotYetReceived"]) _ = Just Public + privacyFor (Namespace _ ["ChainSelectionForBoostedBlock"]) _ = Just Public + privacyFor _ _ = Nothing + + detailsFor (Namespace _ ["AddedPerasCertToQueue"]) _ = Just DDetailed + detailsFor (Namespace _ ["PoppedPerasCertFromQueue"]) _ = Just DDetailed + detailsFor (Namespace _ ["IgnorePerasCertTooOld"]) _ = Just DNormal + detailsFor (Namespace _ ["PerasCertBoostsCurrentChain"]) _ = Just DNormal + detailsFor (Namespace _ ["PerasCertBoostsGenesis"]) _ = Just DNormal + detailsFor (Namespace _ ["PerasCertBoostsBlockNotYetReceived"]) _ = Just DNormal + detailsFor (Namespace _ ["ChainSelectionForBoostedBlock"]) _ = Just DNormal + detailsFor _ _ = Nothing + + documentFor (Namespace _ ["AddedPerasCertToQueue"]) = Just "Peras certificate added to processing queue" + documentFor (Namespace _ ["PoppedPerasCertFromQueue"]) = Just "Peras certificate popped from processing queue" + documentFor (Namespace _ ["IgnorePerasCertTooOld"]) = Just "Peras certificate ignored as it is too old compared to immutable slot" + documentFor (Namespace _ ["PerasCertBoostsCurrentChain"]) = Just "Peras certificate boosts a block on the current selection" + documentFor (Namespace _ ["PerasCertBoostsGenesis"]) = Just "Peras certificate boosts the Genesis point" + documentFor (Namespace _ ["PerasCertBoostsBlockNotYetReceived"]) = Just "Peras certificate boosts a block not yet received" + documentFor (Namespace _ ["ChainSelectionForBoostedBlock"]) = Just "Perform chain selection for block boosted by Peras certificate" + documentFor _ = Nothing + + allNamespaces = + [Namespace [] ["AddedPerasCertToQueue"], + Namespace [] ["PoppedPerasCertFromQueue"], + Namespace [] ["IgnorePerasCertTooOld"], + Namespace [] ["PerasCertBoostsCurrentChain"], + Namespace [] ["PerasCertBoostsGenesis"], + Namespace [] ["PerasCertBoostsBlockNotYetReceived"], + Namespace [] ["ChainSelectionForBoostedBlock"]] diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index 14bb1c02994..2d0bc5988f7 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -69,10 +69,8 @@ import Ouroboros.Network.BlockFetch.ClientState (TraceLabelPeer (..)) import qualified Ouroboros.Network.BlockFetch.ClientState as BlockFetch import Ouroboros.Network.BlockFetch.Decision import Ouroboros.Network.BlockFetch.Decision.Trace (TraceDecisionEvent (..)) -import Ouroboros.Network.ConnectionId (ConnectionId (..)) import Ouroboros.Network.SizeInBytes (SizeInBytes (..)) -import Ouroboros.Network.TxSubmission.Inbound hiding (txId) -import Ouroboros.Network.TxSubmission.Outbound +import Ouroboros.Network.Tracing () import Control.Monad (guard) import Data.Aeson (ToJSON, Value (..), toJSON, (.=)) @@ -87,15 +85,6 @@ import Data.Time (NominalDiffTime) import Data.Word (Word32, Word64) import Network.TypedProtocol.Core -instance (LogFormatting adr, Show adr) => LogFormatting (ConnectionId adr) where - forMachine _dtal (ConnectionId local' remote) = - mconcat [ "connectionId" .= String (showT local' - <> " " - <> showT remote) - ] - forHuman (ConnectionId local' remote) = - "ConnectionId " <> showT local' <> " " <> showT remote - -------------------------------------------------------------------------------- -- TraceLabelCreds peer a -------------------------------------------------------------------------------- @@ -669,7 +658,7 @@ instance MetaTrace (TraceDecisionEvent peer (Header blk)) where allNamespaces = [ Namespace [] ["PeersFetch"], Namespace [] ["PeerStarvedUs"] ] -instance (Show peer, ToJSON peer, ConvertRawHash (Header blk), HasHeader blk) +instance (Show peer, ToJSON peer, ConvertRawHash (Header blk), HasHeader blk, ToJSON (HeaderHash blk)) => LogFormatting (TraceDecisionEvent peer (Header blk)) where forHuman = Text.pack . show @@ -1063,157 +1052,6 @@ instance LogFormatting SanityCheckIssue where forHuman (InconsistentSecurityParam e) = "Configuration contains multiple security parameters: " <> Text.pack (show e) - - --------------------------------------------------------------------------------- --- TxInbound Tracer --------------------------------------------------------------------------------- - -instance LogFormatting (TraceTxSubmissionInbound txid tx) where - forMachine _dtal (TraceTxSubmissionCollected count) = - mconcat - [ "kind" .= String "TraceTxSubmissionCollected" - , "count" .= toJSON count - ] - forMachine _dtal (TraceTxSubmissionProcessed processed) = - mconcat - [ "kind" .= String "TraceTxSubmissionProcessed" - , "accepted" .= toJSON (ptxcAccepted processed) - , "rejected" .= toJSON (ptxcRejected processed) - ] - forMachine _dtal TraceTxInboundTerminated = - mconcat - [ "kind" .= String "TraceTxInboundTerminated" - ] - forMachine _dtal (TraceTxInboundCanRequestMoreTxs count) = - mconcat - [ "kind" .= String "TraceTxInboundCanRequestMoreTxs" - , "count" .= toJSON count - ] - forMachine _dtal (TraceTxInboundCannotRequestMoreTxs count) = - mconcat - [ "kind" .= String "TraceTxInboundCannotRequestMoreTxs" - , "count" .= toJSON count - ] - - asMetrics (TraceTxSubmissionCollected count)= - [CounterM "submissions.submitted" (Just count)] - asMetrics (TraceTxSubmissionProcessed processed) = - [ CounterM "submissions.accepted" - (Just (ptxcAccepted processed)) - , CounterM "submissions.rejected" - (Just (ptxcRejected processed)) - ] - asMetrics _ = [] - -instance MetaTrace (TraceTxSubmissionInbound txid tx) where - namespaceFor TraceTxSubmissionCollected {} = Namespace [] ["Collected"] - namespaceFor TraceTxSubmissionProcessed {} = Namespace [] ["Processed"] - namespaceFor TraceTxInboundTerminated {} = Namespace [] ["Terminated"] - namespaceFor TraceTxInboundCanRequestMoreTxs {} = Namespace [] ["CanRequestMoreTxs"] - namespaceFor TraceTxInboundCannotRequestMoreTxs {} = Namespace [] ["CannotRequestMoreTxs"] - - severityFor (Namespace _ ["Collected"]) _ = Just Debug - severityFor (Namespace _ ["Processed"]) _ = Just Debug - severityFor (Namespace _ ["Terminated"]) _ = Just Notice - severityFor (Namespace _ ["CanRequestMoreTxs"]) _ = Just Debug - severityFor (Namespace _ ["CannotRequestMoreTxs"]) _ = Just Debug - severityFor _ _ = Nothing - - metricsDocFor (Namespace _ ["Collected"]) = - [ ("submissions.submitted", "")] - metricsDocFor (Namespace _ ["Processed"]) = - [ ("submissions.accepted", "") - , ("submissions.rejected", "") - ] - metricsDocFor _ = [] - - documentFor (Namespace _ ["Collected"]) = Just - "Number of transactions just about to be inserted." - documentFor (Namespace _ ["Processed"]) = Just - "Just processed transaction pass/fail breakdown." - documentFor (Namespace _ ["Terminated"]) = Just - "Server received 'MsgDone'." - documentFor (Namespace _ ["CanRequestMoreTxs"]) = Just $ mconcat - [ "There are no replies in flight, but we do know some more txs we" - , " can ask for, so lets ask for them and more txids." - ] - documentFor (Namespace _ ["CannotRequestMoreTxs"]) = Just $ mconcat - [ "There's no replies in flight, and we have no more txs we can" - , " ask for so the only remaining thing to do is to ask for more" - , " txids. Since this is the only thing to do now, we make this a" - , " blocking call." - ] - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["Collected"] - , Namespace [] ["Processed"] - , Namespace [] ["Terminated"] - , Namespace [] ["CanRequestMoreTxs"] - , Namespace [] ["CannotRequestMoreTxs"] - ] - --------------------------------------------------------------------------------- --- TxOutbound Tracer --------------------------------------------------------------------------------- - -instance (Show txid, Show tx) - => LogFormatting (TraceTxSubmissionOutbound txid tx) where - forMachine DDetailed (TraceTxSubmissionOutboundRecvMsgRequestTxs txids) = - mconcat - [ "kind" .= String "TraceTxSubmissionOutboundRecvMsgRequestTxs" - , "txIds" .= String (Text.pack $ show txids) - ] - forMachine _dtal (TraceTxSubmissionOutboundRecvMsgRequestTxs _txids) = - mconcat - [ "kind" .= String "TraceTxSubmissionOutboundRecvMsgRequestTxs" - ] - forMachine DDetailed (TraceTxSubmissionOutboundSendMsgReplyTxs txs) = - mconcat - [ "kind" .= String "TraceTxSubmissionOutboundSendMsgReplyTxs" - , "txs" .= String (Text.pack $ show txs) - ] - forMachine _dtal (TraceTxSubmissionOutboundSendMsgReplyTxs _txs) = - mconcat - [ "kind" .= String "TraceTxSubmissionOutboundSendMsgReplyTxs" - ] - forMachine _dtal (TraceControlMessage _msg) = - mconcat - [ "kind" .= String "TraceControlMessage" - ] - -instance MetaTrace (TraceTxSubmissionOutbound txid tx) where - namespaceFor TraceTxSubmissionOutboundRecvMsgRequestTxs {} = - Namespace [] ["RecvMsgRequest"] - namespaceFor TraceTxSubmissionOutboundSendMsgReplyTxs {} = - Namespace [] ["SendMsgReply"] - namespaceFor TraceControlMessage {} = - Namespace [] ["ControlMessage"] - - severityFor (Namespace _ ["RecvMsgRequest"]) _ = - Just Info - severityFor (Namespace _ ["SendMsgReply"]) _ = - Just Info - severityFor (Namespace _ ["ControlMessage"]) _ = - Just Info - severityFor _ _ = Nothing - - documentFor (Namespace _ ["RecvMsgRequest"]) = Just - "The IDs of the transactions requested." - documentFor (Namespace _ ["SendMsgReply"]) = Just - "The transactions to be sent in the response." - documentFor (Namespace _ ["ControlMessage"]) = Just - "" - documentFor _ = Nothing - - allNamespaces = - [ Namespace [] ["RecvMsgRequest"] - , Namespace [] ["SendMsgReply"] - , Namespace [] ["ControlMessage"] - ] - - -------------------------------------------------------------------------------- -- TxSubmissionServer Tracer -------------------------------------------------------------------------------- diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs index 840076510db..e05ae92b183 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs @@ -13,981 +13,8 @@ {-# OPTIONS_GHC -Wno-orphans #-} -module Cardano.Node.Tracing.Tracers.Diffusion - ( txsMempoolTimeoutHardCounterName - , impliesMempoolTimeoutHard - ) where +module Cardano.Node.Tracing.Tracers.Diffusion () where +import Ouroboros.Network.Tracing () +import Ouroboros.Network.Tracing.PeerSelection () -import Cardano.Logging -import Cardano.Node.Configuration.TopologyP2P () -import Control.Exception (fromException) -import Ouroboros.Consensus.Mempool.API (ExnMempoolTimeout) -import qualified Ouroboros.Network.Diffusion.Types as Diff -import Ouroboros.Network.PeerSelection.LedgerPeers (NumberOfPeers (..), PoolStake (..), - TraceLedgerPeers (..)) -import qualified Ouroboros.Network.Protocol.Handshake.Type as HS - -import Data.Aeson (Value (String), (.=)) -import qualified Data.List as List -import Data.Text (Text, pack) -import Data.Typeable -import Formatting - -import qualified Network.Mux as Mux -#ifdef linux_HOST_OS -import Network.Mux.TCPInfo (StructTCPInfo (..)) -#endif -import Network.Mux.Types (SDUHeader (..), unRemoteClockModel) -import Network.TypedProtocol.Codec (AnyMessage (..)) - --------------------------------------------------------------------------------- --- Mux Tracer --------------------------------------------------------------------------------- - -instance (LogFormatting peer, LogFormatting tr, Typeable tr) => - LogFormatting (Mux.WithBearer peer tr) where - forMachine dtal (Mux.WithBearer b ev) = - mconcat [ "kind" .= (show . typeOf $ ev) - , "bearer" .= forMachine dtal b - , "event" .= forMachine dtal ev ] - forHuman (Mux.WithBearer b ev) = "With mux bearer " <> forHuman b - <> ". " <> forHuman ev - -instance MetaTrace tr => MetaTrace (Mux.WithBearer peer tr) where - namespaceFor (Mux.WithBearer _peer obj) = (nsCast . namespaceFor) obj - severityFor ns Nothing = severityFor (nsCast ns :: Namespace tr) Nothing - severityFor ns (Just (Mux.WithBearer _peer obj)) = - severityFor (nsCast ns) (Just obj) - privacyFor ns Nothing = privacyFor (nsCast ns :: Namespace tr) Nothing - privacyFor ns (Just (Mux.WithBearer _peer obj)) = - privacyFor (nsCast ns) (Just obj) - detailsFor ns Nothing = detailsFor (nsCast ns :: Namespace tr) Nothing - detailsFor ns (Just (Mux.WithBearer _peer obj)) = - detailsFor (nsCast ns) (Just obj) - documentFor ns = documentFor (nsCast ns :: Namespace tr) - metricsDocFor ns = metricsDocFor (nsCast ns :: Namespace tr) - allNamespaces = map nsCast (allNamespaces :: [Namespace tr]) - -instance LogFormatting Mux.BearerTrace where - forMachine _dtal Mux.TraceRecvHeaderStart = mconcat - [ "kind" .= String "Mux.TraceRecvHeaderStart" - , "msg" .= String "Bearer Receive Header Start" - ] - forMachine _dtal (Mux.TraceRecvHeaderEnd SDUHeader { mhTimestamp, mhNum, mhDir, mhLength }) = mconcat - [ "kind" .= String "Mux.TraceRecvHeaderStart" - , "msg" .= String "Bearer Receive Header End" - , "timestamp" .= String (showTHex (unRemoteClockModel mhTimestamp)) - , "miniProtocolNum" .= String (showT mhNum) - , "miniProtocolDir" .= String (showT mhDir) - , "length" .= String (showT mhLength) - ] - forMachine _dtal (Mux.TraceRecvDeltaQObservation SDUHeader { mhTimestamp, mhLength } ts) = mconcat - [ "kind" .= String "Mux.TraceRecvDeltaQObservation" - , "msg" .= String "Bearer DeltaQ observation" - , "timeRemote" .= String (showT ts) - , "timeLocal" .= String (showTHex (unRemoteClockModel mhTimestamp)) - , "length" .= String (showT mhLength) - ] - forMachine _dtal (Mux.TraceRecvDeltaQSample d sp so dqs dqvm dqvs estR sdud) = mconcat - [ "kind" .= String "Mux.TraceRecvDeltaQSample" - , "msg" .= String "Bearer DeltaQ Sample" - , "duration" .= String (showT d) - , "packets" .= String (showT sp) - , "sumBytes" .= String (showT so) - , "DeltaQ_S" .= String (showT dqs) - , "DeltaQ_VMean" .= String (showT dqvm) - , "DeltaQ_VVar" .= String (showT dqvs) - , "DeltaQ_estR" .= String (showT estR) - , "sizeDist" .= String (showT sdud) - ] - forMachine _dtal (Mux.TraceRecvStart len) = mconcat - [ "kind" .= String "Mux.TraceRecvStart" - , "msg" .= String "Bearer Receive Start" - , "length" .= String (showT len) - ] - forMachine _dtal (Mux.TraceRecvRaw len) = mconcat - [ "kind" .= String "Mux.TraceRecvRaw" - , "msg" .= String "Bearer Receive Raw" - , "length" .= String (showT len) - ] - forMachine _dtal (Mux.TraceRecvEnd len) = mconcat - [ "kind" .= String "Mux.TraceRecvEnd" - , "msg" .= String "Bearer Receive End" - , "length" .= String (showT len) - ] - forMachine _dtal (Mux.TraceSendStart SDUHeader { mhTimestamp, mhNum, mhDir, mhLength }) = mconcat - [ "kind" .= String "Mux.TraceSendStart" - , "msg" .= String "Bearer Send Start" - , "timestamp" .= String (showTHex (unRemoteClockModel mhTimestamp)) - , "miniProtocolNum" .= String (showT mhNum) - , "miniProtocolDir" .= String (showT mhDir) - , "length" .= String (showT mhLength) - ] - forMachine _dtal Mux.TraceSendEnd = mconcat - [ "kind" .= String "Mux.TraceSendEnd" - , "msg" .= String "Bearer Send End" - ] - forMachine _dtal Mux.TraceSDUReadTimeoutException = mconcat - [ "kind" .= String "Mux.TraceSDUReadTimeoutException" - , "msg" .= String "Timed out reading SDU" - ] - forMachine _dtal Mux.TraceSDUWriteTimeoutException = mconcat - [ "kind" .= String "Mux.TraceSDUWriteTimeoutException" - , "msg" .= String "Timed out writing SDU" - ] - forMachine _dtal Mux.TraceEmitDeltaQ = mempty -#ifdef linux_HOST_OS - forMachine _dtal (Mux.TraceTCPInfo StructTCPInfo - { tcpi_snd_mss, tcpi_rcv_mss, tcpi_lost, tcpi_retrans - , tcpi_rtt, tcpi_rttvar, tcpi_snd_cwnd } - len) = mconcat - [ "kind" .= String "Mux.TraceTCPInfo" - , "msg" .= String "TCPInfo" - , "rtt" .= (fromIntegral tcpi_rtt :: Word) - , "rttvar" .= (fromIntegral tcpi_rttvar :: Word) - , "snd_cwnd" .= (fromIntegral tcpi_snd_cwnd :: Word) - , "snd_mss" .= (fromIntegral tcpi_snd_mss :: Word) - , "rcv_mss" .= (fromIntegral tcpi_rcv_mss :: Word) - , "lost" .= (fromIntegral tcpi_lost :: Word) - , "retrans" .= (fromIntegral tcpi_retrans :: Word) - , "length" .= len - ] -#else - forMachine _dtal (Mux.TraceTCPInfo _ len) = mconcat - [ "kind" .= String "Mux.TraceTCPInfo" - , "msg" .= String "TCPInfo" - , "len" .= String (showT len) - ] -#endif - - forHuman Mux.TraceRecvHeaderStart = - "Bearer Receive Header Start" - forHuman (Mux.TraceRecvHeaderEnd SDUHeader { mhTimestamp, mhNum, mhDir, mhLength }) = - sformat ("Bearer Receive Header End: ts:" % prefixHex % "(" % shown % ") " % shown % " len " % int) - (unRemoteClockModel mhTimestamp) mhNum mhDir mhLength - forHuman (Mux.TraceRecvDeltaQObservation SDUHeader { mhTimestamp, mhLength } ts) = - sformat ("Bearer DeltaQ observation: remote ts" % int % " local ts " % shown % " length " % int) - (unRemoteClockModel mhTimestamp) ts mhLength - forHuman (Mux.TraceRecvDeltaQSample d sp so dqs dqvm dqvs estR sdud) = - sformat ("Bearer DeltaQ Sample: duration " % fixed 3 % " packets " % int % " sumBytes " - % int % " DeltaQ_S " % fixed 3 % " DeltaQ_VMean " % fixed 3 % "DeltaQ_VVar " % fixed 3 - % " DeltaQ_estR " % fixed 3 % " sizeDist " % string) - d sp so dqs dqvm dqvs estR sdud - forHuman (Mux.TraceRecvStart len) = - sformat ("Bearer Receive Start: length " % int) len - forHuman (Mux.TraceRecvRaw len) = - sformat ("Bearer Receive Raw: length " % int) len - forHuman (Mux.TraceRecvEnd len) = - sformat ("Bearer Receive End: length " % int) len - forHuman (Mux.TraceSendStart SDUHeader { mhTimestamp, mhNum, mhDir, mhLength }) = - sformat ("Bearer Send Start: ts: " % prefixHex % " (" % shown % ") " % shown % " length " % int) - (unRemoteClockModel mhTimestamp) mhNum mhDir mhLength - forHuman Mux.TraceSendEnd = - "Bearer Send End" - forHuman Mux.TraceSDUReadTimeoutException = - "Timed out reading SDU" - forHuman Mux.TraceSDUWriteTimeoutException = - "Timed out writing SDU" - forHuman Mux.TraceEmitDeltaQ = mempty -#ifdef linux_HOST_OS - forHuman (Mux.TraceTCPInfo StructTCPInfo - { tcpi_snd_mss, tcpi_rcv_mss, tcpi_lost, tcpi_retrans - , tcpi_rtt, tcpi_rttvar, tcpi_snd_cwnd } - len) = - sformat ("TCPInfo rtt " % int % " rttvar " % int % " snd_cwnd " % int % - " snd_mss " % int % " rcv_mss " % int % " lost " % int % - " retrans " % int % " len " % int) - (fromIntegral tcpi_rtt :: Word) - (fromIntegral tcpi_rttvar :: Word) - (fromIntegral tcpi_snd_cwnd :: Word) - (fromIntegral tcpi_snd_mss :: Word) - (fromIntegral tcpi_rcv_mss :: Word) - (fromIntegral tcpi_lost :: Word) - (fromIntegral tcpi_retrans :: Word) - len -#else - forHuman (Mux.TraceTCPInfo _ len) = sformat ("TCPInfo len " % int) len -#endif - -instance MetaTrace Mux.BearerTrace where - namespaceFor Mux.TraceRecvHeaderStart {} = - Namespace [] ["RecvHeaderStart"] - namespaceFor Mux.TraceRecvHeaderEnd {} = - Namespace [] ["RecvHeaderEnd"] - namespaceFor Mux.TraceRecvStart {} = - Namespace [] ["RecvStart"] - namespaceFor Mux.TraceRecvRaw {} = - Namespace [] ["RecvRaw"] - namespaceFor Mux.TraceRecvEnd {} = - Namespace [] ["RecvEnd"] - namespaceFor Mux.TraceSendStart {} = - Namespace [] ["SendStart"] - namespaceFor Mux.TraceSendEnd = - Namespace [] ["SendEnd"] - namespaceFor Mux.TraceRecvDeltaQObservation {} = - Namespace [] ["RecvDeltaQObservation"] - namespaceFor Mux.TraceRecvDeltaQSample {} = - Namespace [] ["RecvDeltaQSample"] - namespaceFor Mux.TraceSDUReadTimeoutException = - Namespace [] ["SDUReadTimeoutException"] - namespaceFor Mux.TraceSDUWriteTimeoutException = - Namespace [] ["SDUWriteTimeoutException"] - namespaceFor Mux.TraceEmitDeltaQ = - Namespace [] ["TraceEmitDeltaQ"] - namespaceFor Mux.TraceTCPInfo {} = - Namespace [] ["TCPInfo"] - - severityFor (Namespace _ ["RecvHeaderStart"]) _ = Just Debug - severityFor (Namespace _ ["RecvRaw"]) _ = Just Debug - severityFor (Namespace _ ["RecvHeaderEnd"]) _ = Just Debug - severityFor (Namespace _ ["RecvStart"]) _ = Just Debug - severityFor (Namespace _ ["RecvEnd"]) _ = Just Debug - severityFor (Namespace _ ["SendStart"]) _ = Just Debug - severityFor (Namespace _ ["SendEnd"]) _ = Just Debug - severityFor (Namespace _ ["RecvDeltaQObservation"]) _ = Just Debug - severityFor (Namespace _ ["RecvDeltaQSample"]) _ = Just Debug - severityFor (Namespace _ ["SDUReadTimeoutException"]) _ = Just Notice - severityFor (Namespace _ ["SDUWriteTimeoutException"]) _ = Just Notice - severityFor (Namespace _ ["TCPInfo"]) _ = Just Debug - severityFor (Namespace _ ["TraceEmitDeltaQ"]) _ = Nothing - severityFor _ _ = Nothing - - documentFor (Namespace _ ["RecvHeaderStart"]) = Just - "Bearer receive header start." - documentFor (Namespace _ ["RecvRaw"]) = Just - "Bearer receive raw." - documentFor (Namespace _ ["RecvHeaderEnd"]) = Just - "Bearer receive header end." - documentFor (Namespace _ ["RecvStart"]) = Just - "Bearer receive start." - documentFor (Namespace _ ["RecvEnd"]) = Just - "Bearer receive end." - documentFor (Namespace _ ["SendStart"]) = Just - "Bearer send start." - documentFor (Namespace _ ["SendEnd"]) = Just - "Bearer send end." - documentFor (Namespace _ ["RecvDeltaQObservation"]) = Just - "Bearer DeltaQ observation." - documentFor (Namespace _ ["RecvDeltaQSample"]) = Just - "Bearer DeltaQ sample." - documentFor (Namespace _ ["SDUReadTimeoutException"]) = Just - "Timed out reading SDU." - documentFor (Namespace _ ["SDUWriteTimeoutException"]) = Just - "Timed out writing SDU." - documentFor (Namespace _ ["TraceEmitDeltaQ"]) = Nothing - documentFor (Namespace _ ["TCPInfo"]) = Just - "TCPInfo." - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["RecvHeaderStart"] - , Namespace [] ["RecvRaw"] - , Namespace [] ["RecvHeaderEnd"] - , Namespace [] ["RecvStart"] - , Namespace [] ["RecvEnd"] - , Namespace [] ["SendStart"] - , Namespace [] ["SendEnd"] - , Namespace [] ["RecvDeltaQObservation"] - , Namespace [] ["RecvDeltaQSample"] - , Namespace [] ["SDUReadTimeoutException"] - , Namespace [] ["SDUWriteTimeoutException"] - , Namespace [] ["TraceEmitDeltaQ"] - , Namespace [] ["TCPInfo"] - ] - -instance LogFormatting Mux.ChannelTrace where - forMachine _dtal (Mux.TraceChannelRecvStart mid) = mconcat - [ "kind" .= String "Mux.TraceChannelRecvStart" - , "msg" .= String "Channel Receive Start" - , "miniProtocolNum" .= String (showT mid) - ] - forMachine _dtal (Mux.TraceChannelRecvEnd mid len) = mconcat - [ "kind" .= String "Mux.TraceChannelRecvEnd" - , "msg" .= String "Channel Receive End" - , "miniProtocolNum" .= String (showT mid) - , "length" .= String (showT len) - ] - forMachine _dtal (Mux.TraceChannelSendStart mid len) = mconcat - [ "kind" .= String "Mux.TraceChannelSendStart" - , "msg" .= String "Channel Send Start" - , "miniProtocolNum" .= String (showT mid) - , "length" .= String (showT len) - ] - forMachine _dtal (Mux.TraceChannelSendEnd mid) = mconcat - [ "kind" .= String "Mux.TraceChannelSendEnd" - , "msg" .= String "Channel Send End" - , "miniProtocolNum" .= String (showT mid) - ] - - forHuman (Mux.TraceChannelRecvStart mid) = - sformat ("Channel Receive Start on " % shown) mid - forHuman (Mux.TraceChannelRecvEnd mid len) = - sformat ("Channel Receive End on (" % shown % ") " % int) mid len - forHuman (Mux.TraceChannelSendStart mid len) = - sformat ("Channel Send Start on (" % shown % ") " % int) mid len - forHuman (Mux.TraceChannelSendEnd mid) = - sformat ("Channel Send End on " % shown) mid - -instance MetaTrace Mux.ChannelTrace where - namespaceFor Mux.TraceChannelRecvStart {} = - Namespace [] ["ChannelRecvStart"] - namespaceFor Mux.TraceChannelRecvEnd {} = - Namespace [] ["ChannelRecvEnd"] - namespaceFor Mux.TraceChannelSendStart {} = - Namespace [] ["ChannelSendStart"] - namespaceFor Mux.TraceChannelSendEnd {} = - Namespace [] ["ChannelSendEnd"] - - severityFor (Namespace _ ["ChannelRecvStart"]) _ = Just Debug - severityFor (Namespace _ ["ChannelRecvEnd"]) _ = Just Debug - severityFor (Namespace _ ["ChannelSendStart"]) _ = Just Debug - severityFor (Namespace _ ["ChannelSendEnd"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["ChannelRecvStart"]) = Just - "Channel receive start." - documentFor (Namespace _ ["ChannelRecvEnd"]) = Just - "Channel receive end." - documentFor (Namespace _ ["ChannelSendStart"]) = Just - "Channel send start." - documentFor (Namespace _ ["ChannelSendEnd"]) = Just - "Channel send end." - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["ChannelRecvStart"] - , Namespace [] ["ChannelRecvEnd"] - , Namespace [] ["ChannelSendStart"] - , Namespace [] ["ChannelSendEnd"] - ] - -txsMempoolTimeoutHardCounterName :: Text -txsMempoolTimeoutHardCounterName = "txsMempoolTimeoutHard" - -impliesMempoolTimeoutHard :: Mux.Trace -> Bool -impliesMempoolTimeoutHard = \case - Mux.TraceExceptionExit _mid _dir e - | Just _ <- fromException @ExnMempoolTimeout e - -> True - _ -> False - -instance LogFormatting Mux.Trace where - forMachine _dtal (Mux.TraceState new) = mconcat - [ "kind" .= String "Mux.TraceState" - , "msg" .= String "MuxState" - , "state" .= String (showT new) - ] - forMachine _dtal (Mux.TraceCleanExit mid dir) = mconcat - [ "kind" .= String "Mux.TraceCleanExit" - , "msg" .= String "Miniprotocol terminated cleanly" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - ] - forMachine _dtal (Mux.TraceExceptionExit mid dir exc) = mconcat - [ "kind" .= String "Mux.TraceExceptionExit" - , "msg" .= String "Miniprotocol terminated with exception" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - , "exception" .= String (showT exc) - ] - forMachine _dtal (Mux.TraceStartEagerly mid dir) = mconcat - [ "kind" .= String "Mux.TraceStartEagerly" - , "msg" .= String "Eagerly started" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - ] - forMachine _dtal (Mux.TraceStartOnDemand mid dir) = mconcat - [ "kind" .= String "Mux.TraceStartOnDemand" - , "msg" .= String "Preparing to start" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - ] - forMachine _dtal (Mux.TraceStartOnDemandAny mid dir) = mconcat - [ "kind" .= String "Mux.TraceStartOnDemandAny" - , "msg" .= String "Preparing to start" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - ] - forMachine _dtal (Mux.TraceStartedOnDemand mid dir) = mconcat - [ "kind" .= String "Mux.TraceStartedOnDemand" - , "msg" .= String "Started on demand" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - ] - forMachine _dtal (Mux.TraceTerminating mid dir) = mconcat - [ "kind" .= String "Mux.TraceTerminating" - , "msg" .= String "Terminating" - , "miniProtocolNum" .= String (showT mid) - , "miniProtocolDir" .= String (showT dir) - ] - forMachine _dtal Mux.TraceStopping = mconcat - [ "kind" .= String "Mux.TraceStopping" - , "msg" .= String "Mux stopping" - ] - forMachine _dtal Mux.TraceStopped = mconcat - [ "kind" .= String "Mux.TraceStopped" - , "msg" .= String "Mux stoppped" - ] - - forHuman (Mux.TraceState new) = - sformat ("State: " % shown) new - forHuman (Mux.TraceCleanExit mid dir) = - sformat ("Miniprotocol (" % shown % ") " % shown % " terminated cleanly") - mid dir - forHuman (Mux.TraceExceptionExit mid dir e) = - sformat ("Miniprotocol (" % shown % ") " % shown % - " terminated with exception " % shown) mid dir e - forHuman (Mux.TraceStartEagerly mid dir) = - sformat ("Eagerly started (" % shown % ") in " % shown) mid dir - forHuman (Mux.TraceStartOnDemand mid dir) = - sformat ("Preparing to start (" % shown % ") in " % shown) mid dir - forHuman (Mux.TraceStartOnDemandAny mid dir) = - sformat ("Preparing to start (" % shown % ") in " % shown) mid dir - forHuman (Mux.TraceStartedOnDemand mid dir) = - sformat ("Started on demand (" % shown % ") in " % shown) mid dir - forHuman (Mux.TraceTerminating mid dir) = - sformat ("Terminating (" % shown % ") in " % shown) mid dir - forHuman Mux.TraceStopping = "Mux stopping" - forHuman Mux.TraceStopped = "Mux stoppped" - - asMetrics = \case - Mux.TraceState{} -> [] - Mux.TraceCleanExit{} -> [] - ev@Mux.TraceExceptionExit{} -> - -- Somewhat awkward to "catch" this Consensus exception here, but - -- Diffusion Layer is indeed the ultimate manager of the per-peer - -- threads. - [ CounterM txsMempoolTimeoutHardCounterName Nothing - | impliesMempoolTimeoutHard ev - ] - Mux.TraceStartEagerly{} -> [] - Mux.TraceStartOnDemand{} -> [] - Mux.TraceStartOnDemandAny{} -> [] - Mux.TraceStartedOnDemand{} -> [] - Mux.TraceTerminating{} -> [] - Mux.TraceStopping{} -> [] - Mux.TraceStopped{} -> [] - -instance MetaTrace Mux.Trace where - namespaceFor Mux.TraceState {} = - Namespace [] ["State"] - namespaceFor Mux.TraceCleanExit {} = - Namespace [] ["CleanExit"] - namespaceFor Mux.TraceExceptionExit {} = - Namespace [] ["ExceptionExit"] - namespaceFor Mux.TraceStartEagerly {} = - Namespace [] ["StartEagerly"] - namespaceFor Mux.TraceStartOnDemand {} = - Namespace [] ["StartOnDemand"] - namespaceFor Mux.TraceStartOnDemandAny {} = - Namespace [] ["StartOnDemandAny"] - namespaceFor Mux.TraceStartedOnDemand {} = - Namespace [] ["StartedOnDemand"] - namespaceFor Mux.TraceTerminating {} = - Namespace [] ["Terminating"] - namespaceFor Mux.TraceStopping = - Namespace [] ["Stopping"] - namespaceFor Mux.TraceStopped = - Namespace [] ["Stopped"] - - severityFor (Namespace _ ["State"]) _ = Just Info - severityFor (Namespace _ ["CleanExit"]) _ = Just Notice - severityFor (Namespace _ ["ExceptionExit"]) _ = Just Notice - severityFor (Namespace _ ["StartEagerly"]) _ = Just Debug - severityFor (Namespace _ ["StartOnDemand"]) _ = Just Debug - severityFor (Namespace _ ["StartOnDemandAny"]) _ = Just Debug - severityFor (Namespace _ ["StartedOnDemand"]) _ = Just Debug - severityFor (Namespace _ ["Terminating"]) _ = Just Debug - severityFor (Namespace _ ["Stopping"]) _ = Just Debug - severityFor (Namespace _ ["Stopped"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["State"]) = Just - "State." - documentFor (Namespace _ ["CleanExit"]) = Just - "Miniprotocol terminated cleanly." - documentFor (Namespace _ ["ExceptionExit"]) = Just - "Miniprotocol terminated with exception." - documentFor (Namespace _ ["StartEagerly"]) = Just - "Eagerly started." - documentFor (Namespace _ ["StartOnDemand"]) = Just - "Preparing to start." - documentFor (Namespace _ ["StartedOnDemand"]) = Just - "Started on demand." - documentFor (Namespace _ ["StartOnDemandAny"]) = Just - "Start whenever any other protocol has started." - documentFor (Namespace _ ["Terminating"]) = Just - "Terminating." - documentFor (Namespace _ ["Stopping"]) = Just - "Mux shutdown." - documentFor (Namespace _ ["Stopped"]) = Just - "Mux shutdown." - documentFor _ = Nothing - - metricsDocFor (Namespace _ ["State"]) = [] - metricsDocFor (Namespace _ ["CleanExit"]) = [] - metricsDocFor (Namespace _ ["ExceptionExit"]) = - [ (txsMempoolTimeoutHardCounterName, "Transactions that hard timed out in mempool") - ] - metricsDocFor (Namespace _ ["StartEagerly"]) = [] - metricsDocFor (Namespace _ ["StartOnDemand"]) = [] - metricsDocFor (Namespace _ ["StartedOnDemand"]) = [] - metricsDocFor (Namespace _ ["StartOnDemandAny"]) = [] - metricsDocFor (Namespace _ ["Terminating"]) = [] - metricsDocFor (Namespace _ ["Stopping"]) = [] - metricsDocFor (Namespace _ ["Stopped"]) = [] - metricsDocFor _ = [] - - allNamespaces = [ - Namespace [] ["State"] - , Namespace [] ["CleanExit"] - , Namespace [] ["ExceptionExit"] - , Namespace [] ["StartEagerly"] - , Namespace [] ["StartOnDemand"] - , Namespace [] ["StartOnDemandAny"] - , Namespace [] ["StartedOnDemand"] - , Namespace [] ["Terminating"] - , Namespace [] ["Stopping"] - , Namespace [] ["Stopped"] - ] - - --------------------------------------------------------------------------------- --- Handshake Tracer --------------------------------------------------------------------------------- - -instance (Show term, Show ntcVersion) => - LogFormatting (AnyMessage (HS.Handshake ntcVersion term)) where - forMachine _dtal (AnyMessageAndAgency stok msg) = - mconcat [ "kind" .= String kind - , "msg" .= (String . showT $ msg) - , "agency" .= String (pack $ show stok) - ] - where - kind = case msg of - HS.MsgProposeVersions {} -> "ProposeVersions" - HS.MsgReplyVersions {} -> "ReplyVersions" - HS.MsgQueryReply {} -> "QueryReply" - HS.MsgAcceptVersion {} -> "AcceptVersion" - HS.MsgRefuse {} -> "Refuse" - - forHuman (AnyMessageAndAgency stok msg) = - "Handshake (agency, message) = " <> "(" <> showT stok <> "," <> showT msg <> ")" - -instance MetaTrace (AnyMessage (HS.Handshake a b)) where - namespaceFor (AnyMessage msg) = Namespace [] $ case msg of - HS.MsgProposeVersions {} -> ["ProposeVersions"] - HS.MsgReplyVersions {} -> ["ReplyVersions"] - HS.MsgQueryReply {} -> ["QueryReply"] - HS.MsgAcceptVersion {} -> ["AcceptVersion"] - HS.MsgRefuse {} -> ["Refuse"] - - severityFor (Namespace _ [sym]) _ = case sym of - "ProposeVersions" -> Just Debug - "ReplyVersions" -> Just Debug - "QueryReply" -> Just Debug - "AcceptVersion" -> Just Debug - "Refuse" -> Just Debug - _otherwise -> Nothing - severityFor _ _ = Nothing - - documentFor (Namespace _ sym) = wrap . mconcat $ case sym of - ["ProposeVersions"] -> - [ "Propose versions together with version parameters. It must be" - , " encoded to a sorted list.." - ] - ["ReplyVersions"] -> - [ "`MsgReplyVersions` received as a response to 'MsgProposeVersions'. It" - , " is not supported to explicitly send this message. It can only be" - , " received as a copy of 'MsgProposeVersions' in a simultaneous open" - , " scenario." - ] - ["QueryReply"] -> - [ "`MsgQueryReply` received as a response to a handshake query in " - , " 'MsgProposeVersions' and lists the supported versions." - ] - ["AcceptVersion"] -> - [ "The remote end decides which version to use and sends chosen version." - , "The server is allowed to modify version parameters." - ] - ["Refuse"] -> ["It refuses to run any version."] - _otherwise -> [] :: [Text] - where - wrap it = case it of - "" -> Nothing - it' -> Just it' - - allNamespaces = [ - Namespace [] ["ProposeVersions"] - , Namespace [] ["ReplyVersions"] - , Namespace [] ["QueryReply"] - , Namespace [] ["AcceptVersion"] - , Namespace [] ["Refuse"] - ] - - --------------------------------------------------------------------------------- --- DiffusionInit Tracer --------------------------------------------------------------------------------- - -instance (Show ntnAddr, Show ntcAddr) => - LogFormatting (Diff.DiffusionTracer ntnAddr ntcAddr) where - forMachine _dtal (Diff.RunServer sockAddr) = mconcat - [ "kind" .= String "RunServer" - , "socketAddress" .= String (pack (show sockAddr)) - ] - - forMachine _dtal (Diff.RunLocalServer localAddress) = mconcat - [ "kind" .= String "RunLocalServer" - , "localAddress" .= String (pack (show localAddress)) - ] - forMachine _dtal (Diff.UsingSystemdSocket localAddress) = mconcat - [ "kind" .= String "UsingSystemdSocket" - , "path" .= String (pack . show $ localAddress) - ] - - forMachine _dtal (Diff.CreateSystemdSocketForSnocketPath localAddress) = mconcat - [ "kind" .= String "CreateSystemdSocketForSnocketPath" - , "path" .= String (pack . show $ localAddress) - ] - forMachine _dtal (Diff.CreatedLocalSocket localAddress) = mconcat - [ "kind" .= String "CreatedLocalSocket" - , "path" .= String (pack . show $ localAddress) - ] - forMachine _dtal (Diff.ConfiguringLocalSocket localAddress socket) = mconcat - [ "kind" .= String "ConfiguringLocalSocket" - , "path" .= String (pack . show $ localAddress) - , "socket" .= String (pack (show socket)) - ] - forMachine _dtal (Diff.ListeningLocalSocket localAddress socket) = mconcat - [ "kind" .= String "ListeningLocalSocket" - , "path" .= String (pack . show $ localAddress) - , "socket" .= String (pack (show socket)) - ] - forMachine _dtal (Diff.LocalSocketUp localAddress fd) = mconcat - [ "kind" .= String "LocalSocketUp" - , "path" .= String (pack . show $ localAddress) - , "socket" .= String (pack (show fd)) - ] - forMachine _dtal (Diff.CreatingServerSocket socket) = mconcat - [ "kind" .= String "CreatingServerSocket" - , "socket" .= String (pack (show socket)) - ] - forMachine _dtal (Diff.ListeningServerSocket socket) = mconcat - [ "kind" .= String "ListeningServerSocket" - , "socket" .= String (pack (show socket)) - ] - forMachine _dtal (Diff.ServerSocketUp socket) = mconcat - [ "kind" .= String "ServerSocketUp" - , "socket" .= String (pack (show socket)) - ] - forMachine _dtal (Diff.ConfiguringServerSocket socket) = mconcat - [ "kind" .= String "ConfiguringServerSocket" - , "socket" .= String (pack (show socket)) - ] - forMachine _dtal (Diff.UnsupportedLocalSystemdSocket path) = mconcat - [ "kind" .= String "UnsupportedLocalSystemdSocket" - , "path" .= String (pack (show path)) - ] - forMachine _dtal Diff.UnsupportedReadySocketCase = mconcat - [ "kind" .= String "UnsupportedReadySocketCase" - ] - forMachine _dtal (Diff.DiffusionErrored exception) = mconcat - [ "kind" .= String "DiffusionErrored" - , "error" .= String (pack (show exception)) - ] - forMachine _dtal (Diff.SystemdSocketConfiguration config) = mconcat - [ "kind" .= String "SystemdSocketConfiguration" - , "path" .= String (pack (show config)) - ] - -instance MetaTrace (Diff.DiffusionTracer ntnAddr ntcAddr) where - namespaceFor Diff.RunServer {} = - Namespace [] ["RunServer"] - namespaceFor Diff.RunLocalServer {} = - Namespace [] ["RunLocalServer"] - namespaceFor Diff.UsingSystemdSocket {} = - Namespace [] ["UsingSystemdSocket"] - namespaceFor Diff.CreateSystemdSocketForSnocketPath {} = - Namespace [] ["CreateSystemdSocketForSnocketPath"] - namespaceFor Diff.CreatedLocalSocket {} = - Namespace [] ["CreatedLocalSocket"] - namespaceFor Diff.ConfiguringLocalSocket {} = - Namespace [] ["ConfiguringLocalSocket"] - namespaceFor Diff.ListeningLocalSocket {} = - Namespace [] ["ListeningLocalSocket"] - namespaceFor Diff.LocalSocketUp {} = - Namespace [] ["LocalSocketUp"] - namespaceFor Diff.CreatingServerSocket {} = - Namespace [] ["CreatingServerSocket"] - namespaceFor Diff.ListeningServerSocket {} = - Namespace [] ["ListeningServerSocket"] - namespaceFor Diff.ServerSocketUp {} = - Namespace [] ["ServerSocketUp"] - namespaceFor Diff.ConfiguringServerSocket {} = - Namespace [] ["ConfiguringServerSocket"] - namespaceFor Diff.UnsupportedLocalSystemdSocket {} = - Namespace [] ["UnsupportedLocalSystemdSocket"] - namespaceFor Diff.UnsupportedReadySocketCase {} = - Namespace [] ["UnsupportedReadySocketCase"] - namespaceFor Diff.DiffusionErrored {} = - Namespace [] ["DiffusionErrored"] - namespaceFor Diff.SystemdSocketConfiguration {} = - Namespace [] ["SystemdSocketConfiguration"] - - severityFor (Namespace _ ["RunServer"]) _ = Just Info - severityFor (Namespace _ ["RunLocalServer"]) _ = Just Info - severityFor (Namespace _ ["UsingSystemdSocket"]) _ = Just Info - severityFor (Namespace _ ["CreateSystemdSocketForSnocketPath"]) _ = Just Info - severityFor (Namespace _ ["CreatedLocalSocket"]) _ = Just Info - severityFor (Namespace _ ["ConfiguringLocalSocket"]) _ = Just Info - severityFor (Namespace _ ["ListeningLocalSocket"]) _ = Just Info - severityFor (Namespace _ ["LocalSocketUp"]) _ = Just Info - severityFor (Namespace _ ["CreatingServerSocket"]) _ = Just Info - severityFor (Namespace _ ["ListeningServerSocket"]) _ = Just Info - severityFor (Namespace _ ["ServerSocketUp"]) _ = Just Info - severityFor (Namespace _ ["ConfiguringServerSocket"]) _ = Just Info - severityFor (Namespace _ ["UnsupportedLocalSystemdSocket"]) _ = Just Warning - severityFor (Namespace _ ["UnsupportedReadySocketCase"]) _ = Just Info - severityFor (Namespace _ ["DiffusionErrored"]) _ = Just Critical - severityFor (Namespace _ ["SystemdSocketConfiguration"]) _ = Just Warning - severityFor _ _ = Nothing - - documentFor (Namespace _ ["RunServer"]) = Just - "RunServer" - documentFor (Namespace _ ["RunLocalServer"]) = Just - "RunLocalServer" - documentFor (Namespace _ ["UsingSystemdSocket"]) = Just - "UsingSystemdSocket" - documentFor (Namespace _ ["CreateSystemdSocketForSnocketPath"]) = Just - "CreateSystemdSocketForSnocketPath" - documentFor (Namespace _ ["CreatedLocalSocket"]) = Just - "CreatedLocalSocket" - documentFor (Namespace _ ["ConfiguringLocalSocket"]) = Just - "ConfiguringLocalSocket" - documentFor (Namespace _ ["ListeningLocalSocket"]) = Just - "ListeningLocalSocket" - documentFor (Namespace _ ["LocalSocketUp"]) = Just - "LocalSocketUp" - documentFor (Namespace _ ["CreatingServerSocket"]) = Just - "CreatingServerSocket" - documentFor (Namespace _ ["ListeningServerSocket"]) = Just - "ListeningServerSocket" - documentFor (Namespace _ ["ServerSocketUp"]) = Just - "ServerSocketUp" - documentFor (Namespace _ ["ConfiguringServerSocket"]) = Just - "ConfiguringServerSocket" - documentFor (Namespace _ ["UnsupportedLocalSystemdSocket"]) = Just - "UnsupportedLocalSystemdSocket" - documentFor (Namespace _ ["UnsupportedReadySocketCase"]) = Just - "UnsupportedReadySocketCase" - documentFor (Namespace _ ["DiffusionErrored"]) = Just - "DiffusionErrored" - documentFor (Namespace _ ["SystemdSocketConfiguration"]) = Just - "SystemdSocketConfiguration" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["RunServer"] - , Namespace [] ["RunLocalServer"] - , Namespace [] ["UsingSystemdSocket"] - , Namespace [] ["CreateSystemdSocketForSnocketPath"] - , Namespace [] ["CreatedLocalSocket"] - , Namespace [] ["ConfiguringLocalSocket"] - , Namespace [] ["ListeningLocalSocket"] - , Namespace [] ["LocalSocketUp"] - , Namespace [] ["CreatingServerSocket"] - , Namespace [] ["ListeningServerSocket"] - , Namespace [] ["ServerSocketUp"] - , Namespace [] ["ConfiguringServerSocket"] - , Namespace [] ["UnsupportedLocalSystemdSocket"] - , Namespace [] ["UnsupportedReadySocketCase"] - , Namespace [] ["DiffusionErrored"] - , Namespace [] ["SystemdSocketConfiguration"] - ] - --------------------------------------------------------------------------------- --- LedgerPeers Tracer --------------------------------------------------------------------------------- - -instance LogFormatting TraceLedgerPeers where - forMachine _dtal (PickedLedgerPeer addr _ackStake stake) = - mconcat - [ "kind" .= String "PickedLedgerPeer" - , "address" .= show addr - , "relativeStake" .= (realToFrac (unPoolStake stake) :: Double) - ] - forMachine _dtal (PickedLedgerPeers (NumberOfPeers n) addrs) = - mconcat - [ "kind" .= String "PickedLedgerPeers" - , "desiredCount" .= n - , "count" .= List.length addrs - , "addresses" .= show addrs - ] - forMachine _dtal (PickedBigLedgerPeer addr _ackStake stake) = - mconcat - [ "kind" .= String "PickedBigLedgerPeer" - , "address" .= show addr - , "relativeStake" .= (realToFrac (unPoolStake stake) :: Double) - ] - forMachine _dtal (PickedBigLedgerPeers (NumberOfPeers n) addrs) = - mconcat - [ "kind" .= String "PickedBigLedgerPeers" - , "desiredCount" .= n - , "count" .= List.length addrs - , "addresses" .= show addrs - ] - forMachine _dtal (FetchingNewLedgerState cnt bigCnt) = - mconcat - [ "kind" .= String "FetchingNewLedgerState" - , "numberOfLedgerPeers" .= cnt - , "numberOfBigLedgerPeers" .= bigCnt - ] - forMachine _dtal DisabledLedgerPeers = - mconcat - [ "kind" .= String "DisabledLedgerPeers" - ] - forMachine _dtal (TraceUseLedgerPeers ulp) = - mconcat - [ "kind" .= String "UseLedgerPeers" - , "useLedgerPeers" .= ulp - ] - forMachine _dtal WaitingOnRequest = - mconcat - [ "kind" .= String "WaitingOnRequest" - ] - forMachine _dtal (RequestForPeers (NumberOfPeers np)) = - mconcat - [ "kind" .= String "RequestForPeers" - , "numberOfPeers" .= np - ] - forMachine _dtal (ReusingLedgerState cnt age) = - mconcat - [ "kind" .= String "ReusingLedgerState" - , "numberOfPools" .= cnt - , "ledgerStateAge" .= age - ] - forMachine _dtal FallingBackToPublicRootPeers = - mconcat - [ "kind" .= String "FallingBackToPublicRootPeers" - ] - forMachine _dtal (NotEnoughLedgerPeers (NumberOfPeers target) numOfLedgerPeers) = - mconcat - [ "kind" .= String "NotEnoughLedgerPeers" - , "target" .= target - , "numOfLedgerPeers" .= numOfLedgerPeers - ] - forMachine _dtal (NotEnoughBigLedgerPeers (NumberOfPeers target) numOfBigLedgerPeers) = - mconcat - [ "kind" .= String "NotEnoughBigLedgerPeers" - , "target" .= target - , "numOfBigLedgerPeers" .= numOfBigLedgerPeers - ] - forMachine _dtal (TraceLedgerPeersDomains daps) = - mconcat - [ "kind" .= String "TraceLedgerPeersDomains" - , "domainAccessPoints" .= daps - ] - forMachine _dtal UsingBigLedgerPeerSnapshot = - mconcat - [ "kind" .= String "UsingBigLedgerPeerSnapshot" - ] - -instance MetaTrace TraceLedgerPeers where - namespaceFor PickedLedgerPeer {} = - Namespace [] ["PickedLedgerPeer"] - namespaceFor PickedLedgerPeers {} = - Namespace [] ["PickedLedgerPeers"] - namespaceFor PickedBigLedgerPeer {} = - Namespace [] ["PickedBigLedgerPeer"] - namespaceFor PickedBigLedgerPeers {} = - Namespace [] ["PickedBigLedgerPeers"] - namespaceFor FetchingNewLedgerState {} = - Namespace [] ["FetchingNewLedgerState"] - namespaceFor DisabledLedgerPeers {} = - Namespace [] ["DisabledLedgerPeers"] - namespaceFor TraceUseLedgerPeers {} = - Namespace [] ["TraceUseLedgerPeers"] - namespaceFor WaitingOnRequest {} = - Namespace [] ["WaitingOnRequest"] - namespaceFor RequestForPeers {} = - Namespace [] ["RequestForPeers"] - namespaceFor ReusingLedgerState {} = - Namespace [] ["ReusingLedgerState"] - namespaceFor FallingBackToPublicRootPeers {} = - Namespace [] ["FallingBackToPublicRootPeers"] - namespaceFor NotEnoughLedgerPeers {} = - Namespace [] ["NotEnoughLedgerPeers"] - namespaceFor NotEnoughBigLedgerPeers {} = - Namespace [] ["NotEnoughBigLedgerPeers"] - namespaceFor TraceLedgerPeersDomains {} = - Namespace [] ["TraceLedgerPeersDomains"] - namespaceFor UsingBigLedgerPeerSnapshot {} = - Namespace [] ["UsingBigLedgerPeerSnapshot"] - - severityFor (Namespace _ ["PickedLedgerPeer"]) _ = Just Debug - severityFor (Namespace _ ["PickedLedgerPeers"]) _ = Just Info - severityFor (Namespace _ ["PickedBigLedgerPeer"]) _ = Just Debug - severityFor (Namespace _ ["PickedBigLedgerPeers"]) _ = Just Info - severityFor (Namespace _ ["FetchingNewLedgerState"]) _ = Just Info - severityFor (Namespace _ ["DisabledLedgerPeers"]) _ = Just Info - severityFor (Namespace _ ["TraceUseLedgerAfter"]) _ = Just Info - severityFor (Namespace _ ["WaitingOnRequest"]) _ = Just Debug - severityFor (Namespace _ ["RequestForPeers"]) _ = Just Debug - severityFor (Namespace _ ["ReusingLedgerState"]) _ = Just Debug - severityFor (Namespace _ ["FallingBackToPublicRootPeers"]) _ = Just Info - severityFor (Namespace _ ["NotEnoughLedgerPeers"]) _ = Just Warning - severityFor (Namespace _ ["NotEnoughBigLedgerPeers"]) _ = Just Warning - severityFor (Namespace _ ["TraceLedgerPeersDomains"]) _ = Just Debug - severityFor (Namespace _ ["UsingBigLedgerPeerSnapshot"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["PickedLedgerPeer"]) = Just - "Trace for a peer picked with accumulated and relative stake of its pool." - documentFor (Namespace _ ["PickedLedgerPeers"]) = Just - "Trace for the number of peers we wanted to pick and the list of peers picked." - documentFor (Namespace _ ["PickedBigLedgerPeer"]) = Just - "Trace for a big ledger peer picked with accumulated and relative stake of its pool." - documentFor (Namespace _ ["PickedBigLedgerPeers"]) = Just - "Trace for the number of big ledger peers we wanted to pick and the list of peers picked." - documentFor (Namespace _ ["FetchingNewLedgerState"]) = Just $ mconcat - [ "Trace for fetching a new list of peers from the ledger. Int is the number of peers" - , " returned." - ] - documentFor (Namespace _ ["DisabledLedgerPeers"]) = Just - "Trace for when getting peers from the ledger is disabled, that is DontUseLedger." - documentFor (Namespace _ ["TraceUseLedgerAfter"]) = Just - "Trace UseLedgerAfter value." - documentFor (Namespace _ ["WaitingOnRequest"]) = Just - "" - documentFor (Namespace _ ["RequestForPeers"]) = Just - "RequestForPeers (NumberOfPeers 1)" - documentFor (Namespace _ ["ReusingLedgerState"]) = Just - "" - documentFor (Namespace _ ["FallingBackToPublicRootPeers"]) = Just - "" - documentFor (Namespace _ ["TraceLedgerPeersDomains"]) = Just - "" - documentFor (Namespace _ ["UsingBigLedgerPeerSnapshot"]) = Just $ mconcat - [ "Trace for when a request for big ledger peers is fulfilled from the snapshot file" - , " specified in the topology file."] - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["PickedLedgerPeer"] - , Namespace [] ["PickedLedgerPeers"] - , Namespace [] ["PickedBigLedgerPeer"] - , Namespace [] ["PickedBigLedgerPeers"] - , Namespace [] ["FetchingNewLedgerState"] - , Namespace [] ["DisabledLedgerPeers"] - , Namespace [] ["TraceUseLedgerAfter"] - , Namespace [] ["WaitingOnRequest"] - , Namespace [] ["RequestForPeers"] - , Namespace [] ["ReusingLedgerState"] - , Namespace [] ["FallingBackToPublicRootPeers"] - , Namespace [] ["NotEnoughLedgerPeers"] - , Namespace [] ["NotEnoughBigLedgerPeers"] - , Namespace [] ["TraceLedgerPeersDomains"] - , Namespace [] ["UsingBigLedgerPeerSnapshot"] - ] diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/LedgerMetrics.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/LedgerMetrics.hs index dc97441f6fc..6f2e0820ff4 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/LedgerMetrics.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/LedgerMetrics.hs @@ -105,7 +105,7 @@ traceLedgerMetrics nodeKern slotNo tracer = do query <- mapNodeKernelDataIO (\nk -> (,,) -- (,,,,) - <$> fmap (maybe 0 LedgerDB.ledgerTableSize) (ChainDB.getStatistics $ getChainDB nk) + <$> ChainDB.getStatistics (getChainDB nk) <*> nkQueryLedger (ledgerDelegMapSize . ledgerState) nk <*> nkQueryChain fragmentChainDensity nk {- see Note [GovMetrics] @@ -116,10 +116,10 @@ traceLedgerMetrics nodeKern slotNo tracer = do nodeKern case query of SNothing -> pure () - SJust (utxoSize, delegMapSize, {- drepCount, drepMapSize, -} chainDensity) -> + SJust (ledgerStatistics, delegMapSize, {- drepCount, drepMapSize, -} chainDensity) -> let msg = LedgerMetrics slotNo - utxoSize + (LedgerDB.ledgerTableSize ledgerStatistics) delegMapSize {- see Note [GovMetrics] drepCount diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToClient.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToClient.hs index e6ddcb3e180..ff105fbc036 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToClient.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToClient.hs @@ -12,12 +12,11 @@ module Cardano.Node.Tracing.Tracers.NodeToClient () where import Cardano.Logging import Ouroboros.Consensus.Ledger.Query (Query) -import qualified Ouroboros.Network.Driver.Simple as Simple -import qualified Ouroboros.Network.Driver.Stateful as Stateful import Ouroboros.Network.Protocol.ChainSync.Type as ChainSync import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as LSQ import qualified Ouroboros.Network.Protocol.LocalTxMonitor.Type as LTM import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS +import Ouroboros.Network.Tracing () import Data.Aeson (Value (String), (.=)) import Data.Text (Text, pack) @@ -26,140 +25,6 @@ import qualified Network.TypedProtocol.Stateful.Codec as Stateful {-# ANN module ("HLint: ignore Redundant bracket" :: Text) #-} -instance LogFormatting (Simple.AnyMessage ps) - => LogFormatting (Simple.TraceSendRecv ps) where - forMachine dtal (Simple.TraceSendMsg m) = mconcat - [ "kind" .= String "Send" , "msg" .= forMachine dtal m ] - forMachine dtal (Simple.TraceRecvMsg m) = mconcat - [ "kind" .= String "Recv" , "msg" .= forMachine dtal m ] - - forHuman (Simple.TraceSendMsg m) = "Send: " <> forHuman m - forHuman (Simple.TraceRecvMsg m) = "Receive: " <> forHuman m - - asMetrics (Simple.TraceSendMsg m) = asMetrics m - asMetrics (Simple.TraceRecvMsg m) = asMetrics m - -instance LogFormatting (Stateful.AnyMessage ps f) - => LogFormatting (Stateful.TraceSendRecv ps f) where - forMachine dtal (Stateful.TraceSendMsg m) = mconcat - [ "kind" .= String "Send" , "msg" .= forMachine dtal m ] - forMachine dtal (Stateful.TraceRecvMsg m) = mconcat - [ "kind" .= String "Recv" , "msg" .= forMachine dtal m ] - - forHuman (Stateful.TraceSendMsg m) = "Send: " <> forHuman m - forHuman (Stateful.TraceRecvMsg m) = "Receive: " <> forHuman m - - asMetrics (Stateful.TraceSendMsg m) = asMetrics m - asMetrics (Stateful.TraceRecvMsg m) = asMetrics m - -instance MetaTrace (Simple.AnyMessage ps) => - MetaTrace (Simple.TraceSendRecv ps) where - namespaceFor (Simple.TraceSendMsg msg) = - nsPrependInner "Send" (namespaceFor msg) - namespaceFor (Simple.TraceRecvMsg msg) = - nsPrependInner "Receive" (namespaceFor msg) - - severityFor (Namespace out ("Send" : tl)) (Just (Simple.TraceSendMsg msg)) = - severityFor (Namespace out tl) (Just msg) - severityFor (Namespace out ("Send" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace (Simple.AnyMessage ps)) Nothing - severityFor (Namespace out ("Receive" : tl)) (Just (Simple.TraceSendMsg msg)) = - severityFor (Namespace out tl) (Just msg) - severityFor (Namespace out ("Receive" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace (Simple.AnyMessage ps)) Nothing - severityFor _ _ = Nothing - - privacyFor (Namespace out ("Send" : tl)) (Just (Simple.TraceSendMsg msg)) = - privacyFor (Namespace out tl) (Just msg) - privacyFor (Namespace out ("Send" : tl)) Nothing = - privacyFor (Namespace out tl :: Namespace (Simple.AnyMessage ps)) Nothing - privacyFor (Namespace out ("Receive" : tl)) (Just (Simple.TraceSendMsg msg)) = - privacyFor (Namespace out tl) (Just msg) - privacyFor (Namespace out ("Receive" : tl)) Nothing = - privacyFor (Namespace out tl :: Namespace (Simple.AnyMessage ps)) Nothing - privacyFor _ _ = Nothing - - detailsFor (Namespace out ("Send" : tl)) (Just (Simple.TraceSendMsg msg)) = - detailsFor (Namespace out tl) (Just msg) - detailsFor (Namespace out ("Send" : tl)) Nothing = - detailsFor (Namespace out tl :: Namespace (Simple.AnyMessage ps)) Nothing - detailsFor (Namespace out ("Receive" : tl)) (Just (Simple.TraceSendMsg msg)) = - detailsFor (Namespace out tl) (Just msg) - detailsFor (Namespace out ("Receive" : tl)) Nothing = - detailsFor (Namespace out tl :: Namespace (Simple.AnyMessage ps)) Nothing - detailsFor _ _ = Nothing - - metricsDocFor (Namespace out ("Send" : tl)) = - metricsDocFor (nsCast (Namespace out tl) :: Namespace (Simple.AnyMessage ps)) - metricsDocFor (Namespace out ("Receive" : tl)) = - metricsDocFor (nsCast (Namespace out tl) :: Namespace (Simple.AnyMessage ps)) - metricsDocFor _ = [] - - documentFor (Namespace out ("Send" : tl)) = - documentFor (nsCast (Namespace out tl) :: Namespace (Simple.AnyMessage ps)) - documentFor (Namespace out ("Receive" : tl)) = - documentFor (nsCast (Namespace out tl) :: Namespace (Simple.AnyMessage ps)) - documentFor _ = Nothing - - allNamespaces = - let cn = allNamespaces :: [Namespace (Simple.AnyMessage ps)] - in fmap (nsPrependInner "Send") cn ++ fmap (nsPrependInner "Receive") cn - -instance MetaTrace (Stateful.AnyMessage ps f) => - MetaTrace (Stateful.TraceSendRecv ps f) where - namespaceFor (Stateful.TraceSendMsg msg) = - nsPrependInner "Send" (namespaceFor msg) - namespaceFor (Stateful.TraceRecvMsg msg) = - nsPrependInner "Receive" (namespaceFor msg) - - severityFor (Namespace out ("Send" : tl)) (Just (Stateful.TraceSendMsg msg)) = - severityFor (Namespace out tl) (Just msg) - severityFor (Namespace out ("Send" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace (Stateful.AnyMessage ps f)) Nothing - - severityFor (Namespace out ("Receive" : tl)) (Just (Stateful.TraceSendMsg msg)) = - severityFor (Namespace out tl) (Just msg) - severityFor (Namespace out ("Receive" : tl)) Nothing = - severityFor (Namespace out tl :: Namespace (Stateful.AnyMessage ps f)) Nothing - severityFor _ _ = Nothing - - privacyFor (Namespace out ("Send" : tl)) (Just (Stateful.TraceSendMsg msg)) = - privacyFor (Namespace out tl) (Just msg) - privacyFor (Namespace out ("Send" : tl)) Nothing = - privacyFor (Namespace out tl :: Namespace (Stateful.AnyMessage ps f)) Nothing - privacyFor (Namespace out ("Receive" : tl)) (Just (Stateful.TraceSendMsg msg)) = - privacyFor (Namespace out tl) (Just msg) - privacyFor (Namespace out ("Receive" : tl)) Nothing = - privacyFor (Namespace out tl :: Namespace (Stateful.AnyMessage ps f)) Nothing - privacyFor _ _ = Nothing - - detailsFor (Namespace out ("Send" : tl)) (Just (Stateful.TraceSendMsg msg)) = - detailsFor (Namespace out tl) (Just msg) - detailsFor (Namespace out ("Send" : tl)) Nothing = - detailsFor (Namespace out tl :: Namespace (Stateful.AnyMessage ps f)) Nothing - detailsFor (Namespace out ("Receive" : tl)) (Just (Stateful.TraceSendMsg msg)) = - detailsFor (Namespace out tl) (Just msg) - detailsFor (Namespace out ("Receive" : tl)) Nothing = - detailsFor (Namespace out tl :: Namespace (Stateful.AnyMessage ps f)) Nothing - detailsFor _ _ = Nothing - - metricsDocFor (Namespace out ("Send" : tl)) = - metricsDocFor (nsCast (Namespace out tl) :: Namespace (Stateful.AnyMessage ps f)) - metricsDocFor (Namespace out ("Receive" : tl)) = - metricsDocFor (nsCast (Namespace out tl) :: Namespace (Stateful.AnyMessage ps f)) - metricsDocFor _ = [] - - documentFor (Namespace out ("Send" : tl)) = - documentFor (nsCast (Namespace out tl) :: Namespace (Stateful.AnyMessage ps f)) - documentFor (Namespace out ("Receive" : tl)) = - documentFor (nsCast (Namespace out tl) :: Namespace (Stateful.AnyMessage ps f)) - documentFor _ = Nothing - - allNamespaces = - let cn = allNamespaces :: [Namespace (Stateful.AnyMessage ps f)] - in fmap (nsPrependInner "Send") cn ++ fmap (nsPrependInner "Receive") cn - - -- -------------------------------------------------------------------------------- -- -- TChainSync Tracer -- -------------------------------------------------------------------------------- diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToNode.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToNode.hs index 0e35639178b..18f8d2f76ed 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToNode.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/NodeToNode.hs @@ -26,7 +26,6 @@ import Ouroboros.Network.Protocol.BlockFetch.Type (BlockFetch (..), Me import qualified Ouroboros.Network.Protocol.TxSubmission2.Type as STX import qualified Ouroboros.Network.Protocol.KeepAlive.Type as KA import qualified Ouroboros.Network.Protocol.PeerSharing.Type as PS -import Ouroboros.Network.SizeInBytes (SizeInBytes (..)) import Control.Monad.Class.MonadTime.SI (Time (..)) import Data.Aeson (ToJSON (..), Value (String), (.=)) @@ -87,9 +86,6 @@ instance ( ConvertTxId blk ] -instance ToJSON SizeInBytes where - toJSON (SizeInBytes s) = toJSON s - instance MetaTrace (AnyMessage (BlockFetch blk1 (Point blk2))) where namespaceFor (AnyMessageAndAgency _stok MsgRequestRange{}) = Namespace [] ["RequestRange"] diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs deleted file mode 100644 index 7142b3c07f6..00000000000 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/P2P.hs +++ /dev/null @@ -1,2104 +0,0 @@ -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RecordWildCards #-} -{-# LANGUAGE ScopedTypeVariables #-} - -{-# OPTIONS_GHC -Wno-orphans #-} - -module Cardano.Node.Tracing.Tracers.P2P - () where - -import Cardano.Logging -import Cardano.Network.Diffusion.Types -import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano.PublicRootPeers -import qualified Cardano.Network.PeerSelection.Governor.Types as Cardano -import Cardano.Node.Configuration.TopologyP2P () -import Cardano.Node.Tracing.Tracers.NodeToNode () -import Cardano.Tracing.OrphanInstances.Network () -import Ouroboros.Network.ConnectionHandler (ConnectionHandlerTrace (..)) -import Ouroboros.Network.ConnectionId (ConnectionId (..)) -import Ouroboros.Network.ConnectionManager.ConnMap (ConnMap (..)) -import Ouroboros.Network.ConnectionManager.Core as ConnectionManager (Trace (..)) -import Ouroboros.Network.ConnectionManager.Types (ConnectionManagerCounters (..)) -import qualified Ouroboros.Network.ConnectionManager.Types as ConnectionManager -import Ouroboros.Network.InboundGovernor as InboundGovernor (Trace (..)) -import qualified Ouroboros.Network.InboundGovernor as InboundGovernor -import Ouroboros.Network.InboundGovernor.State as InboundGovernor (Counters (..)) -import qualified Cardano.Network.NodeToNode as NtN -import Ouroboros.Network.OrphanInstances () -import Ouroboros.Network.PeerSelection.Churn (ChurnCounters (..)) -import Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..), - DebugPeerSelectionState (..), PeerSelectionCounters, PeerSelectionState (..), - PeerSelectionTargets (..), PeerSelectionView (..), TracePeerSelection (..), - peerSelectionStateToCounters) -import Ouroboros.Network.PeerSelection.Governor.Types (DemotionTimeoutException) -import Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..)) -import Ouroboros.Network.PeerSelection.RootPeersDNS.DNSActions (DNSTrace (..)) -import Ouroboros.Network.PeerSelection.RootPeersDNS.LocalRootPeers - (TraceLocalRootPeers (..)) -import Ouroboros.Network.PeerSelection.RootPeersDNS.PublicRootPeers - (TracePublicRootPeers (..)) -import qualified Ouroboros.Network.PeerSelection.State.KnownPeers as KnownPeers -import Ouroboros.Network.PeerSelection.Types () -import Ouroboros.Network.Protocol.PeerSharing.Type (PeerSharingAmount (..)) -import Ouroboros.Network.RethrowPolicy (ErrorCommand (..)) -import Ouroboros.Network.Server as Server -import Ouroboros.Network.Snocket (LocalAddress (..)) - -import Control.Exception (displayException, fromException) -import Data.Aeson (Object, ToJSON, ToJSONKey, Value (..), object, toJSON, toJSONList, - (.=)) -import Data.Aeson.Types (listValue) -import Data.Bifunctor (Bifunctor (..)) -import Data.Foldable (Foldable (..)) -import qualified Data.IP as IP -import qualified Data.Map.Strict as Map -import qualified Data.Set as Set -import Data.Text (pack) -import Network.Socket (SockAddr (..)) - - --------------------------------------------------------------------------------- --- Addresses --------------------------------------------------------------------------------- - -instance LogFormatting LocalAddress where - forMachine _dtal (LocalAddress path) = - mconcat ["path" .= path] - -instance LogFormatting NtN.RemoteAddress where - forMachine _dtal (SockAddrInet port addr) = - let ip = IP.fromHostAddress addr in - mconcat [ "addr" .= show ip - , "port" .= show port - ] - forMachine _dtal (SockAddrInet6 port _ addr _) = - let ip = IP.fromHostAddress6 addr in - mconcat [ "addr" .= show ip - , "port" .= show port - ] - forMachine _dtal (SockAddrUnix path) = - mconcat [ "path" .= show path ] - --------------------------------------------------------------------------------- --- LocalRootPeers Tracer --------------------------------------------------------------------------------- - -instance LogFormatting CardanoTraceLocalRootPeers where - forMachine _dtal (TraceLocalRootDomains groups) = - mconcat [ "kind" .= String "LocalRootDomains" - , "localRootDomains" .= toJSON groups - ] - forMachine _dtal (TraceLocalRootWaiting d dt) = - mconcat [ "kind" .= String "LocalRootWaiting" - , "domainAddress" .= toJSON d - , "diffTime" .= show dt - ] - forMachine _dtal (TraceLocalRootGroups groups) = - mconcat [ "kind" .= String "LocalRootGroups" - , "localRootGroups" .= toJSON groups - ] - forMachine _dtal (TraceLocalRootFailure d exception) = - mconcat [ "kind" .= String "LocalRootFailure" - , "domainAddress" .= toJSON d - , "reason" .= displayException exception - ] - forMachine _dtal (TraceLocalRootError d exception) = - mconcat [ "kind" .= String "LocalRootError" - , "domainAddress" .= String (pack . show $ d) - , "reason" .= displayException exception - ] - forMachine _dtal (TraceLocalRootReconfigured d exception) = - mconcat [ "kind" .= String "LocalRootReconfigured" - , "domainAddress" .= toJSON d - , "reason" .= show exception - ] - forMachine _dtal (TraceLocalRootDNSMap dnsMap) = - mconcat - [ "kind" .= String "TraceLocalRootDNSMap" - , "dnsMap" .= dnsMap - ] - forHuman = pack . show - -instance MetaTrace (TraceLocalRootPeers ntnAddr extraFlags) where - namespaceFor = \case - TraceLocalRootDomains {} -> Namespace [] ["LocalRootDomains"] - TraceLocalRootWaiting {} -> Namespace [] ["LocalRootWaiting"] - TraceLocalRootGroups {} -> Namespace [] ["LocalRootGroups"] - TraceLocalRootFailure {} -> Namespace [] ["LocalRootFailure"] - TraceLocalRootError {} -> Namespace [] ["LocalRootError"] - TraceLocalRootReconfigured {} -> Namespace [] ["LocalRootReconfigured"] - TraceLocalRootDNSMap {} -> Namespace [] ["LocalRootDNSMap"] - - severityFor (Namespace [] ["LocalRootDomains"]) _ = Just Info - severityFor (Namespace [] ["LocalRootWaiting"]) _ = Just Info - severityFor (Namespace [] ["LocalRootGroups"]) _ = Just Info - severityFor (Namespace [] ["LocalRootFailure"]) _ = Just Info - severityFor (Namespace [] ["LocalRootError"]) _ = Just Info - severityFor (Namespace [] ["LocalRootReconfigured"]) _ = Just Info - severityFor (Namespace [] ["LocalRootDNSMap"]) _ = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace [] ["LocalRootDomains"]) = Just - "" - documentFor (Namespace [] ["LocalRootWaiting"]) = Just - "" - documentFor (Namespace [] ["LocalRootGroups"]) = Just - "" - documentFor (Namespace [] ["LocalRootFailure"]) = Just - "" - documentFor (Namespace [] ["LocalRootError"]) = Just - "" - documentFor (Namespace [] ["LocalRootReconfigured"]) = Just - "" - documentFor (Namespace [] ["LocalRootDNSMap"]) = Just - "" - documentFor _ = Nothing - - allNamespaces = - [ Namespace [] ["LocalRootDomains"] - , Namespace [] ["LocalRootWaiting"] - , Namespace [] ["LocalRootGroups"] - , Namespace [] ["LocalRootFailure"] - , Namespace [] ["LocalRootError"] - , Namespace [] ["LocalRootReconfigured"] - , Namespace [] ["LocalRootDNSMap"] - ] - --------------------------------------------------------------------------------- --- PublicRootPeers Tracer --------------------------------------------------------------------------------- - -instance LogFormatting TracePublicRootPeers where - forMachine _dtal (TracePublicRootRelayAccessPoint relays) = - mconcat [ "kind" .= String "PublicRootRelayAddresses" - , "relayAddresses" .= toJSON relays - ] - forMachine _dtal (TracePublicRootDomains domains) = - mconcat [ "kind" .= String "PublicRootDomains" - , "domainAddresses" .= toJSONList domains - ] - forHuman = pack . show - -instance MetaTrace TracePublicRootPeers where - namespaceFor TracePublicRootRelayAccessPoint {} = Namespace [] ["PublicRootRelayAccessPoint"] - namespaceFor TracePublicRootDomains {} = Namespace [] ["PublicRootDomains"] - - severityFor (Namespace [] ["PublicRootRelayAccessPoint"]) _ = Just Info - severityFor (Namespace [] ["PublicRootDomains"]) _ = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace [] ["PublicRootRelayAccessPoint"]) = Just - "" - documentFor (Namespace [] ["PublicRootDomains"]) = Just - "" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["PublicRootRelayAccessPoint"] - , Namespace [] ["PublicRootDomains"] - ] - --------------------------------------------------------------------------------- --- PeerSelection Tracer --------------------------------------------------------------------------------- - -instance LogFormatting CardanoTracePeerSelection where - forMachine _dtal (TraceLocalRootPeersChanged lrp lrp') = - mconcat [ "kind" .= String "LocalRootPeersChanged" - , "previous" .= toJSON lrp - , "current" .= toJSON lrp' - ] - forMachine _dtal (TraceTargetsChanged pst pst') = - mconcat [ "kind" .= String "TargetsChanged" - , "previous" .= toJSON pst - , "current" .= toJSON pst' - ] - forMachine _dtal (TracePublicRootsRequest tRootPeers nRootPeers) = - mconcat [ "kind" .= String "PublicRootsRequest" - , "targetNumberOfRootPeers" .= tRootPeers - , "numberOfRootPeers" .= nRootPeers - ] - forMachine _dtal (TracePublicRootsResults res group dt) = - mconcat [ "kind" .= String "PublicRootsResults" - , "result" .= toJSON res - , "group" .= group - , "diffTime" .= dt - ] - forMachine _dtal (TracePublicRootsFailure err group dt) = - mconcat [ "kind" .= String "PublicRootsFailure" - , "reason" .= show err - , "group" .= group - , "diffTime" .= dt - ] - forMachine _dtal (TraceForgetColdPeers targetKnown actualKnown sp) = - mconcat [ "kind" .= String "ForgetColdPeers" - , "targetKnown" .= targetKnown - , "actualKnown" .= actualKnown - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TraceBigLedgerPeersRequest tRootPeers nRootPeers) = - mconcat [ "kind" .= String "BigLedgerPeersRequest" - , "targetNumberOfBigLedgerPeers" .= tRootPeers - , "numberOfBigLedgerPeers" .= nRootPeers - ] - forMachine _dtal (TraceBigLedgerPeersResults res group dt) = - mconcat [ "kind" .= String "BigLedgerPeersResults" - , "result" .= toJSONList (toList res) - , "group" .= group - , "diffTime" .= dt - ] - forMachine _dtal (TraceBigLedgerPeersFailure err group dt) = - mconcat [ "kind" .= String "BigLedgerPeersFailure" - , "reason" .= show err - , "group" .= group - , "diffTime" .= dt - ] - forMachine _dtal (TraceForgetBigLedgerPeers targetKnown actualKnown sp) = - mconcat [ "kind" .= String "ForgetColdBigLedgerPeers" - , "targetKnown" .= targetKnown - , "actualKnown" .= actualKnown - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePeerShareRequests targetKnown actualKnown (PeerSharingAmount numRequested) aps sps) = - mconcat [ "kind" .= String "PeerShareRequests" - , "targetKnown" .= targetKnown - , "actualKnown" .= actualKnown - , "numRequested" .= numRequested - , "availablePeers" .= toJSONList (toList aps) - , "selectedPeers" .= toJSONList (toList sps) - ] - forMachine _dtal (TracePeerShareResults res) = - mconcat [ "kind" .= String "PeerShareResults" - , "result" .= toJSONList (map (first show <$>) res) - ] - forMachine _dtal (TracePeerShareResultsFiltered res) = - mconcat [ "kind" .= String "PeerShareResultsFiltered" - , "result" .= toJSONList res - ] - forMachine _dtal (TracePromoteColdPeers targetKnown actualKnown sp) = - mconcat [ "kind" .= String "PromoteColdPeers" - , "targetEstablished" .= targetKnown - , "actualEstablished" .= actualKnown - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePromoteColdLocalPeers tLocalEst sp) = - mconcat [ "kind" .= String "PromoteColdLocalPeers" - , "targetLocalEstablished" .= tLocalEst - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePromoteColdFailed tEst aEst p d err) = - mconcat [ "kind" .= String "PromoteColdFailed" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - , "delay" .= toJSON d - , "reason" .= show err - ] - forMachine _dtal (TracePromoteColdDone tEst aEst p) = - mconcat [ "kind" .= String "PromoteColdDone" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - ] - forMachine _dtal (TracePromoteColdBigLedgerPeers targetKnown actualKnown sp) = - mconcat [ "kind" .= String "PromoteColdBigLedgerPeers" - , "targetEstablished" .= targetKnown - , "actualEstablished" .= actualKnown - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePromoteColdBigLedgerPeerFailed tEst aEst p d err) = - mconcat [ "kind" .= String "PromoteColdBigLedgerPeerFailed" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - , "delay" .= toJSON d - , "reason" .= show err - ] - forMachine _dtal (TracePromoteColdBigLedgerPeerDone tEst aEst p) = - mconcat [ "kind" .= String "PromoteColdBigLedgerPeerDone" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - ] - forMachine _dtal (TracePromoteWarmPeers tActive aActive sp) = - mconcat [ "kind" .= String "PromoteWarmPeers" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePromoteWarmLocalPeers taa sp) = - mconcat [ "kind" .= String "PromoteWarmLocalPeers" - , "targetActualActive" .= toJSONList taa - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePromoteWarmFailed tActive aActive p err) = - mconcat [ "kind" .= String "PromoteWarmFailed" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - , "reason" .= show err - ] - forMachine _dtal (TracePromoteWarmDone tActive aActive p) = - mconcat [ "kind" .= String "PromoteWarmDone" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - ] - forMachine _dtal (TracePromoteWarmAborted tActive aActive p) = - mconcat [ "kind" .= String "PromoteWarmAborted" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - ] - forMachine _dtal (TracePromoteWarmBigLedgerPeers tActive aActive sp) = - mconcat [ "kind" .= String "PromoteWarmBigLedgerPeers" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TracePromoteWarmBigLedgerPeerFailed tActive aActive p err) = - mconcat [ "kind" .= String "PromoteWarmBigLedgerPeerFailed" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - , "reason" .= show err - ] - forMachine _dtal (TracePromoteWarmBigLedgerPeerDone tActive aActive p) = - mconcat [ "kind" .= String "PromoteWarmBigLedgerPeerDone" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - ] - forMachine _dtal (TracePromoteWarmBigLedgerPeerAborted tActive aActive p) = - mconcat [ "kind" .= String "PromoteWarmBigLedgerPeerAborted" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - ] - forMachine _dtal (TraceDemoteWarmPeers tEst aEst sp) = - mconcat [ "kind" .= String "DemoteWarmPeers" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TraceDemoteWarmFailed tEst aEst p err) = - mconcat [ "kind" .= String "DemoteWarmFailed" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - , "reason" .= show err - ] - forMachine _dtal (TraceDemoteWarmDone tEst aEst p) = - mconcat [ "kind" .= String "DemoteWarmDone" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - ] - forMachine _dtal (TraceDemoteWarmBigLedgerPeers tEst aEst sp) = - mconcat [ "kind" .= String "DemoteWarmBigLedgerPeers" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TraceDemoteWarmBigLedgerPeerFailed tEst aEst p err) = - mconcat [ "kind" .= String "DemoteWarmBigLedgerPeerFailed" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - , "reason" .= show err - ] - forMachine _dtal (TraceDemoteWarmBigLedgerPeerDone tEst aEst p) = - mconcat [ "kind" .= String "DemoteWarmBigLedgerPeerDone" - , "targetEstablished" .= tEst - , "actualEstablished" .= aEst - , "peer" .= toJSON p - ] - forMachine _dtal (TraceDemoteHotPeers tActive aActive sp) = - mconcat [ "kind" .= String "DemoteHotPeers" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TraceDemoteLocalHotPeers taa sp) = - mconcat [ "kind" .= String "DemoteLocalHotPeers" - , "targetActualActive" .= toJSONList taa - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TraceDemoteHotFailed tActive aActive p err) = - mconcat [ "kind" .= String "DemoteHotFailed" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - , "reason" .= show err - ] - forMachine _dtal (TraceDemoteHotDone tActive aActive p) = - mconcat [ "kind" .= String "DemoteHotDone" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - ] - forMachine _dtal (TraceDemoteHotBigLedgerPeers tActive aActive sp) = - mconcat [ "kind" .= String "DemoteHotBigLedgerPeers" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "selectedPeers" .= toJSONList (toList sp) - ] - forMachine _dtal (TraceDemoteHotBigLedgerPeerFailed tActive aActive p err) = - mconcat [ "kind" .= String "DemoteHotBigLedgerPeerFailed" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - , "reason" .= show err - ] - forMachine _dtal (TraceDemoteHotBigLedgerPeerDone tActive aActive p) = - mconcat [ "kind" .= String "DemoteHotBigLedgerPeerDone" - , "targetActive" .= tActive - , "actualActive" .= aActive - , "peer" .= toJSON p - ] - forMachine _dtal (TraceDemoteAsynchronous msp) = - mconcat [ "kind" .= String "DemoteAsynchronous" - , "state" .= toJSON msp - ] - forMachine _dtal (TraceDemoteLocalAsynchronous msp) = - mconcat [ "kind" .= String "DemoteLocalAsynchronous" - , "state" .= toJSON msp - ] - forMachine _dtal (TraceDemoteBigLedgerPeersAsynchronous msp) = - mconcat [ "kind" .= String "DemoteBigLedgerPeerAsynchronous" - , "state" .= toJSON msp - ] - forMachine _dtal TraceGovernorWakeup = - mconcat [ "kind" .= String "GovernorWakeup" - ] - forMachine _dtal (TraceChurnWait dt) = - mconcat [ "kind" .= String "ChurnWait" - , "diffTime" .= toJSON dt - ] - forMachine _dtal (TracePickInboundPeers targetNumberOfKnownPeers numberOfKnownPeers selected available) = - mconcat [ "kind" .= String "PickInboundPeers" - , "targetKnown" .= targetNumberOfKnownPeers - , "actualKnown" .= numberOfKnownPeers - , "selected" .= selected - , "available" .= available - ] - forMachine _dtal (TraceLedgerStateJudgementChanged new) = - mconcat [ "kind" .= String "LedgerStateJudgementChanged" - , "new" .= show new ] - forMachine _dtal TraceOnlyBootstrapPeers = - mconcat [ "kind" .= String "LedgerStateJudgementChanged" ] - forMachine _dtal (TraceUseBootstrapPeersChanged ubp) = - mconcat [ "kind" .= String "UseBootstrapPeersChanged" - , "useBootstrapPeers" .= toJSON ubp ] - forMachine _dtal TraceBootstrapPeersFlagChangedWhilstInSensitiveState = - mconcat [ "kind" .= String "BootstrapPeersFlagChangedWhilstInSensitiveState" - ] - forMachine _dtal (TraceVerifyPeerSnapshot result) = - mconcat [ "kind" .= String "VerifyPeerSnapshot" - , "result" .= toJSON result ] - forMachine _dtal (TraceOutboundGovernorCriticalFailure err) = - mconcat [ "kind" .= String "OutboundGovernorCriticalFailure" - , "reason" .= show err - ] - forMachine _dtal (TraceChurnAction duration action counter) = - mconcat [ "kind" .= String "ChurnAction" - , "action" .= show action - , "counter" .= counter - , "duration" .= duration - ] - forMachine _dtal (TraceChurnTimeout duration action counter) = - mconcat [ "kind" .= String "ChurnTimeout" - , "action" .= show action - , "counter" .= counter - , "duration" .= duration - ] - forMachine _dtal (TraceDebugState mtime ds) = - mconcat [ "kind" .= String "DebugState" - , "monotonicTime" .= show mtime - , "targets" .= peerSelectionTargetsToObject (dpssTargets ds) - , "localRootPeers" .= dpssLocalRootPeers ds - , "publicRootPeers" .= dpssPublicRootPeers ds - , "knownPeers" .= KnownPeers.allPeers (dpssKnownPeers ds) - , "establishedPeers" .= dpssEstablishedPeers ds - , "activePeers" .= dpssActivePeers ds - , "publicRootBackoffs" .= dpssPublicRootBackoffs ds - , "publicRootRetryTime" .= dpssPublicRootRetryTime ds - , "bigLedgerPeerBackoffs" .= dpssBigLedgerPeerBackoffs ds - , "bigLedgerPeerRetryTime" .= dpssBigLedgerPeerRetryTime ds - , "inProgressBigLedgerPeersReq" .= dpssInProgressBigLedgerPeersReq ds - , "inProgressPeerShareReqs" .= dpssInProgressPeerShareReqs ds - , "inProgressPromoteCold" .= dpssInProgressPromoteCold ds - , "inProgressPromoteWarm" .= dpssInProgressPromoteWarm ds - , "inProgressDemoteWarm" .= dpssInProgressDemoteWarm ds - , "inProgressDemoteHot" .= dpssInProgressDemoteHot ds - , "inProgressDemoteToCold" .= dpssInProgressDemoteToCold ds - , "upstreamyness" .= dpssUpstreamyness ds - , "fetchynessBlocks" .= dpssFetchynessBlocks ds - ] - - forHuman = pack . show - - asMetrics (TraceChurnAction duration action _) = - [ DoubleM ("peerSelection.churn" <> pack (show action) <> ".duration") - (realToFrac duration) - ] - asMetrics _ = [] - -instance MetaTrace (TracePeerSelection extraDebugState extraFlags extraPeers SockAddr) where - namespaceFor TraceLocalRootPeersChanged {} = - Namespace [] ["LocalRootPeersChanged"] - namespaceFor TraceTargetsChanged {} = - Namespace [] ["TargetsChanged"] - namespaceFor TracePublicRootsRequest {} = - Namespace [] ["PublicRootsRequest"] - namespaceFor TracePublicRootsResults {} = - Namespace [] ["PublicRootsResults"] - namespaceFor TracePublicRootsFailure {} = - Namespace [] ["PublicRootsFailure"] - namespaceFor TraceForgetColdPeers {} = - Namespace [] ["ForgetColdPeers"] - namespaceFor TraceBigLedgerPeersRequest {} = - Namespace [] ["BigLedgerPeersRequest"] - namespaceFor TraceBigLedgerPeersResults {} = - Namespace [] ["BigLedgerPeersResults"] - namespaceFor TraceBigLedgerPeersFailure {} = - Namespace [] ["BigLedgerPeersFailure"] - namespaceFor TraceForgetBigLedgerPeers {} = - Namespace [] ["ForgetBigLedgerPeers"] - namespaceFor TracePeerShareRequests {} = - Namespace [] ["PeerShareRequests"] - namespaceFor TracePeerShareResults {} = - Namespace [] ["PeerShareResults"] - namespaceFor TracePeerShareResultsFiltered {} = - Namespace [] ["PeerShareResultsFiltered"] - namespaceFor TracePickInboundPeers {} = - Namespace [] ["PickInboundPeers"] - namespaceFor TracePromoteColdPeers {} = - Namespace [] ["PromoteColdPeers"] - namespaceFor TracePromoteColdLocalPeers {} = - Namespace [] ["PromoteColdLocalPeers"] - namespaceFor TracePromoteColdFailed {} = - Namespace [] ["PromoteColdFailed"] - namespaceFor TracePromoteColdDone {} = - Namespace [] ["PromoteColdDone"] - namespaceFor TracePromoteColdBigLedgerPeers {} = - Namespace [] ["PromoteColdBigLedgerPeers"] - namespaceFor TracePromoteColdBigLedgerPeerFailed {} = - Namespace [] ["PromoteColdBigLedgerPeerFailed"] - namespaceFor TracePromoteColdBigLedgerPeerDone {} = - Namespace [] ["PromoteColdBigLedgerPeerDone"] - namespaceFor TracePromoteWarmPeers {} = - Namespace [] ["PromoteWarmPeers"] - namespaceFor TracePromoteWarmLocalPeers {} = - Namespace [] ["PromoteWarmLocalPeers"] - namespaceFor TracePromoteWarmFailed {} = - Namespace [] ["PromoteWarmFailed"] - namespaceFor TracePromoteWarmDone {} = - Namespace [] ["PromoteWarmDone"] - namespaceFor TracePromoteWarmAborted {} = - Namespace [] ["PromoteWarmAborted"] - namespaceFor TracePromoteWarmBigLedgerPeers {} = - Namespace [] ["PromoteWarmBigLedgerPeers"] - namespaceFor TracePromoteWarmBigLedgerPeerFailed {} = - Namespace [] ["PromoteWarmBigLedgerPeerFailed"] - namespaceFor TracePromoteWarmBigLedgerPeerDone {} = - Namespace [] ["PromoteWarmBigLedgerPeerDone"] - namespaceFor TracePromoteWarmBigLedgerPeerAborted {} = - Namespace [] ["PromoteWarmBigLedgerPeerAborted"] - namespaceFor TraceDemoteWarmPeers {} = - Namespace [] ["DemoteWarmPeers"] - namespaceFor (TraceDemoteWarmFailed _ _ _ e) = - case fromException e :: Maybe DemotionTimeoutException of - Just _ -> Namespace [] ["DemoteWarmFailed", "CoolingToColdTimeout"] - Nothing -> Namespace [] ["DemoteWarmFailed"] - namespaceFor TraceDemoteWarmDone {} = - Namespace [] ["DemoteWarmDone"] - namespaceFor TraceDemoteWarmBigLedgerPeers {} = - Namespace [] ["DemoteWarmBigLedgerPeers"] - namespaceFor (TraceDemoteWarmBigLedgerPeerFailed _ _ _ e) = - case fromException e :: Maybe DemotionTimeoutException of - Just _ -> Namespace [] ["DemoteWarmBigLedgerPeerFailed", "CoolingToColdTimeout"] - Nothing -> Namespace [] ["DemoteWarmBigLedgerPeerFailed"] - namespaceFor TraceDemoteWarmBigLedgerPeerDone {} = - Namespace [] ["DemoteWarmBigLedgerPeerDone"] - namespaceFor TraceDemoteHotPeers {} = - Namespace [] ["DemoteHotPeers"] - namespaceFor TraceDemoteLocalHotPeers {} = - Namespace [] ["DemoteLocalHotPeers"] - namespaceFor (TraceDemoteHotFailed _ _ _ e) = - case fromException e :: Maybe DemotionTimeoutException of - Just _ -> Namespace [] ["DemoteHotFailed", "CoolingToColdTimeout"] - Nothing -> Namespace [] ["DemoteHotFailed"] - namespaceFor TraceDemoteHotDone {} = - Namespace [] ["DemoteHotDone"] - namespaceFor TraceDemoteHotBigLedgerPeers {} = - Namespace [] ["DemoteHotBigLedgerPeers"] - namespaceFor (TraceDemoteHotBigLedgerPeerFailed _ _ _ e) = - case fromException e :: Maybe DemotionTimeoutException of - Just _ -> Namespace [] ["DemoteHotBigLedgerPeerFailed", "CoolingToColdTimeout"] - Nothing -> Namespace [] ["DemoteHotBigLedgerPeerFailed"] - namespaceFor TraceDemoteHotBigLedgerPeerDone {} = - Namespace [] ["DemoteHotBigLedgerPeerDone"] - namespaceFor TraceDemoteAsynchronous {} = - Namespace [] ["DemoteAsynchronous"] - namespaceFor TraceDemoteLocalAsynchronous {} = - Namespace [] ["DemoteLocalAsynchronous"] - namespaceFor TraceDemoteBigLedgerPeersAsynchronous {} = - Namespace [] ["DemoteBigLedgerPeersAsynchronous"] - namespaceFor TraceGovernorWakeup {} = - Namespace [] ["GovernorWakeup"] - namespaceFor TraceChurnWait {} = - Namespace [] ["ChurnWait"] - namespaceFor TraceLedgerStateJudgementChanged {} = - Namespace [] ["LedgerStateJudgementChanged"] - namespaceFor TraceOnlyBootstrapPeers {} = - Namespace [] ["OnlyBootstrapPeers"] - namespaceFor TraceUseBootstrapPeersChanged {} = - Namespace [] ["UseBootstrapPeersChanged"] - namespaceFor TraceVerifyPeerSnapshot {} = - Namespace [] ["VerifyPeerSnapshot"] - namespaceFor TraceBootstrapPeersFlagChangedWhilstInSensitiveState = - Namespace [] ["BootstrapPeersFlagChangedWhilstInSensitiveState"] - namespaceFor TraceOutboundGovernorCriticalFailure {} = - Namespace [] ["OutboundGovernorCriticalFailure"] - namespaceFor TraceChurnAction {} = - Namespace [] ["ChurnAction"] - namespaceFor TraceChurnTimeout {} = - Namespace [] ["ChurnTimeout"] - namespaceFor TraceDebugState {} = - Namespace [] ["DebugState"] - - severityFor (Namespace [] ["LocalRootPeersChanged"]) _ = Just Notice - severityFor (Namespace [] ["TargetsChanged"]) _ = Just Notice - severityFor (Namespace [] ["PublicRootsRequest"]) _ = Just Info - severityFor (Namespace [] ["PublicRootsResults"]) _ = Just Info - severityFor (Namespace [] ["PublicRootsFailure"]) _ = Just Error - severityFor (Namespace [] ["ForgetColdPeers"]) _ = Just Info - severityFor (Namespace [] ["BigLedgerPeersRequest"]) _ = Just Info - severityFor (Namespace [] ["BigLedgerPeersResults"]) _ = Just Info - severityFor (Namespace [] ["BigLedgerPeersFailure"]) _ = Just Info - severityFor (Namespace [] ["ForgetBigLedgerPeers"]) _ = Just Info - severityFor (Namespace [] ["PeerShareRequests"]) _ = Just Debug - severityFor (Namespace [] ["PeerShareResults"]) _ = Just Debug - severityFor (Namespace [] ["PeerShareResultsFiltered"]) _ = Just Info - severityFor (Namespace [] ["PickInboundPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdLocalPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdFailed"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdDone"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdBigLedgerPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdBigLedgerPeerFailed"]) _ = Just Info - severityFor (Namespace [] ["PromoteColdBigLedgerPeerDone"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmLocalPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmFailed"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmDone"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmAborted"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmBigLedgerPeers"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmBigLedgerPeerFailed"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmBigLedgerPeerDone"]) _ = Just Info - severityFor (Namespace [] ["PromoteWarmBigLedgerPeerAborted"]) _ = Just Info - severityFor (Namespace [] ["DemoteWarmPeers"]) _ = Just Info - severityFor (Namespace [] ["DemoteWarmFailed"]) _ = Just Info - severityFor (Namespace [] ["DemoteWarmFailed", "CoolingToColdTimeout"]) _ = Just Error - severityFor (Namespace [] ["DemoteWarmDone"]) _ = Just Info - severityFor (Namespace [] ["DemoteWarmBigLedgerPeers"]) _ = Just Info - severityFor (Namespace [] ["DemoteWarmBigLedgerPeerFailed"]) _ = Just Info - severityFor (Namespace [] ["DemoteWarmBigLedgerPeerFailed", "CoolingToColdTimeout"]) _ = Just Error - severityFor (Namespace [] ["DemoteWarmBigLedgerPeerDone"]) _ = Just Info - severityFor (Namespace [] ["DemoteHotPeers"]) _ = Just Info - severityFor (Namespace [] ["DemoteLocalHotPeers"]) _ = Just Info - severityFor (Namespace [] ["DemoteHotFailed"]) _ = Just Info - severityFor (Namespace [] ["DemoteHotFailed", "CoolingToColdTimeout"]) _ = Just Error - severityFor (Namespace [] ["DemoteHotDone"]) _ = Just Info - severityFor (Namespace [] ["DemoteHotBigLedgerPeers"]) _ = Just Info - severityFor (Namespace [] ["DemoteHotBigLedgerPeerFailed"]) _ = Just Info - severityFor (Namespace [] ["DemoteHotBigLedgerPeerFailed", "CoolingToColdTimeout"]) _ = Just Error - severityFor (Namespace [] ["DemoteHotBigLedgerPeerDone"]) _ = Just Info - severityFor (Namespace [] ["DemoteAsynchronous"]) _ = Just Info - severityFor (Namespace [] ["DemoteLocalAsynchronous"]) _ = Just Warning - severityFor (Namespace [] ["DemoteBigLedgerPeersAsynchronous"]) _ = Just Info - severityFor (Namespace [] ["GovernorWakeup"]) _ = Just Info - severityFor (Namespace [] ["ChurnWait"]) _ = Just Info - severityFor (Namespace [] ["LedgerStateJudgementChanged"]) _ = Just Info - severityFor (Namespace [] ["OnlyBootstrapPeers"]) _ = Just Info - severityFor (Namespace [] ["UseBootstrapPeersChanged"]) _ = Just Notice - severityFor (Namespace [] ["VerifyPeerSnapshot"]) _ = Just Error - severityFor (Namespace [] ["BootstrapPeersFlagChangedWhilstInSensitiveState"]) _ = Just Warning - severityFor (Namespace [] ["OutboundGovernorCriticalFailure"]) _ = Just Error - severityFor (Namespace [] ["ChurnAction"]) _ = Just Info - severityFor (Namespace [] ["ChurnTimeout"]) _ = Just Notice - severityFor (Namespace [] ["DebugState"]) _ = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace [] ["LocalRootPeersChanged"]) = Just "" - documentFor (Namespace [] ["TargetsChanged"]) = Just "" - documentFor (Namespace [] ["PublicRootsRequest"]) = Just "" - documentFor (Namespace [] ["PublicRootsResults"]) = Just "" - documentFor (Namespace [] ["PublicRootsFailure"]) = Just "" - documentFor (Namespace [] ["PeerShareRequests"]) = Just $ mconcat - [ "target known peers, actual known peers, peers available for gossip," - , " peers selected for gossip" - ] - documentFor (Namespace [] ["PeerShareResults"]) = Just "" - documentFor (Namespace [] ["ForgetColdPeers"]) = Just - "target known peers, actual known peers, selected peers" - documentFor (Namespace [] ["PromoteColdPeers"]) = Just - "target established, actual established, selected peers" - documentFor (Namespace [] ["PromoteColdLocalPeers"]) = Just - "target local established, actual local established, selected peers" - documentFor (Namespace [] ["PromoteColdFailed"]) = Just $ mconcat - [ "target established, actual established, peer, delay until next" - , " promotion, reason" - ] - documentFor (Namespace [] ["PromoteColdDone"]) = Just - "target active, actual active, selected peers" - documentFor (Namespace [] ["PromoteWarmPeers"]) = Just - "target active, actual active, selected peers" - documentFor (Namespace [] ["PromoteWarmLocalPeers"]) = Just - "local per-group (target active, actual active), selected peers" - documentFor (Namespace [] ["PromoteWarmFailed"]) = Just - "target active, actual active, peer, reason" - documentFor (Namespace [] ["PromoteWarmDone"]) = Just - "target active, actual active, peer" - documentFor (Namespace [] ["PromoteWarmAborted"]) = Just "" - documentFor (Namespace [] ["DemoteWarmPeers"]) = Just - "target established, actual established, selected peers" - documentFor (Namespace [] ["DemoteWarmFailed"]) = Just - "target established, actual established, peer, reason" - documentFor (Namespace [] ["DemoteWarmFailed", "CoolingToColdTimeout"]) = - Just "Impossible asynchronous demotion timeout" - documentFor (Namespace [] ["DemoteWarmBigLedgerPeerFailed", "CoolingToColdTimeout"]) = - Just "Impossible asynchronous demotion timeout" - documentFor (Namespace [] ["DemoteWarmDone"]) = Just - "target established, actual established, peer" - documentFor (Namespace [] ["DemoteHotPeers"]) = Just - "target active, actual active, selected peers" - documentFor (Namespace [] ["DemoteLocalHotPeers"]) = Just - "local per-group (target active, actual active), selected peers" - documentFor (Namespace [] ["DemoteHotFailed"]) = Just - "target active, actual active, peer, reason" - documentFor (Namespace [] ["DemoteHotFailed", "CoolingToColdTimeout"]) = - Just "Impossible asynchronous demotion timeout" - documentFor (Namespace [] ["DemoteHotBigLedgerPeerFailed", "CoolingToColdTimeout"]) = - Just "Impossible asynchronous demotion timeout" - documentFor (Namespace [] ["DemoteHotDone"]) = Just - "target active, actual active, peer" - documentFor (Namespace [] ["DemoteAsynchronous"]) = Just "" - documentFor (Namespace [] ["DemoteLocalAsynchronous"]) = Just "" - documentFor (Namespace [] ["GovernorWakeup"]) = Just "" - documentFor (Namespace [] ["ChurnWait"]) = Just "" - documentFor (Namespace [] ["PickInboundPeers"]) = Just - "An inbound connection was added to known set of outbound governor" - documentFor (Namespace [] ["OutboundGovernorCriticalFailure"]) = Just - "Outbound Governor was killed unexpectedly" - documentFor (Namespace [] ["DebugState"]) = Just - "peer selection internal state" - documentFor (Namespace [] ["VerifyPeerSnapshot"]) = Just - "Verification outcome of big ledger peer snapshot" - documentFor _ = Nothing - - metricsDocFor (Namespace [] ["ChurnAction"]) = - [ ("peerSelection.churn.DecreasedActivePeers.duration", "") - , ("peerSelection.churn.DecreasedActiveBigLedgerPeers.duration", "") - , ("peerSelection.churn.DecreasedEstablishedPeers.duration", "") - , ("peerSelection.churn.DecreasedEstablishedBigLedgerPeers.duration", "") - , ("peerSelection.churn.DecreasedKnownPeers.duration", "") - , ("peerSelection.churn.DecreasedKnownBigLedgerPeers.duration", "") - ] - metricsDocFor _ = [] - - allNamespaces = [ - Namespace [] ["LocalRootPeersChanged"] - , Namespace [] ["TargetsChanged"] - , Namespace [] ["PublicRootsRequest"] - , Namespace [] ["PublicRootsResults"] - , Namespace [] ["PublicRootsFailure"] - , Namespace [] ["ForgetColdPeers"] - , Namespace [] ["BigLedgerPeersRequest"] - , Namespace [] ["BigLedgerPeersResults"] - , Namespace [] ["BigLedgerPeersFailure"] - , Namespace [] ["ForgetBigLedgerPeers"] - , Namespace [] ["PeerShareRequests"] - , Namespace [] ["PeerShareResults"] - , Namespace [] ["PeerShareResultsFiltered"] - , Namespace [] ["PickInboundPeers"] - , Namespace [] ["PromoteColdPeers"] - , Namespace [] ["PromoteColdLocalPeers"] - , Namespace [] ["PromoteColdFailed"] - , Namespace [] ["PromoteColdDone"] - , Namespace [] ["PromoteColdBigLedgerPeers"] - , Namespace [] ["PromoteColdBigLedgerPeerFailed"] - , Namespace [] ["PromoteColdBigLedgerPeerDone"] - , Namespace [] ["PromoteWarmPeers"] - , Namespace [] ["PromoteWarmLocalPeers"] - , Namespace [] ["PromoteWarmFailed"] - , Namespace [] ["PromoteWarmDone"] - , Namespace [] ["PromoteWarmAborted"] - , Namespace [] ["PromoteWarmBigLedgerPeers"] - , Namespace [] ["PromoteWarmBigLedgerPeerFailed"] - , Namespace [] ["PromoteWarmBigLedgerPeerDone"] - , Namespace [] ["PromoteWarmBigLedgerPeerAborted"] - , Namespace [] ["DemoteWarmPeers"] - , Namespace [] ["DemoteWarmFailed"] - , Namespace [] ["DemoteWarmFailed", "CoolingToColdTimeout"] - , Namespace [] ["DemoteWarmDone"] - , Namespace [] ["DemoteWarmBigLedgerPeers"] - , Namespace [] ["DemoteWarmBigLedgerPeerFailed"] - , Namespace [] ["DemoteWarmBigLedgerPeerFailed", "CoolingToColdTimeout"] - , Namespace [] ["DemoteWarmBigLedgerPeerDone"] - , Namespace [] ["DemoteHotPeers"] - , Namespace [] ["DemoteLocalHotPeers"] - , Namespace [] ["DemoteHotFailed"] - , Namespace [] ["DemoteHotFailed", "CoolingToColdTimeout"] - , Namespace [] ["DemoteHotDone"] - , Namespace [] ["DemoteHotBigLedgerPeers"] - , Namespace [] ["DemoteHotBigLedgerPeerFailed"] - , Namespace [] ["DemoteHotBigLedgerPeerFailed", "CoolingToColdTimeout"] - , Namespace [] ["DemoteHotBigLedgerPeerDone"] - , Namespace [] ["DemoteAsynchronous"] - , Namespace [] ["DemoteLocalAsynchronous"] - , Namespace [] ["DemoteBigLedgerPeersAsynchronous"] - , Namespace [] ["GovernorWakeup"] - , Namespace [] ["ChurnWait"] - , Namespace [] ["ChurnAction"] - , Namespace [] ["ChurnTimeout"] - , Namespace [] ["LedgerStateJudgementChanged"] - , Namespace [] ["OnlyBootstrapPeers"] - , Namespace [] ["BootstrapPeersFlagChangedWhilstInSensitiveState"] - , Namespace [] ["UseBootstrapPeersChanged"] - , Namespace [] ["VerifyPeerSnapshot"] - , Namespace [] ["OutboundGovernorCriticalFailure"] - , Namespace [] ["DebugState"] - ] - --------------------------------------------------------------------------------- --- DebugPeerSelection Tracer --------------------------------------------------------------------------------- - -instance LogFormatting CardanoDebugPeerSelection where - forMachine dtal@DNormal (TraceGovernorState blockedAt wakeupAfter - st@PeerSelectionState { targets }) = - mconcat [ "kind" .= String "DebugPeerSelection" - , "blockedAt" .= String (pack $ show blockedAt) - , "wakeupAfter" .= String (pack $ show wakeupAfter) - , "targets" .= peerSelectionTargetsToObject targets - , "counters" .= forMachine dtal (peerSelectionStateToCounters Cardano.PublicRootPeers.toSet Cardano.cardanoPeerSelectionStatetoCounters st) - ] - forMachine _ (TraceGovernorState blockedAt wakeupAfter ev) = - mconcat [ "kind" .= String "DebugPeerSelection" - , "blockedAt" .= String (pack $ show blockedAt) - , "wakeupAfter" .= String (pack $ show wakeupAfter) - , "peerSelectionState" .= String (pack $ show ev) - ] - forHuman = pack . show - -peerSelectionTargetsToObject :: PeerSelectionTargets -> Value -peerSelectionTargetsToObject - PeerSelectionTargets { targetNumberOfRootPeers, - targetNumberOfKnownPeers, - targetNumberOfEstablishedPeers, - targetNumberOfActivePeers, - targetNumberOfKnownBigLedgerPeers, - targetNumberOfEstablishedBigLedgerPeers, - targetNumberOfActiveBigLedgerPeers - } = - Object $ - mconcat [ "roots" .= targetNumberOfRootPeers - , "knownPeers" .= targetNumberOfKnownPeers - , "established" .= targetNumberOfEstablishedPeers - , "active" .= targetNumberOfActivePeers - , "knownBigLedgerPeers" .= targetNumberOfKnownBigLedgerPeers - , "establishedBigLedgerPeers" .= targetNumberOfEstablishedBigLedgerPeers - , "activeBigLedgerPeers" .= targetNumberOfActiveBigLedgerPeers - ] - -instance MetaTrace (DebugPeerSelection extraState extraFlags extraPeers SockAddr) where - namespaceFor TraceGovernorState {} = Namespace [] ["GovernorState"] - - severityFor (Namespace _ ["GovernorState"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["GovernorState"]) = Just "" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["GovernorState"] - ] - - --------------------------------------------------------------------------------- --- PeerSelectionCounters --------------------------------------------------------------------------------- - -instance LogFormatting (PeerSelectionCounters (Cardano.ExtraPeerSelectionSetsWithSizes addr)) where - forMachine _dtal PeerSelectionCounters {..} = - mconcat [ "kind" .= String "PeerSelectionCounters" - - , "knownPeers" .= numberOfKnownPeers - , "rootPeers" .= numberOfRootPeers - , "coldPeersPromotions" .= numberOfColdPeersPromotions - , "establishedPeers" .= numberOfEstablishedPeers - , "warmPeersDemotions" .= numberOfWarmPeersDemotions - , "warmPeersPromotions" .= numberOfWarmPeersPromotions - , "activePeers" .= numberOfActivePeers - , "activePeersDemotions" .= numberOfActivePeersDemotions - - , "knownBigLedgerPeers" .= numberOfKnownBigLedgerPeers - , "coldBigLedgerPeersPromotions" .= numberOfColdBigLedgerPeersPromotions - , "establishedBigLedgerPeers" .= numberOfEstablishedBigLedgerPeers - , "warmBigLedgerPeersDemotions" .= numberOfWarmBigLedgerPeersDemotions - , "warmBigLedgerPeersPromotions" .= numberOfWarmBigLedgerPeersPromotions - , "activeBigLedgerPeers" .= numberOfActiveBigLedgerPeers - , "activeBigLedgerPeersDemotions" .= numberOfActiveBigLedgerPeersDemotions - - , "knownLocalRootPeers" .= numberOfKnownLocalRootPeers - , "establishedLocalRootPeers" .= numberOfEstablishedLocalRootPeers - , "warmLocalRootPeersPromotions" .= numberOfWarmLocalRootPeersPromotions - , "activeLocalRootPeers" .= numberOfActiveLocalRootPeers - , "activeLocalRootPeersDemotions" .= numberOfActiveLocalRootPeersDemotions - - , "knownNonRootPeers" .= numberOfKnownNonRootPeers - , "coldNonRootPeersPromotions" .= numberOfColdNonRootPeersPromotions - , "establishedNonRootPeers" .= numberOfEstablishedNonRootPeers - , "warmNonRootPeersDemotions" .= numberOfWarmNonRootPeersDemotions - , "warmNonRootPeersPromotions" .= numberOfWarmNonRootPeersPromotions - , "activeNonRootPeers" .= numberOfActiveNonRootPeers - , "activeNonRootPeersDemotions" .= numberOfActiveNonRootPeersDemotions - - , "knownBootstrapPeers" .= snd (Cardano.viewKnownBootstrapPeers extraCounters) - , "coldBootstrapPeersPromotions" .= snd (Cardano.viewColdBootstrapPeersPromotions extraCounters) - , "establishedBootstrapPeers" .= snd (Cardano.viewEstablishedBootstrapPeers extraCounters) - , "warmBootstrapPeersDemotions" .= snd (Cardano.viewWarmBootstrapPeersDemotions extraCounters) - , "warmBootstrapPeersPromotions" .= snd (Cardano.viewWarmBootstrapPeersPromotions extraCounters) - , "activeBootstrapPeers" .= snd (Cardano.viewActiveBootstrapPeers extraCounters) - , "ActiveBootstrapPeersDemotions" .= snd (Cardano.viewActiveBootstrapPeersDemotions extraCounters) - ] - asMetrics psc = - case psc of - PeerSelectionCountersHWC {..} -> - -- Deprecated metrics; they will be removed in a future version. - [ IntM - "peerSelection.Cold" - (fromIntegral numberOfColdPeers) - , IntM - "peerSelection.Warm" - (fromIntegral numberOfWarmPeers) - , IntM - "peerSelection.Hot" - (fromIntegral numberOfHotPeers) - , IntM - "peerSelection.ColdBigLedgerPeers" - (fromIntegral numberOfColdBigLedgerPeers) - , IntM - "peerSelection.WarmBigLedgerPeers" - (fromIntegral numberOfWarmBigLedgerPeers) - , IntM - "peerSelection.HotBigLedgerPeers" - (fromIntegral numberOfHotBigLedgerPeers) - - , IntM - "peerSelection.WarmLocalRoots" - (fromIntegral $ numberOfActiveLocalRootPeers psc) - , IntM - "peerSelection.HotLocalRoots" - (fromIntegral $ numberOfEstablishedLocalRootPeers psc - - numberOfActiveLocalRootPeers psc) - ] - ++ - case psc of - PeerSelectionCounters {..} -> - [ IntM "peerSelection.RootPeers" (fromIntegral numberOfRootPeers) - - , IntM "peerSelection.KnownPeers" (fromIntegral numberOfKnownPeers) - , IntM "peerSelection.ColdPeersPromotions" (fromIntegral numberOfColdPeersPromotions) - , IntM "peerSelection.EstablishedPeers" (fromIntegral numberOfEstablishedPeers) - , IntM "peerSelection.WarmPeersDemotions" (fromIntegral numberOfWarmPeersDemotions) - , IntM "peerSelection.WarmPeersPromotions" (fromIntegral numberOfWarmPeersPromotions) - , IntM "peerSelection.ActivePeers" (fromIntegral numberOfActivePeers) - , IntM "peerSelection.ActivePeersDemotions" (fromIntegral numberOfActivePeersDemotions) - - , IntM "peerSelection.KnownBigLedgerPeers" (fromIntegral numberOfKnownBigLedgerPeers) - , IntM "peerSelection.ColdBigLedgerPeersPromotions" (fromIntegral numberOfColdBigLedgerPeersPromotions) - , IntM "peerSelection.EstablishedBigLedgerPeers" (fromIntegral numberOfEstablishedBigLedgerPeers) - , IntM "peerSelection.WarmBigLedgerPeersDemotions" (fromIntegral numberOfWarmBigLedgerPeersDemotions) - , IntM "peerSelection.WarmBigLedgerPeersPromotions" (fromIntegral numberOfWarmBigLedgerPeersPromotions) - , IntM "peerSelection.ActiveBigLedgerPeers" (fromIntegral numberOfActiveBigLedgerPeers) - , IntM "peerSelection.ActiveBigLedgerPeersDemotions" (fromIntegral numberOfActiveBigLedgerPeersDemotions) - - , IntM "peerSelection.KnownLocalRootPeers" (fromIntegral numberOfKnownLocalRootPeers) - , IntM "peerSelection.EstablishedLocalRootPeers" (fromIntegral numberOfEstablishedLocalRootPeers) - , IntM "peerSelection.WarmLocalRootPeersPromotions" (fromIntegral numberOfWarmLocalRootPeersPromotions) - , IntM "peerSelection.ActiveLocalRootPeers" (fromIntegral numberOfActiveLocalRootPeers) - , IntM "peerSelection.ActiveLocalRootPeersDemotions" (fromIntegral numberOfActiveLocalRootPeersDemotions) - - - , IntM "peerSelection.KnownNonRootPeers" (fromIntegral numberOfKnownNonRootPeers) - , IntM "peerSelection.ColdNonRootPeersPromotions" (fromIntegral numberOfColdNonRootPeersPromotions) - , IntM "peerSelection.EstablishedNonRootPeers" (fromIntegral numberOfEstablishedNonRootPeers) - , IntM "peerSelection.WarmNonRootPeersDemotions" (fromIntegral numberOfWarmNonRootPeersDemotions) - , IntM "peerSelection.WarmNonRootPeersPromotions" (fromIntegral numberOfWarmNonRootPeersPromotions) - , IntM "peerSelection.ActiveNonRootPeers" (fromIntegral numberOfActiveNonRootPeers) - , IntM "peerSelection.ActiveNonRootPeersDemotions" (fromIntegral numberOfActiveNonRootPeersDemotions) - - , IntM "peerSelection.KnownBootstrapPeers" (fromIntegral $ snd $ Cardano.viewKnownBootstrapPeers extraCounters) - , IntM "peerSelection.ColdBootstrapPeersPromotions" (fromIntegral $ snd $ Cardano.viewColdBootstrapPeersPromotions extraCounters) - , IntM "peerSelection.EstablishedBootstrapPeers" (fromIntegral $ snd $ Cardano.viewEstablishedBootstrapPeers extraCounters) - , IntM "peerSelection.WarmBootstrapPeersDemotions" (fromIntegral $ snd $ Cardano.viewWarmBootstrapPeersDemotions extraCounters) - , IntM "peerSelection.WarmBootstrapPeersPromotions" (fromIntegral $ snd $ Cardano.viewWarmBootstrapPeersPromotions extraCounters) - , IntM "peerSelection.ActiveBootstrapPeers" (fromIntegral $ snd $ Cardano.viewActiveBootstrapPeers extraCounters) - , IntM "peerSelection.ActiveBootstrapPeersDemotions" (fromIntegral $ snd $ Cardano.viewActiveBootstrapPeersDemotions extraCounters) - ] - -instance MetaTrace (PeerSelectionCounters extraCounters) where - namespaceFor PeerSelectionCounters {} = Namespace [] ["Counters"] - - severityFor (Namespace _ ["Counters"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["Counters"]) = Just - "Counters of selected peers" - documentFor _ = Nothing - - metricsDocFor (Namespace _ ["Counters"]) = - [ ("peerSelection.Cold", "Number of cold peers") - , ("peerSelection.Warm", "Number of warm peers") - , ("peerSelection.Hot", "Number of hot peers") - , ("peerSelection.ColdBigLedgerPeers", "Number of cold big ledger peers") - , ("peerSelection.WarmBigLedgerPeers", "Number of warm big ledger peers") - , ("peerSelection.HotBigLedgerPeers", "Number of hot big ledger peers") - , ("peerSelection.LocalRoots", "Numbers of warm & hot local roots") - - , ("peerSelection.RootPeers", "Number of root peers") - , ("peerSelection.KnownPeers", "Number of known peers") - , ("peerSelection.ColdPeersPromotions", "Number of cold peers promotions") - , ("peerSelection.EstablishedPeers", "Number of established peers") - , ("peerSelection.WarmPeersDemotions", "Number of warm peers demotions") - , ("peerSelection.WarmPeersPromotions", "Number of warm peers promotions") - , ("peerSelection.ActivePeers", "Number of active peers") - , ("peerSelection.ActivePeersDemotions", "Number of active peers demotions") - - , ("peerSelection.KnownBigLedgerPeers", "Number of known big ledger peers") - , ("peerSelection.ColdBigLedgerPeersPromotions", "Number of cold big ledger peers promotions") - , ("peerSelection.EstablishedBigLedgerPeers", "Number of established big ledger peers") - , ("peerSelection.WarmBigLedgerPeersDemotions", "Number of warm big ledger peers demotions") - , ("peerSelection.WarmBigLedgerPeersPromotions", "Number of warm big ledger peers promotions") - , ("peerSelection.ActiveBigLedgerPeers", "Number of active big ledger peers") - , ("peerSelection.ActiveBigLedgerPeersDemotions", "Number of active big ledger peers demotions") - - , ("peerSelection.KnownLocalRootPeers", "Number of known local root peers") - , ("peerSelection.EstablishedLocalRootPeers", "Number of established local root peers") - , ("peerSelection.WarmLocalRootPeersPromotions", "Number of warm local root peers promotions") - , ("peerSelection.ActiveLocalRootPeers", "Number of active local root peers") - , ("peerSelection.ActiveLocalRootPeersDemotions", "Number of active local root peers demotions") - - , ("peerSelection.KnownNonRootPeers", "Number of known non root peers") - , ("peerSelection.ColdNonRootPeersPromotions", "Number of cold non root peers promotions") - , ("peerSelection.EstablishedNonRootPeers", "Number of established non root peers") - , ("peerSelection.WarmNonRootPeersDemotions", "Number of warm non root peers demotions") - , ("peerSelection.WarmNonRootPeersPromotions", "Number of warm non root peers promotions") - , ("peerSelection.ActiveNonRootPeers", "Number of active non root peers") - , ("peerSelection.ActiveNonRootPeersDemotions", "Number of active non root peers demotions") - - , ("peerSelection.KnownBootstrapPeers", "Number of known bootstrap peers") - , ("peerSelection.ColdBootstrapPeersPromotions", "Number of cold bootstrap peers promotions") - , ("peerSelection.EstablishedBootstrapPeers", "Number of established bootstrap peers") - , ("peerSelection.WarmBootstrapPeersDemotions", "Number of warm bootstrap peers demotions") - , ("peerSelection.WarmBootstrapPeersPromotions", "Number of warm bootstrap peers promotions") - , ("peerSelection.ActiveBootstrapPeers", "Number of active bootstrap peers") - , ("peerSelection.ActiveBootstrapPeersDemotions", "Number of active bootstrap peers demotions") - - ] - metricsDocFor _ = [] - - allNamespaces =[ - Namespace [] ["Counters"] - ] - - --------------------------------------------------------------------------------- --- ChurnCounters Tracer --------------------------------------------------------------------------------- - - -instance LogFormatting ChurnCounters where - forMachine _dtal (ChurnCounter action c) = - mconcat [ "kind" .= String "ChurnCounter" - , "action" .= String (pack $ show action) - , "counter" .= c - ] - asMetrics (ChurnCounter action c) = - [ IntM - ("peerSelection.churn." <> pack (show action)) - (fromIntegral c) - ] - -instance MetaTrace ChurnCounters where - namespaceFor ChurnCounter {} = Namespace [] ["ChurnCounters"] - - severityFor (Namespace _ ["ChurnCounters"]) _ = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace _ ["ChurnCounters"]) = Just - "churn counters" - documentFor _ = Nothing - - metricsDocFor (Namespace _ ["ChurnCounters"]) = - [ ("peerSelection.churn.DecreasedActivePeers", "number of decreased active peers") - , ("peerSelection.churn.IncreasedActivePeers", "number of increased active peers") - , ("peerSelection.churn.DecreasedActiveBigLedgerPeers", "number of decreased active big ledger peers") - , ("peerSelection.churn.IncreasedActiveBigLedgerPeers", "number of increased active big ledger peers") - , ("peerSelection.churn.DecreasedEstablishedPeers", "number of decreased established peers") - , ("peerSelection.churn.IncreasedEstablishedPeers", "number of increased established peers") - , ("peerSelection.churn.IncreasedEstablishedBigLedgerPeers", "number of increased established big ledger peers") - , ("peerSelection.churn.DecreasedEstablishedBigLedgerPeers", "number of decreased established big ledger peers") - , ("peerSelection.churn.DecreasedKnownPeers", "number of decreased known peers") - , ("peerSelection.churn.IncreasedKnownPeers", "number of increased known peers") - , ("peerSelection.churn.DecreasedKnownBigLedgerPeers", "number of decreased known big ledger peers") - , ("peerSelection.churn.IncreasedKnownBigLedgerPeers", "number of increased known big ledger peers") - ] - metricsDocFor _ = [] - - allNamespaces =[ - Namespace [] ["ChurnCounters"] - ] - - --------------------------------------------------------------------------------- --- PeerSelectionActions Tracer --------------------------------------------------------------------------------- - --- TODO: Write PeerStatusChangeType ToJSON at ouroboros-network --- For that an export is needed at ouroboros-network -instance Show lAddr => LogFormatting (PeerSelectionActionsTrace SockAddr lAddr) where - forMachine _dtal (PeerStatusChanged ps) = - mconcat [ "kind" .= String "PeerStatusChanged" - , "peerStatusChangeType" .= show ps - ] - forMachine _dtal (PeerStatusChangeFailure ps f) = - mconcat [ "kind" .= String "PeerStatusChangeFailure" - , "peerStatusChangeType" .= show ps - , "reason" .= show f - ] - forMachine _dtal (PeerMonitoringError connId s) = - mconcat [ "kind" .= String "PeerMonitoringError" - , "connectionId" .= toJSON connId - , "reason" .= show s - ] - forMachine _dtal (PeerMonitoringResult connId wf) = - mconcat [ "kind" .= String "PeerMonitoringResult" - , "connectionId" .= toJSON connId - , "withProtocolTemp" .= show wf - ] - forMachine _dtal (AcquireConnectionError exception) = - mconcat [ "kind" .= String "AcquireConnectionError" - , "error" .= displayException exception - ] - forMachine _dtal (PeerHotDuration connId dt) = - mconcat [ "kind" .= String "PeerHotDuration" - , "connectionId" .= toJSON connId - , "time" .= show dt] - forHuman = pack . show - -instance MetaTrace (PeerSelectionActionsTrace SockAddr lAddr) where - namespaceFor PeerStatusChanged {} = Namespace [] ["StatusChanged"] - namespaceFor PeerStatusChangeFailure {} = Namespace [] ["StatusChangeFailure"] - namespaceFor PeerMonitoringError {} = Namespace [] ["MonitoringError"] - namespaceFor PeerMonitoringResult {} = Namespace [] ["MonitoringResult"] - namespaceFor AcquireConnectionError {} = Namespace [] ["ConnectionError"] - namespaceFor PeerHotDuration {} = Namespace [] ["PeerHotDuration"] - - severityFor (Namespace _ ["StatusChanged"]) _ = Just Info - severityFor (Namespace _ ["StatusChangeFailure"]) _ = Just Error - severityFor (Namespace _ ["MonitoringError"]) _ = Just Error - severityFor (Namespace _ ["MonitoringResult"]) _ = Just Debug - severityFor (Namespace _ ["ConnectionError"]) _ = Just Error - severityFor (Namespace _ ["PeerHotDuration"]) _ = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace _ ["StatusChanged"]) = Just - "" - documentFor (Namespace _ ["StatusChangeFailure"]) = Just - "" - documentFor (Namespace _ ["MonitoringError"]) = Just - "" - documentFor (Namespace _ ["MonitoringResult"]) = Just - "" - documentFor (Namespace _ ["ConnectionError"]) = Just - "" - documentFor (Namespace _ ["PeerHotDuration"]) = Just - "Reports how long the outbound connection was in hot state" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["StatusChanged"] - , Namespace [] ["StatusChangeFailure"] - , Namespace [] ["MonitoringError"] - , Namespace [] ["MonitoringResult"] - , Namespace [] ["ConnectionError"] - , Namespace [] ["PeerHotDuration"] - ] - --------------------------------------------------------------------------------- --- Connection Manager Tracer --------------------------------------------------------------------------------- - -instance (Show addr, LogFormatting addr, ToJSON addr, LogFormatting handler, Show handler) - => LogFormatting (ConnectionManager.Trace addr handler) where - forMachine dtal (TrIncludeConnection prov peerAddr) = - mconcat $ reverse - [ "kind" .= String "IncludeConnection" - , "remoteAddress" .= forMachine dtal peerAddr - , "provenance" .= String (pack . show $ prov) - ] - forMachine _dtal (TrReleaseConnection prov connId) = - mconcat $ reverse - [ "kind" .= String "UnregisterConnection" - , "remoteAddress" .= toJSON connId - , "provenance" .= String (pack . show $ prov) - ] - forMachine _dtal (TrConnect (Just localAddress) remoteAddress diffusionMode) = - mconcat - [ "kind" .= String "Connect" - , "connectionId" .= toJSON ConnectionId { localAddress, remoteAddress } - , "diffusionMode" .= toJSON diffusionMode - ] - forMachine dtal (TrConnect Nothing remoteAddress diffusionMode) = - mconcat - [ "kind" .= String "Connect" - , "remoteAddress" .= forMachine dtal remoteAddress - , "diffusionMode" .= toJSON diffusionMode - ] - forMachine _dtal (TrConnectError (Just localAddress) remoteAddress err) = - mconcat - [ "kind" .= String "ConnectError" - , "connectionId" .= toJSON ConnectionId { localAddress, remoteAddress } - , "reason" .= String (pack . show $ err) - ] - forMachine dtal (TrConnectError Nothing remoteAddress err) = - mconcat - [ "kind" .= String "ConnectError" - , "remoteAddress" .= forMachine dtal remoteAddress - , "reason" .= String (pack . show $ err) - ] - forMachine _dtal (TrTerminatingConnection prov connId) = - mconcat - [ "kind" .= String "TerminatingConnection" - , "provenance" .= String (pack . show $ prov) - , "connectionId" .= toJSON connId - ] - forMachine dtal (TrTerminatedConnection prov remoteAddress) = - mconcat - [ "kind" .= String "TerminatedConnection" - , "provenance" .= String (pack . show $ prov) - , "remoteAddress" .= forMachine dtal remoteAddress - ] - forMachine dtal (TrConnectionHandler connId handler) = - mconcat - [ "kind" .= String "ConnectionHandler" - , "connectionId" .= toJSON connId - , "connectionHandler" .= forMachine dtal handler - ] - forMachine _dtal TrShutdown = - mconcat - [ "kind" .= String "Shutdown" - ] - forMachine dtal (TrConnectionExists prov remoteAddress inState) = - mconcat - [ "kind" .= String "ConnectionExists" - , "provenance" .= String (pack . show $ prov) - , "remoteAddress" .= forMachine dtal remoteAddress - , "state" .= toJSON inState - ] - forMachine _dtal (TrForbiddenConnection connId) = - mconcat - [ "kind" .= String "ForbiddenConnection" - , "connectionId" .= toJSON connId - ] - forMachine _dtal (TrConnectionFailure connId) = - mconcat - [ "kind" .= String "ConnectionFailure" - , "connectionId" .= toJSON connId - ] - forMachine dtal (TrConnectionNotFound prov remoteAddress) = - mconcat - [ "kind" .= String "ConnectionNotFound" - , "remoteAddress" .= forMachine dtal remoteAddress - , "provenance" .= String (pack . show $ prov) - ] - forMachine dtal (TrForbiddenOperation remoteAddress connState) = - mconcat - [ "kind" .= String "ForbiddenOperation" - , "remoteAddress" .= forMachine dtal remoteAddress - , "connectionState" .= toJSON connState - ] - forMachine _dtal (TrPruneConnections pruningSet numberPruned chosenPeers) = - mconcat - [ "kind" .= String "PruneConnections" - , "prunedPeers" .= toJSON pruningSet - , "numberPrunedPeers" .= toJSON numberPruned - , "choiceSet" .= toJSON (toJSON `Set.map` chosenPeers) - ] - forMachine _dtal (TrConnectionCleanup connId) = - mconcat - [ "kind" .= String "ConnectionCleanup" - , "connectionId" .= toJSON connId - ] - forMachine _dtal (TrConnectionTimeWait connId) = - mconcat - [ "kind" .= String "ConnectionTimeWait" - , "connectionId" .= toJSON connId - ] - forMachine _dtal (TrConnectionTimeWaitDone connId) = - mconcat - [ "kind" .= String "ConnectionTimeWaitDone" - , "connectionId" .= toJSON connId - ] - forMachine _dtal (TrConnectionManagerCounters cmCounters) = - mconcat - [ "kind" .= String "ConnectionManagerCounters" - , "state" .= toJSON cmCounters - ] - forMachine _dtal (TrState cmState) = - mconcat - [ "kind" .= String "ConnectionManagerState" - , "state" .= listValue (\(remoteAddr, inner) -> - object - [ "connections" .= - listValue (\(localAddr, connState) -> - object - [ "localAddress" .= localAddr - , "state" .= toJSON connState - ] - ) - (Map.toList inner) - , "remoteAddress" .= toJSON remoteAddr - ] - ) - (Map.toList (getConnMap cmState)) - ] - forMachine _dtal (ConnectionManager.TrUnexpectedlyFalseAssertion info) = - mconcat - [ "kind" .= String "UnexpectedlyFalseAssertion" - , "info" .= String (pack . show $ info) - ] - forHuman = pack . show - asMetrics (TrConnectionManagerCounters ConnectionManagerCounters {..}) = - [ IntM - "connectionManager.fullDuplexConns" - (fromIntegral fullDuplexConns) - , IntM - "connectionManager.duplexConns" - (fromIntegral duplexConns) - , IntM - "connectionManager.unidirectionalConns" - (fromIntegral unidirectionalConns) - , IntM - "connectionManager.inboundConns" - (fromIntegral inboundConns) - , IntM - "connectionManager.outboundConns" - (fromIntegral outboundConns) - ] - asMetrics _ = [] - -instance (Show versionNumber, ToJSON versionNumber, ToJSON agreedOptions) - => LogFormatting (ConnectionHandlerTrace versionNumber agreedOptions) where - forMachine _dtal (TrHandshakeSuccess versionNumber agreedOptions) = - mconcat - [ "kind" .= String "HandshakeSuccess" - , "versionNumber" .= toJSON versionNumber - , "agreedOptions" .= toJSON agreedOptions - ] - forMachine _dtal (TrHandshakeQuery vMap) = - mconcat - [ "kind" .= String "HandshakeQuery" - , "versions" .= toJSON ((\(k,v) -> object [ - "versionNumber" .= k - , "options" .= v - ]) <$> Map.toList vMap) - ] - forMachine _dtal (TrHandshakeClientError err) = - mconcat - [ "kind" .= String "HandshakeClientError" - , "reason" .= toJSON err - ] - forMachine _dtal (TrHandshakeServerError err) = - mconcat - [ "kind" .= String "HandshakeServerError" - , "reason" .= toJSON err - ] - forMachine _dtal (TrConnectionHandlerError e err cerr) = - mconcat - [ "kind" .= String "Error" - , "context" .= show e - , "reason" .= show err - , "command" .= show cerr - ] - -instance MetaTrace handler => MetaTrace (ConnectionManager.Trace addr handler) where - namespaceFor TrIncludeConnection {} = Namespace [] ["IncludeConnection"] - namespaceFor TrReleaseConnection {} = Namespace [] ["UnregisterConnection"] - namespaceFor TrConnect {} = Namespace [] ["Connect"] - namespaceFor TrConnectError {} = Namespace [] ["ConnectError"] - namespaceFor TrTerminatingConnection {} = Namespace [] ["TerminatingConnection"] - namespaceFor TrTerminatedConnection {} = Namespace [] ["TerminatedConnection"] - namespaceFor (TrConnectionHandler _ hdl) = - nsPrependInner "ConnectionHandler" (namespaceFor hdl) - namespaceFor TrShutdown {} = Namespace [] ["Shutdown"] - namespaceFor TrConnectionExists {} = Namespace [] ["ConnectionExists"] - namespaceFor TrForbiddenConnection {} = Namespace [] ["ForbiddenConnection"] - namespaceFor TrConnectionFailure {} = Namespace [] ["ConnectionFailure"] - namespaceFor TrConnectionNotFound {} = Namespace [] ["ConnectionNotFound"] - namespaceFor TrForbiddenOperation {} = Namespace [] ["ForbiddenOperation"] - namespaceFor TrPruneConnections {} = Namespace [] ["PruneConnections"] - namespaceFor TrConnectionCleanup {} = Namespace [] ["ConnectionCleanup"] - namespaceFor TrConnectionTimeWait {} = Namespace [] ["ConnectionTimeWait"] - namespaceFor TrConnectionTimeWaitDone {} = Namespace [] ["ConnectionTimeWaitDone"] - namespaceFor TrConnectionManagerCounters {} = Namespace [] ["ConnectionManagerCounters"] - namespaceFor TrState {} = Namespace [] ["State"] - namespaceFor ConnectionManager.TrUnexpectedlyFalseAssertion {} = - Namespace [] ["UnexpectedlyFalseAssertion"] - - severityFor (Namespace _ ["IncludeConnection"]) _ = Just Debug - severityFor (Namespace _ ["UnregisterConnection"]) _ = Just Debug - severityFor (Namespace _ ["Connect"]) _ = Just Debug - severityFor (Namespace _ ["ConnectError"]) _ = Just Info - severityFor (Namespace _ ["TerminatingConnection"]) _ = Just Debug - severityFor (Namespace _ ["TerminatedConnection"]) _ = Just Debug - severityFor (Namespace out ("ConnectionHandler" : tl)) (Just (TrConnectionHandler _ hdl)) = - severityFor (Namespace out tl) (Just hdl) - severityFor (Namespace _ ("ConnectionHandler" : _)) Nothing = Just Info - severityFor (Namespace _ ["Shutdown"]) _ = Just Info - severityFor (Namespace _ ["ConnectionExists"]) _ = Just Info - severityFor (Namespace _ ["ForbiddenConnection"]) _ = Just Info - severityFor (Namespace _ ["ConnectionFailure"]) _ = Just Info - severityFor (Namespace _ ["ConnectionNotFound"]) _ = Just Debug - severityFor (Namespace _ ["ForbiddenOperation"]) _ = Just Info - severityFor (Namespace _ ["PruneConnections"]) _ = Just Notice - severityFor (Namespace _ ["ConnectionCleanup"]) _ = Just Debug - severityFor (Namespace _ ["ConnectionTimeWait"]) _ = Just Debug - severityFor (Namespace _ ["ConnectionTimeWaitDone"]) _ = Just Info - severityFor (Namespace _ ["ConnectionManagerCounters"]) _ = Just Info - severityFor (Namespace _ ["State"]) _ = Just Info - severityFor (Namespace _ ["UnexpectedlyFalseAssertion"]) _ = Just Error - severityFor _ _ = Nothing - - documentFor (Namespace _ ["IncludeConnection"]) = Just "" - documentFor (Namespace _ ["UnregisterConnection"]) = Just "" - documentFor (Namespace _ ["Connect"]) = Just "" - documentFor (Namespace _ ["ConnectError"]) = Just "" - documentFor (Namespace _ ["TerminatingConnection"]) = Just "" - documentFor (Namespace _ ["TerminatedConnection"]) = Just "" - documentFor (Namespace out ("ConnectionHandler" : tl)) = - documentFor (Namespace out tl :: Namespace handler) - documentFor (Namespace _ ["Shutdown"]) = Just "" - documentFor (Namespace _ ["ConnectionExists"]) = Just "" - documentFor (Namespace _ ["ForbiddenConnection"]) = Just "" - documentFor (Namespace _ ["ConnectionFailure"]) = Just "" - documentFor (Namespace _ ["ConnectionNotFound"]) = Just "" - documentFor (Namespace _ ["ForbiddenOperation"]) = Just "" - documentFor (Namespace _ ["PruneConnections"]) = Just "" - documentFor (Namespace _ ["ConnectionCleanup"]) = Just "" - documentFor (Namespace _ ["ConnectionTimeWait"]) = Just "" - documentFor (Namespace _ ["ConnectionTimeWaitDone"]) = Just "" - documentFor (Namespace _ ["ConnectionManagerCounters"]) = Just "" - documentFor (Namespace _ ["State"]) = Just "" - documentFor (Namespace _ ["UnexpectedlyFalseAssertion"]) = Just "" - documentFor _ = Nothing - - metricsDocFor (Namespace _ ["ConnectionManagerCounters"]) = - [("connectionManager.fullDuplexConns","") - ,("connectionManager.duplexConns","") - ,("connectionManager.unidirectionalConns","") - ,("connectionManager.inboundConns","") - ,("connectionManager.outboundConns","") - ,("connectionManager.prunableConns","") - ] - metricsDocFor _ = [] - - allNamespaces = [ - Namespace [] ["IncludeConnection"] - , Namespace [] ["UnregisterConnection"] - , Namespace [] ["Connect"] - , Namespace [] ["ConnectError"] - , Namespace [] ["TerminatingConnection"] - , Namespace [] ["TerminatedConnection"] - , Namespace [] ["Shutdown"] - , Namespace [] ["ConnectionExists"] - , Namespace [] ["ForbiddenConnection"] - , Namespace [] ["ConnectionFailure"] - , Namespace [] ["ConnectionNotFound"] - , Namespace [] ["ForbiddenOperation"] - , Namespace [] ["PruneConnections"] - , Namespace [] ["ConnectionCleanup"] - , Namespace [] ["ConnectionTimeWait"] - , Namespace [] ["ConnectionTimeWaitDone"] - , Namespace [] ["ConnectionManagerCounters"] - , Namespace [] ["State"] - , Namespace [] ["UnexpectedlyFalseAssertion"]] - ++ map (nsPrependInner "ConnectionHandler") - (allNamespaces :: [Namespace handler]) - - -instance MetaTrace (ConnectionHandlerTrace versionNumber agreedOptions) where - namespaceFor TrHandshakeSuccess {} = Namespace [] ["HandshakeSuccess"] - namespaceFor TrHandshakeQuery {} = Namespace [] ["HandshakeQuery"] - namespaceFor TrHandshakeClientError {} = Namespace [] ["HandshakeClientError"] - namespaceFor TrHandshakeServerError {} = Namespace [] ["HandshakeServerError"] - namespaceFor TrConnectionHandlerError {} = Namespace [] ["Error"] - - severityFor (Namespace _ ["HandshakeSuccess"]) _ = Just Info - severityFor (Namespace _ ["HandshakeQuery"]) _ = Just Info - severityFor (Namespace _ ["HandshakeClientError"]) _ = Just Notice - severityFor (Namespace _ ["HandshakeServerError"]) _ = Just Info - severityFor (Namespace _ ["Error"]) (Just (TrConnectionHandlerError _ _ ShutdownNode)) = Just Critical - severityFor (Namespace _ ["Error"]) (Just (TrConnectionHandlerError _ _ ShutdownPeer)) = Just Info - severityFor (Namespace _ ["Error"]) Nothing = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace _ ["HandshakeSuccess"]) = Just "" - documentFor (Namespace _ ["HandshakeQuery"]) = Just "" - documentFor (Namespace _ ["HandshakeClientError"]) = Just "" - documentFor (Namespace _ ["HandshakeServerError"]) = Just "" - documentFor (Namespace _ ["Error"]) = Just "" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["HandshakeSuccess"] - , Namespace [] ["HandshakeQuery"] - , Namespace [] ["HandshakeClientError"] - , Namespace [] ["HandshakeServerError"] - , Namespace [] ["Error"] - ] - --------------------------------------------------------------------------------- --- Connection Manager Transition Tracer --------------------------------------------------------------------------------- - -instance (Show peerAddr, ToJSON peerAddr) - => LogFormatting (ConnectionManager.AbstractTransitionTrace peerAddr) where - forMachine _dtal (ConnectionManager.TransitionTrace peerAddr tr) = - mconcat $ reverse - [ "kind" .= String "ConnectionManagerTransition" - , "address" .= toJSON peerAddr - , "from" .= toJSON (ConnectionManager.fromState tr) - , "to" .= toJSON (ConnectionManager.toState tr) - ] - - forHuman = pack . show - - asMetrics _ = [] - -instance MetaTrace (ConnectionManager.AbstractTransitionTrace peerAddr) where - namespaceFor ConnectionManager.TransitionTrace {} = - Namespace [] ["Transition"] - - severityFor (Namespace _ ["Transition"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["Transition"]) = Just "" - documentFor _ = Nothing - - allNamespaces = [Namespace [] ["Transition"]] - --------------------------------------------------------------------------------- --- Server Tracer --------------------------------------------------------------------------------- - -instance (Show addr, LogFormatting addr, ToJSON addr) - => LogFormatting (Server.Trace addr) where - forMachine _dtal (TrAcceptConnection connId) = - mconcat [ "kind" .= String "AcceptConnection" - , "address" .= toJSON connId - ] - forMachine _dtal (TrAcceptError exception) = - mconcat [ "kind" .= String "AcceptErroor" - , "reason" .= show exception - ] - forMachine dtal (TrAcceptPolicyTrace policyTrace) = - mconcat [ "kind" .= String "AcceptPolicyTrace" - , "policy" .= forMachine dtal policyTrace - ] - forMachine dtal (TrServerStarted peerAddrs) = - mconcat [ "kind" .= String "AcceptPolicyTrace" - , "addresses" .= toJSON (forMachine dtal `map` peerAddrs) - ] - forMachine _dtal TrServerStopped = - mconcat [ "kind" .= String "ServerStopped" - ] - forMachine _dtal (TrServerError exception) = - mconcat [ "kind" .= String "ServerError" - , "reason" .= show exception - ] - forHuman = pack . show - -instance MetaTrace (Server.Trace addr) where - namespaceFor TrAcceptConnection {} = Namespace [] ["AcceptConnection"] - namespaceFor TrAcceptError {} = Namespace [] ["AcceptError"] - namespaceFor TrAcceptPolicyTrace {} = Namespace [] ["AcceptPolicy"] - namespaceFor TrServerStarted {} = Namespace [] ["Started"] - namespaceFor TrServerStopped {} = Namespace [] ["Stopped"] - namespaceFor TrServerError {} = Namespace [] ["Error"] - - severityFor (Namespace _ ["AcceptConnection"]) _ = Just Debug - severityFor (Namespace _ ["AcceptError"]) _ = Just Error - severityFor (Namespace _ ["AcceptPolicy"]) _ = Just Notice - severityFor (Namespace _ ["Started"]) _ = Just Notice - severityFor (Namespace _ ["Stopped"]) _ = Just Notice - severityFor (Namespace _ ["Error"]) _ = Just Critical - severityFor _ _ = Nothing - - documentFor (Namespace _ ["AcceptConnection"]) = Just "" - documentFor (Namespace _ ["AcceptError"]) = Just "" - documentFor (Namespace _ ["AcceptPolicy"]) = Just "" - documentFor (Namespace _ ["Started"]) = Just "" - documentFor (Namespace _ ["Stopped"]) = Just "" - documentFor (Namespace _ ["Error"]) = Just "" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["AcceptConnection"] - , Namespace [] ["AcceptError"] - , Namespace [] ["AcceptPolicy"] - , Namespace [] ["Started"] - , Namespace [] ["Stopped"] - , Namespace [] ["Error"] - ] - --------------------------------------------------------------------------------- --- InboundGovernor Tracer --------------------------------------------------------------------------------- - -instance LogFormatting (InboundGovernor.Trace SockAddr) where - forMachine = forMachineGov - forHuman = pack . show - asMetrics (TrInboundGovernorCounters InboundGovernor.Counters {..}) = - [ IntM - "inboundGovernor.idle" - (fromIntegral idlePeersRemote) - , IntM - "inboundGovernor.cold" - (fromIntegral coldPeersRemote) - , IntM - "inboundGovernor.warm" - (fromIntegral warmPeersRemote) - , IntM - "inboundGovernor.hot" - (fromIntegral hotPeersRemote) - ] - asMetrics _ = [] - -instance LogFormatting (InboundGovernor.Trace LocalAddress) where - forMachine = forMachineGov - forHuman = pack . show - asMetrics (TrInboundGovernorCounters InboundGovernor.Counters {..}) = - [ IntM - "localInboundGovernor.idle" - (fromIntegral idlePeersRemote) - , IntM - "localInboundGovernor.cold" - (fromIntegral coldPeersRemote) - , IntM - "localInboundGovernor.warm" - (fromIntegral warmPeersRemote) - , IntM - "localInboundGovernor.hot" - (fromIntegral hotPeersRemote) - ] - asMetrics _ = [] - - -forMachineGov :: (ToJSON adr, Show adr, ToJSONKey adr) => DetailLevel -> InboundGovernor.Trace adr -> Object -forMachineGov _dtal (TrNewConnection p connId) = - mconcat [ "kind" .= String "NewConnection" - , "provenance" .= show p - , "connectionId" .= toJSON connId - ] -forMachineGov _dtal (TrResponderRestarted connId m) = - mconcat [ "kind" .= String "ResponderStarted" - , "connectionId" .= toJSON connId - , "miniProtocolNum" .= toJSON m - ] -forMachineGov _dtal (TrResponderStartFailure connId m s) = - mconcat [ "kind" .= String "ResponderStartFailure" - , "connectionId" .= toJSON connId - , "miniProtocolNum" .= toJSON m - , "reason" .= show s - ] -forMachineGov _dtal (TrResponderErrored connId m s) = - mconcat [ "kind" .= String "ResponderErrored" - , "connectionId" .= toJSON connId - , "miniProtocolNum" .= toJSON m - , "reason" .= show s - ] -forMachineGov _dtal (TrResponderStarted connId m) = - mconcat [ "kind" .= String "ResponderStarted" - , "connectionId" .= toJSON connId - , "miniProtocolNum" .= toJSON m - ] -forMachineGov _dtal (TrResponderTerminated connId m) = - mconcat [ "kind" .= String "ResponderTerminated" - , "connectionId" .= toJSON connId - , "miniProtocolNum" .= toJSON m - ] -forMachineGov _dtal (TrPromotedToWarmRemote connId opRes) = - mconcat [ "kind" .= String "PromotedToWarmRemote" - , "connectionId" .= toJSON connId - , "result" .= toJSON opRes - ] -forMachineGov _dtal (TrPromotedToHotRemote connId) = - mconcat [ "kind" .= String "PromotedToHotRemote" - , "connectionId" .= toJSON connId - ] -forMachineGov _dtal (TrDemotedToColdRemote connId od) = - mconcat [ "kind" .= String "DemotedToColdRemote" - , "connectionId" .= toJSON connId - , "result" .= show od - ] -forMachineGov _dtal (TrDemotedToWarmRemote connId) = - mconcat [ "kind" .= String "DemotedToWarmRemote" - , "connectionId" .= toJSON connId - ] -forMachineGov _dtal (TrWaitIdleRemote connId opRes) = - mconcat [ "kind" .= String "WaitIdleRemote" - , "connectionId" .= toJSON connId - , "result" .= toJSON opRes - ] -forMachineGov _dtal (TrMuxCleanExit connId) = - mconcat [ "kind" .= String "MuxCleanExit" - , "connectionId" .= toJSON connId - ] -forMachineGov _dtal (TrMuxErrored connId s) = - mconcat [ "kind" .= String "MuxErrored" - , "connectionId" .= toJSON connId - , "reason" .= show s - ] -forMachineGov _dtal (TrInboundGovernorCounters counters) = - mconcat [ "kind" .= String "InboundGovernorCounters" - , "idlePeers" .= idlePeersRemote counters - , "coldPeers" .= coldPeersRemote counters - , "warmPeers" .= warmPeersRemote counters - , "hotPeers" .= hotPeersRemote counters - ] -forMachineGov _dtal (TrRemoteState st) = - mconcat [ "kind" .= String "RemoteState" - , "remoteSt" .= toJSON st - ] -forMachineGov _dtal (InboundGovernor.TrUnexpectedlyFalseAssertion info) = - mconcat [ "kind" .= String "UnexpectedlyFalseAssertion" - , "remoteSt" .= String (pack . show $ info) - ] -forMachineGov _dtal (InboundGovernor.TrInboundGovernorError err) = - mconcat [ "kind" .= String "InboundGovernorError" - , "remoteSt" .= String (pack . show $ err) - ] -forMachineGov _dtal (InboundGovernor.TrMaturedConnections matured fresh) = - mconcat [ "kind" .= String "MaturedConnections" - , "matured" .= toJSON matured - , "fresh" .= toJSON fresh - ] -forMachineGov _dtal (InboundGovernor.TrInactive fresh) = - mconcat [ "kind" .= String "Inactive" - , "fresh" .= toJSON fresh - ] - -instance MetaTrace (InboundGovernor.Trace addr) where - namespaceFor TrNewConnection {} = Namespace [] ["NewConnection"] - namespaceFor TrResponderRestarted {} = Namespace [] ["ResponderRestarted"] - namespaceFor TrResponderStartFailure {} = Namespace [] ["ResponderStartFailure"] - namespaceFor TrResponderErrored {} = Namespace [] ["ResponderErrored"] - namespaceFor TrResponderStarted {} = Namespace [] ["ResponderStarted"] - namespaceFor TrResponderTerminated {} = Namespace [] ["ResponderTerminated"] - namespaceFor TrPromotedToWarmRemote {} = Namespace [] ["PromotedToWarmRemote"] - namespaceFor TrPromotedToHotRemote {} = Namespace [] ["PromotedToHotRemote"] - namespaceFor TrDemotedToColdRemote {} = Namespace [] ["DemotedToColdRemote"] - namespaceFor TrDemotedToWarmRemote {} = Namespace [] ["DemotedToWarmRemote"] - namespaceFor TrWaitIdleRemote {} = Namespace [] ["WaitIdleRemote"] - namespaceFor TrMuxCleanExit {} = Namespace [] ["MuxCleanExit"] - namespaceFor TrMuxErrored {} = Namespace [] ["MuxErrored"] - namespaceFor TrInboundGovernorCounters {} = Namespace [] ["InboundGovernorCounters"] - namespaceFor TrRemoteState {} = Namespace [] ["RemoteState"] - namespaceFor InboundGovernor.TrUnexpectedlyFalseAssertion {} = - Namespace [] ["UnexpectedlyFalseAssertion"] - namespaceFor InboundGovernor.TrInboundGovernorError {} = - Namespace [] ["InboundGovernorError"] - namespaceFor InboundGovernor.TrMaturedConnections {} = - Namespace [] ["MaturedConnections"] - namespaceFor InboundGovernor.TrInactive {} = - Namespace [] ["Inactive"] - - severityFor (Namespace _ ["NewConnection"]) _ = Just Debug - severityFor (Namespace _ ["ResponderRestarted"]) _ = Just Debug - severityFor (Namespace _ ["ResponderStartFailure"]) _ = Just Info - severityFor (Namespace _ ["ResponderErrored"]) _ = Just Info - severityFor (Namespace _ ["ResponderStarted"]) _ = Just Debug - severityFor (Namespace _ ["ResponderTerminated"]) _ = Just Debug - severityFor (Namespace _ ["PromotedToWarmRemote"]) _ = Just Info - severityFor (Namespace _ ["PromotedToHotRemote"]) _ = Just Info - severityFor (Namespace _ ["DemotedToColdRemote"]) _ = Just Info - severityFor (Namespace _ ["DemotedToWarmRemote"]) _ = Just Info - severityFor (Namespace _ ["WaitIdleRemote"]) _ = Just Debug - severityFor (Namespace _ ["MuxCleanExit"]) _ = Just Debug - severityFor (Namespace _ ["MuxErrored"]) _ = Just Info - severityFor (Namespace _ ["InboundGovernorCounters"]) _ = Just Info - severityFor (Namespace _ ["RemoteState"]) _ = Just Debug - severityFor (Namespace _ ["UnexpectedlyFalseAssertion"]) _ = Just Error - severityFor (Namespace _ ["InboundGovernorError"]) _ = Just Error - severityFor (Namespace _ ["MaturedConnections"]) _ = Just Info - severityFor (Namespace _ ["Inactive"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace _ ["NewConnection"]) = Just "" - documentFor (Namespace _ ["ResponderRestarted"]) = Just "" - documentFor (Namespace _ ["ResponderStartFailure"]) = Just "" - documentFor (Namespace _ ["ResponderErrored"]) = Just "" - documentFor (Namespace _ ["ResponderStarted"]) = Just "" - documentFor (Namespace _ ["ResponderTerminated"]) = Just "" - documentFor (Namespace _ ["PromotedToWarmRemote"]) = Just "" - documentFor (Namespace _ ["PromotedToHotRemote"]) = Just "" - documentFor (Namespace _ ["DemotedToColdRemote"]) = Just $ mconcat - [ "All mini-protocols terminated. The boolean is true if this connection" - , " was not used by p2p-governor, and thus the connection will be terminated." - ] - documentFor (Namespace _ ["DemotedToWarmRemote"]) = Just $ mconcat - [ "All mini-protocols terminated. The boolean is true if this connection" - , " was not used by p2p-governor, and thus the connection will be terminated." - ] - documentFor (Namespace _ ["WaitIdleRemote"]) = Just "" - documentFor (Namespace _ ["MuxCleanExit"]) = Just "" - documentFor (Namespace _ ["MuxErrored"]) = Just "" - documentFor (Namespace _ ["InboundGovernorCounters"]) = Just "" - documentFor (Namespace _ ["RemoteState"]) = Just "" - documentFor (Namespace _ ["UnexpectedlyFalseAssertion"]) = Just "" - documentFor (Namespace _ ["InboundGovernorError"]) = Just "" - documentFor (Namespace _ ["MaturedConnections"]) = Just "" - documentFor (Namespace _ ["Inactive"]) = Just "" - documentFor _ = Nothing - - metricsDocFor (Namespace ons ["InboundGovernorCounters"]) - | null ons -- docu generation - = - [("localInboundGovernor.idle","") - ,("localInboundGovernor.cold","") - ,("localInboundGovernor.warm","") - ,("localInboundGovernor.hot","") - ,("inboundGovernor.Idle","") - ,("inboundGovernor.Cold","") - ,("inboundGovernor.Warm","") - ,("inboundGovernor.Hot","") - ] - | last ons == "Local" - = - [("localInboundGovernor.idle","") - ,("localInboundGovernor.cold","") - ,("localInboundGovernor.warm","") - ,("localInboundGovernor.hot","") - ] - | otherwise - = - [("inboundGovernor.Idle","") - ,("inboundGovernor.Cold","") - ,("inboundGovernor.Warm","") - ,("inboundGovernor.Hot","") - ] - metricsDocFor _ = [] - - allNamespaces = [ - Namespace [] ["NewConnection"] - , Namespace [] ["ResponderRestarted"] - , Namespace [] ["ResponderStartFailure"] - , Namespace [] ["ResponderErrored"] - , Namespace [] ["ResponderStarted"] - , Namespace [] ["ResponderTerminated"] - , Namespace [] ["PromotedToWarmRemote"] - , Namespace [] ["PromotedToHotRemote"] - , Namespace [] ["DemotedToColdRemote"] - , Namespace [] ["DemotedToWarmRemote"] - , Namespace [] ["WaitIdleRemote"] - , Namespace [] ["MuxCleanExit"] - , Namespace [] ["MuxErrored"] - , Namespace [] ["InboundGovernorCounters"] - , Namespace [] ["RemoteState"] - , Namespace [] ["UnexpectedlyFalseAssertion"] - , Namespace [] ["InboundGovernorError"] - , Namespace [] ["MaturedConnections"] - , Namespace [] ["Inactive"] - ] - --------------------------------------------------------------------------------- --- InboundGovernor Transition Tracer --------------------------------------------------------------------------------- - - -instance (Show peerAddr, ToJSON peerAddr) - => LogFormatting (InboundGovernor.RemoteTransitionTrace peerAddr) where - forMachine _dtal (InboundGovernor.TransitionTrace peerAddr tr) = - mconcat $ reverse - [ "kind" .= String "ConnectionManagerTransition" - , "address" .= toJSON peerAddr - , "from" .= toJSON (ConnectionManager.fromState tr) - , "to" .= toJSON (ConnectionManager.toState tr) - ] - forHuman = pack . show - asMetrics _ = [] - -instance MetaTrace (InboundGovernor.RemoteTransitionTrace peerAddr) where - namespaceFor InboundGovernor.TransitionTrace {} = Namespace [] ["Transition"] - - severityFor (Namespace [] ["Transition"]) _ = Just Debug - severityFor _ _ = Nothing - - documentFor (Namespace [] ["Transition"]) = Just "" - documentFor _ = Nothing - - allNamespaces = [Namespace [] ["Transition"]] - - --------------------------------------------------------------------------------- --- AcceptPolicy Tracer --------------------------------------------------------------------------------- - -instance LogFormatting NtN.AcceptConnectionsPolicyTrace where - forMachine _dtal (NtN.ServerTraceAcceptConnectionRateLimiting delay numOfConnections) = - mconcat [ "kind" .= String "ServerTraceAcceptConnectionRateLimiting" - , "delay" .= show delay - , "numberOfConnection" .= show numOfConnections - ] - forMachine _dtal (NtN.ServerTraceAcceptConnectionHardLimit softLimit) = - mconcat [ "kind" .= String "ServerTraceAcceptConnectionHardLimit" - , "softLimit" .= show softLimit - ] - forMachine _dtal (NtN.ServerTraceAcceptConnectionResume numOfConnections) = - mconcat [ "kind" .= String "ServerTraceAcceptConnectionResume" - , "numberOfConnection" .= show numOfConnections - ] - forHuman = showT - -instance MetaTrace NtN.AcceptConnectionsPolicyTrace where - namespaceFor NtN.ServerTraceAcceptConnectionRateLimiting {} = - Namespace [] ["ConnectionRateLimiting"] - namespaceFor NtN.ServerTraceAcceptConnectionHardLimit {} = - Namespace [] ["ConnectionHardLimit"] - namespaceFor NtN.ServerTraceAcceptConnectionResume {} = - Namespace [] ["ConnectionLimitResume"] - - severityFor (Namespace _ ["ConnectionRateLimiting"]) _ = Just Info - severityFor (Namespace _ ["ConnectionHardLimit"]) _ = Just Warning - severityFor (Namespace _ ["ConnectionLimitResume"]) _ = Just Info - severityFor _ _ = Nothing - - documentFor (Namespace _ ["ConnectionRateLimiting"]) = Just $ mconcat - [ "Rate limiting accepting connections," - , " delaying next accept for given time, currently serving n connections." - ] - documentFor (Namespace _ ["ConnectionHardLimit"]) = Just $ mconcat - [ "Hard rate limit reached," - , " waiting until the number of connections drops below n." - ] - documentFor (Namespace _ ["ConnectionLimitResume"]) = Just - "" - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["ConnectionRateLimiting"] - , Namespace [] ["ConnectionHardLimit"] - , Namespace [] ["ConnectionLimitResume"] - ] - --------------------------------------------------------------------------------- --- DNSTrace Tracer --------------------------------------------------------------------------------- - -instance LogFormatting DNSTrace where - forMachine _dtal (DNSLookupResult peerKind domain Nothing results) = - mconcat [ "kind" .= String "DNSLookupResult" - , "peerKind" .= String (pack . show $ peerKind) - , "domain" .= String (pack . show $ domain) - , "results" .= results - ] - forMachine _dtal (DNSLookupResult peerKind domain (Just srv) results) = - mconcat [ "kind" .= String "DNSLookupResult" - , "peerKind" .= String (pack . show $ peerKind) - , "domain" .= String (pack . show $ domain) - , "srv" .= String (pack . show $ srv) - , "results" .= results - ] - forMachine _dtal (DNSLookupError peerKind lookupType domain dnsError) = - mconcat [ "kind" .= String "DNSLookupError" - , "peerKind" .= String (pack . show $ peerKind) - , "lookupKind" .= String (pack . show $ lookupType) - , "domain" .= String (pack . show $ domain) - , "dnsError" .= String (pack . show $ dnsError) - ] - forMachine _dtal (SRVLookupResult peerKind domain results) = - mconcat [ "kind" .= String "SRVLookupResult" - , "peerKind" .= String (pack . show $ peerKind) - , "domain" .= String (pack . show $ domain) - , "results" .= [ (show a, b, c, d, e) - | (a, b, c, d, e) <- results - ] - ] - forMachine _dtal (SRVLookupError peerKind domain) = - mconcat [ "kind" .= String "SRVLookupError" - , "peerKind" .= String (pack . show $ peerKind) - , "domain" .= String (pack . show $ domain) - ] - -instance MetaTrace DNSTrace where - namespaceFor DNSLookupResult {} = - Namespace [] ["DNSLookupResult"] - namespaceFor DNSLookupError {} = - Namespace [] ["DNSLookupError"] - namespaceFor SRVLookupResult {} = - Namespace [] ["SRVLookupResult"] - namespaceFor SRVLookupError {} = - Namespace [] ["SRVLookupError"] - - severityFor _ (Just DNSLookupResult {}) = Just Info - severityFor _ (Just DNSLookupError {}) = Just Info - severityFor _ (Just SRVLookupResult{}) = Just Info - severityFor _ (Just SRVLookupError{}) = Just Info - severityFor _ Nothing = Nothing - - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["DNSLookupResult"] - , Namespace [] ["DNSLookupError"] - , Namespace [] ["SRVLookupResult"] - , Namespace [] ["SRVLookupError"] - ] - --------------------------------------------------------------------------------- --- ChurnMode Tracer --------------------------------------------------------------------------------- - -instance LogFormatting TraceChurnMode where - forMachine _dtal (TraceChurnMode mode) = - mconcat [ "kind" .= String "ChurnMode" - , "churnMode" .= String (pack . show $ mode) - ] - -instance MetaTrace TraceChurnMode where - namespaceFor TraceChurnMode {} = - Namespace [] ["PeerSelection", "ChurnMode"] - severityFor _ (Just TraceChurnMode {}) = Just Info - severityFor _ Nothing = Nothing - - documentFor (Namespace _ ["PeerSelection", "ChurnMode"]) = Just $ mconcat - ["Affects churning strategy. For a synced node or operating in GenesisMode " - , " consensus mode, the default strategy is used. Otherwise for a syncing PraosMode" - , " node, the legacy bulk sync churning intervals are used whose durations" - , " depend on whether bootstrap peers are enabled." - ] - documentFor _ = Nothing - - allNamespaces = [ - Namespace [] ["PeerSelection", "ChurnMode"] - ] diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs index 7f877112caa..3b89975d194 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs @@ -505,6 +505,7 @@ nodeToClientVersionToInt = \case NodeToClientV_20 -> 20 NodeToClientV_21 -> 21 NodeToClientV_22 -> 22 + NodeToClientV_23 -> 23 nodeToNodeVersionToInt :: NodeToNodeVersion -> Int nodeToNodeVersionToInt = \case diff --git a/cardano-node/src/Cardano/Tracing/Config.hs b/cardano-node/src/Cardano/Tracing/Config.hs index 43b7e1cb07e..09e01488756 100644 --- a/cardano-node/src/Cardano/Tracing/Config.hs +++ b/cardano-node/src/Cardano/Tracing/Config.hs @@ -197,6 +197,8 @@ type TraceKesAgent = ("TraceKesAgent" :: Symbol) type TraceDevotedBlockFetch = ("TraceDevotedBlockFetch" :: Symbol) type TraceChurnMode = ("TraceChurnMode" :: Symbol) type TraceDNS = ("TraceDNS" :: Symbol) +type TraceTxLogic = ("TraceTxLogic" :: Symbol) +type TraceTxCounters = ("TraceTxCounters" :: Symbol) newtype OnOff (name :: Symbol) = OnOff { isOn :: Bool } deriving (Eq, Show) @@ -280,6 +282,8 @@ data TraceSelection , traceDevotedBlockFetch :: OnOff TraceDevotedBlockFetch , traceChurnMode :: OnOff TraceChurnMode , traceDNS :: OnOff TraceDNS + , traceTxLogic :: OnOff TraceTxLogic + , traceTxCounters :: OnOff TraceTxCounters } deriving (Eq, Show) @@ -357,6 +361,8 @@ data PartialTraceSelection , pTraceChurnMode :: Last (OnOff TraceChurnMode) , pTraceDNS :: Last (OnOff TraceDNS) , pTraceKesAgent :: Last (OnOff TraceKesAgent) + , pTraceTxLogic :: Last (OnOff TraceTxLogic) + , pTraceTxCounters :: Last (OnOff TraceTxCounters) } deriving (Eq, Generic, Show) @@ -435,6 +441,8 @@ instance FromJSON PartialTraceSelection where <*> parseTracer (Proxy @TraceChurnMode) v <*> parseTracer (Proxy @TraceDNS) v <*> parseTracer (Proxy @TraceKesAgent) v + <*> parseTracer (Proxy @TraceTxLogic) v + <*> parseTracer (Proxy @TraceTxCounters) v defaultPartialTraceConfiguration :: PartialTraceSelection @@ -510,6 +518,8 @@ defaultPartialTraceConfiguration = , pTraceChurnMode = pure $ OnOff True , pTraceDNS = pure $ OnOff True , pTraceKesAgent = pure $ OnOff False + , pTraceTxLogic = pure $ OnOff False + , pTraceTxCounters = pure $ OnOff False } @@ -587,6 +597,8 @@ partialTraceSelectionToEither (Last (Just (PartialTraceDispatcher pTraceSelectio traceDevotedBlockFetch <- proxyLastToEither (Proxy @TraceDevotedBlockFetch) pTraceDevotedBlockFetch traceChurnMode <- proxyLastToEither (Proxy @TraceChurnMode) pTraceChurnMode traceDNS <- proxyLastToEither (Proxy @TraceDNS) pTraceDNS + traceTxLogic <- proxyLastToEither (Proxy @TraceTxLogic) pTraceTxLogic + traceTxCounters <- proxyLastToEither (Proxy @TraceTxCounters) pTraceTxCounters Right $ TraceDispatcher $ TraceSelection { traceVerbosity = traceVerbosity , traceAcceptPolicy = traceAcceptPolicy @@ -657,6 +669,8 @@ partialTraceSelectionToEither (Last (Just (PartialTraceDispatcher pTraceSelectio , traceChurnMode , traceDNS , traceKesAgent = traceKesAgent + , traceTxLogic + , traceTxCounters } partialTraceSelectionToEither (Last (Just (PartialTracingOnLegacy pTraceSelection))) = do @@ -731,6 +745,8 @@ partialTraceSelectionToEither (Last (Just (PartialTracingOnLegacy pTraceSelectio traceDevotedBlockFetch <- proxyLastToEither (Proxy @TraceDevotedBlockFetch) pTraceDevotedBlockFetch traceChurnMode <- proxyLastToEither (Proxy @TraceChurnMode) pTraceChurnMode traceDNS <- proxyLastToEither (Proxy @TraceDNS) pTraceDNS + traceTxLogic <- proxyLastToEither (Proxy @TraceTxLogic) pTraceTxLogic + traceTxCounters <- proxyLastToEither (Proxy @TraceTxCounters) pTraceTxCounters Right $ TracingOnLegacy $ TraceSelection { traceVerbosity = traceVerbosity , traceAcceptPolicy = traceAcceptPolicy @@ -801,6 +817,8 @@ partialTraceSelectionToEither (Last (Just (PartialTracingOnLegacy pTraceSelectio , traceChurnMode , traceDNS , traceKesAgent = traceKesAgent + , traceTxLogic + , traceTxCounters } proxyLastToEither :: KnownSymbol name => Proxy name -> Last (OnOff name) -> Either Text (OnOff name) diff --git a/cardano-node/src/Cardano/Tracing/HasIssuer.hs b/cardano-node/src/Cardano/Tracing/HasIssuer.hs index 8b74ccdd33b..f41f64a56fe 100644 --- a/cardano-node/src/Cardano/Tracing/HasIssuer.hs +++ b/cardano-node/src/Cardano/Tracing/HasIssuer.hs @@ -69,8 +69,8 @@ instance -- We don't support a "block issuer" key role in @cardano-api@, so we'll -- just convert it to a stake pool key. toStakePoolKey - :: Shelley.VKey 'Shelley.BlockIssuer - -> Shelley.VKey 'Shelley.StakePool + :: Shelley.VKey Shelley.BlockIssuer + -> Shelley.VKey Shelley.StakePool toStakePoolKey vk = Shelley.VKey (Shelley.unVKey vk) issuer = pHeaderIssuer (shelleyHeaderRaw shelleyBlkHdr) diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs index d376ef0319a..eee200131a8 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs @@ -19,11 +19,13 @@ module Cardano.Tracing.OrphanInstances.Consensus () where +import Ouroboros.Consensus.Peras.SelectView import Cardano.Node.Tracing.Tracers.ConsensusStartupException (ConsensusStartupException (..)) import Cardano.Prelude (Typeable, maximumDef) import Cardano.Slotting.Slot (fromWithOrigin) import Cardano.Tracing.OrphanInstances.Common +import Cardano.Network.OrphanInstances () import Cardano.Tracing.OrphanInstances.Network () import Cardano.Tracing.Render (renderChainHash, renderChunkNo, renderHeaderHash, renderHeaderHashForVerbosity, renderPointAsPhrase, renderPointForVerbosity, @@ -31,7 +33,7 @@ import Cardano.Tracing.Render (renderChainHash, renderChunkNo, renderH renderWithOrigin) import Ouroboros.Consensus.Block (BlockProtocol, BlockSupportsProtocol, CannotForge, ConvertRawHash (..), ForgeStateUpdateError, GenesisWindow (..), GetHeader (..), - Header, RealPoint (..), blockNo, blockPoint, blockPrevHash, getHeader, pointHash, + Header, HeaderHash, RealPoint (..), blockNo, blockPoint, blockPrevHash, getHeader, pointHash, realPointHash, realPointSlot, withOriginToMaybe) import Ouroboros.Consensus.Block.SupportsSanityCheck import Ouroboros.Consensus.Genesis.Governor (DensityBounds (..), GDDDebugInfo (..), @@ -162,9 +164,9 @@ instance HasSeverityAnnotation (ChainDB.TraceEvent blk) where ChainDB.TrySwitchToAFork {} -> Info ChainDB.StoreButDontChange {} -> Debug ChainDB.ChangingSelection {} -> Debug - ChainDB.AddedToCurrentChain events _ _ _ -> + ChainDB.AddedToCurrentChain events _ _ _ _ -> maximumDef Notice (map getSeverityAnnotation events) - ChainDB.SwitchedToAFork events _ _ _ -> + ChainDB.SwitchedToAFork events _ _ _ _ -> maximumDef Notice (map getSeverityAnnotation events) ChainDB.AddBlockValidation ev' -> case ev' of ChainDB.InvalidBlock {} -> Error @@ -175,7 +177,6 @@ instance HasSeverityAnnotation (ChainDB.TraceEvent blk) where ChainDB.PoppedReprocessLoEBlocksFromQueue -> Debug ChainDB.ChainSelectionLoEDebug _ _ -> Debug - getSeverityAnnotation (ChainDB.TraceLedgerDBEvent ev) = case ev of LedgerDB.LedgerDBSnapshotEvent ev' -> case ev' of LedgerDB.TookSnapshot {} -> Info @@ -253,6 +254,9 @@ instance HasSeverityAnnotation (ChainDB.TraceEvent blk) where getSeverityAnnotation ChainDB.TraceChainSelStarvationEvent{} = Debug + getSeverityAnnotation ChainDB.TracePerasCertDbEvent{} = Info + getSeverityAnnotation ChainDB.TraceAddPerasCertEvent{} = Info + instance HasSeverityAnnotation (LedgerEvent blk) where getSeverityAnnotation (LedgerUpdate _) = Notice getSeverityAnnotation (LedgerWarning _) = Critical @@ -361,7 +365,7 @@ instance HasTextFormatter (TraceLabelPeer peer (TraceBlockFetchServerEvent blk)) formatText _ = pack . show . toList -instance (ConvertRawHash blk, LedgerSupportsProtocol blk) +instance (ConvertRawHash blk, LedgerSupportsProtocol blk, ToJSON (HeaderHash blk)) => Transformable Text IO (TraceChainSyncClientEvent blk) where trTransformer = trStructured @@ -378,9 +382,11 @@ instance (StandardHash blk, Show peer) formatText a _ = pack $ show a -instance ( ToObject (ApplyTxErr blk), ToObject (GenTx blk), - ToJSON (GenTxId blk), LedgerSupportsMempool blk, - ConvertRawHash blk) +instance ( ToObject (ApplyTxErr blk), ToObject (GenTx blk) + , ToJSON (GenTxId blk), LedgerSupportsMempool blk + , ConvertRawHash blk + , ToJSON (HeaderHash blk) + ) => Transformable Text IO (TraceEventMempool blk) where trTransformer = trStructured @@ -521,7 +527,9 @@ instance ( ConvertRawHash blk , InspectLedger blk , ToObject (Header blk) , ToObject (LedgerEvent blk) - , ToObject (SelectView (BlockProtocol blk))) + , ToObject (WeightedSelectView (BlockProtocol blk)) + , ToJSON (HeaderHash blk) + ) => Transformable Text IO (ChainDB.TraceEvent blk) where trTransformer = trStructuredText @@ -562,10 +570,10 @@ instance ( ConvertRawHash blk "Block fits onto some fork: " <> renderRealPointAsPhrase pt ChainDB.ChangingSelection pt -> "Changing selection to: " <> renderPointAsPhrase pt - ChainDB.AddedToCurrentChain es _ _ c -> + ChainDB.AddedToCurrentChain es _ _ c _ -> "Chain extended, new tip: " <> renderPointAsPhrase (AF.headPoint c) <> Text.concat [ "\nEvent: " <> showT e | e <- es ] - ChainDB.SwitchedToAFork es _ _ c -> + ChainDB.SwitchedToAFork es _ _ c _ -> "Switched to a fork, new tip: " <> renderPointAsPhrase (AF.headPoint c) <> Text.concat [ "\nEvent: " <> showT e | e <- es ] ChainDB.AddBlockValidation ev' -> case ev' of @@ -786,10 +794,14 @@ instance ( ConvertRawHash blk ChainDB.TraceChainSelStarvationEvent ev -> case ev of ChainDB.ChainSelStarvation RisingEdge -> "Chain Selection was starved." ChainDB.ChainSelStarvation (FallingEdgeWith pt) -> "Chain Selection was unstarved by " <> renderRealPoint pt + ChainDB.TracePerasCertDbEvent ev -> showT ev + ChainDB.TraceAddPerasCertEvent ev -> showT ev where showProgressT :: Int -> Int -> Text showProgressT chunkNo outOf = pack (showFFloat (Just 2) (100 * fromIntegral chunkNo / fromIntegral outOf :: Float) mempty) + + -- -- | instances of @ToObject@ -- @@ -925,9 +937,10 @@ instance (ToObject (LedgerUpdate blk), ToObject (LedgerWarning blk)) instance ( ConvertRawHash blk , LedgerSupportsProtocol blk + , ToJSON (HeaderHash blk) , ToObject (Header blk) , ToObject (LedgerEvent blk) - , ToObject (SelectView (BlockProtocol blk))) + , ToObject (WeightedSelectView (BlockProtocol blk))) => ToObject (ChainDB.TraceEvent blk) where toObject _verb ChainDB.TraceLastShutdownUnclean = mconcat [ "kind" .= String "TraceLastShutdownUnclean" ] @@ -967,31 +980,31 @@ instance ( ConvertRawHash blk ChainDB.ChangingSelection pt -> mconcat [ "kind" .= String "TraceAddBlockEvent.ChangingSelection" , "block" .= toObject verb pt ] - ChainDB.AddedToCurrentChain events selChangedInfo base extended -> + ChainDB.AddedToCurrentChain events selChangedInfo base extended _ -> mconcat $ [ "kind" .= String "TraceAddBlockEvent.AddedToCurrentChain" , "newtip" .= renderPointForVerbosity verb (AF.headPoint extended) , "chainLengthDelta" .= extended `chainLengthΔ` base - , "newTipSelectView" .= toObject verb (ChainDB.newTipSelectView selChangedInfo) + , "newSuffixSelectView" .= toObject verb (ChainDB.newSuffixSelectView selChangedInfo) ] - ++ [ "oldTipSelectView" .= toObject verb oldTipSelectView - | Just oldTipSelectView <- [ChainDB.oldTipSelectView selChangedInfo] + ++ [ "oldSuffixSelectView" .= toObject verb oldSuffixSelectView + | Just oldSuffixSelectView <- [ChainDB.oldSuffixSelectView selChangedInfo] ] ++ [ "headers" .= toJSON (toObject verb `map` addedHdrsNewChain base extended) | verb == MaximalVerbosity ] ++ [ "events" .= toJSON (map (toObject verb) events) | not (null events) ] - ChainDB.SwitchedToAFork events selChangedInfo old new -> + ChainDB.SwitchedToAFork events selChangedInfo old new _ -> mconcat $ [ "kind" .= String "TraceAddBlockEvent.SwitchedToAFork" , "newtip" .= renderPointForVerbosity verb (AF.headPoint new) , "chainLengthDelta" .= new `chainLengthΔ` old -- Check that the SwitchedToAFork event was triggered by a proper fork. , "realFork" .= not (AF.withinFragmentBounds (AF.headPoint old) new) - , "newTipSelectView" .= toObject verb (ChainDB.newTipSelectView selChangedInfo) + , "newSuffixSelectView" .= toObject verb (ChainDB.newSuffixSelectView selChangedInfo) ] - ++ [ "oldTipSelectView" .= toObject verb oldTipSelectView - | Just oldTipSelectView <- [ChainDB.oldTipSelectView selChangedInfo] + ++ [ "oldSuffixSelectView" .= toObject verb oldSuffixSelectView + | Just oldSuffixSelectView <- [ChainDB.oldSuffixSelectView selChangedInfo] ] ++ [ "headers" .= toJSON (toObject verb `map` addedHdrsNewChain old new) | verb == MaximalVerbosity ] @@ -1066,6 +1079,15 @@ instance ( ConvertRawHash blk chainLengthΔ :: AF.AnchoredFragment (Header blk) -> AF.AnchoredFragment (Header blk) -> Int chainLengthΔ = on (-) (fromWithOrigin (-1) . fmap (fromIntegral . unBlockNo) . AF.headBlockNo) + toObject _verb (ChainDB.TracePerasCertDbEvent ev) = + mconcat [ "kind" .= String "TracePerasCertDbEvent" + , "event" .= show ev + ] + toObject _verb (ChainDB.TraceAddPerasCertEvent ev) = + mconcat [ "kind" .= String "TraceAddPerasCertEvent" + , "event" .= show ev + ] + toObject MinimalVerbosity (ChainDB.TraceLedgerDBEvent _ev) = mempty -- no output toObject verb (ChainDB.TraceLedgerDBEvent ev) = case ev of LedgerDB.LedgerDBSnapshotEvent ev' -> case ev' of @@ -1365,7 +1387,7 @@ tipToObject = \case , "blockNo" .= blockno ] -instance (ConvertRawHash blk, LedgerSupportsProtocol blk) +instance (ConvertRawHash blk, LedgerSupportsProtocol blk, ToJSON (HeaderHash blk)) => ToObject (TraceChainSyncClientEvent blk) where toObject verb ev = case ev of TraceDownloadedHeader h -> @@ -1424,8 +1446,9 @@ instance (ConvertRawHash blk, LedgerSupportsProtocol blk) , "n" .= natToInt n ] -instance ( LedgerSupportsProtocol blk, - ConvertRawHash blk +instance ( LedgerSupportsProtocol blk + , ConvertRawHash blk + , ToJSON (HeaderHash blk) ) => ToObject (ChainSync.Client.Instruction blk) where toObject verb = \case ChainSync.Client.RunNormally -> @@ -1437,8 +1460,9 @@ instance ( LedgerSupportsProtocol blk, , "payload" .= toObject verb info ] -instance ( LedgerSupportsProtocol blk, - ConvertRawHash blk +instance ( LedgerSupportsProtocol blk + , ConvertRawHash blk + , ToJSON (HeaderHash blk) ) => ToObject (ChainSync.Client.JumpInstruction blk) where toObject verb = \case ChainSync.Client.JumpTo info -> @@ -1448,8 +1472,9 @@ instance ( LedgerSupportsProtocol blk, mconcat [ "kind" .= String "JumpToGoodPoint" , "info" .= toObject verb info ] -instance ( LedgerSupportsProtocol blk, - ConvertRawHash blk +instance ( LedgerSupportsProtocol blk + , ConvertRawHash blk + , ToJSON (HeaderHash blk) ) => ToObject (ChainSync.Client.JumpInfo blk) where toObject verb info = mconcat [ "kind" .= String "JumpInfo" @@ -1461,10 +1486,10 @@ instance ( LedgerSupportsProtocol blk, instance HasPrivacyAnnotation (ChainSync.Client.TraceEventCsj peer blk) where instance HasSeverityAnnotation (ChainSync.Client.TraceEventCsj peer blk) where getSeverityAnnotation _ = Debug -instance (ToObject peer, ConvertRawHash blk) +instance (ToObject peer, ConvertRawHash blk, ToJSON (HeaderHash blk)) => Transformable Text IO (TraceLabelPeer peer (ChainSync.Client.TraceEventCsj peer blk)) where trTransformer = trStructured -instance (ToObject peer, ConvertRawHash blk) +instance (ToObject peer, ConvertRawHash blk, ToJSON (HeaderHash blk)) => ToObject (ChainSync.Client.TraceEventCsj peer blk) where toObject verb = \case ChainSync.Client.BecomingObjector prevObjector -> @@ -1534,9 +1559,10 @@ instance ConvertRawHash blk ] <> [ "risingEdge" .= True | RisingEdge <- [enclosing] ] -instance ( ToObject (ApplyTxErr blk), ToObject (GenTx blk), - ToJSON (GenTxId blk), LedgerSupportsMempool blk, - ConvertRawHash blk +instance ( ToObject (ApplyTxErr blk), ToObject (GenTx blk) + , ToJSON (GenTxId blk), LedgerSupportsMempool blk + , ConvertRawHash blk + , ToJSON (HeaderHash blk) ) => ToObject (TraceEventMempool blk) where toObject verb (TraceMempoolAddedTx tx _mpSzBefore mpSzAfter) = mconcat @@ -1803,10 +1829,10 @@ instance ToObject selection => ToObject (TraceGsmEvent selection) where instance HasPrivacyAnnotation (TraceGDDEvent peer blk) where instance HasSeverityAnnotation (TraceGDDEvent peer blk) where getSeverityAnnotation _ = Debug -instance (Typeable blk, ToObject peer, ConvertRawHash blk, GetHeader blk) => Transformable Text IO (TraceGDDEvent peer blk) where +instance (Typeable blk, ToObject peer, ConvertRawHash blk, GetHeader blk, ToJSON (HeaderHash blk)) => Transformable Text IO (TraceGDDEvent peer blk) where trTransformer = trStructured -instance (Typeable blk, ToObject peer, ConvertRawHash blk, GetHeader blk) => ToObject (TraceGDDEvent peer blk) where +instance (Typeable blk, ToObject peer, ConvertRawHash blk, GetHeader blk, ToJSON (HeaderHash blk)) => ToObject (TraceGDDEvent peer blk) where toObject verb (TraceGDDDebug (GDDDebugInfo {..})) = mconcat $ [ "kind" .= String "TraceGDDEvent" , "losingPeers".= toJSON (map (toObject verb) losingPeers) @@ -1852,7 +1878,9 @@ instance (Typeable blk, ToObject peer, ConvertRawHash blk, GetHeader blk) => ToO , "peer" .= toJSON (map (toObject verb) $ toList peer) ] -instance (Typeable blk, ConvertRawHash blk, GetHeader blk) => ToObject (DensityBounds blk) where +instance + (Typeable blk, ConvertRawHash blk, GetHeader blk, ToJSON (HeaderHash blk)) => + ToObject (DensityBounds blk) where toObject verb DensityBounds {..} = mconcat [ "kind" .= String "DensityBounds" , "clippedFragment" .= toObject verb clippedFragment diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs index 8c75604c5cb..1736b04f68c 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs @@ -22,7 +22,7 @@ import Cardano.Slotting.Slot (EpochSize (..)) import Cardano.Tracing.OrphanInstances.Common import Cardano.Tracing.OrphanInstances.Consensus () import Ouroboros.Consensus.Block (BlockProtocol, CannotForge, ForgeStateInfo, - ForgeStateUpdateError) + ForgeStateUpdateError, PerasWeight (..)) import Ouroboros.Consensus.BlockchainTime (getSlotLength) import Ouroboros.Consensus.Cardano.Condense () import Ouroboros.Consensus.HardFork.Combinator @@ -43,7 +43,7 @@ import Ouroboros.Consensus.Ledger.Inspect (LedgerUpdate, LedgerWarning import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr) import Ouroboros.Consensus.Node.NetworkProtocolVersion (BlockNodeToClientVersion, BlockNodeToNodeVersion) -import Ouroboros.Consensus.Protocol.Abstract (ValidationErr, SelectView (svTiebreakerView, svBlockNo), ConsensusProtocol (TiebreakerView)) +import Ouroboros.Consensus.Protocol.Abstract (ValidationErr, ConsensusProtocol (TiebreakerView)) import Ouroboros.Consensus.TypeFamilyWrappers import Ouroboros.Consensus.Util.Condense (Condense (..)) @@ -53,6 +53,7 @@ import qualified Data.ByteString.Short as SBS import Data.Proxy (Proxy (..)) import Data.SOP (All, Compose, K (..)) import Data.SOP.Strict +import Ouroboros.Consensus.Peras.SelectView -- @@ -434,10 +435,11 @@ instance (ToJSON (BlockNodeToNodeVersion blk)) => ToJSON (WrapNodeToNodeVersion instance All (ToObject `Compose` WrapTiebreakerView) xs => ToObject (HardForkTiebreakerView xs) where toObject verb = toObject verb . getHardForkTiebreakerView -instance ToObject (TiebreakerView protocol) => ToObject (SelectView protocol) where +instance ToObject (TiebreakerView protocol) => ToObject (WeightedSelectView protocol) where toObject verb sv = mconcat - [ "blockNo" .= svBlockNo sv - , toObject verb (svTiebreakerView sv) + [ "blockNo" .= wsvBlockNo sv + , "weightBoost" .= unPerasWeight (wsvWeightBoost sv) + , toObject verb (wsvTiebreaker sv) ] instance All (ToObject `Compose` WrapTiebreakerView) xs => ToObject (OneEraTiebreakerView xs) where diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs index 8cb0df80666..b19eff76a0c 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @@ -21,12 +21,14 @@ module Cardano.Tracing.OrphanInstances.Network , FetchDecisionToJSON (..) ) where + +import qualified Cardano.Network.PeerSelection as Cardano +import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano +import Cardano.Network.PeerSelection.PublicRootPeers (PublicRootPeers(..)) import Cardano.Network.Diffusion (CardanoDebugPeerSelection, CardanoPeerSelectionCounters, - CardanoTraceLocalRootPeers, CardanoTracePeerSelection, TraceChurnMode (..)) -import Ouroboros.Network.OrphanInstances () + CardanoTraceLocalRootPeers, TraceChurnMode (..)) +import Cardano.Network.OrphanInstances () import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano.PublicRootPeers -import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionState as Cardano -import qualified Cardano.Network.PeerSelection.Governor.Types as Cardano import Cardano.Node.Queries (ConvertTxId) import Cardano.Tracing.OrphanInstances.Common import Cardano.Tracing.Render @@ -55,9 +57,8 @@ import qualified Ouroboros.Network.Driver.Stateful as Stateful import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import qualified Ouroboros.Network.InboundGovernor.State as InboundGovernor import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) -import Cardano.Network.NodeToClient (NodeToClientVersion (..)) import qualified Cardano.Network.NodeToClient as NtC -import Cardano.Network.NodeToNode (NodeToNodeVersion (..), RemoteAddress, +import Cardano.Network.NodeToNode (RemoteAddress, TraceSendRecv (..)) import qualified Cardano.Network.NodeToNode as NtN import Ouroboros.Network.OrphanInstances () @@ -89,13 +90,14 @@ import Ouroboros.Network.Protocol.TxSubmission2.Type as TxSubmission2 import Ouroboros.Network.RethrowPolicy (ErrorCommand (..)) import Ouroboros.Network.Server as Server import Ouroboros.Network.Snocket (LocalAddress (..)) -import Ouroboros.Network.TxSubmission.Inbound (ProcessedTxCount (..), - TraceTxSubmissionInbound (..)) +import Ouroboros.Network.TxSubmission.Inbound.V2 (ProcessedTxCount (..), + TraceTxSubmissionInbound (..), TraceTxLogic(..), TxSubmissionCounters(..), + TxDecision(..), TxsToMempool(..)) import Ouroboros.Network.TxSubmission.Outbound (TraceTxSubmissionOutbound (..)) import Control.Exception (Exception (..)) import Control.Monad.Class.MonadTime.SI (DiffTime, Time (..)) -import Data.Aeson (Value (..)) +import Data.Aeson (Value (..), ToJSONKey(..)) import qualified Data.Aeson as Aeson import Data.Aeson.Types (listValue) import Data.Bifunctor (Bifunctor (first)) @@ -124,16 +126,6 @@ instance HasSeverityAnnotation (Diffusion.DiffusionTracer ntnAddr ntcAddr) where getSeverityAnnotation Diffusion.DiffusionErrored {} = Critical getSeverityAnnotation _ = Info -instance HasPrivacyAnnotation (NtC.HandshakeTr LocalAddress NodeToClientVersion) -instance HasSeverityAnnotation (NtC.HandshakeTr LocalAddress NodeToClientVersion) where - getSeverityAnnotation _ = Info - - -instance HasPrivacyAnnotation (NtN.HandshakeTr RemoteAddress NodeToNodeVersion) -instance HasSeverityAnnotation (NtN.HandshakeTr RemoteAddress NodeToNodeVersion) where - getSeverityAnnotation _ = Info - - instance HasPrivacyAnnotation NtN.AcceptConnectionsPolicyTrace instance HasSeverityAnnotation NtN.AcceptConnectionsPolicyTrace where getSeverityAnnotation NtN.ServerTraceAcceptConnectionRateLimiting {} = Info @@ -205,6 +197,10 @@ instance HasSeverityAnnotation (TraceTxSubmissionInbound txid tx) where getSeverityAnnotation TraceTxInboundTerminated = Notice getSeverityAnnotation TraceTxInboundCannotRequestMoreTxs {} = Debug getSeverityAnnotation TraceTxInboundCanRequestMoreTxs {} = Debug + getSeverityAnnotation TraceTxInboundAddedToMempool {} = Debug + getSeverityAnnotation TraceTxInboundRejectedFromMempool {} = Debug + getSeverityAnnotation TraceTxInboundError {} = Debug + getSeverityAnnotation TraceTxInboundDecision {} = Debug instance HasPrivacyAnnotation (TraceTxSubmissionOutbound txid tx) @@ -252,6 +248,8 @@ instance HasSeverityAnnotation (Mux.WithBearer peer Mux.Trace) where Mux.TraceTerminating {} -> Debug Mux.TraceStopping -> Debug Mux.TraceStopped -> Debug + Mux.TraceNewMux{} -> Info + Mux.TraceStarting{} -> Info instance HasPrivacyAnnotation (Mux.WithBearer peer Mux.ChannelTrace) instance HasSeverityAnnotation (Mux.WithBearer peer Mux.ChannelTrace) where @@ -278,6 +276,8 @@ instance HasSeverityAnnotation (Mux.WithBearer peer Mux.BearerTrace) where Mux.TraceSDUWriteTimeoutException -> Notice Mux.TraceTCPInfo {} -> Debug +instance HasPrivacyAnnotation (Mux.WithBearer peer (TraceSendRecv a)) +instance HasSeverityAnnotation (Mux.WithBearer peer (TraceSendRecv a)) instance HasPrivacyAnnotation CardanoTraceLocalRootPeers instance HasSeverityAnnotation CardanoTraceLocalRootPeers where @@ -287,8 +287,8 @@ instance HasPrivacyAnnotation TracePublicRootPeers instance HasSeverityAnnotation TracePublicRootPeers where getSeverityAnnotation _ = Info -instance HasPrivacyAnnotation CardanoTracePeerSelection -instance HasSeverityAnnotation CardanoTracePeerSelection where +instance HasPrivacyAnnotation (TracePeerSelection extraDebugState extraFlags extraPeers ntnAddr) where +instance HasSeverityAnnotation (TracePeerSelection extraDebugState extraFlags extraPeers ntnAddr) where getSeverityAnnotation ev = case ev of TraceLocalRootPeersChanged {} -> Notice @@ -321,7 +321,6 @@ instance HasSeverityAnnotation CardanoTracePeerSelection where TraceDemoteLocalAsynchronous {} -> Warning TraceGovernorWakeup {} -> Info TraceChurnWait {} -> Info - -- TraceChurnMode {} -> Info TraceForgetBigLedgerPeers {} -> Info @@ -348,10 +347,8 @@ instance HasSeverityAnnotation CardanoTracePeerSelection where TraceDemoteBigLedgerPeersAsynchronous {} -> Warning - TraceUseBootstrapPeersChanged {} -> Info TraceBootstrapPeersFlagChangedWhilstInSensitiveState -> Info - TraceLedgerStateJudgementChanged {} -> Notice TraceOnlyBootstrapPeers {} -> Notice TraceOutboundGovernorCriticalFailure {} -> Error @@ -364,6 +361,8 @@ instance HasSeverityAnnotation CardanoTracePeerSelection where TraceVerifyPeerSnapshot True -> Info TraceVerifyPeerSnapshot False -> Error + ExtraTrace {} -> Info + instance HasPrivacyAnnotation CardanoDebugPeerSelection instance HasSeverityAnnotation CardanoDebugPeerSelection where getSeverityAnnotation _ = Debug @@ -416,6 +415,7 @@ instance HasSeverityAnnotation (ConnMgr.Trace addr (ConnectionHandlerTrace versi TrConnectionManagerCounters {} -> Info TrState {} -> Info ConnMgr.TrUnexpectedlyFalseAssertion {} -> Error + TrInboundConnectionNotFound {} -> Info instance HasPrivacyAnnotation (ConnMgr.AbstractTransitionTrace addr) instance HasSeverityAnnotation (ConnMgr.AbstractTransitionTrace addr) where @@ -477,8 +477,7 @@ instance Transformable Text IO NtN.AcceptConnectionsPolicyTrace where instance HasTextFormatter NtN.AcceptConnectionsPolicyTrace where formatText a _ = pack (show a) - -instance (StandardHash header, Show peer, ToJSON peer, ConvertRawHash header) +instance (StandardHash header, Show peer, ToJSON peer, ConvertRawHash header, ToJSON (HeaderHash header)) => Transformable Text IO [TraceLabelPeer peer (FetchDecision [Point header])] where trTransformer = trStructuredText instance (StandardHash header, Show peer) @@ -492,7 +491,7 @@ instance (Show header, StandardHash header, Show peer) => HasTextFormatter (TraceLabelPeer peer (TraceFetchClientState header)) where formatText a _ = pack (show a) -instance (StandardHash header, Show peer, ToJSON peer, ConvertRawHash header) +instance (StandardHash header, Show peer, ToJSON peer, ConvertRawHash header, ToJSON (HeaderHash header)) => Transformable Text IO (BlockFetch.TraceDecisionEvent peer header) where trTransformer = trStructuredText instance (StandardHash header, Show peer) @@ -510,8 +509,8 @@ instance (ToObject peer, ToObject (AnyMessage (TraceTxSubmissionInbound (GenTxId => Transformable Text IO (TraceLabelPeer peer (NtN.TraceSendRecv (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk)))) where trTransformer = trStructured -instance ToObject peer - => Transformable Text IO (TraceLabelPeer peer (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk))) where +instance (ToObject peer, ToJSON txid, ToObject (TxDecision txid tx)) + => Transformable Text IO (TraceLabelPeer peer (TraceTxSubmissionInbound txid tx)) where trTransformer = trStructured instance (ToObject peer, ConvertTxId blk, RunNode blk, HasTxs blk) @@ -557,9 +556,9 @@ instance (ToObject peer, Show (TxId (GenTx blk)), Show (GenTx blk)) => Transformable Text IO (TraceLabelPeer peer (TraceTxSubmissionOutbound (GenTxId blk) (GenTx blk))) where trTransformer = trStructured -instance Transformable Text IO (TraceTxSubmissionInbound txid tx) where +instance (Show tx, Show txid, ToJSON txid, ToObject (TxDecision txid tx)) => Transformable Text IO (TraceTxSubmissionInbound txid tx) where trTransformer = trStructuredText -instance HasTextFormatter (TraceTxSubmissionInbound txid tx) where +instance (Show tx, Show txid) => HasTextFormatter (TraceTxSubmissionInbound txid tx) where formatText a _ = pack (show a) @@ -609,9 +608,21 @@ instance Transformable Text IO TracePublicRootPeers where instance HasTextFormatter TracePublicRootPeers where formatText a _ = pack (show a) -instance Transformable Text IO CardanoTracePeerSelection where +instance + ( ( ToJSON + ( PublicRootPeers + (Cardano.PublicRootPeers.ExtraPeers SockAddr) + addr + ) + ) + , ToJSON addr + , ToJSONKey addr + , Ord addr + , Show addr + ) => + Transformable Text IO (TracePeerSelection Cardano.DebugPeerSelectionState Cardano.PeerTrustable (Cardano.ExtraPeers addr) addr) where trTransformer = trStructuredText -instance HasTextFormatter CardanoTracePeerSelection where +instance (Ord addr, Show addr) => HasTextFormatter (TracePeerSelection Cardano.DebugPeerSelectionState Cardano.PeerTrustable (Cardano.ExtraPeers addr) addr) where formatText a _ = pack (show a) instance Transformable Text IO CardanoDebugPeerSelection where @@ -672,6 +683,26 @@ instance Show addr => HasTextFormatter (Server.RemoteTransitionTrace addr) where formatText a _ = pack (show a) +instance (Show txid, Show tx, Show addr) + => Transformable Text IO (TraceTxLogic txid tx addr) where + trTransformer = trStructuredText +instance (Show txid, Show tx, Show addr) + => HasTextFormatter (TraceTxLogic txid tx addr) where + formatText a _ = pack (show a) + +instance Transformable Text IO TxSubmissionCounters where + trTransformer = trStructuredText +instance HasTextFormatter TxSubmissionCounters where + formatText a _ = pack (show a) + +instance (Show txid, Show tx, Show addr, Show peer, ToObject peer) + => Transformable Text IO (TraceLabelPeer peer (TraceTxLogic txid tx addr)) where + trTransformer = trStructuredText +instance (Show txid, Show tx, Show addr, Show peer) + => HasTextFormatter (TraceLabelPeer peer (TraceTxLogic txid tx addr)) where + formatText a _ = pack (show a) + + -- -- | instances of @ToObject@ -- @@ -1056,20 +1087,6 @@ instance ToObject NtN.AcceptConnectionsPolicyTrace where , "numberOfConnection" .= show numOfConnections ] - -instance ConvertRawHash header - => ToJSON (Point header) where - toJSON GenesisPoint = String "GenesisPoint" - toJSON (BlockPoint (SlotNo slotNo) hash) = - -- it is unlikely that there will be two short hashes in the same slot - String $ renderHeaderHashForVerbosity - (Proxy @header) - MinimalVerbosity - hash - <> "@" - <> pack (show slotNo) - - newtype Verbose a = Verbose a instance ConvertRawHash header @@ -1085,7 +1102,7 @@ instance ConvertRawHash header <> pack (show slotNo) -instance ConvertRawHash blk +instance (ConvertRawHash blk, ToJSON (HeaderHash blk)) => ToObject (Point blk) where toObject _verb GenesisPoint = mconcat [ "point" .= String "GenesisPoint" ] @@ -1114,7 +1131,7 @@ instance (ConvertRawHash blk) => ToObject (AF.Anchor blk) where , "blockNo" .= toJSON (unBlockNo bno) ] -instance (ConvertRawHash blk, HasHeader blk) => ToObject (AF.AnchoredFragment blk) where +instance (ConvertRawHash blk, HasHeader blk, ToJSON (HeaderHash blk)) => ToObject (AF.AnchoredFragment blk) where toObject verb frag = mconcat [ "kind" .= String "AnchoredFragment" , "anchor" .= toObject verb (AF.anchor frag) @@ -1165,7 +1182,7 @@ instance (HasHeader header, ConvertRawHash header) , "outstanding" .= outstanding ] -instance (ToJSON peer, ConvertRawHash header) +instance (ToJSON peer, ConvertRawHash header, ToJSON (HeaderHash header)) => ToObject [TraceLabelPeer peer (FetchDecision [Point header])] where toObject MinimalVerbosity _ = mempty toObject _ [] = mempty @@ -1196,7 +1213,7 @@ instance ToJSON point toJSON (FetchDecisionToJSON (Right points)) = toJSON points -instance (ToJSON peer, ConvertRawHash header) +instance (ToJSON peer, ConvertRawHash header, ToJSON (HeaderHash header)) => ToObject (BlockFetch.TraceDecisionEvent peer header) where toObject verb (BlockFetch.PeersFetch as) = toObject verb as toObject _verb (BlockFetch.PeerStarvedUs peer) = mconcat @@ -1220,11 +1237,11 @@ instance ToObject (Stateful.AnyMessage ps f) [ "kind" .= String "Recv" , "msg" .= toObject verb m ] -instance ToObject (TraceTxSubmissionInbound txid tx) where - toObject _verb (TraceTxSubmissionCollected count) = +instance (ToJSON txid, ToObject (TxDecision txid tx)) => ToObject (TraceTxSubmissionInbound txid tx) where + toObject _verb (TraceTxSubmissionCollected txids) = mconcat [ "kind" .= String "TxSubmissionCollected" - , "count" .= toJSON count + , "count" .= toJSON (length txids) ] toObject _verb (TraceTxSubmissionProcessed processed) = mconcat @@ -1246,6 +1263,26 @@ instance ToObject (TraceTxSubmissionInbound txid tx) where [ "kind" .= String "TxInboundCannotRequestMoreTxs" , "count" .= toJSON count ] + toObject _verb (TraceTxInboundAddedToMempool txids duration) = + mconcat + [ "kind" .= String "TraceTxInboundAddedToMempool" + , "count" .= toJSON (length txids) + , "duration" .= toJSON duration + ] + toObject _verb (TraceTxInboundRejectedFromMempool txids duration) = + mconcat + [ "kind" .= String "TraceTxInboundRejectedFromMempool" + , "count" .= toJSON (length txids) + , "duration" .= toJSON duration + ] + toObject _verb (TraceTxInboundError err) = mconcat + [ "kind" .= String "TraceTxInboundError" + , "reason" .= displayException err + ] + toObject verb (TraceTxInboundDecision decision) = mconcat + [ "kind" .= String "TraceTxInboundDecision" + , "reason" .= toObject verb decision + ] -- TODO: use the json encoding of transactions instance (Show txid, Show tx) @@ -1432,17 +1469,25 @@ instance ToObject TracePublicRootPeers where , "domainAddresses" .= Aeson.toJSONList domains ] - -instance ToObject CardanoTracePeerSelection where +instance + ( ToJSON + ( PublicRootPeers + (Cardano.PublicRootPeers.ExtraPeers SockAddr) + addr + ) + , Ord addr + , ToJSON addr + , ToJSONKey addr + ) => + ToObject (TracePeerSelection Cardano.DebugPeerSelectionState Cardano.PeerTrustable (Cardano.ExtraPeers addr) addr) where toObject _verb (TraceLocalRootPeersChanged lrp lrp') = mconcat [ "kind" .= String "LocalRootPeersChanged" , "previous" .= toJSON lrp , "current" .= toJSON lrp' ] - toObject _verb (TraceTargetsChanged pst pst') = + toObject _verb (TraceTargetsChanged pst) = mconcat [ "kind" .= String "TargetsChanged" - , "previous" .= toJSON pst - , "current" .= toJSON pst' + , "current" .= toJSON pst ] toObject _verb (TracePublicRootsRequest tRootPeers nRootPeers) = mconcat [ "kind" .= String "PublicRootsRequest" @@ -1517,13 +1562,14 @@ instance ToObject CardanoTracePeerSelection where , "targetLocalEstablished" .= tLocalEst , "selectedPeers" .= Aeson.toJSONList (toList sp) ] - toObject _verb (TracePromoteColdFailed tEst aEst p d err) = + toObject _verb (TracePromoteColdFailed tEst aEst p d err forgotten) = mconcat [ "kind" .= String "PromoteColdFailed" , "targetEstablished" .= tEst , "actualEstablished" .= aEst , "peer" .= toJSON p , "delay" .= toJSON d , "reason" .= show err + , "reason" .= show forgotten ] toObject _verb (TracePromoteColdDone tEst aEst p) = mconcat [ "kind" .= String "PromoteColdDone" @@ -1537,13 +1583,14 @@ instance ToObject CardanoTracePeerSelection where , "actualEstablished" .= actualKnown , "selectedPeers" .= Aeson.toJSONList (toList sp) ] - toObject _verb (TracePromoteColdBigLedgerPeerFailed tEst aEst p d err) = + toObject _verb (TracePromoteColdBigLedgerPeerFailed tEst aEst p d err forgotten) = mconcat [ "kind" .= String "PromoteColdBigLedgerPeerFailed" , "targetEstablished" .= tEst , "actualEstablished" .= aEst , "peer" .= toJSON p , "delay" .= toJSON d , "reason" .= show err + , "forgotten" .= show forgotten ] toObject _verb (TracePromoteColdBigLedgerPeerDone tEst aEst p) = mconcat [ "kind" .= String "PromoteColdBigLedgerPeerDone" @@ -1706,9 +1753,6 @@ instance ToObject CardanoTracePeerSelection where mconcat [ "kind" .= String "ChurnWait" , "diffTime" .= toJSON dt ] - -- toObject _verb (TraceChurnMode c) = - -- mconcat [ "kind" .= String "ChurnMode" - -- , "event" .= show c ] toObject _verb (TracePickInboundPeers targetNumberOfKnownPeers numberOfKnownPeers selected available) = mconcat [ "kind" .= String "PickInboundPeers" , "targetKnown" .= targetNumberOfKnownPeers @@ -1716,14 +1760,8 @@ instance ToObject CardanoTracePeerSelection where , "selected" .= selected , "available" .= available ] - toObject _verb (TraceLedgerStateJudgementChanged new) = - mconcat [ "kind" .= String "LedgerStateJudgementChanged" - , "new" .= show new ] toObject _verb TraceOnlyBootstrapPeers = mconcat [ "kind" .= String "OnlyBootstrapPeers" ] - toObject _verb (TraceUseBootstrapPeersChanged ubp) = - mconcat [ "kind" .= String "UseBootstrapPeersChanged" - , "bootstrapPeers" .= show ubp ] toObject _verb TraceBootstrapPeersFlagChangedWhilstInSensitiveState = mconcat [ "kind" .= String "BootstrapPeersFlagChangedWhilstInSensitiveState" ] @@ -1771,6 +1809,13 @@ instance ToObject CardanoTracePeerSelection where , "ledgerStateJudgement" .= Cardano.debugLedgerStateJudgement (dpssExtraState ds) , "associationMode" .= dpssAssociationMode ds ] + toObject _verb (ExtraTrace (Cardano.TraceLedgerStateJudgementChanged new)) = + mconcat [ "kind" .= String "LedgerStateJudgementChanged" + , "new" .= show new ] + toObject _verb (ExtraTrace (Cardano.TraceUseBootstrapPeersChanged ubp)) = + mconcat [ "kind" .= String "UseBootstrapPeersChanged" + , "bootstrapPeers" .= show ubp ] + peerSelectionTargetsToObject :: PeerSelectionTargets -> Value peerSelectionTargetsToObject @@ -1801,8 +1846,6 @@ instance ToObject CardanoDebugPeerSelection where , "wakeupAfter" .= String (pack $ show wakeupAfter) , "targets" .= peerSelectionTargetsToObject targets , "counters" .= toObject verb (peerSelectionStateToCounters - Cardano.PublicRootPeers.toSet - Cardano.cardanoPeerSelectionStatetoCounters st) ] @@ -2068,6 +2111,11 @@ instance (Show addr, Show versionNumber, Show agreedOptions, ToObject addr, [ "kind" .= String "UnexpectedlyFalseAssertion" , "info" .= String (pack . show $ info) ] + TrInboundConnectionNotFound peerAddr -> + mconcat $ reverse + [ "kind" .= String "InboundConnectionNotFound" + , "remoteAddress" .= toJSON peerAddr + ] instance (Show addr, ToObject addr, ToJSON addr) => ToObject (ConnMgr.AbstractTransitionTrace addr) where @@ -2118,9 +2166,6 @@ instance ToObject NtN.RemoteAddress where toObject _verb (SockAddrUnix path) = mconcat [ "path" .= show path ] -instance ToJSON Time where - toJSON = String . pack . show - instance ToObject NtN.RemoteConnectionId where toObject verb (NtN.ConnectionId l r) = mconcat [ "local" .= toObject verb l @@ -2294,3 +2339,32 @@ instance ToObject DNSTrace where , "peerKind" .= String (pack . show $ peerKind) , "domain" .= String (pack . show $ domain) ] + +instance HasPrivacyAnnotation (TraceTxLogic txid tx addr) where +instance HasSeverityAnnotation (TraceTxLogic txid tx addr) where + getSeverityAnnotation _ = Debug +instance (Show txid, Show tx, Show addr) => ToObject (TraceTxLogic txid tx addr) where + +instance HasPrivacyAnnotation TxSubmissionCounters where +instance HasSeverityAnnotation TxSubmissionCounters where + getSeverityAnnotation _ = Debug +instance ToObject TxSubmissionCounters where + toObject _ TxSubmissionCounters {..} = + mconcat [ "kind" .= String "TxSubmissionCounters" + , "numOfOutstandingTxIds" .= numOfOutstandingTxIds + , "numOfBufferedTxs" .= numOfBufferedTxs + , "numOfInSubmissionToMempoolTxs" .= numOfInSubmissionToMempoolTxs + , "numOfTxIdsInflight" .= numOfTxIdsInflight + ] + +instance Show txid => ToObject (TxDecision txid tx) where + toObject verb decision = + ("kind" .= String "TraceTxDecisions") + <> case verb of + MaximalVerbosity -> "decision" .= + let g (TxsToMempool txs) = map (show . fst) txs + f TxDecision {..} = + [( fromIntegral txdTxIdsToAcknowledge :: Int, fromIntegral txdTxIdsToRequest :: Int + , map (first show) . Map.toList $ txdTxsToRequest, g txdTxsToMempool)] + in f decision + _otherwise -> mempty diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs index d8645b49170..ca76caaa55e 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs @@ -38,13 +38,14 @@ import Cardano.Ledger.Chain import Cardano.Ledger.Conway.Governance (govActionIdToText) import Cardano.Ledger.Conway.Rules (ConwayUtxosPredFailure) import qualified Cardano.Ledger.Conway.Rules as Conway +import qualified Cardano.Ledger.Dijkstra.Rules as Dijkstra import qualified Cardano.Ledger.Core as Core import qualified Cardano.Ledger.Core as Ledger import qualified Cardano.Ledger.Hashes as Hashes import Cardano.Ledger.Shelley.API import Cardano.Ledger.Shelley.Rules import Cardano.Node.Tracing.Render (renderMissingRedeemers, renderScriptHash, - renderScriptIntegrityHash) + renderScriptIntegrityHash, renderIncompleteWithdrawals) import Cardano.Node.Tracing.Tracers.KESInfo () import qualified Cardano.Protocol.Crypto as Core import Cardano.Protocol.TPraos.API (ChainTransitionError (ChainTransitionError)) @@ -73,15 +74,18 @@ import Ouroboros.Consensus.Util.Condense (condense) import Ouroboros.Network.Block (SlotNo (..), blockHash, blockNo, blockSlot) import Ouroboros.Network.Point (WithOrigin, withOriginToMaybe) +import qualified Data.Aeson.Types as Aeson import Data.Aeson (Value (..)) -import qualified Data.Aeson as Aeson +import qualified Data.Aeson.Key as Aeson (fromText) import qualified Data.ByteString.Base16 as B16 import qualified Data.List.NonEmpty as NonEmpty import Data.Set (Set) import qualified Data.Set as Set +import qualified Data.Map as Map import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Encoding as Text +import qualified Data.Set.NonEmpty as NonEmptySet {- HLINT ignore "Use :" -} @@ -109,9 +113,8 @@ instance ShelleyCompatible protocol era => ToObject (Header (ShelleyBlock protoc instance ( ToObject (PredicateFailure (Core.EraRule "LEDGER" ledgerera)) + , ToJSON (ApplyTxError ledgerera) -- provided by cardano-api ) => ToObject (ApplyTxError ledgerera) where - toObject verb (ApplyTxError predicateFailures) = - mconcat $ NonEmpty.toList $ fmap (toObject verb) predicateFailures instance Core.Crypto crypto => ToObject (TPraosCannotForge crypto) where toObject _verb (TPraosCannotForgeKeyNotUsableYet wallClockPeriod keyStartPeriod) = @@ -214,7 +217,7 @@ instance ToObject (Conway.ConwayDelegPredFailure era) where , "amount" .= String (textShow credential) , "error" .= String "Stake key not registered" ] - Conway.StakeKeyHasNonZeroRewardAccountBalanceDELEG coin -> + Conway.StakeKeyHasNonZeroAccountBalanceDELEG coin -> [ "kind" .= String "StakeKeyHasNonZeroAccountBalanceDELEG" , "amount" .= coin , "error" .= String "Stake key has non-zero account balance" @@ -237,13 +240,13 @@ instance ToObject (Conway.ConwayDelegPredFailure era) where , "error" .= String "Refund mismatch" ] -instance ToObject (Set (Credential 'Staking)) where +instance ToObject (Set (Credential Staking)) where toObject _verb creds = mconcat [ "kind" .= String "StakeCreds" , "stakeCreds" .= map toJSON (Set.toList creds) ] -instance ToObject (NonEmpty.NonEmpty (KeyHash 'Staking)) where +instance ToObject (NonEmpty.NonEmpty (KeyHash Staking)) where toObject _verb keyHashes = mconcat [ "kind" .= String "StakeKeyHashes" , "stakeKeyHashes" .= toJSON keyHashes @@ -320,6 +323,15 @@ instance ) => ToObject (ShelleyLedgersPredFailure ledgerera) where toObject verb (LedgerFailure f) = toObject verb f +instance ToObject Withdrawals where + toObject _verb (Withdrawals ws) = + mconcat ["kind" .= String "Withdrawals" + , "withdrawals" .= Aeson.object (map renderTuple $ Map.toList ws) + ] + where + renderTuple :: (Ledger.AccountAddress, Coin) -> Aeson.Pair + renderTuple (address, mismatch) = + Aeson.fromText (Api.serialiseAddress $ Api.fromShelleyStakeAddr address) .= show mismatch instance ( ToObject (PredicateFailure (Core.EraRule "DELEGS" ledgerera)) @@ -327,6 +339,11 @@ instance ) => ToObject (ShelleyLedgerPredFailure ledgerera) where toObject verb (UtxowFailure f) = toObject verb f toObject verb (DelegsFailure f) = toObject verb f + toObject verb (ShelleyWithdrawalsMissingAccounts withdrawals) = toObject verb withdrawals + toObject _verb (ShelleyIncompleteWithdrawals payload) = + mconcat ["kind" .= String "ShelleyIncompleteWithdrawals" + , "withdrawals" .= renderIncompleteWithdrawals payload] + instance ( ToObject (PredicateFailure (Core.EraRule "CERTS" ledgerera)) @@ -334,6 +351,14 @@ instance , ToObject (PredicateFailure (Core.EraRule "GOV" ledgerera)) ) => ToObject (Conway.ConwayLedgerPredFailure ledgerera) where toObject verb (Conway.ConwayUtxowFailure f) = toObject verb f + toObject _ (Conway.ConwayWithdrawalsMissingAccounts missingWithdrawals) = + mconcat [ "kind" .= String "ConwayWithdrawalsMissingAccounts" + , "withdrawals" .= unWithdrawals missingWithdrawals + ] + toObject _ (Conway.ConwayIncompleteWithdrawals incompleteWithdrawals) = + mconcat [ "kind" .= String "ConwayIncompleteWithdrawals" + , "withdrawals" .= renderIncompleteWithdrawals incompleteWithdrawals + ] toObject _ (Conway.ConwayTxRefScriptsSizeTooBig Mismatch {mismatchSupplied, mismatchExpected}) = mconcat [ "kind" .= String "ConwayTxRefScriptsSizeTooBig" , "actual" .= mismatchSupplied @@ -407,11 +432,6 @@ instance Ledger.EraPParams era => ToObject (Conway.ConwayGovPredFailure era) whe , "protVer" .= mismatchSupplied , "prevProtVer" .= mismatchExpected ] - toObject _ (Conway.InvalidPolicyHash actualPolicyHash expectedPolicyHash) = - mconcat [ "kind" .= String "InvalidPolicyHash" - , "actualPolicyHash" .= actualPolicyHash - , "expectedPolicyHash" .= expectedPolicyHash - ] toObject _ (Conway.DisallowedProposalDuringBootstrap proposal) = mconcat [ "kind" .= String "DisallowedProposalDuringBootstrap" , "proposal" .= proposal @@ -440,7 +460,11 @@ instance Ledger.EraPParams era => ToObject (Conway.ConwayGovPredFailure era) whe mconcat [ "kind" .= String "UnelectedCommitteeVoters" , "unelectedCommitteeVoters" .= creds ] - + toObject _ (Conway.InvalidGuardrailsScriptHash actualScriptHash expectedScriptHash) = + mconcat [ "kind" .= String "InvalidGuardrailsScriptHash" + , "actualGuardrailsScriptHash" .= actualScriptHash + , "expectedGuardrailsScriptHash" .= expectedScriptHash + ] instance ( ToObject (PredicateFailure (Ledger.EraRule "CERT" era)) @@ -450,6 +474,37 @@ instance mconcat [ "kind" .= String "WithdrawalsNotInRewardsCERTS" , "incorrectWithdrawals" .= unWithdrawals incorrectWithdrawals ] Conway.CertFailure f -> toObject verb f +instance + ( ToObject (PredicateFailure (Core.EraRule "CERTS" ledgerera)) + , ToObject (PredicateFailure (Core.EraRule "UTXOW" ledgerera)) + , ToObject (PredicateFailure (Core.EraRule "GOV" ledgerera)) + ) => ToObject (Dijkstra.DijkstraLedgerPredFailure ledgerera) where + toObject _verb = error "Dijkstra era is not active yet" + +instance + (ToObject (PredicateFailure (Core.EraRule "CERTS" ledgerera)) + ) => ToObject (Dijkstra.DijkstraGovCertPredFailure ledgerera) where + toObject _verb = error "Dijkstra era is not active yet" + +instance + (ToObject (PredicateFailure (Core.EraRule "CERTS" ledgerera)) + ) => ToObject (Dijkstra.DijkstraGovPredFailure ledgerera) where + toObject _verb = error "Dijkstra era is not active yet" + +instance + (ToObject (PredicateFailure (Core.EraRule "UTXOW" ledgerera)) + ) => ToObject (Dijkstra.DijkstraUtxowPredFailure ledgerera) where + toObject _verb = error "Dijkstra era is not active yet" + +instance + (ToObject (PredicateFailure (Core.EraRule "CERTS" ledgerera)) + ) => ToObject (Dijkstra.DijkstraBbodyPredFailure ledgerera) where + toObject _verb = error "Dijkstra era is not active yet" + +instance + (ToObject (PredicateFailure (Core.EraRule "CERTS" ledgerera)) + ) => ToObject (Dijkstra.DijkstraUtxoPredFailure ledgerera) where + toObject _verb = error "Dijkstra era is not active yet" instance ( Api.ShelleyLedgerEra era ~ ledgerera @@ -469,7 +524,7 @@ instance toObject _ (MissingRequiredDatums required received) = mconcat [ "kind" .= String "MissingRequiredDatums" , "required" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) - (Set.toList required) + (NonEmptySet.toList required) , "received" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) (Set.toList received) ] @@ -480,11 +535,11 @@ instance ] toObject _ (UnspendableUTxONoDatumHash txins) = mconcat [ "kind" .= String "MissingRequiredSigners" - , "txins" .= Set.toList txins + , "txins" .= NonEmptySet.toList txins ] toObject _ (NotAllowedSupplementalDatums disallowed acceptable) = mconcat [ "kind" .= String "NotAllowedSupplementalDatums" - , "disallowed" .= Set.toList disallowed + , "disallowed" .= NonEmptySet.toList disallowed , "acceptable" .= Set.toList acceptable ] toObject _ (ExtraRedeemers rdmrs) = @@ -493,7 +548,7 @@ instance (\alonzoOnwards -> mconcat [ "kind" .= String "ExtraRedeemers" - , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) rdmrs + , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) (NonEmpty.toList rdmrs) ] ) (Api.shelleyBasedEra :: Api.ShelleyBasedEra era) @@ -509,11 +564,11 @@ instance ) => ToObject (ShelleyUtxowPredFailure ledgerera) where toObject _verb (ExtraneousScriptWitnessesUTXOW extraneousScripts) = mconcat [ "kind" .= String "ExtraneousScriptWitnessesUTXOW" - , "extraneousScripts" .= Set.map renderScriptHash extraneousScripts + , "extraneousScripts" .= map renderScriptHash (NonEmptySet.toList extraneousScripts) ] toObject _verb (InvalidWitnessesUTXOW wits') = mconcat [ "kind" .= String "InvalidWitnessesUTXOW" - , "invalidWitnesses" .= map textShow wits' + , "invalidWitnesses" .= map textShow (NonEmpty.toList wits') ] toObject _verb (MissingVKeyWitnessesUTXOW wits') = mconcat [ "kind" .= String "MissingVKeyWitnessesUTXOW" @@ -560,7 +615,7 @@ instance toObject _verb (BadInputsUTxO badInputs) = mconcat [ "kind" .= String "BadInputsUTxO" , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] toObject _verb (ExpiredUTxO Mismatch {mismatchSupplied, mismatchExpected}) = mconcat [ "kind" .= String "ExpiredUTxO" @@ -622,7 +677,7 @@ instance toObject _verb (Allegra.BadInputsUTxO badInputs) = mconcat [ "kind" .= String "BadInputsUTxO" , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] toObject _verb (Allegra.OutsideValidityIntervalUTxO validityInterval slot) = mconcat [ "kind" .= String "ExpiredUTxO" @@ -706,14 +761,6 @@ instance Ledger.Era era => ToObject (ShelleyPpupPredFailure era) where instance ( ToObject (PredicateFailure (Core.EraRule "DELPL" ledgerera)) ) => ToObject (ShelleyDelegsPredFailure ledgerera) where - toObject _verb (DelegateeNotRegisteredDELEG targetPool) = - mconcat [ "kind" .= String "DelegateeNotRegisteredDELEG" - , "targetPool" .= targetPool - ] - toObject _verb (WithdrawalsNotInRewardsDELEGS incorrectWithdrawals) = - mconcat [ "kind" .= String "WithdrawalsNotInRewardsCERTS" - , "incorrectWithdrawals" .= unWithdrawals incorrectWithdrawals - ] toObject verb (DelplFailure f) = toObject verb f @@ -798,6 +845,10 @@ instance Ledger.Era era => ToObject (ShelleyDelegPredFailure era) where TreasuryMIR -> "Treasury") , "amount" .= coin ] + toObject _verb (DelegateeNotRegisteredDELEG keyHash) = + mconcat [ "kind" .= String "DelegateeNotRegisteredDELEG" + , "unregisteredKeyHash" .= keyHash + ] instance ToObject (ShelleyPoolPredFailure era) where toObject _verb (StakePoolNotRegisteredOnKeyPOOL (KeyHash unregStakePool)) = @@ -1029,7 +1080,7 @@ instance toObject _verb (Alonzo.BadInputsUTxO badInputs) = mconcat [ "kind" .= String "BadInputsUTxO" , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] toObject _verb (Alonzo.OutsideValidityIntervalUTxO validtyInterval slot) = mconcat [ "kind" .= String "ExpiredUTxO" @@ -1316,6 +1367,7 @@ instance ToJSON ShelleyNodeToClientVersion where toJSON ShelleyNodeToClientVersion12 = String "ShelleyNodeToClientVersion12" toJSON ShelleyNodeToClientVersion13 = String "ShelleyNodeToClientVersion13" toJSON ShelleyNodeToClientVersion14 = String "ShelleyNodeToClientVersion14" + toJSON ShelleyNodeToClientVersion15 = String "ShelleyNodeToClientVersion15" -------------------------------------------------------------------------------- -- Conway related @@ -1360,7 +1412,7 @@ instance Conway.BadInputsUTxO badInputs -> mconcat [ "kind" .= String "BadInputsUTxO" , "badInputs" .= badInputs - , "error" .= renderBadInputsUTxOErr badInputs + , "error" .= renderBadInputsUTxOErr (NonEmptySet.toSet badInputs) ] Conway.OutsideValidityIntervalUTxO validityInterval slot -> mconcat [ "kind" .= String "ExpiredUTxO" @@ -1476,7 +1528,7 @@ instance Conway.UtxoFailure utxoPredFail -> toObject v utxoPredFail Conway.InvalidWitnessesUTXOW ws -> mconcat [ "kind" .= String "InvalidWitnessesUTXOW" - , "invalidWitnesses" .= map textShow ws + , "invalidWitnesses" .= map textShow (NonEmpty.toList ws) ] Conway.MissingVKeyWitnessesUTXOW ws -> mconcat [ "kind" .= String "MissingVKeyWitnessesUTXOW" @@ -1508,7 +1560,7 @@ instance ] Conway.ExtraneousScriptWitnessesUTXOW scripts -> mconcat [ "kind" .= String "InvalidWitnessesUTXOW" - , "extraneousScripts" .= Set.map renderScriptHash scripts + , "extraneousScripts" .= Set.map renderScriptHash (NonEmptySet.toSet scripts) ] Conway.MissingRedeemers scripts -> mconcat [ "kind" .= String "MissingRedeemers" @@ -1517,13 +1569,13 @@ instance Conway.MissingRequiredDatums required received -> mconcat [ "kind" .= String "MissingRequiredDatums" , "required" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) - (Set.toList required) + (NonEmptySet.toList required) , "received" .= map (Crypto.hashToTextAsHex . Hashes.extractHash) (Set.toList received) ] Conway.NotAllowedSupplementalDatums disallowed acceptable -> mconcat [ "kind" .= String "NotAllowedSupplementalDatums" - , "disallowed" .= Set.toList disallowed + , "disallowed" .= NonEmptySet.toList disallowed , "acceptable" .= Set.toList acceptable ] Conway.PPViewHashesDontMatch Mismatch {mismatchSupplied, mismatchExpected} -> @@ -1533,7 +1585,7 @@ instance ] Conway.UnspendableUTxONoDatumHash ins -> mconcat [ "kind" .= String "MissingRequiredSigners" - , "txins" .= Set.toList ins + , "txins" .= NonEmptySet.toList ins ] Conway.ExtraRedeemers rs -> Api.caseShelleyToMaryOrAlonzoEraOnwards @@ -1541,7 +1593,7 @@ instance (\alonzoOnwards -> mconcat [ "kind" .= String "ExtraRedeemers" - , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) rs + , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) (NonEmpty.toList rs) ] ) (Api.shelleyBasedEra :: Api.ShelleyBasedEra era) diff --git a/cardano-node/src/Cardano/Tracing/Tracers.hs b/cardano-node/src/Cardano/Tracing/Tracers.hs index 953b089cce5..a12d5c72490 100644 --- a/cardano-node/src/Cardano/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Tracing/Tracers.hs @@ -29,6 +29,10 @@ module Cardano.Tracing.Tracers , traceCounter ) where +import qualified Cardano.Network.PeerSelection.ExtraRootPeers as Cardano +import qualified Ouroboros.Network.PeerSelection.Governor as Governor +import qualified Ouroboros.Network.PeerSelection.Governor.Types as Governor +import qualified Data.List as List import Cardano.BM.Data.Aggregated (Measurable (..)) import Cardano.BM.Data.Tracer (WithSeverity (..), annotateSeverity) import Cardano.BM.Data.Transformers @@ -44,7 +48,6 @@ import qualified Cardano.Node.STM as STM import Cardano.Node.TraceConstraints import Cardano.Node.Tracing import qualified Cardano.Node.Tracing.Tracers.Consensus as ConsensusTracers -import qualified Cardano.Node.Tracing.Tracers.Diffusion as DiffusionTracers import Cardano.Node.Tracing.Tracers.NodeVersion import Cardano.Network.Diffusion (CardanoPeerSelectionCounters) import Cardano.Protocol.TPraos.OCert (KESPeriod (..)) @@ -58,7 +61,7 @@ import Cardano.Tracing.Shutdown () import Cardano.Tracing.Startup () import Ouroboros.Consensus.Block (BlockConfig, BlockProtocol, CannotForge, ConvertRawHash (..), ForgeStateInfo, ForgeStateUpdateError, Header, - realPointHash, realPointSlot) + HeaderHash, realPointHash, realPointSlot) import Ouroboros.Consensus.BlockchainTime (SystemStart (..), TraceBlockchainTimeEvent (..)) import Ouroboros.Consensus.HeaderValidation (OtherHeaderEnvelopeError) @@ -76,7 +79,7 @@ import qualified Ouroboros.Consensus.Network.NodeToClient as NodeToClient import qualified Ouroboros.Consensus.Network.NodeToNode as NodeToNode import qualified Ouroboros.Consensus.Node.Run as Consensus (RunNode) import qualified Ouroboros.Consensus.Node.Tracers as Consensus -import Ouroboros.Consensus.Protocol.Abstract (SelectView, ValidationErr) +import Ouroboros.Consensus.Protocol.Abstract (ValidationErr) import qualified Ouroboros.Consensus.Protocol.Ledger.HotKey as HotKey import qualified Ouroboros.Consensus.Storage.ChainDB as ChainDB import qualified Ouroboros.Consensus.Storage.LedgerDB as LedgerDB @@ -85,7 +88,6 @@ import Ouroboros.Consensus.Util.Enclose import qualified Network.Mux as Mux import qualified Cardano.Network.Diffusion.Types as Cardano.Diffusion -import qualified Cardano.Network.PeerSelection.Governor.Types as Cardano import qualified Ouroboros.Network.AnchoredFragment as AF import Ouroboros.Network.Block (BlockNo (..), ChainUpdate (..), HasHeader (..), Point, @@ -103,14 +105,12 @@ import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.InboundGovernor.State as InboundGovernor import Cardano.Network.NodeToClient (LocalAddress) import Cardano.Network.NodeToNode (RemoteAddress) -import Ouroboros.Network.PeerSelection.Churn (ChurnCounters (..)) import Ouroboros.Network.PeerSelection.Governor ( PeerSelectionView (..)) -import qualified Ouroboros.Network.PeerSelection.Governor as Governor import Ouroboros.Network.Point (fromWithOrigin, withOrigin) import Ouroboros.Network.Protocol.LocalStateQuery.Type (LocalStateQuery, ShowQuery) import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as LocalStateQuery -import Ouroboros.Network.TxSubmission.Inbound +import Ouroboros.Network.TxSubmission.Inbound.V2 import Codec.CBOR.Read (DeserialiseFailure) import Control.Concurrent (MVar, modifyMVar_) @@ -139,6 +139,7 @@ import qualified System.Metrics.Counter as Counter import qualified System.Metrics.Gauge as Gauge import qualified System.Metrics.Label as Label import qualified System.Remote.Monitoring.Wai as EKG +import Ouroboros.Consensus.Peras.SelectView {-# OPTIONS_GHC -Wno-redundant-constraints #-} @@ -245,7 +246,7 @@ instance ElidingTracer (WithSeverity (ChainDB.TraceEvent blk)) where doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent (ChainDB.SwitchedToAFork{}))) = False doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent (ChainDB.AddBlockValidation (ChainDB.InvalidBlock _ _)))) = False doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent (ChainDB.AddBlockValidation _))) = True - doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent (ChainDB.AddedToCurrentChain events _ _ _))) = null events + doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent (ChainDB.AddedToCurrentChain events _ _ _ _))) = null events doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent (ChainDB.PipeliningEvent{}))) = True doelide (WithSeverity _ (ChainDB.TraceAddBlockEvent _)) = True doelide (WithSeverity _ (ChainDB.TraceCopyToImmutableDBEvent _)) = True @@ -413,15 +414,6 @@ mkTracers blockConfig tOpts@(TracingOnLegacy trSel) tr nodeKern ekgDirect = do <> tracePeerSelectionTracerMetrics (tracePeerSelection trSel) ekgDirect - , Diffusion.dtTraceChurnCounters = - traceChurnCountersMetrics - ekgDirect - , Diffusion.dtDebugPeerSelectionInitiatorTracer = - tracerOnOff (traceDebugPeerSelectionInitiatorTracer trSel) - verb "DebugPeerSelection" tr - , Diffusion.dtDebugPeerSelectionInitiatorResponderTracer = - tracerOnOff (traceDebugPeerSelectionInitiatorResponderTracer trSel) - verb "DebugPeerSelection" tr , Diffusion.dtTracePeerSelectionCounters = tracePeerSelectionCountersMetrics (tracePeerSelectionCounters trSel) @@ -465,6 +457,8 @@ mkTracers blockConfig tOpts@(TracingOnLegacy trSel) tr nodeKern ekgDirect = do verb "LedgerPeers" tr , Diffusion.dtDnsTracer = tracerOnOff (traceDNS trSel) verb "DNS" tr + , Diffusion.dtDebugPeerSelectionTracer = + tracerOnOff (traceDNS trSel) verb "DebugPeerSelection" tr } verb :: TracingVerbosity verb = traceVerbosity trSel @@ -511,6 +505,8 @@ mkTracers _ _ _ _ _ = , Consensus.csjTracer = nullTracer , Consensus.dbfTracer = nullTracer , Consensus.kesAgentTracer = nullTracer + , Consensus.txLogicTracer = nullTracer + , Consensus.txCountersTracer = nullTracer } , nodeToClientTracers = NodeToClient.Tracers { NodeToClient.tChainSyncTracer = nullTracer @@ -526,6 +522,7 @@ mkTracers _ _ _ _ _ = , NodeToNode.tTxSubmission2Tracer = nullTracer , NodeToNode.tKeepAliveTracer = nullTracer , NodeToNode.tPeerSharingTracer = nullTracer + , NodeToNode.tTxLogicTracer = nullTracer } , diffusionTracers = Diffusion.nullTracers , churnModeTracer = nullTracer @@ -547,8 +544,25 @@ notifyTxsMempoolTimeoutHard :: Maybe EKGDirect -> Tracer IO Mux.Trace notifyTxsMempoolTimeoutHard mbEKGDirect = case mbEKGDirect of Nothing -> nullTracer Just ekgDirect -> Tracer $ \ev -> do - when (DiffusionTracers.impliesMempoolTimeoutHard ev) $ do - sendEKGDirectCounter ekgDirect $ "cardano.node.metrics." <> DiffusionTracers.txsMempoolTimeoutHardCounterName + when (impliesMempoolTimeoutHard ev) $ do + sendEKGDirectCounter ekgDirect $ "cardano.node.metrics." <> txsMempoolTimeoutHardCounterName + +impliesMempoolTimeoutHard :: Mux.Trace -> Bool +impliesMempoolTimeoutHard = \case + Mux.TraceExceptionExit _mid _dir e +{-- TODO: In cardano-node master this is implemented as: + -- + -- > | Just _ <- fromException @ExnMempoolTimeout e + -- > -> True + -- + -- but `ExnMempoolTimeout` is defined in `ouroboros-consensus` which is not a + -- dependency of `ouroboros-network`. + --} + | List.isPrefixOf "ExnMempoolTimeout " (show e) -> True + _ -> False + +txsMempoolTimeoutHardCounterName :: Text +txsMempoolTimeoutHardCounterName = "txsMempoolTimeoutHard" muxTracer :: Maybe EKGDirect @@ -576,7 +590,8 @@ teeTraceChainTip , InspectLedger blk , ToObject (Header blk) , ToObject (LedgerEvent blk) - , ToObject (SelectView (BlockProtocol blk)) + , ToObject (WeightedSelectView (BlockProtocol blk)) + , ToJSON (HeaderHash blk) ) => BlockConfig blk -> ForgingStats @@ -600,7 +615,8 @@ teeTraceChainTipElide , InspectLedger blk , ToObject (Header blk) , ToObject (LedgerEvent blk) - , ToObject (SelectView (BlockProtocol blk)) + , ToObject (WeightedSelectView (BlockProtocol blk)) + , ToJSON (HeaderHash blk) ) => TracingVerbosity -> MVar (Maybe (WithSeverity (ChainDB.TraceEvent blk)), Integer) @@ -632,11 +648,11 @@ traceChainMetrics (Just _ekgDirect) tForks _blockConfig _fStats tr = do chainTipInformation :: ChainDB.TraceEvent blk -> Maybe ChainInformation chainTipInformation = \case ChainDB.TraceAddBlockEvent ev -> case ev of - ChainDB.SwitchedToAFork _warnings selChangedInfo oldChain newChain -> + ChainDB.SwitchedToAFork _warnings selChangedInfo oldChain newChain _switchReason -> let fork = not $ AF.withinFragmentBounds (AF.headPoint oldChain) newChain in Just $ chainInformation selChangedInfo fork oldChain newChain 0 - ChainDB.AddedToCurrentChain _warnings selChangedInfo oldChain newChain -> + ChainDB.AddedToCurrentChain _warnings selChangedInfo oldChain newChain _switchReason -> Just $ chainInformation selChangedInfo False oldChain newChain 0 _ -> Nothing _ -> Nothing @@ -750,6 +766,7 @@ mkConsensusTracers , ToJSON peer , LedgerQueries blk , ToJSON (GenTxId blk) + , ToJSON (HeaderHash blk) , ToObject (ApplyTxErr blk) , ToObject (CannotForge blk) , ToObject (GenTx blk) @@ -778,7 +795,7 @@ mkConsensusTracers mbEKGDirect trSel verb tr nodeKern fStats = do tBlocksServed <- STM.newTVarIO 0 tLocalUp <- STM.newTVarIO 0 tMaxSlotNo <- STM.newTVarIO $ SlotNo 0 - tSubmissionsCollected <- STM.newTVarIO 0 + tSubmissionsCollected <- STM.newTVarIO [] tSubmissionsAccepted <- STM.newTVarIO 0 tSubmissionsRejected <- STM.newTVarIO 0 tBlockDelayM <- STM.newTVarIO Pq.empty @@ -809,8 +826,8 @@ mkConsensusTracers mbEKGDirect trSel verb tr nodeKern fStats = do traceWith (annotateSeverity . toLogObject' verb $ appendName "TxInbound" tr) ev case ev of TraceLabelPeer _ (TraceTxSubmissionCollected collected) -> - traceI trmet meta "submissions.submitted.count" =<< - STM.modifyReadTVarIO tSubmissionsCollected (+ collected) + traceI trmet meta "submissions.submitted.count" . length =<< + STM.modifyReadTVarIO tSubmissionsCollected (<> collected) TraceLabelPeer _ (TraceTxSubmissionProcessed processed) -> do traceI trmet meta "submissions.accepted.count" =<< @@ -821,6 +838,10 @@ mkConsensusTracers mbEKGDirect trSel verb tr nodeKern fStats = do TraceLabelPeer _ TraceTxInboundTerminated -> return () TraceLabelPeer _ (TraceTxInboundCanRequestMoreTxs _) -> return () TraceLabelPeer _ (TraceTxInboundCannotRequestMoreTxs _) -> return () + TraceLabelPeer _ (TraceTxInboundAddedToMempool _ _) -> return () + TraceLabelPeer _ (TraceTxInboundRejectedFromMempool _ _) -> return () + TraceLabelPeer _ (TraceTxInboundError _) -> return () + TraceLabelPeer _ (TraceTxInboundDecision _) -> return () , Consensus.txOutboundTracer = tracerOnOff (traceTxOutbound trSel) verb "TxOutbound" tr , Consensus.localTxSubmissionServerTracer = tracerOnOff (traceLocalTxSubmissionServer trSel) verb "LocalTxSubmissionServer" tr @@ -840,6 +861,8 @@ mkConsensusTracers mbEKGDirect trSel verb tr nodeKern fStats = do , Consensus.csjTracer = tracerOnOff (traceCsj trSel) verb "CSJ" tr , Consensus.dbfTracer = tracerOnOff (traceDevotedBlockFetch trSel) verb "DevotedBlockFetch" tr , Consensus.kesAgentTracer = tracerOnOff (traceKesAgent trSel) verb "kesAgent" tr + , Consensus.txLogicTracer = tracerOnOff (traceTxLogic trSel) verb "txLogic" tr + , Consensus.txCountersTracer = tracerOnOff (traceTxCounters trSel) verb "txCounters" tr } where mkForgeTracers :: IO ForgeTracers @@ -1066,15 +1089,15 @@ traceLeadershipChecks _ft nodeKern _tverb tr = Tracer $ !query <- mapNodeKernelDataIO (\nk -> (,,) - <$> fmap (maybe 0 LedgerDB.ledgerTableSize) (ChainDB.getStatistics $ getChainDB nk) + <$> ChainDB.getStatistics (getChainDB nk) <*> nkQueryLedger (ledgerDelegMapSize . ledgerState) nk <*> nkQueryChain fragmentChainDensity nk) nodeKern meta <- mkLOMeta sev Public fromSMaybe (pure ()) $ query <&> - \(utxoSize, delegMapSize, _) -> do - traceCounter "utxoSize" tr utxoSize + \(ledgerStatistics, delegMapSize, _) -> do + traceCounter "utxoSize" tr (LedgerDB.ledgerTableSize ledgerStatistics) traceCounter "delegMapSize" tr delegMapSize traceNamedObject (appendName "LeadershipCheck" tr) ( meta @@ -1084,8 +1107,8 @@ traceLeadershipChecks _ft nodeKern _tverb tr = Tracer $ ,("slot", toJSON $ unSlotNo slot)] ++ fromSMaybe [] (query <&> - \(utxoSize, delegMapSize, chainDensity) -> - [ ("utxoSize", toJSON utxoSize) + \(ledgerStatistics, delegMapSize, chainDensity) -> + [ ("utxoSize", toJSON (LedgerDB.ledgerTableSize ledgerStatistics)) , ("delegMapSize", toJSON delegMapSize) , ("chainDensity", toJSON (fromRational chainDensity :: Float)) ]) @@ -1321,6 +1344,7 @@ mempoolTracer :: ( ToJSON (GenTxId blk) , ToObject (ApplyTxErr blk) , ToObject (GenTx blk) + , ToJSON (HeaderHash blk) , LedgerSupportsMempool blk , ConvertRawHash blk ) @@ -1341,6 +1365,7 @@ mempoolTracer mbEKGDirect tc tracer fStats = Tracer $ \ev -> do mpTracer :: ( ToJSON (GenTxId blk) , ToObject (ApplyTxErr blk) , ToObject (GenTx blk) + , ToJSON (HeaderHash blk) , ConvertRawHash blk , LedgerSupportsMempool blk ) @@ -1504,6 +1529,9 @@ nodeToNodeTracers' trSel verb tr = , NodeToNode.tPeerSharingTracer = tracerOnOff (tracePeerSharingProtocol trSel) verb "PeerSharingPrototocol" tr + , NodeToNode.tTxLogicTracer = + tracerOnOff (traceTxLogic trSel) + verb "TxLogicTracer" tr } -- TODO @ouroboros-network @@ -1511,6 +1539,7 @@ teeTraceBlockFetchDecision :: ( Eq peer , Show peer , ToJSON peer + , ToJSON (HeaderHash blk) , HasHeader blk , ConvertRawHash blk ) @@ -1542,6 +1571,7 @@ teeTraceBlockFetchDecisionElide :: ( Eq peer , Show peer , ToJSON peer + , ToJSON (HeaderHash blk) , HasHeader blk , ConvertRawHash blk ) @@ -1590,7 +1620,6 @@ traceConnectionManagerTraceMetrics (OnOff True) (Just ekgDirect) = cmtTracer outboundConns _ -> return () - tracePeerSelectionTracerMetrics :: forall extraDebugState extraFlags extraPeers peeraddr. OnOff TracePeerSelection @@ -1610,7 +1639,6 @@ tracePeerSelectionTracerMetrics (OnOff True) (Just ekgDirect) = pstTracer (realToFrac duration) _ -> pure () - tracePeerSelectionCountersMetrics :: OnOff TracePeerSelectionCounters -> Maybe EKGDirect @@ -1621,7 +1649,7 @@ tracePeerSelectionCountersMetrics (OnOff True) (Just ekgDirect) = pscTracer where pscTracer :: Tracer IO CardanoPeerSelectionCounters pscTracer = Tracer $ \psc -> do - let PeerSelectionCountersHWC {..} = psc + let Governor.PeerSelectionCountersHWC {..} = psc -- Deprecated counters; they will be removed in a future version sendEKGDirectInt ekgDirect "cardano.node.metrics.peerSelection.cold" numberOfColdPeers sendEKGDirectInt ekgDirect "cardano.node.metrics.peerSelection.warm" numberOfWarmPeers @@ -1672,18 +1700,6 @@ tracePeerSelectionCountersMetrics (OnOff True) (Just ekgDirect) = pscTracer sendEKGDirectInt ekgDirect "cardano.node.metrics.peerSelection.ActiveBootstrapPeers" (snd $ Cardano.viewActiveBootstrapPeers extraCounters) sendEKGDirectInt ekgDirect "cardano.node.metrics.peerSelection.ActiveBootstrapPeersDemotions" (snd $ Cardano.viewActiveBootstrapPeersDemotions extraCounters) - -traceChurnCountersMetrics - :: Maybe EKGDirect - -> Tracer IO ChurnCounters -traceChurnCountersMetrics Nothing = nullTracer -traceChurnCountersMetrics (Just ekgDirect) = churnTracer - where - churnTracer :: Tracer IO ChurnCounters - churnTracer = Tracer $ \(ChurnCounter action c) -> - sendEKGDirectInt ekgDirect ("cardano.node.metrics.peerSelection.churn." <> Text.pack (show action)) c - - traceInboundGovernorCountersMetrics :: forall addr. OnOff TraceInboundGovernorCounters From bfab78dcb081251abca01c6d8bd998b4cdadcb80 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Mar 2026 10:02:58 +0100 Subject: [PATCH 11/54] Config parsing for TxSubmissionLogicVersion and TxSubmissionInitDelay --- .../src/Cardano/Node/Configuration/POM.hs | 24 +++++++++++++++++++ cardano-node/src/Cardano/Node/Parsers.hs | 2 ++ cardano-node/src/Cardano/Node/Run.hs | 2 ++ 3 files changed, 28 insertions(+) diff --git a/cardano-node/src/Cardano/Node/Configuration/POM.hs b/cardano-node/src/Cardano/Node/Configuration/POM.hs index b0c488e3dd3..8bfcd3d13d4 100644 --- a/cardano-node/src/Cardano/Node/Configuration/POM.hs +++ b/cardano-node/src/Cardano/Node/Configuration/POM.hs @@ -50,6 +50,8 @@ import Ouroboros.Network.Diffusion.Configuration as Configuration import qualified Ouroboros.Network.Diffusion.Configuration as Ouroboros import qualified Ouroboros.Network.Mux as Mux import qualified Ouroboros.Network.PeerSelection.Governor as PeerSelection +import Ouroboros.Network.TxSubmission.Inbound.V2.Types + (TxSubmissionInitDelay(..), TxSubmissionLogicVersion(..), defaultTxSubmissionInitDelay) import Control.Concurrent (getNumCapabilities) import Control.Monad (unless, void, when) @@ -197,6 +199,9 @@ data NodeConfiguration , ncGenesisConfig :: GenesisConfig , ncResponderCoreAffinityPolicy :: ResponderCoreAffinityPolicy + + , ncTxSubmissionLogicVersion :: TxSubmissionLogicVersion + , ncTxSubmissionInitDelay :: TxSubmissionInitDelay } deriving (Eq, Show) -- | We expose the `Ouroboros.Network.Mux.ForkPolicy` as a `NodeConfiguration` field. @@ -297,6 +302,9 @@ data PartialNodeConfiguration , pncGenesisConfigFlags :: !(Last GenesisConfigFlags) , pncResponderCoreAffinityPolicy :: !(Last ResponderCoreAffinityPolicy) + + , pncTxSubmissionLogicVersion :: !(Last TxSubmissionLogicVersion) + , pncTxSubmissionInitDelay :: !(Last TxSubmissionInitDelay) } deriving (Eq, Generic, Show) instance AdjustFilePaths PartialNodeConfiguration where @@ -413,6 +421,12 @@ instance FromJSON PartialNodeConfiguration where <$> v .:? "ResponderCoreAffinityPolicy" <*> v .:? "ForkPolicy" -- deprecated + txSubmissionLogicVersion <- Last <$> v .:? "TxSubmissionLogicVersion" + let parseInitDelay = + maybe (pncTxSubmissionInitDelay defaultPartialNodeConfiguration) (fmap TxSubmissionInitDelay) + <$> v .:? "TxSubmissionInitDelay" + pncTxSubmissionInitDelay <- parseInitDelay + pure PartialNodeConfiguration { pncProtocolConfig , pncSocketConfig = Last . Just $ SocketConfig mempty mempty mempty pncSocketPath @@ -460,6 +474,8 @@ instance FromJSON PartialNodeConfiguration where , pncPeerSharing , pncGenesisConfigFlags , pncResponderCoreAffinityPolicy + , pncTxSubmissionLogicVersion = txSubmissionLogicVersion + , pncTxSubmissionInitDelay } where parseMempoolCapacityBytesOverride v = parseNoOverride <|> parseOverride @@ -725,6 +741,9 @@ defaultPartialNodeConfiguration = , pncGenesisConfigFlags = Last (Just defaultGenesisConfigFlags) -- https://ouroboros-consensus.cardano.intersectmbo.org/haddocks/ouroboros-consensus-diffusion/Ouroboros-Consensus-Node-Genesis.html#v:defaultGenesisConfigFlags , pncResponderCoreAffinityPolicy = Last $ Just NoResponderCoreAffinity + + , pncTxSubmissionLogicVersion = Last $ Just TxSubmissionLogicV1 + , pncTxSubmissionInitDelay = Last $ Just defaultTxSubmissionInitDelay } lastOption :: Parser a -> Parser (Last a) @@ -846,6 +865,9 @@ makeNodeConfiguration pnc = do ncResponderCoreAffinityPolicy <- lastToEither "Missing ResponderCoreAffinityPolicy" $ pncResponderCoreAffinityPolicy pnc + ncTxSubmissionLogicVersion <- lastToEither "Missing TxSubmissionLogicVersion" $ pncTxSubmissionLogicVersion pnc + ncTxSubmissionInitDelay <- lastToEither "Missing TxSubmissionInitDelay" $ pncTxSubmissionInitDelay pnc + let deadlineTargets = PeerSelectionTargets { targetNumberOfRootPeers = ncDeadlineTargetOfRootPeers, @@ -923,6 +945,8 @@ makeNodeConfiguration pnc = do , ncConsensusMode , ncGenesisConfig , ncResponderCoreAffinityPolicy + , ncTxSubmissionLogicVersion + , ncTxSubmissionInitDelay } ncProtocol :: NodeConfiguration -> Protocol diff --git a/cardano-node/src/Cardano/Node/Parsers.hs b/cardano-node/src/Cardano/Node/Parsers.hs index b6ec0c7441b..bea9fe5b95c 100644 --- a/cardano-node/src/Cardano/Node/Parsers.hs +++ b/cardano-node/src/Cardano/Node/Parsers.hs @@ -144,6 +144,8 @@ nodeRunParser = do , pncPeerSharing = mempty , pncGenesisConfigFlags = mempty , pncResponderCoreAffinityPolicy = mempty + , pncTxSubmissionLogicVersion = mempty + , pncTxSubmissionInitDelay = mempty } parseSocketPath :: Text -> Parser SocketPath diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 3102f6018c0..024ad405239 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -489,6 +489,8 @@ handleSimpleNode blockType runP tracers nc onKernel = do onKernel nodeKernel , rnPeerSharing = ncPeerSharing nc , rnGetUseBootstrapPeers = readTVar useBootstrapVar + , rnTxSubmissionLogicVersion = ncTxSubmissionLogicVersion nc + , rnTxSubmissionInitDelay = ncTxSubmissionInitDelay nc } #ifdef UNIX -- initial `SIGHUP` handler, which only rereads the topology file but From ff7d0adf02b225dbe4cb7b8049ee45f738bf1158 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Mar 2026 10:14:17 +0100 Subject: [PATCH 12/54] Initialise node feature flags as empty --- cardano-node/src/Cardano/Node/Run.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 024ad405239..2fe99336751 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -491,6 +491,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do , rnGetUseBootstrapPeers = readTVar useBootstrapVar , rnTxSubmissionLogicVersion = ncTxSubmissionLogicVersion nc , rnTxSubmissionInitDelay = ncTxSubmissionInitDelay nc + , rnFeatureFlags = mempty -- TODO(10.7) forward this to CLI options? } #ifdef UNIX -- initial `SIGHUP` handler, which only rereads the topology file but From 8ff38165716822466afb645eb1228b7e34a4945e Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Mar 2026 09:58:29 +0100 Subject: [PATCH 13/54] Fix `readPeerSnapshotFile` --- cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs b/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs index 0f6d2085a23..0d7467e4440 100644 --- a/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs +++ b/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} @@ -37,6 +38,7 @@ module Cardano.Node.Configuration.TopologyP2P ) where + import Cardano.Api (handleIOExceptionsLiftWith, liftEither, runExceptT, throwError) import Cardano.Network.ConsensusMode (ConsensusMode (..)) @@ -49,7 +51,7 @@ import Cardano.Node.Types import Cardano.Tracing.OrphanInstances.Network () import Cardano.Network.NodeToNode (DiffusionMode (..), PeerAdvertise (..)) import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSnapshot (..), - UseLedgerPeers (..), RelayAccessPoint (..)) + UseLedgerPeers (..), RelayAccessPoint (..), LedgerPeersKind(..)) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (..), WarmValency (..)) @@ -347,7 +349,7 @@ readTopologyFileOrError nc tr = <> Text.unpack err) pure -readPeerSnapshotFile :: PeerSnapshotFile -> IO (Either Text LedgerPeerSnapshot) +readPeerSnapshotFile :: PeerSnapshotFile -> IO (Either Text (LedgerPeerSnapshot BigLedgerPeers)) readPeerSnapshotFile (PeerSnapshotFile file) = do content <- first renderException <$> try (BS.readFile file) return $ first handler $ content >>= eitherDecodeStrict From ed2cb90584aa1343ebfe96ccc238ab24a5f579cd Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 24 Feb 2026 18:22:01 +0100 Subject: [PATCH 14/54] cardano-tracer: integrate new Network packages --- cardano-tracer/src/Cardano/Tracer/Acceptors/Server.hs | 4 ++++ cardano-tracer/test/Cardano/Tracer/Test/Forwarder.hs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/cardano-tracer/src/Cardano/Tracer/Acceptors/Server.hs b/cardano-tracer/src/Cardano/Tracer/Acceptors/Server.hs index 37c0470c7e2..ef70df89185 100644 --- a/cardano-tracer/src/Cardano/Tracer/Acceptors/Server.hs +++ b/cardano-tracer/src/Cardano/Tracer/Acceptors/Server.hs @@ -123,6 +123,8 @@ doListenToForwarderLocal doListenToForwarderLocal snocket address netMagic timeLimits app = do void $ Server.with snocket + nullTracer + Mux.nullTracers makeLocalBearer mempty -- LocalSocket does not need to be configured address @@ -153,6 +155,8 @@ doListenToForwarderSocket doListenToForwarderSocket snocket address netMagic timeLimits app = do void $ Server.with snocket + nullTracer + Mux.nullTracers makeSocketBearer mempty -- LocalSocket does not need to be configured address diff --git a/cardano-tracer/test/Cardano/Tracer/Test/Forwarder.hs b/cardano-tracer/test/Cardano/Tracer/Test/Forwarder.hs index de95bef2a5d..90a277c8683 100644 --- a/cardano-tracer/test/Cardano/Tracer/Test/Forwarder.hs +++ b/cardano-tracer/test/Cardano/Tracer/Test/Forwarder.hs @@ -272,6 +272,8 @@ doListenToAcceptor TestSetup{..} withAsync (traceObjectsWriter sink) $ \_ -> void $ Server.with snocket + nullTracer + Mux.nullTracers muxBearer mempty address From 36e1ac733f54d5c7f52c8fe6d54ad2832261d2fa Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 25 Feb 2026 09:21:31 +0100 Subject: [PATCH 15/54] tx-generator: update to latest Ledger and Network --- .../src/Cardano/Benchmarking/Tracer.hs | 28 ++++++------------- .../Cardano/TxGenerator/ProtocolParameters.hs | 25 +++++++++-------- .../src/Cardano/TxGenerator/Utils.hs | 3 +- bench/tx-generator/tx-generator.cabal | 2 ++ 4 files changed, 26 insertions(+), 32 deletions(-) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs b/bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs index 453a01217d3..c7e27504354 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs @@ -37,6 +37,8 @@ import qualified Cardano.Logging.Types as Net import Cardano.Node.Startup import Cardano.Node.Tracing.NodeInfo () import Ouroboros.Network.IOManager (IOManager) +import qualified Ouroboros.Network.Protocol.TxSubmission2.Type as TxSubmission +import Ouroboros.Network.Tracing () import Control.Exception (SomeException (..)) import Control.Monad (forM, guard) @@ -49,6 +51,8 @@ import Data.Maybe (fromMaybe) import qualified Data.Text as Text import Data.Time.Clock import GHC.Generics +import Network.Mux.Tracing () +import qualified Network.TypedProtocol.Codec as TypedProtocol import Trace.Forward.Forwarding (InitForwardingConfig (..), initForwardingDelayed) import Trace.Forward.Utils.TraceObject @@ -395,30 +399,16 @@ instance MetaTrace NodeToNodeSubmissionTrace where , Namespace [] ["TxList"] ] -instance LogFormatting SendRecvConnect where +instance (Show txid, Show tx) => LogFormatting (TypedProtocol.AnyMessage (TxSubmission.TxSubmission2 txid tx)) where forHuman = Text.pack . show - forMachine _ _ = KeyMap.fromList [ "kind" .= A.String "SendRecvConnect" ] + forMachine _ _ = KeyMap.fromList [ "kind" .= A.String "TxSubmission2" ] -instance MetaTrace SendRecvConnect where - namespaceFor _ = Namespace [] ["ReqIdsBlocking"] +instance MetaTrace (TypedProtocol.AnyMessage (TxSubmission.TxSubmission2 tx a)) where + namespaceFor _ = Namespace [] ["TxSubmission2"] severityFor _ _ = Just Info documentFor _ = Just "" allNamespaces = [ - Namespace [] ["SendRecvConnect"] - ] - -instance LogFormatting SendRecvTxSubmission2 where - forHuman = Text.pack . show - forMachine _ _ = KeyMap.fromList [ "kind" .= A.String "SendRecvTxSubmission2" ] - -instance MetaTrace SendRecvTxSubmission2 where - namespaceFor _ = Namespace [] ["SendRecvTxSubmission2"] - severityFor _ _ = Just Info - - documentFor _ = Just "" - - allNamespaces = [ - Namespace [] ["SendRecvTxSubmission2"] + Namespace [] ["TxSubmission2"] ] diff --git a/bench/tx-generator/src/Cardano/TxGenerator/ProtocolParameters.hs b/bench/tx-generator/src/Cardano/TxGenerator/ProtocolParameters.hs index 2ed26726be7..ede1ccd534a 100644 --- a/bench/tx-generator/src/Cardano/TxGenerator/ProtocolParameters.hs +++ b/bench/tx-generator/src/Cardano/TxGenerator/ProtocolParameters.hs @@ -48,6 +48,7 @@ import qualified Cardano.Ledger.Babbage.Core as Ledger import qualified Cardano.Ledger.BaseTypes as Ledger import qualified Cardano.Ledger.Coin as L import qualified Cardano.Ledger.Plutus.Language as Plutus +import qualified Cardano.Ledger.Compactible as L import Data.Aeson ((.!=), (.:), (.:?), (.=)) import qualified Data.Aeson as Aeson @@ -379,8 +380,8 @@ toShelleyCommonPParams protVer <- mkProtVer protocolParamProtocolVersion let ppCommon = emptyPParams - & ppMinFeeAL .~ protocolParamTxFeePerByte - & ppMinFeeBL .~ protocolParamTxFeeFixed + & ppTxFeePerByteL .~ (CoinPerByte . L.compactCoinOrError $ protocolParamTxFeePerByte) + & ppTxFeeFixedL .~ protocolParamTxFeeFixed & ppMaxBBSizeL .~ fromIntegral protocolParamMaxBlockBodySize & ppMaxTxSizeL .~ fromIntegral protocolParamMaxTxSize & ppMaxBHSizeL .~ fromIntegral protocolParamMaxBlockHeaderSize @@ -457,9 +458,9 @@ toAlonzoCommonPParams & ppPricesL .~ prices & ppMaxTxExUnitsL .~ toAlonzoExUnits maxTxExUnits & ppMaxBlockExUnitsL .~ toAlonzoExUnits maxBlockExUnits - & ppMaxValSizeL .~ maxValueSize - & ppCollateralPercentageL .~ collateralPercent - & ppMaxCollateralInputsL .~ maxCollateralInputs + & ppMaxValSizeL .~ fromIntegral maxValueSize + & ppCollateralPercentageL .~ fromIntegral collateralPercent + & ppMaxCollateralInputsL .~ fromIntegral maxCollateralInputs pure ppAlonzoCommon -- Was removed in "cardano-api" module "Cardano.Api.Internal.ProtocolParameters" @@ -495,7 +496,7 @@ toBabbagePParams requireParam "protocolParamUTxOCostPerByte" Right protocolParamUTxOCostPerByte let ppBabbage = ppAlonzoCommon - & ppCoinsPerUTxOByteL .~ CoinPerByte utxoCostPerByte + & ppCoinsPerUTxOByteL .~ CoinPerByte (L.compactCoinOrError utxoCostPerByte) pure ppBabbage -- Was removed in "cardano-api" module "Cardano.Api.Internal.ProtocolParameters" @@ -531,8 +532,8 @@ fromShelleyCommonPParams pp = , protocolParamMaxBlockHeaderSize = fromIntegral $ pp ^. ppMaxBHSizeL , protocolParamMaxBlockBodySize = fromIntegral $ pp ^. ppMaxBBSizeL , protocolParamMaxTxSize = fromIntegral $ pp ^. ppMaxTxSizeL - , protocolParamTxFeeFixed = pp ^. ppMinFeeBL - , protocolParamTxFeePerByte = pp ^. ppMinFeeAL + , protocolParamTxFeeFixed = pp ^. ppTxFeeFixedL + , protocolParamTxFeePerByte = L.fromCompact . L.unCoinPerByte $ pp ^. ppTxFeePerByteL , protocolParamStakeAddressDeposit = pp ^. ppKeyDepositL , protocolParamStakePoolDeposit = pp ^. ppPoolDepositL , protocolParamMinPoolCost = pp ^. ppMinPoolCostL @@ -579,9 +580,9 @@ fromAlonzoPParams pp = , protocolParamPrices = Just . fromAlonzoPrices $ pp ^. ppPricesL , protocolParamMaxTxExUnits = Just . fromAlonzoExUnits $ pp ^. ppMaxTxExUnitsL , protocolParamMaxBlockExUnits = Just . fromAlonzoExUnits $ pp ^. ppMaxBlockExUnitsL - , protocolParamMaxValueSize = Just $ pp ^. ppMaxValSizeL - , protocolParamCollateralPercent = Just $ pp ^. ppCollateralPercentageL - , protocolParamMaxCollateralInputs = Just $ pp ^. ppMaxCollateralInputsL + , protocolParamMaxValueSize = Just $ fromIntegral (pp ^. ppMaxValSizeL) + , protocolParamCollateralPercent = Just $ fromIntegral (pp ^. ppCollateralPercentageL) + , protocolParamMaxCollateralInputs = Just $ fromIntegral (pp ^. ppMaxCollateralInputsL) } fromExactlyAlonzoPParams @@ -599,7 +600,7 @@ fromBabbagePParams -> ProtocolParameters fromBabbagePParams pp = (fromAlonzoPParams pp) - { protocolParamUTxOCostPerByte = Just . unCoinPerByte $ pp ^. ppCoinsPerUTxOByteL + { protocolParamUTxOCostPerByte = Just . L.fromCompact . unCoinPerByte $ pp ^. ppCoinsPerUTxOByteL , protocolParamDecentralization = Nothing } diff --git a/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs b/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs index 6565dbc1575..d6d5ed65adf 100644 --- a/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs +++ b/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs @@ -18,6 +18,7 @@ import qualified Cardano.Ledger.Coin as L import Cardano.TxGenerator.Types import Data.Maybe (fromJust) +import Data.Maybe.Strict import GHC.Stack @@ -76,7 +77,7 @@ mkTxFee = TxFeeExplicit shelleyBasedEra -- `TxValidityNoUpperBound` with the constraint of `IsShelleyBasedEra`. mkTxValidityUpperBound :: forall era. IsShelleyBasedEra era => SlotNo -> TxValidityUpperBound era mkTxValidityUpperBound slotNo = - TxValidityUpperBound (fromJust $ forEraMaybeEon (cardanoEra @era)) (Just slotNo) + TxValidityUpperBound (fromJust $ forEraMaybeEon (cardanoEra @era)) (SJust slotNo) -- | `mkTxInModeCardano` never uses the `TxInByronSpecial` constructor -- because its type enforces it being a Shelley-based era. diff --git a/bench/tx-generator/tx-generator.cabal b/bench/tx-generator/tx-generator.cabal index a7db05b4d7c..2e0ae8f93a6 100644 --- a/bench/tx-generator/tx-generator.cabal +++ b/bench/tx-generator/tx-generator.cabal @@ -122,6 +122,7 @@ library , cardano-ledger-core , cardano-node , cardano-prelude + , cardano-strict-containers >=0.1 , contra-tracer , cborg >= 0.2.2 && < 0.3 , containers @@ -143,6 +144,7 @@ library , plutus-ledger-api , plutus-tx , random + , typed-protocols ^>= 1.2 , serialise , streaming , cardano-ledger-shelley From 86fd77161820c007747e23239c7eb2d4273b7da0 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 26 Feb 2026 17:57:47 +0100 Subject: [PATCH 16/54] cardano-testnet: adapt to latest ledger - fix blockfrost response types to match alonzo genesis ones --- cardano-testnet/src/Testnet/Blockfrost.hs | 149 ++++++++++-------- .../src/Testnet/Components/Configuration.hs | 4 +- .../src/Testnet/Components/Query.hs | 10 +- .../src/Testnet/Process/Cli/SPO.hs | 2 +- .../Test/Gov/ProposeNewConstitution.hs | 2 +- 5 files changed, 90 insertions(+), 77 deletions(-) diff --git a/cardano-testnet/src/Testnet/Blockfrost.hs b/cardano-testnet/src/Testnet/Blockfrost.hs index be8093d13f6..4895fd1a3fc 100644 --- a/cardano-testnet/src/Testnet/Blockfrost.hs +++ b/cardano-testnet/src/Testnet/Blockfrost.hs @@ -4,6 +4,7 @@ {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -Werror=missing-fields #-} +{-# LANGUAGE NamedFieldPuns #-} module Testnet.Blockfrost ( BlockfrostParams @@ -14,8 +15,7 @@ import Cardano.Ledger.Alonzo.Genesis (AlonzoGenesis (..)) import Cardano.Ledger.Alonzo.PParams (CoinPerWord) import Cardano.Ledger.BaseTypes (EpochInterval, NonNegativeInterval, Nonce, ProtVer (..), UnitInterval, Version) -import Cardano.Ledger.Coin (Coin) -import Cardano.Ledger.Compactible (toCompactPartial) +import Cardano.Ledger.Coin (Coin, CoinPerByte (..), compactCoinOrError) import Cardano.Ledger.Conway.Genesis (ConwayGenesis (..)) import Cardano.Ledger.Conway.PParams (DRepVotingThresholds (..), PoolVotingThresholds (..), UpgradeConwayPParams (..)) @@ -28,25 +28,27 @@ import Cardano.Ledger.Shelley.Genesis (ShelleyGenesis (..)) import Cardano.Ledger.Shelley.PParams (ShelleyPParams (..)) import Control.Applicative ((<|>)) +import Control.Exception.Safe (MonadThrow) import Data.Aeson (FromJSON (..), withObject, (.:)) import qualified Data.Aeson as Aeson import qualified Data.Aeson.Types as Aeson import qualified Data.Map.Strict as Map import Data.Scientific (Scientific) import Data.Word (Word16, Word32) +import GHC.Stack import Numeric.Natural (Natural) import Text.Read (readMaybe) data BlockfrostParams = BlockfrostParams { -- Alonzo parameters bfgCoinsPerUTxOWord :: CoinPerWord - , bfgCollateralPercent :: Natural + , bfgCollateralPercent :: Word16 , bfgMaxBlockExMem :: Natural , bfgMaxBlockExSteps :: Natural - , bfgMaxCollateralInputs :: Natural + , bfgMaxCollateralInputs :: Word16 , bfgMaxTxExMem :: Natural , bfgMaxTxExSteps :: Natural - , bfgMaxValueSize :: Natural + , bfgMaxValueSize :: Word32 , bfgPriceMem :: NonNegativeInterval , bfgPriceSteps :: NonNegativeInterval -- PlutusV1 and PlutusV2 @@ -182,75 +184,87 @@ instance FromJSON BlockfrostParams where Nothing -> Aeson.parseFail $ "Bogus value at key " ++ show k ++ " is neither Number nor String" -- Edit a set of Genesis files with data from Blockfrost parameters -blockfrostToGenesis :: () +blockfrostToGenesis + :: HasCallStack + => MonadThrow m => (ShelleyGenesis, AlonzoGenesis, ConwayGenesis, DijkstraGenesis) -> BlockfrostParams - -> (ShelleyGenesis, AlonzoGenesis, ConwayGenesis, DijkstraGenesis) + -> m (ShelleyGenesis, AlonzoGenesis, ConwayGenesis, DijkstraGenesis) blockfrostToGenesis (shelleyGenesis', alonzoGenesis', conwayGenesis', dijkstraGenesis') BlockfrostParams{..} = - (shelleyGenesis, alonzoGenesis, conwayGenesis, dijkstraGenesis) + (,,,) + <$> shelleyGenesis + <*> alonzoGenesis + <*> conwayGenesis + <*> dijkstraGenesis where -- Alonzo params - alonzoGenesis = alonzoGenesis' - { agCoinsPerUTxOWord = bfgCoinsPerUTxOWord - , agCollateralPercentage = bfgCollateralPercent - , agMaxBlockExUnits = ExUnits - { exUnitsMem = bfgMaxBlockExMem - , exUnitsSteps = bfgMaxBlockExSteps - } - , agMaxCollateralInputs = bfgMaxCollateralInputs - , agMaxTxExUnits = ExUnits - { exUnitsMem = bfgMaxTxExMem - , exUnitsSteps = bfgMaxTxExSteps - } - , agMaxValSize = bfgMaxValueSize - , agPrices = Prices - { prMem = bfgPriceMem - , prSteps = bfgPriceSteps - } - , agCostModels = CostModels.mkCostModels . Map.mapWithKey trimCostModelToInitial $ CostModels.costModelsValid bfgAlonzoCostModels - } + alonzoGenesis = do + v1CostModel <- maybe (error "Testnet.Blockfrost: no PlutusV1 valid cost model in response") (trimCostModelToInitial PlutusV1) + . Map.lookup PlutusV1 $ CostModels.costModelsValid bfgAlonzoCostModels - -- Conway Params - conwayParams = UpgradeConwayPParams - { ucppPoolVotingThresholds = PoolVotingThresholds - { pvtMotionNoConfidence = bfgPVTMotionNoConfidence - , pvtCommitteeNormal = bfgPVTCommitteeNormal - , pvtCommitteeNoConfidence = bfgPVTCommitteeNoConfidence - , pvtHardForkInitiation = bfgPVTHardForkInitiation - , pvtPPSecurityGroup = bfgPVTPPSecurityGroup + pure $ alonzoGenesis' + { agCoinsPerUTxOWord = bfgCoinsPerUTxOWord + , agCollateralPercentage = bfgCollateralPercent + , agMaxBlockExUnits = ExUnits + { exUnitsMem = bfgMaxBlockExMem + , exUnitsSteps = bfgMaxBlockExSteps + } + , agMaxCollateralInputs = bfgMaxCollateralInputs + , agMaxTxExUnits = ExUnits + { exUnitsMem = bfgMaxTxExMem + , exUnitsSteps = bfgMaxTxExSteps + } + , agMaxValSize = bfgMaxValueSize + , agPrices = Prices + { prMem = bfgPriceMem + , prSteps = bfgPriceSteps + } + , agPlutusV1CostModel = v1CostModel + -- CostModels.mkCostModels . Map.mapWithKey trimCostModelToInitial . $ CostModels.costModelsValid bfgAlonzoCostModels } - , ucppDRepVotingThresholds = DRepVotingThresholds - { dvtMotionNoConfidence = bfgDVTMotionNoConfidence - , dvtCommitteeNormal = bfgDVTCommitteeNormal - , dvtCommitteeNoConfidence = bfgDVTCommitteeNoConfidence - , dvtUpdateToConstitution = bfgDVTUpdateToConstitution - , dvtHardForkInitiation = bfgDVTHardForkInitiation - , dvtPPNetworkGroup = bfgDVTPPNetworkGroup - , dvtPPEconomicGroup = bfgDVTPPEconomicGroup - , dvtPPTechnicalGroup = bfgDVTPPTechnicalGroup - , dvtPPGovGroup = bfgDVTPPGovGroup - , dvtTreasuryWithdrawal = bfgDVTTreasuryWithdrawal - } - , ucppCommitteeMinSize = bfgCommitteeMinSize - , ucppCommitteeMaxTermLength = bfgCommitteeMaxTermLength - , ucppGovActionLifetime = bfgGovActionLifetime - , ucppGovActionDeposit = bfgGovActionDeposit - , ucppDRepDeposit = bfgDRepDeposit - , ucppDRepActivity = bfgDRepActivity - , ucppMinFeeRefScriptCostPerByte = bfgMinFeeRevScriptCostPerByte - , ucppPlutusV3CostModel = trimCostModelToInitial PlutusV3 bfgConwayCostModel - } - conwayGenesis = conwayGenesis'{cgUpgradePParams=conwayParams} + + conwayGenesis = do + ucppPlutusV3CostModel <- trimCostModelToInitial PlutusV3 bfgConwayCostModel + let conwayParams = UpgradeConwayPParams + { ucppPoolVotingThresholds = PoolVotingThresholds + { pvtMotionNoConfidence = bfgPVTMotionNoConfidence + , pvtCommitteeNormal = bfgPVTCommitteeNormal + , pvtCommitteeNoConfidence = bfgPVTCommitteeNoConfidence + , pvtHardForkInitiation = bfgPVTHardForkInitiation + , pvtPPSecurityGroup = bfgPVTPPSecurityGroup + } + , ucppDRepVotingThresholds = DRepVotingThresholds + { dvtMotionNoConfidence = bfgDVTMotionNoConfidence + , dvtCommitteeNormal = bfgDVTCommitteeNormal + , dvtCommitteeNoConfidence = bfgDVTCommitteeNoConfidence + , dvtUpdateToConstitution = bfgDVTUpdateToConstitution + , dvtHardForkInitiation = bfgDVTHardForkInitiation + , dvtPPNetworkGroup = bfgDVTPPNetworkGroup + , dvtPPEconomicGroup = bfgDVTPPEconomicGroup + , dvtPPTechnicalGroup = bfgDVTPPTechnicalGroup + , dvtPPGovGroup = bfgDVTPPGovGroup + , dvtTreasuryWithdrawal = bfgDVTTreasuryWithdrawal + } + , ucppCommitteeMinSize = bfgCommitteeMinSize + , ucppCommitteeMaxTermLength = bfgCommitteeMaxTermLength + , ucppGovActionLifetime = bfgGovActionLifetime + , ucppGovActionDeposit = bfgGovActionDeposit + , ucppDRepDeposit = bfgDRepDeposit + , ucppDRepActivity = bfgDRepActivity + , ucppMinFeeRefScriptCostPerByte = bfgMinFeeRevScriptCostPerByte + , ucppPlutusV3CostModel + } + pure conwayGenesis'{cgUpgradePParams=conwayParams} -- Shelley params shelleyParams = PParams $ ShelleyPParams - { sppMinFeeA = bfgMinFeeA - , sppMinFeeB = bfgMinFeeB + { sppTxFeePerByte = CoinPerByte $ compactCoinOrError bfgMinFeeA + , sppTxFeeFixed = compactCoinOrError bfgMinFeeB , sppMaxBBSize = bfgMaxBlockSize , sppMaxTxSize = bfgMaxTxSize , sppMaxBHSize = bfgMaxBlockHeaderSize - , sppKeyDeposit = bfgKeyDeposit - , sppPoolDeposit = toCompactPartial bfgPoolDeposit + , sppKeyDeposit = compactCoinOrError bfgKeyDeposit + , sppPoolDeposit = compactCoinOrError bfgPoolDeposit , sppEMax = bfgEMax , sppNOpt = bfgNOpt , sppA0 = bfgA0 @@ -262,21 +276,20 @@ blockfrostToGenesis (shelleyGenesis', alonzoGenesis', conwayGenesis', dijkstraGe { pvMajor = bfgProtocolMajorVer , pvMinor = bfgProtocolMinorVer } - , sppMinUTxOValue = bfgMinUTxO - , sppMinPoolCost = bfgMinPoolCost + , sppMinUTxOValue = compactCoinOrError bfgMinUTxO + , sppMinPoolCost = compactCoinOrError bfgMinPoolCost } - shelleyGenesis = shelleyGenesis'{sgProtocolParams=shelleyParams} + shelleyGenesis = pure shelleyGenesis'{sgProtocolParams=shelleyParams} -- TODO dijkstra: there are no dijkstra params on blockfrost - dijkstraGenesis = dijkstraGenesis' + dijkstraGenesis = pure dijkstraGenesis' -- | Trims cost model to the initial number of parameters. The cost models in geneses can't -- have more parameters than the initial number. -trimCostModelToInitial :: Language -> CostModel -> CostModel +trimCostModelToInitial :: HasCallStack => MonadThrow m => Language -> CostModel -> m CostModel trimCostModelToInitial lang cm = do let paramsCount = CostModels.costModelInitParamCount lang - either (error . ("Testnet.Blockfrost: Cost model trimming failure: " <>) . show) id + either (error . ("Testnet.Blockfrost: Cost model trimming failure: " <>) . show) pure . CostModels.mkCostModel lang . take paramsCount $ CostModels.getCostModelParams cm - diff --git a/cardano-testnet/src/Testnet/Components/Configuration.hs b/cardano-testnet/src/Testnet/Components/Configuration.hs index 1e5bd4f939f..22eb39bf314 100644 --- a/cardano-testnet/src/Testnet/Components/Configuration.hs +++ b/cardano-testnet/src/Testnet/Components/Configuration.hs @@ -267,9 +267,9 @@ resolveOnChainParams onChainParams geneses = case onChainParams of OnChainParamsFile file -> do eParams <- eitherDecode <$> liftIOAnnotated (LBS.readFile file) case eParams of - Right params -> pure $ blockfrostToGenesis geneses params + Right params -> blockfrostToGenesis geneses params Left err -> throwM $ BlockfrostParamsDecodeError file err OnChainParamsMainnet -> do mainnetParams <- liftIOAnnotated $ HTTP.getResponseBody <$> HTTP.httpJSON mainnetParamsRequest - pure $ blockfrostToGenesis geneses mainnetParams + blockfrostToGenesis geneses mainnetParams diff --git a/cardano-testnet/src/Testnet/Components/Query.hs b/cardano-testnet/src/Testnet/Components/Query.hs index 3313798edf2..151480b78a3 100644 --- a/cardano-testnet/src/Testnet/Components/Query.hs +++ b/cardano-testnet/src/Testnet/Components/Query.hs @@ -350,7 +350,7 @@ findLargestUtxoWithAddress epochStateView sbe address = withFrozenCallStack $ do . listToMaybe $ sortOn (\(_, TxOut _ txOutValue _ _) -> Down $ txOutValueToLovelace txOutValue) utxos --- | Retrieve the largest utxo with a multi-asset +-- | Retrieve the largest utxo with a multi-asset findLargestMultiAssetUtxoWithAddress :: HasCallStack => MonadAssertion m @@ -363,11 +363,11 @@ findLargestMultiAssetUtxoWithAddress findLargestMultiAssetUtxoWithAddress epochStateView sbe address = withFrozenCallStack $ do utxos <- toList <$> findUtxosWithAddress epochStateView sbe address let sortedUTxOs = sortOn (\(_, TxOut _ txOutValue _ _) -> Down $ txOutValueToLovelace txOutValue) utxos - utxosWithMas = filter (\(_,TxOut _ txOutValue _ _) -> isMultiAssetPresent txOutValue) sortedUTxOs + utxosWithMas = filter (\(_,TxOut _ txOutValue _ _) -> isMultiAssetPresent txOutValue) sortedUTxOs pure $ listToMaybe utxosWithMas -isMultiAssetPresent :: TxOutValue era -> Bool -isMultiAssetPresent v = +isMultiAssetPresent :: TxOutValue era -> Bool +isMultiAssetPresent v = Map.size (valueToPolicyAssets $ txOutValueToValue v) > 0 @@ -421,7 +421,7 @@ checkDRepState => MonadTest m => EpochStateView -> ShelleyBasedEra ConwayEra -- ^ The era in which the test runs - -> (Map (Credential 'DRepRole) + -> (Map (Credential DRepRole) DRepState -> Maybe a) -- ^ A function that checks whether the DRep state is correct or up to date -- and potentially inspects it. diff --git a/cardano-testnet/src/Testnet/Process/Cli/SPO.hs b/cardano-testnet/src/Testnet/Process/Cli/SPO.hs index a5856dc6fc2..703ff345b65 100644 --- a/cardano-testnet/src/Testnet/Process/Cli/SPO.hs +++ b/cardano-testnet/src/Testnet/Process/Cli/SPO.hs @@ -172,7 +172,7 @@ checkStakeKeyRegistered tempAbsP nodeConfigFile sPath terminationEpoch execConfi accountState ^. L.balanceAccountStateL . to L.fromCompact -toApiStakeAddress :: L.Network -> L.Credential 'L.Staking -> StakeAddress +toApiStakeAddress :: L.Network -> L.Credential L.Staking -> StakeAddress toApiStakeAddress = StakeAddress diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs index 0ba47e4853d..d9385fe5db6 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs @@ -363,7 +363,7 @@ filterRatificationState c guardRailScriptHash (AnyNewEpochState sbe newEpochStat constitution = rState ^. Ledger.rsEnactStateL . Ledger.ensConstitutionL constitutionAnchorHash = Ledger.anchorDataHash $ Ledger.constitutionAnchor constitution L.ScriptHash constitutionScriptHash = fromMaybe (error "filterRatificationState: constitution does not have a guardrail script") - $ strictMaybeToMaybe $ constitution ^. Ledger.constitutionScriptL + $ strictMaybeToMaybe $ constitution ^. Ledger.constitutionGuardrailsScriptHashL Text.pack c == renderSafeHashAsHex constitutionAnchorHash && L.hashToTextAsHex constitutionScriptHash == Text.pack guardRailScriptHash ) From 2de4bf1caed110c377e10531378fc89e7bf29348 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Tue, 3 Mar 2026 19:00:57 -0600 Subject: [PATCH 17/54] nix: don't generate Haddocks for cardano-diffusion --- nix/haskell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/haskell.nix b/nix/haskell.nix index ae1593eb1ec..be2cab132e4 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -140,6 +140,7 @@ let packages.cardano-protocol-tpraos.components.library.doHaddock = false; packages.ouroboros-consensus.components.library.doHaddock = false; packages.ouroboros-network.components.library.doHaddock = false; # Currently broken + packages.cardano-diffusion.components.library.doHaddock = false; # Currently broken packages.plutus-ledger-api.components.library.doHaddock = false; }) ({ lib, pkgs, ...}: lib.mkIf (pkgs.stdenv.hostPlatform.isWindows) { From 8c1ba86705d66ce9b41fcd38f7b4a24d602b5fe3 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 4 Mar 2026 13:26:40 +0100 Subject: [PATCH 18/54] plutus-scripts-bench: Bump plutus to 1.59 --- bench/plutus-scripts-bench/plutus-scripts-bench.cabal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bench/plutus-scripts-bench/plutus-scripts-bench.cabal b/bench/plutus-scripts-bench/plutus-scripts-bench.cabal index 3815b0a3be1..e61ae793b99 100644 --- a/bench/plutus-scripts-bench/plutus-scripts-bench.cabal +++ b/bench/plutus-scripts-bench/plutus-scripts-bench.cabal @@ -83,9 +83,9 @@ library -------------------------- build-depends: , cardano-api ^>=10.24.1 - , plutus-ledger-api ^>=1.58 - , plutus-tx ^>=1.58 - , plutus-tx-plugin ^>=1.58 + , plutus-ledger-api ^>=1.59 + , plutus-tx ^>=1.59 + , plutus-tx-plugin ^>=1.59 ------------------------ -- Non-IOG dependencies From 51b8accf3d909203df95e88063b202efc5328ee3 Mon Sep 17 00:00:00 2001 From: Fraser Murray Date: Thu, 26 Jun 2025 13:20:20 +0100 Subject: [PATCH 19/54] [wip] cardano-node: add kes-agent support Co-authored-by: Fraser Murray --- cardano-node/cardano-node.cabal | 2 +- cardano-node/src/Cardano/Node/Parsers.hs | 30 ++++++++----- .../src/Cardano/Node/Protocol/Shelley.hs | 45 ++++++++++++------- cardano-node/src/Cardano/Node/Types.hs | 12 +++-- 4 files changed, 57 insertions(+), 32 deletions(-) diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 12e9dce2fac..1b0303bb86c 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -170,7 +170,7 @@ library , hostname , io-classes:{io-classes,strict-stm,si-timers} ^>= 1.8 , iohk-monitoring ^>= 0.2 - , kes-agent ^>=1.1 + , kes-agent ^>=1.2 , microlens , mmap , network-mux diff --git a/cardano-node/src/Cardano/Node/Parsers.hs b/cardano-node/src/Cardano/Node/Parsers.hs index bea9fe5b95c..5cb756c4858 100644 --- a/cardano-node/src/Cardano/Node/Parsers.hs +++ b/cardano-node/src/Cardano/Node/Parsers.hs @@ -64,7 +64,7 @@ nodeRunParser = do -- Protocol files byronCertFile <- optional parseByronDelegationCert byronKeyFile <- optional parseByronSigningKey - shelleyKESFile <- optional parseKesKeyFilePath + shelleyKESSource <- optional parseKesSourceFilePath shelleyVRFFile <- optional parseVrfKeyFilePath shelleyCertFile <- optional parseOperationalCertFilePath shelleyBulkCredsFile <- optional parseBulkCredsFilePath @@ -99,7 +99,7 @@ nodeRunParser = do , pncProtocolFiles = Last $ Just ProtocolFilepaths { byronCertFile , byronKeyFile - , shelleyKESFile + , shelleyKESSource , shelleyVRFFile , shelleyCertFile , shelleyBulkCredsFile @@ -382,15 +382,23 @@ parseBulkCredsFilePath = <> completer (bashCompleter "file") ) ---TODO: pass the current KES evolution, not the KES_0 -parseKesKeyFilePath :: Parser FilePath -parseKesKeyFilePath = - strOption - ( long "shelley-kes-key" - <> metavar "FILEPATH" - <> help "Path to the KES signing key." - <> completer (bashCompleter "file") - ) +parseKesSourceFilePath :: Parser KESSource +parseKesSourceFilePath = asum + [ KESKeyFilePath <$> + strOption + ( long "shelley-kes-key" + <> metavar "FILEPATH" + <> help "Path to the KES signing key." + <> completer (bashCompleter "file") + ) + , KESAgentSocketPath <$> + strOption + ( long "shelley-kes-agent-socket" + <> metavar "SOCKET_FILEPATH" + <> help "Path to the KES Agent socket" + <> completer (bashCompleter "file") + ) + ] parseVrfKeyFilePath :: Parser FilePath parseVrfKeyFilePath = diff --git a/cardano-node/src/Cardano/Node/Protocol/Shelley.hs b/cardano-node/src/Cardano/Node/Protocol/Shelley.hs index e52d6f39324..5cca92f4fd5 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Shelley.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Shelley.hs @@ -167,27 +167,38 @@ readLeaderCredentialsSingleton ProtocolFilepaths { shelleyCertFile = Nothing, shelleyVRFFile = Nothing, - shelleyKESFile = Nothing + shelleyKESSource = Nothing } = pure [] -- Or to supply all of the files readLeaderCredentialsSingleton ProtocolFilepaths { shelleyCertFile = Just opCertFile, shelleyVRFFile = Just vrfFile, - shelleyKESFile = Just kesFile + shelleyKESSource = Just kesSource } = do vrfSKey <- firstExceptT FileError (newExceptT $ readFileTextEnvelope (File vrfFile)) - (opCert, kesSKey) <- opCertKesKeyCheck (File kesFile) (File opCertFile) + (credentialsSource, vkey) <- case kesSource of + KESKeyFilePath kesFile -> do + (OperationalCertificate opCert vkey, KesSigningKey kesKey) <- + opCertKesKeyCheck (File kesFile) (File opCertFile) + pure (PraosCredentialsUnsound opCert kesKey, vkey) - return [mkPraosLeaderCredentials opCert vrfSKey kesSKey] + -- TODO: minor yikes: when we're using an agent, we don't check that the + -- opcert and the key provided by the KES agent match, like we do when + -- the key is provided in a file on the command line + KESAgentSocketPath socketFile -> do + OperationalCertificate _ vkey <- firstExceptT FileError $ newExceptT $ readFileTextEnvelope $ File opCertFile + pure (PraosCredentialsAgent socketFile, vkey) + + return [mkPraosLeaderCredentials credentialsSource vkey vrfSKey] -- But not OK to supply some of the files without the others. readLeaderCredentialsSingleton ProtocolFilepaths {shelleyCertFile = Nothing} = left OCertNotSpecified readLeaderCredentialsSingleton ProtocolFilepaths {shelleyVRFFile = Nothing} = left VRFKeyNotSpecified -readLeaderCredentialsSingleton ProtocolFilepaths {shelleyKESFile = Nothing} = +readLeaderCredentialsSingleton ProtocolFilepaths {shelleyKESSource = Nothing} = left KESKeyNotSpecified opCertKesKeyCheck @@ -227,9 +238,9 @@ readLeaderCredentialsBulk ProtocolFilepaths { shelleyBulkCredsFile = mfp } = -> ExceptT PraosLeaderCredentialsError IO (ShelleyLeaderCredentials StandardCrypto) parseShelleyCredentials ShelleyCredentials { scCert, scVrf, scKes } = do mkPraosLeaderCredentials - <$> parseEnvelope scCert - <*> parseEnvelope scVrf - <*> parseEnvelope scKes + <$> undefined scCert -- parseEnvelope scCert + <*> undefined scVrf -- parseEnvelope scVrf + <*> undefined scKes -- parseEnvelope scKes readBulkFile :: Maybe FilePath @@ -251,29 +262,29 @@ readLeaderCredentialsBulk ProtocolFilepaths { shelleyBulkCredsFile = mfp } = (teKes, loc "kes") mkPraosLeaderCredentials :: - OperationalCertificate + PraosCredentialsSource StandardCrypto + -> VerificationKey StakePoolKey -> SigningKey VrfKey - -> SigningKey KesKey -> ShelleyLeaderCredentials StandardCrypto mkPraosLeaderCredentials - (OperationalCertificate opcert (StakePoolVerificationKey vkey)) - (VrfSigningKey vrfKey) - (KesSigningKey kesKey) = + credentialsSource + (StakePoolVerificationKey vkey) + (VrfSigningKey vrfKey) = ShelleyLeaderCredentials { shelleyLeaderCredentialsCanBeLeader = PraosCanBeLeader { + praosCanBeLeaderCredentialsSource = credentialsSource, praosCanBeLeaderColdVerKey = coerceKeyRole vkey, - praosCanBeLeaderSignKeyVRF = vrfKey, - praosCanBeLeaderCredentialsSource = PraosCredentialsUnsound opcert kesKey + praosCanBeLeaderSignKeyVRF = vrfKey }, shelleyLeaderCredentialsLabel = "Shelley" } -parseEnvelope :: +_parseEnvelope :: HasTextEnvelope a => (TextEnvelope, String) -> ExceptT PraosLeaderCredentialsError IO a -parseEnvelope (te, loc) = +_parseEnvelope (te, loc) = firstExceptT (FileError . Api.FileError loc) . hoistEither $ deserialiseFromTextEnvelope te diff --git a/cardano-node/src/Cardano/Node/Types.hs b/cardano-node/src/Cardano/Node/Types.hs index 240a8f4def1..3a592fbd8d7 100644 --- a/cardano-node/src/Cardano/Node/Types.hs +++ b/cardano-node/src/Cardano/Node/Types.hs @@ -16,6 +16,7 @@ module Cardano.Node.Types , GenesisFile(..) , PeerSnapshotFile (..) , CheckpointsFile(..) + , KESSource(..) , ProtocolFilepaths (..) , hasProtocolFile , GenesisHash(..) @@ -166,11 +167,16 @@ class AdjustFilePaths a where adjustFilePaths :: (FilePath -> FilePath) -> a -> a +data KESSource + = KESKeyFilePath FilePath + | KESAgentSocketPath FilePath + deriving (Eq, Show) + data ProtocolFilepaths = ProtocolFilepaths { byronCertFile :: !(Maybe FilePath) , byronKeyFile :: !(Maybe FilePath) - , shelleyKESFile :: !(Maybe FilePath) + , shelleyKESSource :: !(Maybe KESSource) , shelleyVRFFile :: !(Maybe FilePath) , shelleyCertFile :: !(Maybe FilePath) , shelleyBulkCredsFile :: !(Maybe FilePath) @@ -183,14 +189,14 @@ hasProtocolFile :: ProtocolFilepaths -> Bool hasProtocolFile ProtocolFilepaths { byronCertFile, byronKeyFile, - shelleyKESFile, + shelleyKESSource, shelleyVRFFile, shelleyCertFile, shelleyBulkCredsFile } = isJust byronCertFile || isJust byronKeyFile - || isJust shelleyKESFile + || isJust shelleyKESSource || isJust shelleyVRFFile || isJust shelleyCertFile || isJust shelleyBulkCredsFile From 6f6f5a85bb2a921ffcfb73da0044741c83594616 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 10 Mar 2026 15:33:04 +0100 Subject: [PATCH 20/54] [wip] kes-agent: work on HasTextEnvelope TODOs --- .../src/Cardano/Node/Protocol/Shelley.hs | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Protocol/Shelley.hs b/cardano-node/src/Cardano/Node/Protocol/Shelley.hs index 5cca92f4fd5..fcde9c7d6e0 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Shelley.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Shelley.hs @@ -1,9 +1,13 @@ +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} +-- TODO(10.7): remove once the HasTextEnvelope instance is in the right place +{-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Node.Protocol.Shelley ( mkSomeConsensusProtocolShelley @@ -30,13 +34,14 @@ import qualified Cardano.Crypto.Hash.Class as Crypto import Cardano.Ledger.BaseTypes (ProtVer (..), natVersion) import Cardano.Ledger.Keys (coerceKeyRole) import qualified Cardano.Ledger.Shelley.Genesis as Shelley +import qualified Cardano.Crypto.KES.Class as Crypto import Cardano.Node.Protocol.Types import Cardano.Node.Tracing.Era.HardFork () import Cardano.Node.Tracing.Era.Shelley () import Cardano.Node.Tracing.Formatting () import Cardano.Node.Tracing.Tracers.ChainDB () import Cardano.Node.Types -import Cardano.Protocol.Crypto (StandardCrypto) +import Cardano.Protocol.Crypto (StandardCrypto, KES) import Cardano.Tracing.OrphanInstances.HardFork () import Cardano.Tracing.OrphanInstances.Shelley () import qualified Ouroboros.Consensus.Cardano as Consensus @@ -45,6 +50,7 @@ import Ouroboros.Consensus.Shelley.Node (Nonce (..), ProtocolParamsShe ShelleyLeaderCredentials (..)) import Ouroboros.Consensus.HardFork.Combinator.AcrossEras () +import Data.String (IsString (..)) import Control.Exception (IOException) import Control.Monad import qualified Data.Aeson as Aeson @@ -227,6 +233,26 @@ data ShelleyCredentials , scKes :: (TextEnvelope, FilePath) } +instance HasTypeProxy (PraosCredentialsSource StandardCrypto) where + data AsType (PraosCredentialsSource StandardCrypto) = AsPraosCredentialsSource + proxyToAsType _ = AsPraosCredentialsSource + +instance ToCBOR (PraosCredentialsSource StandardCrypto) where + toCBOR = \case + PraosCredentialsUnsound ocert kesKey -> toCBOR (ocert, kesKey) + PraosCredentialsAgent _path -> + error "PraosCredentialsAgent cannot be serialized to CBOR" +instance FromCBOR (PraosCredentialsSource StandardCrypto) where + fromCBOR = do + (ocert, kesKey) <- fromCBOR + pure $ PraosCredentialsUnsound ocert kesKey +instance SerialiseAsCBOR (PraosCredentialsSource StandardCrypto) + +instance HasTextEnvelope (PraosCredentialsSource StandardCrypto) where + textEnvelopeType _ = + "PraosCredentialsSource_" + <> fromString (Crypto.algorithmNameKES (Proxy @(KES StandardCrypto))) + readLeaderCredentialsBulk :: ProtocolFilepaths -> ExceptT PraosLeaderCredentialsError IO [ShelleyLeaderCredentials StandardCrypto] @@ -238,9 +264,9 @@ readLeaderCredentialsBulk ProtocolFilepaths { shelleyBulkCredsFile = mfp } = -> ExceptT PraosLeaderCredentialsError IO (ShelleyLeaderCredentials StandardCrypto) parseShelleyCredentials ShelleyCredentials { scCert, scVrf, scKes } = do mkPraosLeaderCredentials - <$> undefined scCert -- parseEnvelope scCert - <*> undefined scVrf -- parseEnvelope scVrf - <*> undefined scKes -- parseEnvelope scKes + <$> parseEnvelope scCert + <*> parseEnvelope scVrf + <*> parseEnvelope scKes readBulkFile :: Maybe FilePath @@ -280,11 +306,11 @@ mkPraosLeaderCredentials shelleyLeaderCredentialsLabel = "Shelley" } -_parseEnvelope :: +parseEnvelope :: HasTextEnvelope a => (TextEnvelope, String) -> ExceptT PraosLeaderCredentialsError IO a -_parseEnvelope (te, loc) = +parseEnvelope (te, loc) = firstExceptT (FileError . Api.FileError loc) . hoistEither $ deserialiseFromTextEnvelope te From baf45b25cf75913da1009390b53a6c7bfa785463 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Fri, 28 Nov 2025 15:11:25 +0100 Subject: [PATCH 21/54] kes-agent: fix compilation of tx-generator --- .../tx-generator/src/Cardano/TxGenerator/Setup/NodeConfig.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/tx-generator/src/Cardano/TxGenerator/Setup/NodeConfig.hs b/bench/tx-generator/src/Cardano/TxGenerator/Setup/NodeConfig.hs index bb1e80d8751..2c1b7137f80 100644 --- a/bench/tx-generator/src/Cardano/TxGenerator/Setup/NodeConfig.hs +++ b/bench/tx-generator/src/Cardano/TxGenerator/Setup/NodeConfig.hs @@ -17,7 +17,7 @@ import Cardano.Node.Protocol.Cardano import Cardano.Node.Protocol.Types (SomeConsensusProtocol (..)) import Cardano.Node.Types (ConfigYamlFilePath (..), GenesisFile, NodeProtocolConfiguration (..), NodeShelleyProtocolConfiguration (..), - ProtocolFilepaths (..)) + ProtocolFilepaths (..), KESSource(..)) import Cardano.TxGenerator.Types import qualified Ouroboros.Consensus.Cardano.Node as Consensus @@ -70,7 +70,7 @@ mkNodeConfig configFp_ ProtocolFilepaths { byronCertFile = Just "" , byronKeyFile = Just "" - , shelleyKESFile = Just "" + , shelleyKESSource = Just (KESKeyFilePath "") , shelleyVRFFile = Just "" , shelleyCertFile = Just "" , shelleyBulkCredsFile = Just "" From d18ee9f609caa15c397574d05e71be11403d0b1f Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 2 Dec 2025 14:09:22 +0100 Subject: [PATCH 22/54] kes-agent: run kes-agent in cardano-testnet Allow testing block production with kes-agent via cardano-testnet --use-kes-agent --- cardano-testnet/src/Parsers/Cardano.hs | 5 + .../src/Testnet/Components/Configuration.hs | 2 +- cardano-testnet/src/Testnet/Process/Run.hs | 42 ++- cardano-testnet/src/Testnet/Runtime.hs | 240 ++++++++++++++++-- cardano-testnet/src/Testnet/Start/Cardano.hs | 32 ++- cardano-testnet/src/Testnet/Start/Types.hs | 11 +- cardano-testnet/src/Testnet/Types.hs | 13 +- 7 files changed, 310 insertions(+), 35 deletions(-) diff --git a/cardano-testnet/src/Parsers/Cardano.hs b/cardano-testnet/src/Parsers/Cardano.hs index 12dc8f77e85..cde14d1a37f 100644 --- a/cardano-testnet/src/Parsers/Cardano.hs +++ b/cardano-testnet/src/Parsers/Cardano.hs @@ -82,6 +82,11 @@ pCardanoTestnetCliOptions = CardanoTestnetOptions <> OA.help "Directory where to store files, sockets, and so on. It is created if it doesn't exist. If unset, a temporary directory is used." <> OA.metavar "DIRECTORY" ))) + <*> OA.flag UseKESKeyFile UseKESSocket + ( OA.long "use-kes-agent" + <> OA.help "Get Praos block forging credentials from kes-agent via the default socket path" + <> OA.showDefault + ) pTestnetNodeOptions :: Parser (NonEmpty NodeOption) pTestnetNodeOptions = diff --git a/cardano-testnet/src/Testnet/Components/Configuration.hs b/cardano-testnet/src/Testnet/Components/Configuration.hs index 22eb39bf314..7cf7e169954 100644 --- a/cardano-testnet/src/Testnet/Components/Configuration.hs +++ b/cardano-testnet/src/Testnet/Components/Configuration.hs @@ -120,7 +120,7 @@ getShelleyGenesisHash path key = do -- | For an unknown reason, CLI commands are a lot slower on Windows than on Linux and -- MacOS. We need to allow a lot more time to set up a testnet. -startTimeOffsetSeconds :: DTC.NominalDiffTime +startTimeOffsetSeconds :: Int startTimeOffsetSeconds = if OS.isWin32 then 90 else 15 -- | A start time and 'ShelleyGenesis' value that are fit to pass to 'cardanoTestnet' diff --git a/cardano-testnet/src/Testnet/Process/Run.hs b/cardano-testnet/src/Testnet/Process/Run.hs index c03a8c02efc..2f2213c63d7 100644 --- a/cardano-testnet/src/Testnet/Process/Run.hs +++ b/cardano-testnet/src/Testnet/Process/Run.hs @@ -9,9 +9,12 @@ module Testnet.Process.Run , execCreateScriptContext , execCreateScriptContext' , execCliStdoutToJson + , execKESAgentControl + , execKESAgentControl_ , initiateProcess , procCli , procNode + , procKESAgent , procSubmitApi , procChairman , mkExecConfig @@ -145,7 +148,43 @@ procNode -- ^ Arguments to the CLI command -> m CreateProcess -- ^ Captured stdout -procNode = GHC.withFrozenCallStack $ H.procFlex "cardano-node" "CARDANO_NODE" +procNode args = GHC.withFrozenCallStack $ do + process <- H.procFlex "cardano-node" "CARDANO_NODE" args + H.annotate . ("━━━━ command ━━━━\n" <>)$ + case IO.cmdspec process of + IO.ShellCommand cmd -> cmd + IO.RawCommand cmd cmdArgs -> cmd <> " " <> unwords cmdArgs + pure process + +-- | Create a 'CreateProcess' describing how to start the kes-agent process +-- and an argument list. +procKESAgent + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => [String] + -- ^ Arguments to the CLI command + -> m CreateProcess + -- ^ Captured stdout +procKESAgent args = GHC.withFrozenCallStack $ do + process <- H.procFlex "kes-agent" "KES_AGENT" args + H.annotate . ("━━━━ command ━━━━\n" <>)$ + case IO.cmdspec process of + IO.ShellCommand cmd -> cmd + IO.RawCommand cmd cmdArgs -> cmd <> " " <> unwords cmdArgs + pure process + +-- | Run kes-agent-control, returning the stdout +execKESAgentControl + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => [String] + -> m String +execKESAgentControl = GHC.withFrozenCallStack $ H.execFlex "kes-agent-control" "KES_AGENT_CONTROL" + +-- | Run kes-agent-control, discarding return value +execKESAgentControl_ + :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack) + => [String] + -> m () +execKESAgentControl_ = GHC.withFrozenCallStack $ void . execKESAgentControl -- | Create a 'CreateProcess' describing how to start the cardano-submit-api process -- and an argument list. @@ -240,4 +279,3 @@ resourceAndIOExceptionHandlers :: Applicative m => [Handler m ProcessError] resourceAndIOExceptionHandlers = [ Handler $ pure . ProcessIOException , Handler $ pure . ResourceException ] - diff --git a/cardano-testnet/src/Testnet/Runtime.hs b/cardano-testnet/src/Testnet/Runtime.hs index 1ef96d658e3..2b3ab34fe3b 100644 --- a/cardano-testnet/src/Testnet/Runtime.hs +++ b/cardano-testnet/src/Testnet/Runtime.hs @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} @@ -12,6 +13,8 @@ module Testnet.Runtime ( startNode + , initAndStartKESAgent + , TestnetKESAgentArgs(..) , startLedgerNewEpochStateLogging , NodeStartFailure (..) -- Exposed for testing purposes @@ -54,7 +57,7 @@ import qualified Testnet.Ping as Ping import Testnet.Process.Run (ProcessError (..), initiateProcess) import Testnet.Process.RunIO (liftIOAnnotated, procNode) import Testnet.Types (TestnetNode (..), TestnetRuntime (configurationFile), - showIpv4Address, testnetSprockets) + showIpv4Address, testnetSprockets, TestnetKESAgent(..)) import Hedgehog.Extras.Stock.IO.Network.Sprocket (Sprocket (..)) import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as H @@ -228,33 +231,214 @@ startNode tp node ipv4 port _testnetMagic nodeCmd = GHC.withFrozenCallStack $ do liftIOAnnotated $ mapM_ IO.hClose handles throwE e - -- Sometimes even when we close the files manually, the operating system still holds the lock for some - -- reason. This is most prominent on MacOS. Therefore, as a last resort, instead of - -- failing the node startup procedure, we simply try to use a different file name for the logs, with - -- the suffix @-n.log@ where @n@ is an attempt number. - retryOpenFile :: MonadIO m - => MonadCatch m - => FilePath -- ^ path we're trying to open - -> IO.IOMode - -> ExceptT NodeStartFailure m IO.Handle - retryOpenFile fullPath mode = go 0 - where - go :: MonadIO m - => MonadCatch m - => Int - -> ExceptT NodeStartFailure m IO.Handle - go n = do - let (path, extension) = splitExtension fullPath - path' = if n > 0 - then path <> "-" <> show n <> extension - else fullPath - r <- fmap (first FileRelatedFailure) . try . liftIOAnnotated $ IO.openFile path' mode - case r of - Right h -> pure h - Left e - -- give up after 1000 attempts - | n >= 1000 -> throwE e - | otherwise -> go (n + 1) +-- | Start a kes-agent for a particular node +startKESAgent + :: HasCallStack + => MonadResource m + => MonadCatch m + => MonadFail m + => MonadTest m + => TmpAbsolutePath + -- ^ The temporary absolute path + -> String + -- ^ The name of the node + -> [String] + -- ^ additional CLI options for 'kes-agent` + -> ExceptT NodeStartFailure m TestnetKESAgent +startKESAgent tp node args = GHC.withFrozenCallStack $ do + let tempBaseAbsPath = makeTmpBaseAbsPath tp + socketDir = makeSocketDir tp + logDir = makeLogDir tp + kesAgentStr= "kes-agent" + + liftIO $ createDirectoryIfMissingNew_ $ logDir node kesAgentStr + void . liftIO $ createSubdirectoryIfMissingNew tempBaseAbsPath (socketDir node kesAgentStr) + + let nodeStdoutFile = logDir node kesAgentStr "stdout.log" + nodeStderrFile = logDir node kesAgentStr "stderr.log" + nodePidFile = logDir node kesAgentStr (node <> kesAgentStr <> ".pid") + serviceSocketRelPath = socketDir node kesAgentStr "service.sock" + controlSocketRelPath = socketDir node kesAgentStr "control.sock" + serviceSprocket = Sprocket tempBaseAbsPath serviceSocketRelPath + controlSprocket = Sprocket tempBaseAbsPath controlSocketRelPath + + hNodeStdout <- retryOpenFile nodeStdoutFile IO.WriteMode + hNodeStderr <- retryOpenFile nodeStderrFile IO.ReadWriteMode + + -- Sometimes the handles are not getting properly closed when node fails to start. This results in + -- operating system holding the file lock for longer than it's necessary. This in the end prevents retrying + -- node start and acquiring a lock for the same stderr/stdout files again. + closeHandlesOnError [hNodeStdout, hNodeStderr] $ do + + unless (List.length (H.sprocketArgumentName serviceSprocket) <= H.maxSprocketArgumentNameLength) $ + left MaxSprocketLengthExceededError + unless (List.length (H.sprocketArgumentName controlSprocket) <= H.maxSprocketArgumentNameLength) $ + left MaxSprocketLengthExceededError + + let kesAgentCmd = [ "run" + , "-s", tempBaseAbsPath serviceSocketRelPath + , "-c", tempBaseAbsPath controlSocketRelPath + ] ++ args + + kesAgentProcess <- newExceptT . fmap (first ExecutableRelatedFailure) . try $ procKESAgent kesAgentCmd + + (Just stdIn, _, _, hProcess, _) + <- firstExceptT ProcessRelatedFailure $ initiateProcess + $ kesAgentProcess + { IO.std_in = IO.CreatePipe, IO.std_out = IO.UseHandle hNodeStdout + , IO.std_err = IO.UseHandle hNodeStderr + , IO.cwd = Just tempBaseAbsPath + } + + -- We force the evaluation of initiateProcess so we can be sure that + -- the process has started. This allows us to read stderr in order + -- to fail early on errors generated from the cardano-node binary. + pid <- liftIO (IO.getPid hProcess) + >>= hoistMaybe (NodeExecutableError $ "startKESAgent:" <+> pretty node <+> "'s process did not start.") + + -- We then log the pid in the temp dir structure. + liftIO $ IO.writeFile nodePidFile $ show pid + + -- Wait for the service and control sockets to be created + eServiceSprocketError <- + H.evalIO $ + Ping.waitForSprocket + 120 -- timeout + 0.2 -- check interval + serviceSprocket + eControlSprocketError <- + H.evalIO $ + Ping.waitForSprocket + 120 -- timeout + 0.2 -- check interval + controlSprocket + + -- If we do have anything on stderr, fail. + stdErrContents <- liftIO $ IO.readFile nodeStderrFile + unless (null stdErrContents) $ + throwError $ mkNodeNonEmptyStderrError stdErrContents + + -- No stderr and no socket? Fail. + firstExceptT + (\ioex -> + NodeExecutableError . hsep $ + ["Socket", pretty serviceSocketRelPath, "was not created after 120 seconds. There was no output on stderr. Exception:", prettyException ioex]) + $ hoistEither eServiceSprocketError + firstExceptT + (\ioex -> + NodeExecutableError . hsep $ + ["Socket", pretty controlSocketRelPath, "was not created after 120 seconds. There was no output on stderr. Exception:", prettyException ioex]) + $ hoistEither eControlSprocketError + + -- Ping node and fail on error + -- FIXME: pinging of the node is broken now, has the protocol changed? + -- Ping.pingNode (fromIntegral testnetMagic) sprocket + -- >>= (firstExceptT (NodeExecutableError . ("Ping error:" <+>) . prettyError) . hoistEither) + + pure $ TestnetKESAgent + { kesAgentName = node + , kesAgentPoolKeys = Nothing -- they're set in the function caller, if present + , kesAgentServiceSprocket= serviceSprocket + , kesAgentControlSprocket = controlSprocket + , kesAgentStdinHandle = stdIn + , kesAgentStdout = nodeStdoutFile + , kesAgentStderr = nodeStderrFile + , kesAgentProcessHandle = hProcess + } + +-- | Various file paths needed to start and initialised a 'kes-agent' process +data TestnetKESAgentArgs = + TestnetKESAgentArgs + { tkaaShelleyGenesisFile :: FilePath + , tkaaColdVKeyFile :: FilePath + , tkaaColdSKeyFile :: FilePath + , tkaaKesVKeyFile :: FilePath + , tkaaOpcertCounterFile :: FilePath + , tkaaOpcertFile :: FilePath + } + +-- | Start the 'kes-agent' process and initialise it to handle the kes keys +-- for a block-producing node. +initAndStartKESAgent + :: HasCallStack + => MonadResource m + => MonadCatch m + => MonadFail m + => MonadTest m + => + TmpAbsolutePath + -- ^ The temporary absolute path + -> String + -- ^ The name of the node + -> TestnetKESAgentArgs + -> ExceptT NodeStartFailure m TestnetKESAgent +initAndStartKESAgent tp nodeNameStr + TestnetKESAgentArgs{ tkaaShelleyGenesisFile + , tkaaColdVKeyFile + , tkaaColdSKeyFile + , tkaaKesVKeyFile + , tkaaOpcertCounterFile + , tkaaOpcertFile + } + = do + -- start the agent process + kesAgent@TestnetKESAgent{kesAgentControlSprocket} <- startKESAgent tp nodeNameStr + [ "--cold-verification-key", tkaaColdVKeyFile + , "--genesis-file", tkaaShelleyGenesisFile + ] + -- generate kes key + execKESAgentControl_ [ "gen-staged-key" + , "--kes-verification-key-file", tkaaKesVKeyFile + , "--control-address", H.sprocketSystemName kesAgentControlSprocket] + -- issue opcert + execCli_ + [ "node", "issue-op-cert" + , "--kes-verification-key-file", tkaaKesVKeyFile + , "--cold-signing-key-file", tkaaColdSKeyFile + , "--operational-certificate-issue-counter", tkaaOpcertCounterFile + , "--kes-period", "0" + , "--out-file", tkaaOpcertFile + ] + -- install the opcert into the kes-agent + execKESAgentControl_ [ "install-key" + , "--control-address", H.sprocketSystemName kesAgentControlSprocket + , "--opcert-file", tkaaOpcertFile] + pure kesAgent + +-- | Close provided list of handles when 'ExceptT' throws an error +closeHandlesOnError :: MonadIO m => [IO.Handle] -> ExceptT e m a -> ExceptT e m a +closeHandlesOnError handles action = + catchE action $ \e -> do + liftIO $ mapM_ IO.hClose handles + throwE e + +-- Sometimes even when we close the files manually, the operating system still holds the lock for some +-- reason. This is most prominent on MacOS. Therefore, as a last resort, instead of +-- failing the node startup procedure, we simply try to use a different file name for the logs, with +-- the suffix @-n.log@ where @n@ is an attempt number. +retryOpenFile :: MonadIO m + => MonadCatch m + => FilePath -- ^ path we're trying to open + -> IO.IOMode + -> ExceptT NodeStartFailure m IO.Handle +retryOpenFile fullPath mode = go 0 + where + go :: MonadIO m + => MonadCatch m + => Int + -> ExceptT NodeStartFailure m IO.Handle + go n = do + let (path, extension) = splitExtension fullPath + path' = if n > 0 + then path <> "-" <> show n <> extension + else fullPath + r <- fmap (first FileRelatedFailure) . try . liftIOAnnotated $ IO.openFile path' mode + case r of + Right h -> pure h + Left e + -- give up after 1000 attempts + | n >= 1000 -> throwE e + | otherwise -> go (n + 1) diff --git a/cardano-testnet/src/Testnet/Start/Cardano.hs b/cardano-testnet/src/Testnet/Start/Cardano.hs index 4fb0f28242a..3c9e1cddba5 100644 --- a/cardano-testnet/src/Testnet/Start/Cardano.hs +++ b/cardano-testnet/src/Testnet/Start/Cardano.hs @@ -79,6 +79,7 @@ import Testnet.Types as TR hiding (shelleyGenesis) import qualified Hedgehog.Extras as H import qualified Hedgehog.Extras.Stock.IO.Network.Port as H +import Hedgehog.Extras.Stock (sprocketSystemName) import Hedgehog.Internal.Property (failException) import RIO (MonadUnliftIO, RIO (..), runRIO, throwString, timeout) @@ -235,6 +236,7 @@ cardanoTestnet let CardanoTestnetOptions { cardanoEnableNewEpochStateLogging=enableNewEpochStateLogging , cardanoNodes + , cardanoKESSource } = testnetOptions nPools = cardanoNumPools testnetOptions nodeConfigFile = tmpAbsPath "configuration.yaml" @@ -328,8 +330,7 @@ cardanoTestnet RelayNodeOptions{} -> (Nothing, []) SpoNodeOptions{} -> (Just keys, shelleyCliArgs <> byronCliArgs) where - shelleyCliArgs = [ "--shelley-kes-key", nodePoolKeysDir "kes.skey" - , "--shelley-vrf-key", unFile $ signingKey poolNodeKeysVrf + shelleyCliArgs = [ "--shelley-vrf-key", unFile $ signingKey poolNodeKeysVrf , "--shelley-operational-certificate", nodePoolKeysDir "opcert.cert" ] byronCliArgs = [ "--byron-delegation-certificate", nodePoolKeysDir "byron-delegation.cert" @@ -337,6 +338,32 @@ cardanoTestnet ] keys@SpoNodeKeys{poolNodeKeysVrf} = mkTestnetNodeKeyPaths i + -- depending on testnet configuration, either start a 'kes-agent' or use a key from disk + kesSourceCliArg <- + case cardanoKESSource of + UseKESKeyFile -> pure ["--shelley-kes-key", nodePoolKeysDir "kes.skey"] + UseKESSocket -> do + -- wait startTimeOffsetSeconds so that the startTime from shelly-jenesis.json is not in the future, + -- as otherwise we will trigger an underflow in kes-agent with a negative time difference. + H.threadDelay (startTimeOffsetSeconds * 1_000_000) + H.noteShowIO_ DTC.getCurrentTime + kesAgent <- runExceptT $ + initAndStartKESAgent (TmpAbsolutePath tmpAbsPath) nodeName + TestnetKESAgentArgs{ tkaaShelleyGenesisFile = shelleyGenesisFile + , tkaaColdVKeyFile = nodePoolKeysDir "cold.vkey" + , tkaaColdSKeyFile = nodePoolKeysDir "cold.skey" + , tkaaKesVKeyFile = nodePoolKeysDir "kes.vkey" + , tkaaOpcertCounterFile = nodePoolKeysDir "opcert.counter" + , tkaaOpcertFile = nodePoolKeysDir "opcert.cert" + } + case kesAgent of + Left e -> do + -- TODO: fail if could not start KES agent + H.annotateShow $ "Could not start KES agent: " <> show e + pure ["--shelley-kes-key", nodePoolKeysDir "kes.skey"] + Right (TestnetKESAgent{kesAgentServiceSprocket}) -> + pure ["--shelley-kes-agent-socket", sprocketSystemName kesAgentServiceSprocket] + eRuntime <- runExceptT . retryOnAddressInUseError $ startNode (TmpAbsolutePath tmpAbsPath) nodeName testnetDefaultIpv4Address port testnetMagic $ [ "run" @@ -344,6 +371,7 @@ cardanoTestnet , "--topology", nodeDataDir "topology.json" , "--database-path", nodeDataDir "db" ] + <> kesSourceCliArg <> spoNodeCliArgs <> extraCliArgs nodeOptions diff --git a/cardano-testnet/src/Testnet/Start/Types.hs b/cardano-testnet/src/Testnet/Start/Types.hs index 90acfc8abbc..6fcec905f84 100644 --- a/cardano-testnet/src/Testnet/Start/Types.hs +++ b/cardano-testnet/src/Testnet/Start/Types.hs @@ -34,6 +34,7 @@ module Testnet.Start.Types , UserProvidedData(..) , UserProvidedEnv(..) , UserProvidedGeneses(..) + , PraosCredentialsSource(..) , NodeLoggingFormat(..) , Conf(..) @@ -140,6 +141,12 @@ instance Default UserProvidedGeneses where def def +data PraosCredentialsSource = UseKESKeyFile | UseKESSocket + deriving (Eq, Show) + +instance Default PraosCredentialsSource where + def = UseKESKeyFile + -- | An HTTP request to get a file containing up-to-date mainnet on-chain parameters. -- The file should be formatted with Blockfrost format: -- https://docs.blockfrost.io/#tag/cardano--epochs/GET/epochs/latest/parameters @@ -187,6 +194,7 @@ data CardanoTestnetOptions = CardanoTestnetOptions , cardanoEnableNewEpochStateLogging :: Bool -- ^ if epoch state logging is enabled , cardanoEnableTxGenerator :: TxGeneratorSupport -- ^ Options regarding support for the tx-generator on the testnet (config generation, execution, etc.) , cardanoOutputDir :: UserProvidedEnv -- ^ The output directory where to store files, sockets, and so on. If unset, a temporary directory is used. + , cardanoKESSource :: PraosCredentialsSource } deriving (Eq, Show) -- | Path to the configuration file of the node, specified by the user @@ -223,6 +231,7 @@ instance Default CardanoTestnetOptions where , cardanoEnableNewEpochStateLogging = True , cardanoEnableTxGenerator = NoTxGeneratorSupport , cardanoOutputDir = def + , cardanoKESSource = def } -- | Options that are implemented by writing fields in the Shelley genesis file. @@ -237,7 +246,7 @@ instance Default GenesisOptions where def = GenesisOptions { genesisTestnetMagic = defaultTestnetMagic , genesisEpochLength = 500 - , genesisSlotLength = 0.1 + , genesisSlotLength = 1 -- 0.1 , genesisActiveSlotsCoeff = 0.05 } diff --git a/cardano-testnet/src/Testnet/Types.hs b/cardano-testnet/src/Testnet/Types.hs index 07bfcf709fc..a075f3130ae 100644 --- a/cardano-testnet/src/Testnet/Types.hs +++ b/cardano-testnet/src/Testnet/Types.hs @@ -42,6 +42,7 @@ module Testnet.Types , getStartTime , testnetDefaultIpv4Address , showIpv4Address + , TestnetKESAgent(..) ) where import Cardano.Api @@ -142,6 +143,17 @@ data TestnetNode = TestnetNode , nodeProcessHandle :: !IO.ProcessHandle } +data TestnetKESAgent = TestnetKESAgent + { kesAgentName :: !String + , kesAgentPoolKeys :: Maybe SpoNodeKeys -- ^ Keys are only present for SPO nodes + , kesAgentServiceSprocket :: !Sprocket + , kesAgentControlSprocket :: !Sprocket + , kesAgentStdinHandle :: !IO.Handle + , kesAgentStdout :: !FilePath + , kesAgentStderr :: !FilePath + , kesAgentProcessHandle :: !IO.ProcessHandle + } + isTestnetNodeSpo :: TestnetNode -> Bool isTestnetNodeSpo = isJust . poolKeys @@ -236,4 +248,3 @@ testnetDefaultIpv4Address = tupleToHostAddress (127, 0, 0, 1) showIpv4Address :: IsString s => HostAddress -> s showIpv4Address address = fromString . intercalate "." $ show <$> [a,b,c,d] where (a,b,c,d) = hostAddressToTuple address - From a7b7d1bbc8ba8b52c69e26bea16cc13275274f2a Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 10 Mar 2026 12:06:48 +0100 Subject: [PATCH 23/54] cardano-testnet: enable use with kes-agent Co-authored-by: Pablo Lamela --- .../src/Testnet/Components/Configuration.hs | 4 +- cardano-testnet/src/Testnet/Process/RunIO.hs | 21 +++++ cardano-testnet/src/Testnet/Runtime.hs | 19 ++--- cardano-testnet/src/Testnet/Start/Cardano.hs | 77 +++++++++---------- cardano-testnet/src/Testnet/Start/Types.hs | 2 +- .../files/golden/help.cli | 2 + .../files/golden/help/cardano.cli | 3 + .../files/golden/help/create-env.cli | 3 + 8 files changed, 74 insertions(+), 57 deletions(-) diff --git a/cardano-testnet/src/Testnet/Components/Configuration.hs b/cardano-testnet/src/Testnet/Components/Configuration.hs index 7cf7e169954..b072e38a545 100644 --- a/cardano-testnet/src/Testnet/Components/Configuration.hs +++ b/cardano-testnet/src/Testnet/Components/Configuration.hs @@ -132,7 +132,7 @@ getDefaultShelleyGenesis :: () -> m ShelleyGenesis getDefaultShelleyGenesis asbe maxSupply opts = do currentTime <- liftIOAnnotated DTC.getCurrentTime - let startTime = DTC.addUTCTime startTimeOffsetSeconds currentTime + let startTime = DTC.addUTCTime (fromIntegral startTimeOffsetSeconds) currentTime return $ Defaults.defaultShelleyGenesis asbe startTime maxSupply opts -- | An 'AlonzoGenesis' value that is fit to pass to 'cardanoTestnet' @@ -198,7 +198,7 @@ createSPOGenesisAndFiles let era = toCardanoEra sbe currentTime <- liftIOAnnotated DTC.getCurrentTime - let startTime = DTC.addUTCTime startTimeOffsetSeconds currentTime + let startTime = DTC.addUTCTime (fromIntegral startTimeOffsetSeconds) currentTime execCli_ $ [ eraToString sbe, "genesis", "create-testnet-data" ] diff --git a/cardano-testnet/src/Testnet/Process/RunIO.hs b/cardano-testnet/src/Testnet/Process/RunIO.hs index b480bbc4d37..2794ccb68be 100644 --- a/cardano-testnet/src/Testnet/Process/RunIO.hs +++ b/cardano-testnet/src/Testnet/Process/RunIO.hs @@ -10,6 +10,9 @@ module Testnet.Process.RunIO , execCli_ , mkExecConfig , procNode + , procKESAgent + , execKESAgentControl_ + , procFlex , liftIOAnnotated ) where @@ -269,6 +272,24 @@ procNode -- ^ Captured stdout procNode = GHC.withFrozenCallStack $ procFlex "cardano-node" "CARDANO_NODE" +-- | Create a 'CreateProcess' describing how to start the kes-agent process +-- and an argument list. +procKESAgent + :: (HasCallStack) + => [String] + -- ^ Arguments to the CLI command + -> RIO env CreateProcess + -- ^ Captured stdout +procKESAgent = GHC.withFrozenCallStack $ procFlex "kes-agent" "KES_AGENT" + +-- | Run kes-agent-control, discarding return value +execKESAgentControl_ + :: HasCallStack + => MonadIO m + => [String] + -> m () +execKESAgentControl_ = GHC.withFrozenCallStack $ void . execFlex' defaultExecConfig "kes-agent-control" "KES_AGENT_CONTROL" + -- | Create a 'CreateProcess' describing how to start a process given the Cabal package name -- corresponding to the executable, an environment variable pointing to the executable, diff --git a/cardano-testnet/src/Testnet/Runtime.hs b/cardano-testnet/src/Testnet/Runtime.hs index 2b3ab34fe3b..b3dca04f111 100644 --- a/cardano-testnet/src/Testnet/Runtime.hs +++ b/cardano-testnet/src/Testnet/Runtime.hs @@ -55,7 +55,7 @@ import System.Process (waitForProcess) import Testnet.Filepath import qualified Testnet.Ping as Ping import Testnet.Process.Run (ProcessError (..), initiateProcess) -import Testnet.Process.RunIO (liftIOAnnotated, procNode) +import Testnet.Process.RunIO (liftIOAnnotated, procNode, procKESAgent, execKESAgentControl_, execCli_) import Testnet.Types (TestnetNode (..), TestnetRuntime (configurationFile), showIpv4Address, testnetSprockets, TestnetKESAgent(..)) @@ -223,13 +223,6 @@ startNode tp node ipv4 port _testnetMagic nodeCmd = GHC.withFrozenCallStack $ do , nodeStderr = nodeStderrFile , nodeProcessHandle = hProcess } - where - -- close provided list of handles when 'ExceptT' throws an error - closeHandlesOnError :: MonadIO m => [IO.Handle] -> ExceptT e m a -> ExceptT e m a - closeHandlesOnError handles action = - catchE action $ \e -> do - liftIOAnnotated $ mapM_ IO.hClose handles - throwE e -- | Start a kes-agent for a particular node startKESAgent @@ -237,7 +230,6 @@ startKESAgent => MonadResource m => MonadCatch m => MonadFail m - => MonadTest m => TmpAbsolutePath -- ^ The temporary absolute path -> String @@ -251,7 +243,7 @@ startKESAgent tp node args = GHC.withFrozenCallStack $ do logDir = makeLogDir tp kesAgentStr= "kes-agent" - liftIO $ createDirectoryIfMissingNew_ $ logDir node kesAgentStr + _ <- liftIO $ createDirectoryIfMissingNew $ logDir node kesAgentStr void . liftIO $ createSubdirectoryIfMissingNew tempBaseAbsPath (socketDir node kesAgentStr) let nodeStdoutFile = logDir node kesAgentStr "stdout.log" @@ -280,7 +272,7 @@ startKESAgent tp node args = GHC.withFrozenCallStack $ do , "-c", tempBaseAbsPath controlSocketRelPath ] ++ args - kesAgentProcess <- newExceptT . fmap (first ExecutableRelatedFailure) . try $ procKESAgent kesAgentCmd + kesAgentProcess <- newExceptT . fmap (first ExecutableRelatedFailure) . try $ runRIO () $ procKESAgent kesAgentCmd (Just stdIn, _, _, hProcess, _) <- firstExceptT ProcessRelatedFailure $ initiateProcess @@ -301,13 +293,13 @@ startKESAgent tp node args = GHC.withFrozenCallStack $ do -- Wait for the service and control sockets to be created eServiceSprocketError <- - H.evalIO $ + liftIOAnnotated $ Ping.waitForSprocket 120 -- timeout 0.2 -- check interval serviceSprocket eControlSprocketError <- - H.evalIO $ + liftIOAnnotated $ Ping.waitForSprocket 120 -- timeout 0.2 -- check interval @@ -364,7 +356,6 @@ initAndStartKESAgent => MonadResource m => MonadCatch m => MonadFail m - => MonadTest m => TmpAbsolutePath -- ^ The temporary absolute path diff --git a/cardano-testnet/src/Testnet/Start/Cardano.hs b/cardano-testnet/src/Testnet/Start/Cardano.hs index 3c9e1cddba5..661b11af59a 100644 --- a/cardano-testnet/src/Testnet/Start/Cardano.hs +++ b/cardano-testnet/src/Testnet/Start/Cardano.hs @@ -78,9 +78,9 @@ import Testnet.Start.Types import Testnet.Types as TR hiding (shelleyGenesis) import qualified Hedgehog.Extras as H -import qualified Hedgehog.Extras.Stock.IO.Network.Port as H import Hedgehog.Extras.Stock (sprocketSystemName) import Hedgehog.Internal.Property (failException) +import qualified Hedgehog.Extras.Stock.IO.Network.Port as H import RIO (MonadUnliftIO, RIO (..), runRIO, throwString, timeout) import RIO.Orphans (ResourceMap) @@ -306,7 +306,7 @@ cardanoTestnet -- have to manually set up the start times themselves. when (updateTimestamps == UpdateTimestamps) $ do currentTime <- liftIOAnnotated DTC.getCurrentTime - let startTime = DTC.addUTCTime startTimeOffsetSeconds currentTime + let startTime = DTC.addUTCTime (fromIntegral startTimeOffsetSeconds) currentTime -- Update start time in Byron genesis file eByron <- runExceptT $ Byron.readGenesisData byronGenesisFile @@ -325,44 +325,42 @@ cardanoTestnet let nodeName = Defaults.defaultNodeName i nodeDataDir = tmpAbsPath Defaults.defaultNodeDataDir i nodePoolKeysDir = tmpAbsPath Defaults.defaultSpoKeysDir i - let (mKeys, spoNodeCliArgs) = - case nodeOptions of - RelayNodeOptions{} -> (Nothing, []) - SpoNodeOptions{} -> (Just keys, shelleyCliArgs <> byronCliArgs) - where - shelleyCliArgs = [ "--shelley-vrf-key", unFile $ signingKey poolNodeKeysVrf - , "--shelley-operational-certificate", nodePoolKeysDir "opcert.cert" + (mKeys, spoNodeCliArgs) <- + case nodeOptions of + RelayNodeOptions{} -> pure (Nothing, []) + SpoNodeOptions{} -> do + -- depending on testnet configuration, either start a 'kes-agent' or use a key from disk + kesSourceCliArg <- + case cardanoKESSource of + UseKESKeyFile -> pure ["--shelley-kes-key", nodePoolKeysDir "kes.skey"] + UseKESSocket -> do + -- wait startTimeOffsetSeconds so that the startTime from shelly-genesis.json is not in the future, + -- as otherwise we will trigger an underflow in kes-agent with a negative time difference. + liftIOAnnotated $ threadDelay (startTimeOffsetSeconds * 1_000_000) + kesAgent <- runExceptT $ + initAndStartKESAgent (TmpAbsolutePath tmpAbsPath) nodeName + TestnetKESAgentArgs{ tkaaShelleyGenesisFile = shelleyGenesisFile + , tkaaColdVKeyFile = nodePoolKeysDir "cold.vkey" + , tkaaColdSKeyFile = nodePoolKeysDir "cold.skey" + , tkaaKesVKeyFile = nodePoolKeysDir "kes.vkey" + , tkaaOpcertCounterFile = nodePoolKeysDir "opcert.counter" + , tkaaOpcertFile = nodePoolKeysDir "opcert.cert" + } + case kesAgent of + Left e -> do + -- TODO: fail if could not start KES agent + liftIOAnnotated . putStrLn $ "Could not start KES agent: " <> show e + pure ["--shelley-kes-key", nodePoolKeysDir "kes.skey"] + Right (TestnetKESAgent{kesAgentServiceSprocket}) -> + pure ["--shelley-kes-agent-socket", sprocketSystemName kesAgentServiceSprocket] + let shelleyCliArgs = [ "--shelley-vrf-key", unFile $ signingKey poolNodeKeysVrf + , "--shelley-operational-certificate", nodePoolKeysDir "opcert.cert" + ] + byronCliArgs = [ "--byron-delegation-certificate", nodePoolKeysDir "byron-delegation.cert" + , "--byron-signing-key", nodePoolKeysDir "byron-delegate.key" ] - byronCliArgs = [ "--byron-delegation-certificate", nodePoolKeysDir "byron-delegation.cert" - , "--byron-signing-key", nodePoolKeysDir "byron-delegate.key" - ] - keys@SpoNodeKeys{poolNodeKeysVrf} = mkTestnetNodeKeyPaths i - - -- depending on testnet configuration, either start a 'kes-agent' or use a key from disk - kesSourceCliArg <- - case cardanoKESSource of - UseKESKeyFile -> pure ["--shelley-kes-key", nodePoolKeysDir "kes.skey"] - UseKESSocket -> do - -- wait startTimeOffsetSeconds so that the startTime from shelly-jenesis.json is not in the future, - -- as otherwise we will trigger an underflow in kes-agent with a negative time difference. - H.threadDelay (startTimeOffsetSeconds * 1_000_000) - H.noteShowIO_ DTC.getCurrentTime - kesAgent <- runExceptT $ - initAndStartKESAgent (TmpAbsolutePath tmpAbsPath) nodeName - TestnetKESAgentArgs{ tkaaShelleyGenesisFile = shelleyGenesisFile - , tkaaColdVKeyFile = nodePoolKeysDir "cold.vkey" - , tkaaColdSKeyFile = nodePoolKeysDir "cold.skey" - , tkaaKesVKeyFile = nodePoolKeysDir "kes.vkey" - , tkaaOpcertCounterFile = nodePoolKeysDir "opcert.counter" - , tkaaOpcertFile = nodePoolKeysDir "opcert.cert" - } - case kesAgent of - Left e -> do - -- TODO: fail if could not start KES agent - H.annotateShow $ "Could not start KES agent: " <> show e - pure ["--shelley-kes-key", nodePoolKeysDir "kes.skey"] - Right (TestnetKESAgent{kesAgentServiceSprocket}) -> - pure ["--shelley-kes-agent-socket", sprocketSystemName kesAgentServiceSprocket] + keys@SpoNodeKeys{poolNodeKeysVrf} = mkTestnetNodeKeyPaths i + pure (Just keys, kesSourceCliArg <> shelleyCliArgs <> byronCliArgs) eRuntime <- runExceptT . retryOnAddressInUseError $ startNode (TmpAbsolutePath tmpAbsPath) nodeName testnetDefaultIpv4Address port testnetMagic $ @@ -371,7 +369,6 @@ cardanoTestnet , "--topology", nodeDataDir "topology.json" , "--database-path", nodeDataDir "db" ] - <> kesSourceCliArg <> spoNodeCliArgs <> extraCliArgs nodeOptions diff --git a/cardano-testnet/src/Testnet/Start/Types.hs b/cardano-testnet/src/Testnet/Start/Types.hs index 6fcec905f84..6f988d2ec0e 100644 --- a/cardano-testnet/src/Testnet/Start/Types.hs +++ b/cardano-testnet/src/Testnet/Start/Types.hs @@ -246,7 +246,7 @@ instance Default GenesisOptions where def = GenesisOptions { genesisTestnetMagic = defaultTestnetMagic , genesisEpochLength = 500 - , genesisSlotLength = 1 -- 0.1 + , genesisSlotLength = 0.1 , genesisActiveSlotsCoeff = 0.05 } diff --git a/cardano-testnet/test/cardano-testnet-golden/files/golden/help.cli b/cardano-testnet/test/cardano-testnet-golden/files/golden/help.cli index 90b3c89d4b7..5a96fef6c1f 100644 --- a/cardano-testnet/test/cardano-testnet-golden/files/golden/help.cli +++ b/cardano-testnet/test/cardano-testnet-golden/files/golden/help.cli @@ -7,6 +7,7 @@ Usage: cardano-testnet cardano [--num-pool-nodes COUNT] [--enable-new-epoch-state-logging] [--generate-tx-generator-config] [--output-dir DIRECTORY] + [--use-kes-agent] [--testnet-magic INT] [--epoch-length SLOTS] [--slot-length SECONDS] @@ -24,6 +25,7 @@ Usage: cardano-testnet create-env [--num-pool-nodes COUNT] [--enable-new-epoch-state-logging] [--generate-tx-generator-config] [--output-dir DIRECTORY] + [--use-kes-agent] [--testnet-magic INT] [--epoch-length SLOTS] [--slot-length SECONDS] diff --git a/cardano-testnet/test/cardano-testnet-golden/files/golden/help/cardano.cli b/cardano-testnet/test/cardano-testnet-golden/files/golden/help/cardano.cli index a4ad433beaa..5f654325670 100644 --- a/cardano-testnet/test/cardano-testnet-golden/files/golden/help/cardano.cli +++ b/cardano-testnet/test/cardano-testnet-golden/files/golden/help/cardano.cli @@ -5,6 +5,7 @@ Usage: cardano-testnet cardano [--num-pool-nodes COUNT] [--enable-new-epoch-state-logging] [--generate-tx-generator-config] [--output-dir DIRECTORY] + [--use-kes-agent] [--testnet-magic INT] [--epoch-length SLOTS] [--slot-length SECONDS] @@ -37,6 +38,8 @@ Available options: --output-dir DIRECTORY Directory where to store files, sockets, and so on. It is created if it doesn't exist. If unset, a temporary directory is used. + --use-kes-agent Get Praos block forging credentials from kes-agent + via the default socket path --testnet-magic INT Specify a testnet magic id. (default: 42) --epoch-length SLOTS Epoch length, in number of slots. Ignored if a node environment is passed. (default: 500) diff --git a/cardano-testnet/test/cardano-testnet-golden/files/golden/help/create-env.cli b/cardano-testnet/test/cardano-testnet-golden/files/golden/help/create-env.cli index 6a9c346496e..61bf8a6c623 100644 --- a/cardano-testnet/test/cardano-testnet-golden/files/golden/help/create-env.cli +++ b/cardano-testnet/test/cardano-testnet-golden/files/golden/help/create-env.cli @@ -5,6 +5,7 @@ Usage: cardano-testnet create-env [--num-pool-nodes COUNT] [--enable-new-epoch-state-logging] [--generate-tx-generator-config] [--output-dir DIRECTORY] + [--use-kes-agent] [--testnet-magic INT] [--epoch-length SLOTS] [--slot-length SECONDS] @@ -36,6 +37,8 @@ Available options: --output-dir DIRECTORY Directory where to store files, sockets, and so on. It is created if it doesn't exist. If unset, a temporary directory is used. + --use-kes-agent Get Praos block forging credentials from kes-agent + via the default socket path --testnet-magic INT Specify a testnet magic id. (default: 42) --epoch-length SLOTS Epoch length, in number of slots. Ignored if a node environment is passed. (default: 500) From 91700d2aa85c89e1c46cb97a3610842a40783e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20W=C3=B3jtowicz?= Date: Wed, 11 Mar 2026 07:15:07 +0100 Subject: [PATCH 24/54] network integration --- cardano-node/src/Cardano/Node/Run.hs | 73 ++++++++++++------- cardano-node/src/Cardano/Node/Startup.hs | 10 +-- .../Cardano/Node/Tracing/Tracers/Startup.hs | 52 +------------ 3 files changed, 51 insertions(+), 84 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 2fe99336751..97afdb56d13 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -8,6 +8,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE PackageImports #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} @@ -103,11 +104,12 @@ import qualified Cardano.Network.PeerSelection.PeerSelectionActions as Cardano import qualified Cardano.Network.PeerSelection.Churn as Cardano.Churn import Cardano.Network.PeerSelection (NumberOfBigLedgerPeers (..)) -import Ouroboros.Network.Block (HeaderHash) +import Ouroboros.Network.Block (pattern BlockPoint, pattern GenesisPoint, HeaderHash, atSlot, withHash) import Ouroboros.Network.BlockFetch (FetchMode) import qualified Ouroboros.Network.Diffusion as Diffusion import qualified Ouroboros.Network.Diffusion.Types as Diffusion import qualified Ouroboros.Network.Diffusion.Configuration as Configuration +import Ouroboros.Network.Magic import Ouroboros.Network.Mux (noBindForkPolicy, responderForkPolicy, ForkPolicy) import Cardano.Network.NodeToClient (LocalAddress (..), LocalSocket (..)) import Cardano.Network.NodeToNode (AcceptedConnectionsLimit (..), ConnectionId, @@ -263,7 +265,7 @@ handleNodeWithTracers cmdPc nc p@(SomeConsensusProtocol blockType runP) = do then DisabledBlockForging else EnabledBlockForging)) - handleSimpleNode blockType runP tracers nc + handleSimpleNode blockType runP tracers nc networkMagic (\nk -> do setNodeKernel nodeKernelData nk traceWith (nodeStateTracer tracers) NodeKernelOnline) @@ -309,7 +311,7 @@ handleNodeWithTracers cmdPc nc p@(SomeConsensusProtocol blockType runP) = do -- We ignore peer logging thread if it dies, but it will be killed -- when 'handleSimpleNode' terminates. - handleSimpleNode blockType runP tracers nc + handleSimpleNode blockType runP tracers nc networkMagic (\nk -> do setNodeKernel nodeKernelData nk traceWith (nodeStateTracer tracers) NodeKernelOnline) @@ -382,12 +384,13 @@ handleSimpleNode -> Api.ProtocolInfoArgs blk -> Tracers RemoteAddress LocalAddress blk IO -> NodeConfiguration + -> NetworkMagic -> (NodeKernel IO RemoteAddress LocalConnectionId blk -> IO ()) -- ^ Called on the 'NodeKernel' after creating it, but before the network -- layer is initialised. This implies this function must not block, -- otherwise the node won't actually start. -> IO () -handleSimpleNode blockType runP tracers nc onKernel = do +handleSimpleNode blockType runP tracers nc networkMagic onKernel = do logStartupWarnings logDeprecatedLedgerDBOptions @@ -459,6 +462,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do ledgerPeerSnapshotVar <- newTVarIO =<< updateLedgerPeerSnapshot (startupTracer tracers) nc + networkMagic (readTVar ledgerPeerSnapshotPathVar) (readTVar useLedgerVar) (const . pure $ ()) @@ -507,6 +511,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do void $ updateLedgerPeerSnapshot (startupTracer tracers) nc + networkMagic (readTVar ledgerPeerSnapshotPathVar) (readTVar useLedgerVar) (writeTVar ledgerPeerSnapshotVar) @@ -552,9 +557,9 @@ handleSimpleNode blockType runP tracers nc onKernel = do nodeArgs { rnNodeKernelHook = \registry nodeKernel -> do -- reinstall `SIGHUP` handler - installSigHUPHandler (startupTracer tracers) (Consensus.kesAgentTracer $ consensusTracers tracers) blockType nc nodeKernel - localRootsVar publicRootsVar useLedgerVar useBootstrapVar - ledgerPeerSnapshotPathVar ledgerPeerSnapshotVar + installSigHUPHandler (startupTracer tracers) (Consensus.kesAgentTracer $ consensusTracers tracers) + blockType nc networkMagic nodeKernel localRootsVar publicRootsVar useLedgerVar + useBootstrapVar ledgerPeerSnapshotPathVar ledgerPeerSnapshotVar rnNodeKernelHook nodeArgs registry nodeKernel } StdRunNodeArgs @@ -648,6 +653,7 @@ installSigHUPHandler :: Tracer IO (StartupTrace blk) -> Tracer IO KESAgentClientTrace -> Api.BlockType blk -> NodeConfiguration + -> NetworkMagic -> NodeKernel IO RemoteAddress (ConnectionId LocalAddress) blk -> StrictTVar IO [(HotValency, WarmValency, Map RelayAccessPoint (LocalRootConfig PeerTrustable))] -> StrictTVar IO (Map RelayAccessPoint PeerAdvertise) @@ -657,10 +663,10 @@ installSigHUPHandler :: Tracer IO (StartupTrace blk) -> StrictTVar IO (Maybe (LedgerPeerSnapshot BigLedgerPeers)) -> IO () #ifndef UNIX -installSigHUPHandler _ _ _ _ _ _ _ _ _ _ _ = return () +installSigHUPHandler _ _ _ _ _ _ _ _ _ _ _ _ = return () #else -installSigHUPHandler startupTracer kesAgentTracer blockType nc nodeKernel localRootsVar publicRootsVar useLedgerVar - useBootstrapPeersVar ledgerPeerSnapshotPathVar ledgerPeerSnapshotVar = +installSigHUPHandler startupTracer kesAgentTracer blockType nc networkMagic nodeKernel localRootsVar + publicRootsVar useLedgerVar useBootstrapPeersVar ledgerPeerSnapshotPathVar ledgerPeerSnapshotVar = void $ Signals.installHandler Signals.sigHUP (Signals.Catch $ do @@ -670,6 +676,7 @@ installSigHUPHandler startupTracer kesAgentTracer blockType nc nodeKernel localR void $ updateLedgerPeerSnapshot startupTracer nc + networkMagic (readTVar ledgerPeerSnapshotPathVar) (readTVar useLedgerVar) (writeTVar ledgerPeerSnapshotVar) @@ -765,11 +772,14 @@ updateTopologyConfiguration startupTracer nc localRootsVar publicRootsVar useLed updateLedgerPeerSnapshot :: Tracer IO (StartupTrace blk) -> NodeConfiguration + -> NetworkMagic -> STM IO (Maybe PeerSnapshotFile) -> STM IO UseLedgerPeers -> (Maybe (LedgerPeerSnapshot BigLedgerPeers) -> STM IO ()) -> IO (Maybe (LedgerPeerSnapshot BigLedgerPeers)) -updateLedgerPeerSnapshot startupTracer (NodeConfiguration {ncConsensusMode}) readLedgerPeerPath readUseLedgerVar writeVar = do +updateLedgerPeerSnapshot startupTracer + (NodeConfiguration {ncConsensusMode}) + networkMagic readLedgerPeerPath readUseLedgerVar writeVar = do (mPeerSnapshotFile, useLedgerPeers) <- atomically $ (,) <$> readLedgerPeerPath <*> readUseLedgerVar @@ -783,30 +793,37 @@ updateLedgerPeerSnapshot startupTracer (NodeConfiguration {ncConsensusMode}) rea snapshotFile <- hoistMaybe mPeerSnapshotFile eSnapshot <- liftIO $ readPeerSnapshotFile snapshotFile - lps@(LedgerPeerSnapshotV2 (wOrigin, _)) <- - case ncConsensusMode of - GenesisMode -> - MaybeT $ hushM eSnapshot (trace . NetworkConfigUpdateError) - PraosMode -> - MaybeT $ hushM eSnapshot (trace . NetworkConfigUpdateWarning) + lps <- case eSnapshot of + Left e -> do + traceL $ NetworkConfigUpdateError e + case ncConsensusMode of + GenesisMode -> error "updateLedgerPeerSnapshot error" + PraosMode -> empty + Right lps -> pure lps + fileSlot <- case lps of + LedgerBigPeerSnapshotV23 pt magic _pools + | networkMagic == magic, BlockPoint { atSlot } <- pt -> pure atSlot + | GenesisPoint <- pt -> do + traceL $ NetworkConfigUpdateError "Invalid peer snapshot file" + error "updateLedgerPeerSnapshot error" + | otherwise -> do + traceL . NetworkConfigUpdateError . pack $ + "NetworkMagic " <> show networkMagic <> " doesn't match " + <> "peer snapshot NetworkMagic " <> show magic + error "updateLedgerPeerSnapshot error" + LedgerPeerSnapshotV2 {} -> do + traceL $ NetworkConfigUpdateError "Unsupported legacy peer snapshot version." + error "updateLedgerPeerSnapshot error" case afterSlot of Always -> do - traceL $ LedgerPeerSnapshotLoaded wOrigin + traceL $ LedgerPeerSnapshotLoaded fileSlot return lps After ledgerSlotNo | fileSlot >= ledgerSlotNo -> do - traceL $ LedgerPeerSnapshotLoaded wOrigin + traceL $ LedgerPeerSnapshotLoaded fileSlot pure lps | otherwise -> do - case ncConsensusMode of - GenesisMode -> do - traceL $ LedgerPeerSnapshotError ledgerSlotNo fileSlot snapshotFile - liftIO $ throwIO (LedgerPeerSnapshotTooOld ledgerSlotNo fileSlot snapshotFile) - PraosMode -> do - traceL $ LedgerPeerSnapshotIgnored ledgerSlotNo fileSlot snapshotFile - empty - where - fileSlot = case wOrigin of; Origin -> 0; At slot -> slot + liftIO . throwIO $ LedgerPeerSnapshotTooOld ledgerSlotNo fileSlot snapshotFile mLedgerPeerSnapshot <$ atomically (writeVar mLedgerPeerSnapshot) diff --git a/cardano-node/src/Cardano/Node/Startup.hs b/cardano-node/src/Cardano/Node/Startup.hs index c0a570b7fef..1be1c443c4d 100644 --- a/cardano-node/src/Cardano/Node/Startup.hs +++ b/cardano-node/src/Cardano/Node/Startup.hs @@ -28,7 +28,7 @@ import Cardano.Node.Configuration.Socket import Cardano.Node.Protocol (ProtocolInstantiationError) import Cardano.Node.Protocol.Types (SomeConsensusProtocol (..)) import Cardano.Node.Types (PeerSnapshotFile (..)) -import Cardano.Slotting.Slot (SlotNo, WithOrigin) +import Cardano.Slotting.Slot (SlotNo) import qualified Ouroboros.Consensus.BlockchainTime.WallClock.Types as WCT import Ouroboros.Consensus.Cardano.Block import Ouroboros.Consensus.Cardano.CanHardFork (shelleyLedgerConfig) @@ -140,13 +140,7 @@ data StartupTrace blk = | BIShelley BasicInfoShelleyBased | BIByron BasicInfoByron | BINetwork BasicInfoNetwork - | LedgerPeerSnapshotLoaded (WithOrigin SlotNo) - -- | Ledger peer snapshot ignored since the peer snapshot slot is older than - -- `UseLedgerPeers` in the topology file. Arguments are: - -- useLedgerPeersAfterSlot, peerSnapshotSlot, peerSnapshotFile. - | LedgerPeerSnapshotIgnored SlotNo SlotNo PeerSnapshotFile - -- | Like above, but in `GenesisMode` it is an error to have an old snapshot. - | LedgerPeerSnapshotError SlotNo SlotNo PeerSnapshotFile + | LedgerPeerSnapshotLoaded SlotNo | MovedTopLevelOption String data LedgerPeerSnapshotError = LedgerPeerSnapshotTooOld SlotNo SlotNo PeerSnapshotFile diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs index 3b89975d194..d6e259d72f6 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs @@ -216,31 +216,9 @@ instance ( Show (BlockNodeToNodeVersion blk) forMachine _dtal NetworkConfigUpdate = mconcat [ "kind" .= String "NetworkConfigUpdate" , "message" .= String "network configuration update" ] - forMachine _dtal (LedgerPeerSnapshotLoaded wOrigin) = + forMachine _dtal (LedgerPeerSnapshotLoaded slotNo) = mconcat [ "kind" .= String "LedgerPeerSnapshot" - , "message" .= String ("loaded input recorded " <> showT wOrigin)] - forMachine _dtal (LedgerPeerSnapshotIgnored useLedgerAfterSlot snapshotSlotNo (PeerSnapshotFile snapshotFile)) = - mconcat [ "kind" .= String "LedgerPeerSnapshot" - , "message" .= String ( - mconcat [ "Topology file misconfiguration: ignoring ledger peer snapshot recorded for " - , showT snapshotSlotNo - , " since topology file specifies to use ledger after " - , showT useLedgerAfterSlot - , ".\nPossible fix: update ledger peer snapshot at " - , showT snapshotFile - ] - )] - forMachine _dtal (LedgerPeerSnapshotError useLedgerAfterSlot snapshotSlotNo (PeerSnapshotFile snapshotFile)) = - mconcat [ "kind" .= String "LedgerPeerSnapshot" - , "message" .= String ( - mconcat [ "Topology file misconfiguration: ignoring ledger peer snapshot recorded for " - , showT snapshotSlotNo - , " since topology file specifies to use ledger peers after " - , showT useLedgerAfterSlot - , ".\nPossible fix: update ledger peer snapshot at " - , showT snapshotFile - ] - )] + , "message" .= String ("loaded input recorded " <> showT slotNo)] forMachine _dtal NetworkConfigUpdateUnsupported = mconcat [ "kind" .= String "NetworkConfigUpdate" , "message" .= String "network topology reconfiguration is not supported in non-p2p mode" ] @@ -345,10 +323,6 @@ instance MetaTrace (StartupTrace blk) where Namespace [] ["NetworkConfigUpdate"] namespaceFor (LedgerPeerSnapshotLoaded {}) = Namespace [] ["LedgerPeerSnapshot"] - namespaceFor (LedgerPeerSnapshotIgnored {}) = - Namespace [] ["LedgerPeerSnapshot", "Incompatible"] - namespaceFor (LedgerPeerSnapshotError {}) = - Namespace [] ["LedgerPeerSnapshot", "Error"] namespaceFor NetworkConfigUpdateUnsupported {} = Namespace [] ["NetworkConfigUpdateUnsupported"] namespaceFor NetworkConfigUpdateError {} = @@ -599,26 +573,8 @@ ppStartupInfoTrace (NetworkConfig localRoots publicRoots useLedgerPeers peerSnap <> show (unPeerSnapshotFile p) ] -ppStartupInfoTrace (LedgerPeerSnapshotLoaded wOrigin) = - "Topology: Peer snapshot containing ledger peers " <> showT wOrigin <> " loaded." -ppStartupInfoTrace (LedgerPeerSnapshotIgnored useLedgerAfterSlot snapshotSlotNo (PeerSnapshotFile snapshotFile)) = - mconcat - [ "Topology file misconfiguration: ignoring ledger peer snapshot recorded for " - , showT snapshotSlotNo - , " since topology file specifies to use ledger after " - , showT useLedgerAfterSlot - , ".\nPossible fix: update ledger peer snapshot at " - , showT snapshotFile - ] -ppStartupInfoTrace (LedgerPeerSnapshotError useLedgerAfterSlot snapshotSlotNo (PeerSnapshotFile snapshotFile)) = - mconcat - [ "Topology file misconfiguration: ignoring ledger peer snapshot recorded for " - , showT snapshotSlotNo - , " since topology file specifies to use ledger after " - , showT useLedgerAfterSlot - , ".\nPossible fix: update ledger peer snapshot at " - , showT snapshotFile - ] +ppStartupInfoTrace (LedgerPeerSnapshotLoaded slotNo) = + "Topology: Peer snapshot containing ledger peers " <> showT slotNo <> " loaded." ppStartupInfoTrace NonP2PWarning = nonP2PWarningMessage From 9fe755b3344eaf730decdacaff9d712c7765ab2b Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 11 Mar 2026 09:32:58 +0100 Subject: [PATCH 25/54] Removed connectedPeers metrics John Lotoski found that it doesn't appear under any condition (GenesisMode, PraosMode). Now connection manager & peer selection exposes a more detailed metrics including `cardano_node_metrics_peerSelection_ActivePeers_int` --- .../src/Cardano/Node/Tracing/Tracers/Consensus.hs | 2 +- cardano-node/src/Cardano/Tracing/Tracers.hs | 10 ---------- cardano-tracer/configuration/metrics_help.json | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index 2d0bc5988f7..dc1e4abaf28 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -683,7 +683,7 @@ instance (LogFormatting peer, Show peer) => , "peers" .= toJSON (List.foldl' (\acc x -> forMachine DDetailed x : acc) [] xs) ] - asMetrics peers = [IntM "connectedPeers" (fromIntegral (length peers))] + asMetrics _ = [] instance MetaTrace [TraceLabelPeer peer (FetchDecision [Point header])] where namespaceFor (a : _tl) = (nsCast . namespaceFor) a diff --git a/cardano-node/src/Cardano/Tracing/Tracers.hs b/cardano-node/src/Cardano/Tracing/Tracers.hs index a12d5c72490..3c2259aa9c1 100644 --- a/cardano-node/src/Cardano/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Tracing/Tracers.hs @@ -1552,21 +1552,11 @@ teeTraceBlockFetchDecision verb eliding tr = PeerStarvedUs {} -> do traceWith (toLogObject' verb meTr) ev PeersFetch ev' -> do - traceWith (teeTraceBlockFetchDecision' meTr) (WithSeverity s ev') traceWith (teeTraceBlockFetchDecisionElide verb eliding bfdTr) (WithSeverity s ev') where meTr = appendName "metrics" tr bfdTr = appendName "BlockFetchDecision" tr -teeTraceBlockFetchDecision' - :: Trace IO Text - -> Tracer IO (WithSeverity [TraceLabelPeer peer (FetchDecision [Point (Header blk)])]) -teeTraceBlockFetchDecision' tr = - Tracer $ \(WithSeverity _ peers) -> do - meta <- mkLOMeta Info Confidential - let tr' = appendName "peers" tr - traceNamedObject tr' (meta, LogValue "connectedPeers" . PureI $ fromIntegral $ length peers) - teeTraceBlockFetchDecisionElide :: ( Eq peer , Show peer diff --git a/cardano-tracer/configuration/metrics_help.json b/cardano-tracer/configuration/metrics_help.json index ba7420f6c13..8abcff03307 100644 --- a/cardano-tracer/configuration/metrics_help.json +++ b/cardano-tracer/configuration/metrics_help.json @@ -29,7 +29,6 @@ "cardano_version_major": "Cardano node version information", "cardano_version_minor": "Cardano node version information", "cardano_version_patch": "Cardano node version information", - "connectedPeers": "Number of connected peers", "density": "The actual number of blocks created over the maximum expected number of blocks that could be created over the span of the last @k@ blocks.", "epoch": "In which epoch is the tip of the current chain.", "forgedSlotLast": "Slot number of the last forged block", From b09244b93389cdb7670b3feb286690aa96f216b9 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 11 Mar 2026 09:35:35 +0100 Subject: [PATCH 26/54] Removed Cardano.Node.Tracing.Tracers.Diffusion Its imports are not necessary, so it can be removed. --- cardano-node/cardano-node.cabal | 1 - .../src/Cardano/Node/Tracing/Consistency.hs | 1 - .../src/Cardano/Node/Tracing/Documentation.hs | 1 - .../src/Cardano/Node/Tracing/Tracers.hs | 1 - .../Cardano/Node/Tracing/Tracers/Diffusion.hs | 20 ------------------- 5 files changed, 24 deletions(-) delete mode 100644 cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 1b0303bb86c..6895be1724e 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -104,7 +104,6 @@ library Cardano.Node.Tracing.Tracers.ChainDB Cardano.Node.Tracing.Tracers.Consensus Cardano.Node.Tracing.Tracers.ConsensusStartupException - Cardano.Node.Tracing.Tracers.Diffusion Cardano.Node.Tracing.Tracers.ForgingStats Cardano.Node.Tracing.Tracers.KESInfo Cardano.Node.Tracing.Tracers.LedgerMetrics diff --git a/cardano-node/src/Cardano/Node/Tracing/Consistency.hs b/cardano-node/src/Cardano/Node/Tracing/Consistency.hs index 014083c5235..0bf208a34ad 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Consistency.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Consistency.hs @@ -30,7 +30,6 @@ import Cardano.Node.Tracing.Formatting () import qualified Cardano.Node.Tracing.StateRep as SR import Cardano.Node.Tracing.Tracers.BlockReplayProgress import Cardano.Node.Tracing.Tracers.ConsensusStartupException -import Cardano.Node.Tracing.Tracers.Diffusion () import Cardano.Node.Tracing.Tracers.KESInfo () import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics) import Cardano.Node.Tracing.Tracers.NodeToClient () diff --git a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs index 94300aa0813..f5653d99ebb 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs @@ -41,7 +41,6 @@ import Cardano.Node.Tracing.Tracers.BlockReplayProgress import Cardano.Node.Tracing.Tracers.ChainDB import Cardano.Node.Tracing.Tracers.Consensus import Cardano.Node.Tracing.Tracers.ConsensusStartupException -import Cardano.Node.Tracing.Tracers.Diffusion () import Cardano.Node.Tracing.Tracers.ForgingStats (ForgingStats) import Cardano.Node.Tracing.Tracers.KESInfo () import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers.hs index bf91b58ca69..f81340f475b 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers.hs @@ -30,7 +30,6 @@ import qualified Cardano.Node.Tracing.StateRep as SR import Cardano.Node.Tracing.Tracers.BlockReplayProgress import Cardano.Node.Tracing.Tracers.ChainDB import Cardano.Node.Tracing.Tracers.Consensus -import Cardano.Node.Tracing.Tracers.Diffusion () import Cardano.Node.Tracing.Tracers.ForgingStats (calcForgeStats) import Cardano.Node.Tracing.Tracers.KESInfo import Cardano.Node.Tracing.Tracers.LedgerMetrics () diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs deleted file mode 100644 index e05ae92b183..00000000000 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Diffusion.hs +++ /dev/null @@ -1,20 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE CPP #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} - - - -{-# OPTIONS_GHC -Wno-orphans #-} - -module Cardano.Node.Tracing.Tracers.Diffusion () where - -import Ouroboros.Network.Tracing () -import Ouroboros.Network.Tracing.PeerSelection () - From bd7b7d0dcaea787f01daa0e5daa63213a776bd5e Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 11 Mar 2026 09:51:17 +0100 Subject: [PATCH 27/54] Removed an unused import --- cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index dc1e4abaf28..62eaeecef34 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -70,7 +70,6 @@ import qualified Ouroboros.Network.BlockFetch.ClientState as BlockFetch import Ouroboros.Network.BlockFetch.Decision import Ouroboros.Network.BlockFetch.Decision.Trace (TraceDecisionEvent (..)) import Ouroboros.Network.SizeInBytes (SizeInBytes (..)) -import Ouroboros.Network.Tracing () import Control.Monad (guard) import Data.Aeson (ToJSON, Value (..), toJSON, (.=)) From 5c6fa41648d10c29153e72dcb7e48ffa8bf7cba5 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 11 Mar 2026 10:56:44 +0100 Subject: [PATCH 28/54] cardano-tracer: fix cardano-tracer-test-ext --- cardano-tracer/cardano-tracer.cabal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cardano-tracer/cardano-tracer.cabal b/cardano-tracer/cardano-tracer.cabal index 66691de8f35..4987bc59d89 100644 --- a/cardano-tracer/cardano-tracer.cabal +++ b/cardano-tracer/cardano-tracer.cabal @@ -402,6 +402,7 @@ test-suite cardano-tracer-test-ext build-depends: aeson , async , bytestring + , cardano-diffusion , cardano-tracer , cborg , containers @@ -417,7 +418,7 @@ test-suite cardano-tracer-test-ext , network , network-mux , optparse-applicative - , ouroboros-network:{api, framework, ouroboros-network} ^>= 1.0 + , ouroboros-network:{api, framework} , process , QuickCheck , tasty From 7701d512a2b55ae413174d11755e1d1e56c2cd70 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 11 Mar 2026 11:29:15 +0100 Subject: [PATCH 29/54] trace-forward: fix tests --- .../test/Test/Trace/Forward/Protocol/DataPoint/Tests.hs | 7 ++++--- .../test/Test/Trace/Forward/Protocol/TraceObject/Tests.hs | 7 ++++--- trace-forward/trace-forward.cabal | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/trace-forward/test/Test/Trace/Forward/Protocol/DataPoint/Tests.hs b/trace-forward/test/Test/Trace/Forward/Protocol/DataPoint/Tests.hs index 5911f134313..6831fd8b381 100644 --- a/trace-forward/test/Test/Trace/Forward/Protocol/DataPoint/Tests.hs +++ b/trace-forward/test/Test/Trace/Forward/Protocol/DataPoint/Tests.hs @@ -18,6 +18,7 @@ import Control.Monad.IOSim (runSimOrThrow) import Control.Monad.ST (runST) import Control.Tracer (nullTracer) import Network.TypedProtocol.Codec +import Network.TypedProtocol.Codec.Properties import Network.TypedProtocol.Proofs import Test.Tasty @@ -45,7 +46,7 @@ tests = testGroup "Trace.Forward.Protocol.DataPoint" prop_codec_DataPointForward :: AnyMessage DataPointForward - -> Bool + -> Property prop_codec_DataPointForward msg = runST $ prop_codecM (codecDataPointForward CBOR.encode CBOR.decode @@ -54,7 +55,7 @@ prop_codec_DataPointForward msg = runST $ prop_codec_splits2_DataPointForward :: AnyMessage DataPointForward - -> Bool + -> Property prop_codec_splits2_DataPointForward msg = runST $ prop_codec_splitsM splits2 @@ -65,7 +66,7 @@ prop_codec_splits2_DataPointForward msg = runST $ prop_codec_splits3_DataPointForward :: AnyMessage DataPointForward - -> Bool + -> Property prop_codec_splits3_DataPointForward msg = runST $ prop_codec_splitsM splits3 diff --git a/trace-forward/test/Test/Trace/Forward/Protocol/TraceObject/Tests.hs b/trace-forward/test/Test/Trace/Forward/Protocol/TraceObject/Tests.hs index edf3f04f34a..06d5da2438e 100644 --- a/trace-forward/test/Test/Trace/Forward/Protocol/TraceObject/Tests.hs +++ b/trace-forward/test/Test/Trace/Forward/Protocol/TraceObject/Tests.hs @@ -18,6 +18,7 @@ import Control.Monad.ST (runST) import Control.Tracer (nullTracer) import Network.TypedProtocol.Codec import Network.TypedProtocol.Proofs +import Network.TypedProtocol.Codec.Properties import Test.Tasty import Test.Tasty.QuickCheck @@ -43,7 +44,7 @@ tests = testGroup "Trace.Forward.Protocol.TraceObject" , testProperty "channel IO" prop_channel_IO_TraceObjectForward ] -prop_codec_TraceObjectForward :: AnyMessage (TraceObjectForward TraceItem) -> Bool +prop_codec_TraceObjectForward :: AnyMessage (TraceObjectForward TraceItem) -> Property prop_codec_TraceObjectForward msg = runST $ prop_codecM (codecTraceObjectForward CBOR.encode CBOR.decode @@ -52,7 +53,7 @@ prop_codec_TraceObjectForward msg = runST $ prop_codec_splits2_TraceObjectForward :: AnyMessage (TraceObjectForward TraceItem) - -> Bool + -> Property prop_codec_splits2_TraceObjectForward msg = runST $ prop_codec_splitsM splits2 @@ -62,7 +63,7 @@ prop_codec_splits2_TraceObjectForward msg = runST $ prop_codec_splits3_TraceObjectForward :: AnyMessage (TraceObjectForward TraceItem) - -> Bool + -> Property prop_codec_splits3_TraceObjectForward msg = runST $ prop_codec_splitsM splits3 diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index e71d773cc00..a7539dd9172 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -110,7 +110,7 @@ test-suite test , serialise , tasty , tasty-quickcheck - , typed-protocols + , typed-protocols:{typed-protocols, codec-properties} , text ghc-options: -rtsopts From 6e7549c2db71a528229051f7a7a99a249e3db6f9 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 11 Mar 2026 12:04:36 +0100 Subject: [PATCH 30/54] cardano-note: fix tests --- cardano-node/cardano-node.cabal | 1 + cardano-node/test/Test/Cardano/Node/POM.hs | 8 ++++++++ .../Cardano/Testnet/Test/DumpConfig.hs | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 6895be1724e..6f565c2a6cf 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -245,6 +245,7 @@ test-suite cardano-node-test , cardano-crypto-class , cardano-crypto-wrapper , cardano-api + , cardano-diffusion:{api, cardano-diffusion} , cardano-protocol-tpraos , cardano-node , cardano-slotting diff --git a/cardano-node/test/Test/Cardano/Node/POM.hs b/cardano-node/test/Test/Cardano/Node/POM.hs index b3ac51bb555..a6ef69f0467 100644 --- a/cardano-node/test/Test/Cardano/Node/POM.hs +++ b/cardano-node/test/Test/Cardano/Node/POM.hs @@ -26,6 +26,8 @@ import Cardano.Network.ConsensusMode (ConsensusMode (..)) import Cardano.Network.NodeToNode (AcceptedConnectionsLimit (..), DiffusionMode (InitiatorAndResponderDiffusionMode)) import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) +import Ouroboros.Network.TxSubmission.Inbound.V2.Types + (defaultTxSubmissionInitDelay) import Data.Monoid (Last (..)) import Data.Text (Text) @@ -174,6 +176,8 @@ testPartialYamlConfig = , pncResponderCoreAffinityPolicy = mempty , pncLedgerDbConfig = mempty , pncEgressPollInterval = mempty + , pncTxSubmissionLogicVersion = mempty + , pncTxSubmissionInitDelay = mempty } -- | Example partial configuration theoretically created @@ -227,6 +231,8 @@ testPartialCliConfig = , pncResponderCoreAffinityPolicy = mempty , pncLedgerDbConfig = mempty , pncEgressPollInterval = mempty + , pncTxSubmissionLogicVersion = mempty + , pncTxSubmissionInitDelay = mempty } -- | Expected final NodeConfiguration @@ -286,6 +292,8 @@ eExpectedConfig = do , ncGenesisConfig = disableGenesisConfig , ncResponderCoreAffinityPolicy = NoResponderCoreAffinity , ncLedgerDbConfig = LedgerDbConfiguration DefaultNumOfDiskSnapshots DefaultSnapshotInterval DefaultQueryBatchSize V2InMemory noDeprecatedOptions + , ncTxSubmissionLogicVersion = TxSubmissionLogicV1 + , ncTxSubmissionInitDelay = defaultTxSubmissionInitDelay } -- ----------------------------------------------------------------------------- diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs index 32f91d89bda..7d57787f183 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs @@ -56,7 +56,7 @@ hprop_dump_config = integrationRetryWorkspace 2 "dump-config-files" $ \tmpDir -> H.threadDelay $ double2Int $ realToFrac startTimeOffsetSeconds * 1_000_000 * 1.2 currentTime <- H.noteShowIO Time.getCurrentTime - startTime <- H.noteShow $ Time.addUTCTime startTimeOffsetSeconds currentTime + startTime <- H.noteShow $ Time.addUTCTime (fromIntegral startTimeOffsetSeconds) currentTime -- Update start time in Byron genesis file eByron <- runExceptT $ Byron.readGenesisData byronGenesisFile From 1d442be3f7aaaafc42e816f03703b6ffb6fe6caa Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Tue, 10 Mar 2026 15:52:07 -0500 Subject: [PATCH 31/54] musl: keep the static liuring.a file in postInstall --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index 0636e6fe72e..142d99015f5 100644 --- a/flake.nix +++ b/flake.nix @@ -113,6 +113,13 @@ // final.cardanoLib // import ./nix/svclib.nix {inherit (final) pkgs;}; }) + (final: prev: { + # For musl builds, make sure the static `liburing.a` file is not deleted in `postInstall` + # ex: https://github.com/NixOS/nixpkgs/blob/f84a9816b2d5f7caade4b2fab16a66486abb7038/pkgs/by-name/li/liburing/package.nix#L43-L45 + liburing = prev.liburing.overrideAttrs (attrs: final.lib.optionalAttrs final.stdenv.hostPlatform.isMusl { + postInstall = builtins.replaceStrings [ "rm $out/lib/liburing*.a" ] [ "" ] attrs.postInstall; + }); + }) (import ./nix/pkgs.nix) abseilOverlay self.overlay From f70d5a81d8a35fc587dd69a0866f01ddab938c53 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 12 Mar 2026 10:03:34 -0500 Subject: [PATCH 32/54] ci: fix aarch64-linux.musl ghc-iserv failures --- nix/haskell.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/haskell.nix b/nix/haskell.nix index be2cab132e4..786545f64d7 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -311,11 +311,13 @@ let export WORKDIR=$TMP/testTracerExt ''; }) - ({ lib, pkgs, ... }: lib.mkIf (!pkgs.stdenv.hostPlatform.isDarwin) { + ({ lib, pkgs, ... }: lib.mkIf (!pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.hostPlatform.isMusl) { # Needed for profiled builds to fix an issue loading recursion-schemes part of makeBaseFunctor # that is missing from the `_p` output. See https://gitlab.haskell.org/ghc/ghc/-/issues/18320 # This work around currently breaks regular builds on macOS with: # : error: ghc: ghc-iserv terminated (-11) + # Excluded for musl: ghc-iserv (musl binary) crashes with SIGILL on musl targets. + # Musl builds are same-arch cross-compiles so GHC can run TH in-process (glibc) instead. packages.plutus-core.components.library.ghcOptions = [ "-fexternal-interpreter" ]; }) ({ config, lib, ... }@args: { From 4c4af5e2ae8efe62f5a8228ce4ba524f497924fe Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Mar 2026 10:15:57 +0100 Subject: [PATCH 33/54] cardano-node: Migrate to Network-provided topology types --- cardano-node/cardano-node.cabal | 4 +- .../Cardano/Node/Configuration/TopologyP2P.hs | 270 ++---------------- cardano-node/src/Cardano/Node/Run.hs | 69 ++--- cardano-node/test/Test/Cardano/Node/Gen.hs | 54 ++-- cardano-node/test/Test/Cardano/Node/Json.hs | 13 +- 5 files changed, 76 insertions(+), 334 deletions(-) diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 6f565c2a6cf..c7f9101ba29 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -245,7 +245,7 @@ test-suite cardano-node-test , cardano-crypto-class , cardano-crypto-wrapper , cardano-api - , cardano-diffusion:{api, cardano-diffusion} + , cardano-diffusion:{api, cardano-diffusion, orphan-instances} , cardano-protocol-tpraos , cardano-node , cardano-slotting @@ -258,7 +258,7 @@ test-suite cardano-node-test , iproute , mtl , ouroboros-consensus:{ouroboros-consensus, cardano, diffusion} - , ouroboros-network:{api, ouroboros-network} + , ouroboros-network:{api, framework, ouroboros-network} , strict-sop-core , text , trace-dispatcher diff --git a/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs b/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs index 0d7467e4440..ed4cd83df2b 100644 --- a/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs +++ b/cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs @@ -8,54 +8,30 @@ {-# LANGUAGE PackageImports #-} {-# LANGUAGE RankNTypes #-} --- TODO: We need `2a89d89775 orphan-instances: more flexible NetworkTopology --- JSON encoding` in `ouroboros-network-0.23` for `networkTopologyFromJSON` in --- `Ouroboros.Network.OrphanInstances` to implement a drop in replacement using --- `Ouroboros.Network.Diffusion.Topology` API. +-- needed for instance AdjustFilePaths CardanoNetworkTopology +{-# OPTIONS_GHC -Wno-orphans #-} + module Cardano.Node.Configuration.TopologyP2P - ( TopologyError(..) - , NetworkTopology(..) - , PublicRootPeers(..) - , LocalRootPeersGroup(..) - , LocalRootPeersGroups(..) - , RootConfig(..) - , NodeHostIPAddress(..) - , NodeHostIPv4Address(..) - , NodeHostIPv6Address(..) - , NodeSetup(..) - , nodeAddressToSockAddr - , readTopologyFile + ( readTopologyFile , readPeerSnapshotFile , readTopologyFileOrError - , rootConfigToRelayAccessPoint - -- * Re-exports - , DiffusionMode(..) - , PeerAdvertise(..) - , PeerTrustable(..) - , RelayAccessPoint(..) - , UseBootstrapPeers(..) - , UseLedgerPeers(..) ) where - import Cardano.Api (handleIOExceptionsLiftWith, liftEither, runExceptT, throwError) import Cardano.Network.ConsensusMode (ConsensusMode (..)) -import Cardano.Network.PeerSelection.Bootstrap (UseBootstrapPeers (..)) -import Cardano.Network.PeerSelection.PeerTrustable (PeerTrustable (..)) -import Cardano.Node.Configuration.NodeAddress import Cardano.Node.Configuration.POM (NodeConfiguration (..)) import Cardano.Node.Startup (StartupTrace (..)) import Cardano.Node.Types import Cardano.Tracing.OrphanInstances.Network () -import Cardano.Network.NodeToNode (DiffusionMode (..), PeerAdvertise (..)) import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSnapshot (..), - UseLedgerPeers (..), RelayAccessPoint (..), LedgerPeersKind(..)) -import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (..), - WarmValency (..)) + LedgerPeersKind(..), isLedgerPeersEnabled) +import Cardano.Network.PeerSelection.Bootstrap (UseBootstrapPeers (..)) +import Ouroboros.Network.Diffusion.Topology (NetworkTopology(..)) +import Cardano.Network.Diffusion.Topology (CardanoNetworkTopology, isValidTrustedPeerConfiguration) +import Ouroboros.Network.OrphanInstances () -import Control.Applicative (Alternative (..)) import Control.Exception.Safe (Exception (..), IOException, try) import Control.Monad import Control.Monad.IO.Class @@ -67,209 +43,37 @@ import qualified Data.ByteString.Lazy.Char8 as LBS import Data.Maybe (isJust, isNothing) import Data.Text (Text) import qualified Data.Text as Text -import Data.Word (Word64) -import GHC.Generics (Generic) import System.FilePath (takeDirectory, ()) -newtype TopologyError - = NodeIdNotFoundInToplogyFile FilePath - deriving Show - - -data NodeSetup adr = NodeSetup - { nodeId :: !Word64 - , nodeIPv4Address :: !(Maybe NodeIPv4Address) - , nodeIPv6Address :: !(Maybe NodeIPv6Address) - , producers :: ![RootConfig adr] - , useLedger :: !UseLedgerPeers - } deriving (Eq, Show, Generic, Functor, Foldable, Traversable) - -instance FromJSON adr => FromJSON (NodeSetup adr) where - parseJSON = withObject "NodeSetup" $ \o -> - NodeSetup - <$> o .: "nodeId" - <*> o .: "nodeIPv4Address" - <*> o .: "nodeIPv6Address" - <*> o .: "producers" - <*> o .:? "useLedgerAfterSlot" .!= DontUseLedgerPeers - -instance ToJSON adr => ToJSON (NodeSetup adr) where - toJSON ns = - object - [ "nodeId" .= nodeId ns - , "nodeIPv4Address" .= nodeIPv4Address ns - , "nodeIPv6Address" .= nodeIPv6Address ns - , "producers" .= producers ns - , "useLedgerAfterSlot" .= useLedger ns - ] - - --- | Each root peer consists of a list of access points and a shared --- 'PeerAdvertise' field. --- -data RootConfig adr = RootConfig - { rootAccessPoints :: [adr] - -- ^ a list of relay access points, each of which is either an ip address - -- or domain name and a port number. - , rootAdvertise :: PeerAdvertise - -- ^ 'advertise' configures whether the root should be advertised through - -- peer sharing. - } deriving (Eq, Show, Generic, Functor, Foldable, Traversable) - -instance FromJSON adr => FromJSON (RootConfig adr) where - parseJSON = withObject "RootConfig" $ \o -> - RootConfig - <$> o .: "accessPoints" - <*> o .:? "advertise" .!= DoNotAdvertisePeer - -instance ToJSON adr => ToJSON (RootConfig adr) where - toJSON ra = - object - [ "accessPoints" .= rootAccessPoints ra - , "advertise" .= rootAdvertise ra - ] - --- | Transforms a 'RootConfig' into a pair of 'RelayAccessPoint' and its --- corresponding 'PeerAdvertise' value. --- -rootConfigToRelayAccessPoint :: () - => forall adr. RootConfig adr - -> [(adr, PeerAdvertise)] -rootConfigToRelayAccessPoint RootConfig { rootAccessPoints, rootAdvertise } = - [ (accessPoint, rootAdvertise) | accessPoint <- rootAccessPoints ] - - --- | A local root peers group. Local roots are treated by the outbound --- governor in a special way. The node will make sure that a node has the --- requested number ('valency'/'hotValency') of connections to the local root peer group. --- 'warmValency' value is the value of warm/established connections that the node --- will attempt to maintain. By default this value will be equal to 'hotValency'. --- -data LocalRootPeersGroup adr = LocalRootPeersGroup - { localRoots :: RootConfig adr - , hotValency :: HotValency - , warmValency :: WarmValency - , trustable :: PeerTrustable - -- ^ 'trustable' configures whether the root should be trusted in fallback - -- state. - , rootDiffusionMode :: DiffusionMode - -- ^ diffusion mode; used for local root peers. - } deriving (Eq, Show, Generic, Functor, Foldable, Traversable) - --- | Does not use the 'FromJSON' instance of 'RootConfig', so that --- 'accessPoints', 'advertise', 'valency' and 'warmValency' fields are attached to the --- same object. -instance FromJSON adr => FromJSON (LocalRootPeersGroup adr) where - parseJSON = withObject "LocalRootPeersGroup" $ \o -> do - hv@(HotValency v) <- o .: "valency" - <|> o .: "hotValency" - LocalRootPeersGroup - <$> parseJSON (Object o) - <*> pure hv - <*> o .:? "warmValency" .!= WarmValency v - <*> o .:? "trustable" .!= IsNotTrustable - -- deserialise via NodeDiffusionMode - <*> (maybe InitiatorAndResponderDiffusionMode getDiffusionMode - <$> o .:? "diffusionMode") - -instance ToJSON adr => ToJSON (LocalRootPeersGroup adr) where - toJSON lrpg = - object - [ "accessPoints" .= rootAccessPoints (localRoots lrpg) - , "advertise" .= rootAdvertise (localRoots lrpg) - , "hotValency" .= hotValency lrpg - , "warmValency" .= warmValency lrpg - , "trustable" .= trustable lrpg - -- serialise via NodeDiffusionMode - , "diffusionMode" .= NodeDiffusionMode (rootDiffusionMode lrpg) - ] - -newtype LocalRootPeersGroups adr = LocalRootPeersGroups - { groups :: [LocalRootPeersGroup adr] - } deriving (Eq, Show, Generic, Functor, Foldable, Traversable) - -instance FromJSON adr => FromJSON (LocalRootPeersGroups adr) where - parseJSON = fmap LocalRootPeersGroups . parseJSONList - -instance ToJSON adr => ToJSON (LocalRootPeersGroups adr) where - toJSON = toJSONList . groups - -newtype PublicRootPeers adr = PublicRootPeers - { publicRoots :: RootConfig adr - } deriving (Eq, Show, Generic, Functor, Foldable, Traversable) - -instance FromJSON adr => FromJSON (PublicRootPeers adr) where - parseJSON = fmap PublicRootPeers . parseJSON - -instance ToJSON adr => ToJSON (PublicRootPeers adr) where - toJSON = toJSON . publicRoots - --- | Describes the P2P topology of a node. Whenever the node actually runs, --- the type parameter `adr` should be `RelayAccessPoint`. However, we might want to --- use and serialize this type with `adr` being `NodeId`, or another placeholder --- type, if we want the user to be able to edit the topology without knowing the --- actual addresses of the nodes: those might only be knowable at runtime. -data NetworkTopology adr = RealNodeTopology - { ntLocalRootPeersGroups :: !(LocalRootPeersGroups adr) - , ntPublicRootPeers :: ![PublicRootPeers adr] - , ntUseLedgerPeers :: !UseLedgerPeers - , ntUseBootstrapPeers :: !UseBootstrapPeers - , ntPeerSnapshotPath :: !(Maybe PeerSnapshotFile) - } - deriving (Eq, Show, Generic, Functor, Foldable, Traversable) - -instance AdjustFilePaths (NetworkTopology adr) where - adjustFilePaths f nt@(RealNodeTopology _ _ _ _ mPeerSnapshotPath) = - nt{ntPeerSnapshotPath = PeerSnapshotFile . f . unPeerSnapshotFile <$> mPeerSnapshotPath} - -instance FromJSON adr => FromJSON (NetworkTopology adr) where - parseJSON = withObject "NetworkTopology" $ \o -> - RealNodeTopology <$> (o .: "localRoots" ) - <*> (o .: "publicRoots" ) - <*> (o .:? "useLedgerAfterSlot" .!= DontUseLedgerPeers ) - <*> (o .:? "bootstrapPeers" .!= DontUseBootstrapPeers ) - <*> (o .:? "peerSnapshotFile") - -instance ToJSON adr => ToJSON (NetworkTopology adr) where - toJSON top = - case top of - RealNodeTopology { ntLocalRootPeersGroups - , ntPublicRootPeers - , ntUseLedgerPeers - , ntUseBootstrapPeers - , ntPeerSnapshotPath - } -> object [ "localRoots" .= ntLocalRootPeersGroups - , "publicRoots" .= ntPublicRootPeers - , "useLedgerAfterSlot" .= ntUseLedgerPeers - , "bootstrapPeers" .= ntUseBootstrapPeers - , "peerSnapshotFile" .= ntPeerSnapshotPath - ] +instance AdjustFilePaths CardanoNetworkTopology where + adjustFilePaths f nt@NetworkTopology{peerSnapshotPath} = + nt{peerSnapshotPath = f <$> peerSnapshotPath} -- | Read the `NetworkTopology` configuration from the specified file. readTopologyFile :: () - => forall adr. FromJSON adr => NodeConfiguration - -> CT.Tracer IO (StartupTrace blk) -> IO (Either Text (NetworkTopology adr)) -readTopologyFile NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, ncConsensusMode, ncProtocolFiles} tracer = runExceptT $ do + -> CT.Tracer IO (StartupTrace blk) -> IO (Either Text CardanoNetworkTopology) +readTopologyFile + NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, ncConsensusMode, ncProtocolFiles} tracer = runExceptT $ do bs <- handleIOExceptionsLiftWith handler $ BS.readFile topologyFilePath - topology@RealNodeTopology{ntUseLedgerPeers, ntUseBootstrapPeers, ntPeerSnapshotPath} <- + topology@NetworkTopology{useLedgerPeers, peerSnapshotPath, extraConfig} <- liftEither . first handlerJSON $ eitherDecode $ LBS.fromStrict bs unless (isValidTrustedPeerConfiguration topology) $ throwError handlerBootstrap - when (isBlockProducer && useLedgerPeers ntUseLedgerPeers) $ + when (isBlockProducer && isLedgerPeersEnabled useLedgerPeers) $ liftIO $ CT.traceWith tracer $ NetworkConfigUpdateWarning $ createMsg "Use of ledger peers is not recommended for BP operation" - when (isJust ntPeerSnapshotPath && not (useLedgerPeers ntUseLedgerPeers) && isBlockProducer) $ + when (isJust peerSnapshotPath && not (isLedgerPeersEnabled useLedgerPeers) && isBlockProducer) $ liftIO $ CT.traceWith tracer $ NetworkConfigUpdateInfo $ createMsg "Ledger peers and peer snapshot, although specified in the topology file, are disabled in line with recommended BP operation" - when (inPraosMode && isJust ntPeerSnapshotPath && not (useLedgerPeers ntUseLedgerPeers)) $ + when (inPraosMode && isJust peerSnapshotPath && not (isLedgerPeersEnabled useLedgerPeers)) $ if isBlockProducer then liftIO $ CT.traceWith tracer $ NetworkConfigUpdateWarning @@ -283,12 +87,12 @@ readTopologyFile NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, <> "To turn off this message enable the use of ledger peers or remove peerSnapshotFile from the topology file." - when (inGenesisMode && not (useLedgerPeers ntUseLedgerPeers) && not isBlockProducer) $ + when (inGenesisMode && not (isLedgerPeersEnabled useLedgerPeers) && not isBlockProducer) $ liftIO $ CT.traceWith tracer $ NetworkConfigUpdateWarning $ createMsg "It is recommended to use ledger peers and peer snapshot file for relay operations in Genesis mode" - when (inGenesisMode && isNothing ntPeerSnapshotPath && useLedgerPeers ntUseLedgerPeers && not isBlockProducer) $ + when (inGenesisMode && isNothing peerSnapshotPath && isLedgerPeersEnabled useLedgerPeers && not isBlockProducer) $ liftIO $ CT.traceWith tracer $ NetworkConfigUpdateWarning $ createMsg @@ -297,11 +101,11 @@ readTopologyFile NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, -- make all relative paths in the topology file relative to the topology file location adjustFilePaths (takeDirectory topologyFilePath ) <$> - if isGenesisCompatible ncConsensusMode ntUseBootstrapPeers + if isGenesisCompatible ncConsensusMode extraConfig then pure topology else do liftIO $ CT.traceWith tracer $ NetworkConfigUpdateWarning genesisIncompatible - pure $ topology{ntUseBootstrapPeers = DontUseBootstrapPeers} + pure $ topology{extraConfig = DontUseBootstrapPeers} where createMsg msg = "Cardano.Node.Configuration.Topology.readTopologyFile: " <> msg @@ -332,8 +136,6 @@ readTopologyFile NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, , "in bootstrap mode. Make sure you provide at least one bootstrap peer " , "source. " ] - useLedgerPeers DontUseLedgerPeers = False - useLedgerPeers _ = True isGenesisCompatible GenesisMode UseBootstrapPeers{} = False isGenesisCompatible _ _ = True inPraosMode = ncConsensusMode == PraosMode @@ -341,8 +143,7 @@ readTopologyFile NodeConfiguration{ncTopologyFile=TopologyFile topologyFilePath, isBlockProducer = hasProtocolFile ncProtocolFiles readTopologyFileOrError :: () - => forall adr. FromJSON adr - => NodeConfiguration -> CT.Tracer IO (StartupTrace blk) -> IO (NetworkTopology adr) + => NodeConfiguration -> CT.Tracer IO (StartupTrace blk) -> IO CardanoNetworkTopology readTopologyFileOrError nc tr = readTopologyFile nc tr >>= either (\err -> error $ "Cardano.Node.Configuration.TopologyP2P.readTopologyFile: " @@ -361,26 +162,3 @@ readPeerSnapshotFile (PeerSnapshotFile file) = do handler msg = Text.pack $ "Cardano.Node.Configuration.TopologyP2P.readPeerSnapshotFile: " <> msg - --- --- Checking for chance of progress in bootstrap phase --- - --- | This function returns false if non-trustable peers are configured --- -isValidTrustedPeerConfiguration :: NetworkTopology adr -> Bool -isValidTrustedPeerConfiguration (RealNodeTopology (LocalRootPeersGroups lprgs) _ _ ubp _) = - case ubp of - DontUseBootstrapPeers -> True - UseBootstrapPeers [] -> anyTrustable - UseBootstrapPeers (_:_) -> True - where - anyTrustable = - any (\LocalRootPeersGroup {localRoots, trustable} -> - case trustable of - IsNotTrustable -> False - IsTrustable -> not - . null - . rootAccessPoints - $ localRoots - ) lprgs diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 97afdb56d13..fdf17605c78 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -102,7 +102,8 @@ import qualified Cardano.Network.PeerSelection.Governor.PeerSelectionActions as import qualified Cardano.Network.LedgerPeerConsensusInterface as Cardano import qualified Cardano.Network.PeerSelection.PeerSelectionActions as Cardano import qualified Cardano.Network.PeerSelection.Churn as Cardano.Churn -import Cardano.Network.PeerSelection (NumberOfBigLedgerPeers (..)) +import Cardano.Network.PeerSelection (NumberOfBigLedgerPeers (..), PeerAdvertise(..)) +import Ouroboros.Network.Diffusion.Topology (NetworkTopology(..), producerAddresses) import Ouroboros.Network.Block (pattern BlockPoint, pattern GenesisPoint, HeaderHash, atSlot, withHash) import Ouroboros.Network.BlockFetch (FetchMode) @@ -121,6 +122,7 @@ import Ouroboros.Network.PeerSelection.LedgerPeers.Type (LedgerPeerSna import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) import Ouroboros.Network.PeerSelection.RootPeersDNS.PublicRootPeers (TracePublicRootPeers) +import Ouroboros.Network.ConnectionManager.Types (Provenance (..)) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency, LocalRootConfig (..), WarmValency) import Ouroboros.Network.Protocol.ChainSync.Codec @@ -436,17 +438,17 @@ handleSimpleNode blockType runP tracers nc networkMagic onKernel = do withShutdownHandling (ncShutdownConfig nc) (shutdownTracer tracers) $ do traceWith (startupTracer tracers) (StartupP2PInfo (ncDiffusionMode nc)) - nt@TopologyP2P.RealNodeTopology - { ntUseLedgerPeers - , ntUseBootstrapPeers - , ntPeerSnapshotPath + nt@NetworkTopology + { useLedgerPeers + , peerSnapshotPath + , extraConfig } <- TopologyP2P.readTopologyFileOrError nc (startupTracer tracers) let (localRoots, publicRoots) = producerAddresses nt traceWith (startupTracer tracers) $ NetworkConfig localRoots publicRoots - ntUseLedgerPeers - ntPeerSnapshotPath + useLedgerPeers + (PeerSnapshotFile <$> peerSnapshotPath) case ncPeerSharing nc of PeerSharingEnabled | hasProtocolFile (ncProtocolFiles nc) -> @@ -456,9 +458,9 @@ handleSimpleNode blockType runP tracers nc networkMagic onKernel = do _otherwise -> pure () localRootsVar <- newTVarIO localRoots publicRootsVar <- newTVarIO publicRoots - useLedgerVar <- newTVarIO ntUseLedgerPeers - useBootstrapVar <- newTVarIO ntUseBootstrapPeers - ledgerPeerSnapshotPathVar <- newTVarIO ntPeerSnapshotPath + useLedgerVar <- newTVarIO useLedgerPeers + useBootstrapVar <- newTVarIO extraConfig + ledgerPeerSnapshotPathVar <- newTVarIO (PeerSnapshotFile <$> peerSnapshotPath) ledgerPeerSnapshotVar <- newTVarIO =<< updateLedgerPeerSnapshot (startupTracer tracers) nc @@ -755,19 +757,19 @@ updateTopologyConfiguration startupTracer nc localRootsVar publicRootsVar useLed traceWith startupTracer $ NetworkConfigUpdateError $ pack "Error reading topology configuration file:" <> err - Right nt@RealNodeTopology { ntUseLedgerPeers - , ntUseBootstrapPeers - , ntPeerSnapshotPath + Right nt@NetworkTopology { useLedgerPeers + , peerSnapshotPath + , extraConfig } -> do let (localRoots, publicRoots) = producerAddresses nt traceWith startupTracer - $ NetworkConfig localRoots publicRoots ntUseLedgerPeers ntPeerSnapshotPath + $ NetworkConfig localRoots publicRoots useLedgerPeers (PeerSnapshotFile <$> peerSnapshotPath) atomically $ do writeTVar localRootsVar localRoots writeTVar publicRootsVar publicRoots - writeTVar useLedgerVar ntUseLedgerPeers - writeTVar useBootsrapPeersVar ntUseBootstrapPeers - writeTVar ledgerPeerSnapshotPathVar ntPeerSnapshotPath + writeTVar useLedgerVar useLedgerPeers + writeTVar useBootsrapPeersVar extraConfig + writeTVar ledgerPeerSnapshotPathVar (PeerSnapshotFile <$> peerSnapshotPath) #endif updateLedgerPeerSnapshot :: Tracer IO (StartupTrace blk) @@ -954,36 +956,3 @@ mkDiffusionConfiguration targetNumberOfEstablishedBigLedgerPeers = ncDeadlineTargetOfEstablishedBigLedgerPeers nc, targetNumberOfActiveBigLedgerPeers = ncDeadlineTargetOfActiveBigLedgerPeers nc } - - -producerAddresses - :: NetworkTopology RelayAccessPoint - -> ( [(HotValency, WarmValency, Map RelayAccessPoint (LocalRootConfig PeerTrustable))] - , Map RelayAccessPoint PeerAdvertise - ) - -- ^ local roots & public roots -producerAddresses RealNodeTopology { ntLocalRootPeersGroups - , ntPublicRootPeers - } = - ( map (\lrp -> ( hotValency lrp - , warmValency lrp - , Map.fromList - . map (\(addr, peerAdvertise) -> - ( addr - , LocalRootConfig { - diffusionMode = rootDiffusionMode lrp, - peerAdvertise, - extraLocalRootFlags = trustable lrp, - } - ) - ) - . rootConfigToRelayAccessPoint - $ localRoots lrp - ) - ) - (groups ntLocalRootPeersGroups) - , foldMap ( Map.fromList - . rootConfigToRelayAccessPoint - . publicRoots - ) ntPublicRootPeers - ) diff --git a/cardano-node/test/Test/Cardano/Node/Gen.hs b/cardano-node/test/Test/Cardano/Node/Gen.hs index d62cfc7b31c..66e7b701ff6 100644 --- a/cardano-node/test/Test/Cardano/Node/Gen.hs +++ b/cardano-node/test/Test/Cardano/Node/Gen.hs @@ -14,7 +14,6 @@ module Test.Cardano.Node.Gen , genNodeIPAddress , genNodeIPv4Address , genNodeIPv6Address - , genNodeSetup ) where import Cardano.Api (textShow) @@ -24,9 +23,9 @@ import Cardano.Network.PeerSelection.PeerTrustable import Cardano.Node.Configuration.NodeAddress (NodeAddress' (..), NodeHostIPAddress (..), NodeHostIPv4Address (..), NodeHostIPv6Address (..), NodeIPAddress, NodeIPv4Address, NodeIPv6Address) -import Cardano.Node.Configuration.TopologyP2P (LocalRootPeersGroup (..), - LocalRootPeersGroups (..), NetworkTopology (..), NodeSetup (..), - PeerAdvertise (..), PublicRootPeers (..), RootConfig (..)) +import Ouroboros.Network.Diffusion.Topology (LocalRootPeersGroup (..), + LocalRootPeersGroups (..), NetworkTopology (..), + PublicRootPeers (..), RootConfig (..), LocalRoots (..)) import Cardano.Node.Types import Cardano.Slotting.Slot (SlotNo (..)) import Cardano.Network.NodeToNode.Version @@ -35,6 +34,9 @@ import Ouroboros.Network.PeerSelection.LedgerPeers.Type (AfterSlot (.. import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (..), WarmValency (..)) +import Cardano.Network.Diffusion.Topology (CardanoNetworkTopology) +import Ouroboros.Network.PeerSelection.PeerAdvertise (PeerAdvertise (..)) +import Ouroboros.Network.ConnectionManager.Types (Provenance (..)) import qualified Data.Aeson as Aeson import qualified Data.Aeson.KeyMap as Aeson.KeyMap @@ -50,14 +52,14 @@ import Hedgehog.Internal.Gen () import qualified Hedgehog.Range as Range -- TODO parameterize generators -genNetworkTopology :: Gen (NetworkTopology RelayAccessPoint) +genNetworkTopology :: Gen CardanoNetworkTopology genNetworkTopology = Gen.choice - [ RealNodeTopology <$> genLocalRootPeersGroups - <*> Gen.list (Range.linear 0 10) genPublicRootPeers - <*> genUseLedgerPeers - <*> genUseBootstrapPeers - <*> genPeerSnapshotPath + [ NetworkTopology <$> genLocalRootPeersGroups + <*> Gen.list (Range.linear 0 10) genPublicRootPeers + <*> genUseLedgerPeers + <*> (fmap unPeerSnapshotFile <$> genPeerSnapshotPath) + <*> genUseBootstrapPeers ] -- | Generate valid encodings of p2p topology files @@ -145,15 +147,6 @@ genNodeIPv4Address = genNodeAddress' genNodeHostIPv4Address genNodeIPv6Address :: Gen NodeIPv6Address genNodeIPv6Address = genNodeAddress' genNodeHostIPv6Address -genNodeSetup :: Gen (NodeSetup RelayAccessPoint) -genNodeSetup = - NodeSetup - <$> Gen.word64 (Range.linear 0 10000) - <*> Gen.maybe (genNodeAddress' genNodeHostIPv4Address) - <*> Gen.maybe (genNodeAddress' genNodeHostIPv6Address) - <*> Gen.list (Range.linear 0 6) genRootConfig - <*> genUseLedgerPeers - -- Generates only fully qualified domain names. -- genRelayAddress :: Gen RelayAccessPoint @@ -172,25 +165,34 @@ genRelayAddress = <*> (fromIntegral <$> Gen.int (Range.linear 1000 9000)) ] -genRootConfig :: Gen (RootConfig RelayAccessPoint) +genRootConfig :: Gen RootConfig genRootConfig = do RootConfig <$> Gen.list (Range.linear 0 6) genRelayAddress <*> Gen.element [DoAdvertisePeer, DoNotAdvertisePeer] -genLocalRootPeersGroup :: Gen (LocalRootPeersGroup RelayAccessPoint) +genProvenance :: Gen Provenance +genProvenance = Gen.element [Outbound, Inbound] + +genLocalRoots :: Gen LocalRoots +genLocalRoots = + LocalRoots + <$> genRootConfig + <*> genProvenance + +genLocalRootPeersGroup :: Gen (LocalRootPeersGroup PeerTrustable) genLocalRootPeersGroup = do - ra <- genRootConfig - hval <- Gen.int (Range.linear 0 (length (rootAccessPoints ra))) + ra <- genLocalRoots + hval <- Gen.int (Range.linear 0 (length (rootAccessPoints (rootConfig ra)))) wval <- WarmValency <$> Gen.int (Range.linear 0 hval) - LocalRootPeersGroup ra (HotValency hval) wval <$> genPeerTrustable <*> pure InitiatorAndResponderDiffusionMode + LocalRootPeersGroup ra (HotValency hval) wval <$> pure InitiatorAndResponderDiffusionMode <*> genPeerTrustable -genLocalRootPeersGroups :: Gen (LocalRootPeersGroups RelayAccessPoint) +genLocalRootPeersGroups :: Gen (LocalRootPeersGroups PeerTrustable) genLocalRootPeersGroups = LocalRootPeersGroups <$> Gen.list (Range.linear 0 6) genLocalRootPeersGroup -genPublicRootPeers :: Gen (PublicRootPeers RelayAccessPoint) +genPublicRootPeers :: Gen PublicRootPeers genPublicRootPeers = PublicRootPeers <$> genRootConfig diff --git a/cardano-node/test/Test/Cardano/Node/Json.hs b/cardano-node/test/Test/Cardano/Node/Json.hs index 9452fa28d95..513fc62810b 100644 --- a/cardano-node/test/Test/Cardano/Node/Json.hs +++ b/cardano-node/test/Test/Cardano/Node/Json.hs @@ -4,8 +4,8 @@ module Test.Cardano.Node.Json ( tests ) where -import Cardano.Node.Configuration.TopologyP2P (NetworkTopology) -import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint) +import Cardano.Network.Diffusion.Topology (CardanoNetworkTopology) +import Cardano.Network.OrphanInstances () import Data.Aeson (decode, encode, fromJSON, toJSON) import Data.Maybe (isJust) @@ -44,13 +44,6 @@ prop_roundtrip_NodeHostAddress_JSON = Hedgehog.tripping nha toJSON fromJSON Hedgehog.tripping nha encode decode -prop_roundtrip_NodeSetup_JSON :: Property -prop_roundtrip_NodeSetup_JSON = - Hedgehog.property $ do - ns <- Hedgehog.forAll genNodeSetup - Hedgehog.tripping ns toJSON fromJSON - Hedgehog.tripping ns encode decode - prop_roundtrip_NetworkTopology_JSON :: Property prop_roundtrip_NetworkTopology_JSON = Hedgehog.property $ do @@ -64,7 +57,7 @@ prop_decode_NetworkTopology_JSON :: Property prop_decode_NetworkTopology_JSON = Hedgehog.property $ do enc <- Hedgehog.forAll genNetworkTopologyEncoding - let tp :: Maybe (NetworkTopology RelayAccessPoint) + let tp :: Maybe CardanoNetworkTopology tp = decode enc Hedgehog.assert $ isJust tp From eb0332ae50fc7ecb66eb779a187385d9cdb4bc42 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Thu, 12 Mar 2026 16:06:10 +0100 Subject: [PATCH 34/54] cardano-testnet: adapt to NetworkTopology type changes NetworkTopology was moved to ouroboros-netowork and refactored, which causes the following changes in cardano-testnet: - `createTestnetEnv` now creates a concrete topology, instead of an abstract one - `createTestnetEnv` now allocates random ports to nodes and writes them both to the concrete topology file and the to the nodes config directories - `cardanoTestnet` now does not generate the ports and instead reads the ones assigned by `createTestnetEnv` from disk --- cardano-testnet/cardano-testnet.cabal | 4 +- cardano-testnet/src/Parsers/Run.hs | 2 +- cardano-testnet/src/Testnet/Defaults.hs | 70 +++++++++--------- cardano-testnet/src/Testnet/Start/Cardano.hs | 72 +++++++++++-------- .../Cardano/Testnet/Test/Cli/KesPeriodInfo.hs | 2 +- .../Testnet/Test/Cli/LeadershipSchedule.hs | 2 +- 6 files changed, 85 insertions(+), 67 deletions(-) diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index 12e0c3811ba..4852fdf0900 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -84,7 +84,7 @@ library , network , network-mux , optparse-applicative-fork - , ouroboros-network:{api, ouroboros-network} ^>= 1.0 + , ouroboros-network:{api, framework, ouroboros-network} ^>= 1.0 , cardano-diffusion:{api, cardano-diffusion} ^>= 1.0 , prettyprinter , process @@ -257,7 +257,6 @@ test-suite cardano-testnet-test , cardano-ledger-conway , cardano-ledger-core , cardano-ledger-shelley - , cardano-node , cardano-prelude , cardano-slotting , cardano-strict-containers ^>= 0.1 @@ -276,6 +275,7 @@ test-suite cardano-testnet-test , microlens , monad-control , mtl + , ouroboros-network:api , process , resourcet , regex-compat diff --git a/cardano-testnet/src/Parsers/Run.hs b/cardano-testnet/src/Parsers/Run.hs index 050c8230ed4..04d96885ccc 100644 --- a/cardano-testnet/src/Parsers/Run.hs +++ b/cardano-testnet/src/Parsers/Run.hs @@ -62,7 +62,7 @@ createEnvOptions CardanoTestnetCreateEnvOptions , createEnvCreateEnvOptions=ceOptions } = do conf <- mkConfigAbs outputDir - createTestnetEnv + void $ createTestnetEnv testnetOptions genesisOptions ceOptions -- Do not add hashes to the main config file, so that genesis files -- can be modified without having to recompute hashes every time. diff --git a/cardano-testnet/src/Testnet/Defaults.hs b/cardano-testnet/src/Testnet/Defaults.hs index bfdaa4cf6c0..c9c92dea822 100644 --- a/cardano-testnet/src/Testnet/Defaults.hs +++ b/cardano-testnet/src/Testnet/Defaults.hs @@ -65,17 +65,17 @@ import qualified Cardano.Ledger.Shelley as Ledger import Cardano.Ledger.Shelley.Genesis import Cardano.Network.PeerSelection.Bootstrap (UseBootstrapPeers (..)) import Cardano.Network.PeerSelection.PeerTrustable (PeerTrustable (..)) -import Cardano.Node.Configuration.TopologyP2P (LocalRootPeersGroup (..), - LocalRootPeersGroups (..), NetworkTopology (..), PublicRootPeers (..), - RootConfig (..)) -import qualified Cardano.Node.Configuration.TopologyP2P as P2P -import qualified Cardano.Node.Configuration.TopologyP2P as Topology import Cardano.Tracing.Config import Cardano.Network.NodeToNode (DiffusionMode (..)) import Ouroboros.Network.PeerSelection (AfterSlot (..), PeerAdvertise (..), RelayAccessPoint (..), UseLedgerPeers (..)) import Ouroboros.Network.PeerSelection.State.LocalRootPeers (HotValency (..), WarmValency (..)) +import Ouroboros.Network.Diffusion.Topology (LocalRootPeersGroup (..), + LocalRootPeersGroups (..), NetworkTopology (..), PublicRootPeers (..), + RootConfig (..), LocalRoots (..)) +import Cardano.Network.Diffusion.Topology (CardanoNetworkTopology) +import Ouroboros.Network.ConnectionManager.Types (Provenance (..)) import Prelude @@ -466,27 +466,30 @@ mkProtVer (majorProtVer, minorProtVer) = ppProtocolVersionL' :: Lens' (PParams Ledger.ShelleyEra) ProtVer ppProtocolVersionL' = Ledger.ppLensHKD . Ledger.hkdProtocolVersionL @Ledger.ShelleyEra @Identity -defaultMainnetTopology :: Topology.NetworkTopology RelayAccessPoint +defaultMainnetTopology :: CardanoNetworkTopology defaultMainnetTopology = - Topology.RealNodeTopology { - ntLocalRootPeersGroups = LocalRootPeersGroups [ + NetworkTopology { + localRootPeersGroups = LocalRootPeersGroups [ LocalRootPeersGroup { - localRoots = RootConfig { - rootAccessPoints = - [ RelayAccessDomain "relays-new.cardano-mainnet.iohk.io" 3_001 - ], - rootAdvertise = DoAdvertisePeer + localRoots = LocalRoots { + rootConfig = RootConfig { + rootAccessPoints = + [ RelayAccessDomain "relays-new.cardano-mainnet.iohk.io" 3_001 + ], + rootAdvertise = DoAdvertisePeer + }, + provenance = Outbound }, hotValency = 2, warmValency = 2, - trustable = IsTrustable, - rootDiffusionMode = InitiatorAndResponderDiffusionMode + rootDiffusionMode = InitiatorAndResponderDiffusionMode, + extraFlags = IsTrustable } ], - ntPublicRootPeers = [], - ntUseLedgerPeers = UseLedgerPeers Always, - ntUseBootstrapPeers = DontUseBootstrapPeers, - ntPeerSnapshotPath = Nothing + extraConfig = DontUseBootstrapPeers, + publicRootPeers = [], + useLedgerPeers = UseLedgerPeers Always, + peerSnapshotPath = Nothing } defaultGenesisFilepath :: CardanoEra a -> FilePath @@ -596,9 +599,9 @@ defaultUtxoKeys n = simpleScript :: Text -> Text -simpleScript signerRequired = +simpleScript signerRequired = "{ \"scripts\": [ { \"keyHash\": \"" <> signerRequired <> "\", \"type\": \"sig\" } ], \"type\": \"all\" }" - + plutusV2Script :: Text plutusV2Script = @@ -620,30 +623,33 @@ plutusV2StakeScript :: Text plutusV2StakeScript = "{ \"type\": \"PlutusScriptV2\", \"description\": \"\", \"cborHex\": \"5907655907620100003232323232323232323232323232332232323232322232325335320193333573466e1cd55cea80124000466442466002006004646464646464646464646464646666ae68cdc39aab9d500c480008cccccccccccc88888888888848cccccccccccc00403403002c02802402001c01801401000c008cd4050054d5d0a80619a80a00a9aba1500b33501401635742a014666aa030eb9405cd5d0a804999aa80c3ae501735742a01066a02803e6ae85401cccd54060081d69aba150063232323333573466e1cd55cea801240004664424660020060046464646666ae68cdc39aab9d5002480008cc8848cc00400c008cd40a9d69aba15002302b357426ae8940088c98c80b4cd5ce01701681589aab9e5001137540026ae854008c8c8c8cccd5cd19b8735573aa004900011991091980080180119a8153ad35742a00460566ae84d5d1280111931901699ab9c02e02d02b135573ca00226ea8004d5d09aba2500223263202933573805405204e26aae7940044dd50009aba1500533501475c6ae854010ccd540600708004d5d0a801999aa80c3ae200135742a004603c6ae84d5d1280111931901299ab9c026025023135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d5d1280089aba25001135744a00226ae8940044d55cf280089baa00135742a004601c6ae84d5d1280111931900b99ab9c018017015101613263201633573892010350543500016135573ca00226ea800448c88c008dd6000990009aa80a911999aab9f0012500a233500930043574200460066ae880080508c8c8cccd5cd19b8735573aa004900011991091980080180118061aba150023005357426ae8940088c98c8050cd5ce00a80a00909aab9e5001137540024646464646666ae68cdc39aab9d5004480008cccc888848cccc00401401000c008c8c8c8cccd5cd19b8735573aa0049000119910919800801801180a9aba1500233500f014357426ae8940088c98c8064cd5ce00d00c80b89aab9e5001137540026ae854010ccd54021d728039aba150033232323333573466e1d4005200423212223002004357426aae79400c8cccd5cd19b875002480088c84888c004010dd71aba135573ca00846666ae68cdc3a801a400042444006464c6403666ae7007006c06406005c4d55cea80089baa00135742a00466a016eb8d5d09aba2500223263201533573802c02a02626ae8940044d5d1280089aab9e500113754002266aa002eb9d6889119118011bab00132001355012223233335573e0044a010466a00e66442466002006004600c6aae754008c014d55cf280118021aba200301213574200222440042442446600200800624464646666ae68cdc3a800a40004642446004006600a6ae84d55cf280191999ab9a3370ea0049001109100091931900819ab9c01101000e00d135573aa00226ea80048c8c8cccd5cd19b875001480188c848888c010014c01cd5d09aab9e500323333573466e1d400920042321222230020053009357426aae7940108cccd5cd19b875003480088c848888c004014c01cd5d09aab9e500523333573466e1d40112000232122223003005375c6ae84d55cf280311931900819ab9c01101000e00d00c00b135573aa00226ea80048c8c8cccd5cd19b8735573aa004900011991091980080180118029aba15002375a6ae84d5d1280111931900619ab9c00d00c00a135573ca00226ea80048c8cccd5cd19b8735573aa002900011bae357426aae7940088c98c8028cd5ce00580500409baa001232323232323333573466e1d4005200c21222222200323333573466e1d4009200a21222222200423333573466e1d400d2008233221222222233001009008375c6ae854014dd69aba135744a00a46666ae68cdc3a8022400c4664424444444660040120106eb8d5d0a8039bae357426ae89401c8cccd5cd19b875005480108cc8848888888cc018024020c030d5d0a8049bae357426ae8940248cccd5cd19b875006480088c848888888c01c020c034d5d09aab9e500b23333573466e1d401d2000232122222223005008300e357426aae7940308c98c804ccd5ce00a00980880800780700680600589aab9d5004135573ca00626aae7940084d55cf280089baa0012323232323333573466e1d400520022333222122333001005004003375a6ae854010dd69aba15003375a6ae84d5d1280191999ab9a3370ea0049000119091180100198041aba135573ca00c464c6401866ae700340300280244d55cea80189aba25001135573ca00226ea80048c8c8cccd5cd19b875001480088c8488c00400cdd71aba135573ca00646666ae68cdc3a8012400046424460040066eb8d5d09aab9e500423263200933573801401200e00c26aae7540044dd500089119191999ab9a3370ea00290021091100091999ab9a3370ea00490011190911180180218031aba135573ca00846666ae68cdc3a801a400042444004464c6401466ae7002c02802001c0184d55cea80089baa0012323333573466e1d40052002200723333573466e1d40092000212200123263200633573800e00c00800626aae74dd5000a4c2400292010350543100122002112323001001223300330020020011\" }" -defaultP2PTopology :: [adr] -> P2P.NetworkTopology adr -defaultP2PTopology addresses = P2P.RealNodeTopology - { ntLocalRootPeersGroups = LocalRootPeersGroups +defaultP2PTopology :: [RelayAccessPoint] -> CardanoNetworkTopology +defaultP2PTopology addresses = NetworkTopology + { localRootPeersGroups = LocalRootPeersGroups { groups = [ LocalRootPeersGroup - { localRoots = RootConfig - { rootAccessPoints = addresses - , rootAdvertise = DoNotAdvertisePeer + { localRoots = LocalRoots + { rootConfig = RootConfig + { rootAccessPoints = addresses + , rootAdvertise = DoNotAdvertisePeer + } + , provenance = Outbound } , hotValency = HotValency $ length addresses , warmValency = WarmValency $ length addresses - , trustable = IsTrustable , rootDiffusionMode = InitiatorAndResponderDiffusionMode + , extraFlags = IsTrustable } ] } - , ntPublicRootPeers = + , extraConfig = DontUseBootstrapPeers + , publicRootPeers = [ PublicRootPeers RootConfig { rootAccessPoints = [] , rootAdvertise = DoNotAdvertisePeer } ] - , ntUseLedgerPeers = DontUseLedgerPeers - , ntUseBootstrapPeers = DontUseBootstrapPeers - , ntPeerSnapshotPath = Nothing + , useLedgerPeers = DontUseLedgerPeers + , peerSnapshotPath = Nothing } diff --git a/cardano-testnet/src/Testnet/Start/Cardano.hs b/cardano-testnet/src/Testnet/Start/Cardano.hs index 661b11af59a..cb754d65516 100644 --- a/cardano-testnet/src/Testnet/Start/Cardano.hs +++ b/cardano-testnet/src/Testnet/Start/Cardano.hs @@ -35,11 +35,11 @@ import qualified Cardano.Api.Byron as Byron import Cardano.CLI.Type.Common (SigningKeyFile) import Cardano.Node.Configuration.NodeAddress (NodeAddress' (..), - NodeHostIPv4Address (..)) -import qualified Cardano.Node.Configuration.TopologyP2P as P2P + NodeHostIPv4Address (..), PortNumber) import Cardano.Prelude (NonEmpty ((:|)), canonicalEncodePretty) import Cardano.TxGenerator.Setup.NixService (NixServiceOptions (..), NodeDescription (..)) import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) +import Cardano.Network.Diffusion.Topology (CardanoNetworkTopology) import Prelude hiding (lines) @@ -107,6 +107,7 @@ createTestnetEnv :: () => HasCallStack => MonadIO m => MonadThrow m + => MonadFail m => CardanoTestnetOptions -> GenesisOptions -> CreateEnvOptions @@ -142,14 +143,24 @@ createTestnetEnv liftIOAnnotated . LBS.writeFile configurationFile $ A.encodePretty $ Object config - -- Create network topology, with abstract IDs in lieu of addresses + portNumbers <- forM (NEL.zip (1 :| [2..]) cardanoNodes) + (\(i, _nodeOption) -> (i,) <$> H.randomPort testnetDefaultIpv4Address) + + let portNumbersMap = Map.fromList (NEL.toList portNumbers) + + -- Create network topology and write port files let nodeIds = fst <$> NEL.zip (1 :| [2..]) cardanoNodes forM_ nodeIds $ \i -> do let nodeDataDir = tmpAbsPath Defaults.defaultNodeDataDir i liftIOAnnotated $ IO.createDirectoryIfMissing True nodeDataDir - let producers = NodeId <$> NEL.filter (/= i) nodeIds - topology = Defaults.defaultP2PTopology producers + -- Write port file + case Map.lookup i portNumbersMap of + Just port -> liftIOAnnotated $ writeFile (nodeDataDir "port") (show port) + Nothing -> error $ "Port not found for node " <> show i + + producers <- mapM (idToRemoteAddressP2P portNumbersMap) $ NodeId <$> NEL.filter (/= i) nodeIds + let topology = Defaults.defaultP2PTopology producers liftIOAnnotated . LBS.writeFile (nodeDataDir "topology.json") $ A.encodePretty topology -- | Starts a number of nodes, as configured by the value of the 'cardanoNodes' @@ -268,38 +279,23 @@ cardanoTestnet , paymentKeyInfoAddr = Text.pack paymentAddr } - portNumbersWithNodeOptions <- forM cardanoNodes - (\nodeOption -> (nodeOption,) <$> H.randomPort testnetDefaultIpv4Address) - - let portNumbers = NEL.zip (1 :| [2..]) $ snd <$> portNumbersWithNodeOptions - portNumbersMap = Map.fromList (NEL.toList portNumbers) - - idToRemoteAddressP2P :: () - => MonadIO m - => HasCallStack - => NodeId -> m RelayAccessPoint - idToRemoteAddressP2P (NodeId i) = case Map.lookup i portNumbersMap of - Just port -> pure $ RelayAccessAddress - (showIpv4Address testnetDefaultIpv4Address) - port - Nothing -> do - throwString $ "Found node id that was unaccounted for: " ++ show i - - forM_ portNumbers $ \(i, portNumber) -> do + -- Read port numbers from disk (written by createTestnetEnv) + portNumbers <- forM (NEL.zip (1 :| [2..]) cardanoNodes) $ \(i, _nodeOption) -> do let nodeDataDir = tmpAbsPath Defaults.defaultNodeDataDir i - liftIOAnnotated $ IO.createDirectoryIfMissing True nodeDataDir - liftIOAnnotated $ writeFile (nodeDataDir "port") (show portNumber) - let topologyPath = tmpAbsPath Defaults.defaultNodeDataDir i "topology.json" + portPath = nodeDataDir "port" + portStr <- liftIOAnnotated $ readFile portPath + let port = read portStr :: PortNumber + let topologyPath = nodeDataDir "topology.json" tBytes <- liftIOAnnotated $ LBS.readFile topologyPath case eitherDecode tBytes of - Right (abstractTopology :: P2P.NetworkTopology NodeId) -> do - topology <- mapM idToRemoteAddressP2P abstractTopology - liftIOAnnotated $ LBS.writeFile topologyPath $ encode topology + Right (abstractTopology :: CardanoNetworkTopology) -> do + liftIOAnnotated $ LBS.writeFile topologyPath $ encode abstractTopology Left e -> do -- There can be multiple reasons for why both decodings have failed. -- Here we assume, very optimistically, that the user has already -- instantiated it with a concrete topology file. liftIOAnnotated . putStrLn $ "Could not decode topology file: " <> topologyPath <> ". This may be okay. Reason for decoding failure is:\n" ++ e + pure (i, port) -- If necessary, update the time stamps in Byron and Shelley Genesis files. -- This is a QoL feature so that users who edit their configuration files don't @@ -321,7 +317,12 @@ cardanoTestnet let shelleyGenesis' = shelleyGenesis{sgSystemStart = startTime} liftIOAnnotated . LBS.writeFile shelleyGenesisFile $ A.encodePretty shelleyGenesis' - eTestnetNodes <- forConcurrently (NEL.zip (1 :| [2..]) portNumbersWithNodeOptions) $ \(i, (nodeOptions, port)) -> do + let portNumbersMap = Map.fromList (NEL.toList portNumbers) + + eTestnetNodes <- forConcurrently (NEL.zip (1 :| [2..]) cardanoNodes) $ \(i, nodeOptions) -> do + port <- case Map.lookup i portNumbersMap of + Just p -> pure p + Nothing -> throwString $ "Port not found for node " <> show i let nodeName = Defaults.defaultNodeName i nodeDataDir = tmpAbsPath Defaults.defaultNodeDataDir i nodePoolKeysDir = tmpAbsPath Defaults.defaultSpoKeysDir i @@ -490,6 +491,17 @@ cardanoTestnet throwString $ nodeName <> " was unable to produce any blocks for " <> show timeoutSeconds <> "s" +idToRemoteAddressP2P :: () + => MonadIO m + => HasCallStack + => Map.Map Int PortNumber -> NodeId -> m RelayAccessPoint +idToRemoteAddressP2P portNumbersMap (NodeId i) = case Map.lookup i portNumbersMap of + Just port -> pure $ RelayAccessAddress + (showIpv4Address testnetDefaultIpv4Address) + port + Nothing -> do + throwString $ "Found node id that was unaccounted for: " ++ show i + -- | A convenience wrapper around `createTestnetEnv` and `cardanoTestnet` createAndRunTestnet :: () => HasCallStack diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs index bdb2b0a1e33..16bdca8c89e 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs @@ -14,9 +14,9 @@ module Cardano.Testnet.Test.Cli.KesPeriodInfo import Cardano.Api as Api import Cardano.CLI.Type.Output -import Cardano.Node.Configuration.TopologyP2P import Cardano.Testnet import Cardano.Testnet.Test.Misc +import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) import Prelude diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs index 6c44f25017b..70fbf358315 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs @@ -16,8 +16,8 @@ module Cardano.Testnet.Test.Cli.LeadershipSchedule import Cardano.Api import qualified Cardano.Api as Api -import Cardano.Node.Configuration.TopologyP2P import Cardano.Testnet +import Ouroboros.Network.PeerSelection.RelayAccessPoint (RelayAccessPoint (..)) import Prelude From d43836859832b5ceed2a35b4228d96c14b79a822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20W=C3=B3jtowicz?= Date: Fri, 13 Mar 2026 15:13:43 +0100 Subject: [PATCH 35/54] cleanup --- cardano-node/src/Cardano/Node/Run.hs | 23 ++++++++----------- .../Cardano/Node/Tracing/Tracers/Startup.hs | 2 +- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index fdf17605c78..2dcedd0e882 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -797,25 +797,20 @@ updateLedgerPeerSnapshot startupTracer <- liftIO $ readPeerSnapshotFile snapshotFile lps <- case eSnapshot of Left e -> do - traceL $ NetworkConfigUpdateError e case ncConsensusMode of - GenesisMode -> error "updateLedgerPeerSnapshot error" - PraosMode -> empty + GenesisMode -> error $ Text.unpack e + PraosMode -> empty <$ traceL $ NetworkConfigUpdateError e Right lps -> pure lps fileSlot <- case lps of LedgerBigPeerSnapshotV23 pt magic _pools | networkMagic == magic, BlockPoint { atSlot } <- pt -> pure atSlot - | GenesisPoint <- pt -> do - traceL $ NetworkConfigUpdateError "Invalid peer snapshot file" - error "updateLedgerPeerSnapshot error" - | otherwise -> do - traceL . NetworkConfigUpdateError . pack $ - "NetworkMagic " <> show networkMagic <> " doesn't match " - <> "peer snapshot NetworkMagic " <> show magic - error "updateLedgerPeerSnapshot error" - LedgerPeerSnapshotV2 {} -> do - traceL $ NetworkConfigUpdateError "Unsupported legacy peer snapshot version." - error "updateLedgerPeerSnapshot error" + | GenesisPoint <- pt -> + error "GenesisPoint is not a valid value in the peer snapshot file" + | otherwise -> error $ + "NetworkMagic " <> show networkMagic <> " doesn't match " + <> "peer snapshot NetworkMagic " <> show magic + LedgerPeerSnapshotV2 {} -> + error "Unsupported legacy peer snapshot version." case afterSlot of Always -> do traceL $ LedgerPeerSnapshotLoaded fileSlot diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs index d6e259d72f6..1c3c8df85bb 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs @@ -574,7 +574,7 @@ ppStartupInfoTrace (NetworkConfig localRoots publicRoots useLedgerPeers peerSnap ] ppStartupInfoTrace (LedgerPeerSnapshotLoaded slotNo) = - "Topology: Peer snapshot containing ledger peers " <> showT slotNo <> " loaded." + "Topology: Peer snapshot containing ledger peers recorded at " <> showT slotNo <> " loaded." ppStartupInfoTrace NonP2PWarning = nonP2PWarningMessage From a38f95ea157edd52cde7837bfdafe4b63b6ed4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20W=C3=B3jtowicz?= Date: Fri, 13 Mar 2026 16:06:52 +0100 Subject: [PATCH 36/54] disable txsubmission init delay in tests --- cardano-node/test/Test/Cardano/Node/POM.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cardano-node/test/Test/Cardano/Node/POM.hs b/cardano-node/test/Test/Cardano/Node/POM.hs index a6ef69f0467..ed00348b4a8 100644 --- a/cardano-node/test/Test/Cardano/Node/POM.hs +++ b/cardano-node/test/Test/Cardano/Node/POM.hs @@ -27,7 +27,6 @@ import Cardano.Network.NodeToNode (AcceptedConnectionsLimit (..), DiffusionMode (InitiatorAndResponderDiffusionMode)) import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..)) import Ouroboros.Network.TxSubmission.Inbound.V2.Types - (defaultTxSubmissionInitDelay) import Data.Monoid (Last (..)) import Data.Text (Text) @@ -293,7 +292,7 @@ eExpectedConfig = do , ncResponderCoreAffinityPolicy = NoResponderCoreAffinity , ncLedgerDbConfig = LedgerDbConfiguration DefaultNumOfDiskSnapshots DefaultSnapshotInterval DefaultQueryBatchSize V2InMemory noDeprecatedOptions , ncTxSubmissionLogicVersion = TxSubmissionLogicV1 - , ncTxSubmissionInitDelay = defaultTxSubmissionInitDelay + , ncTxSubmissionInitDelay = NoTxSubmissionInitDelay } -- ----------------------------------------------------------------------------- From 3c79501ed1ecc19483036eed5b2ad41625bb66bb Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Tue, 17 Mar 2026 10:47:20 +0100 Subject: [PATCH 37/54] Bump Network to 1.1 --- bench/locli/locli.cabal | 2 +- cardano-node/cardano-node.cabal | 2 +- cardano-testnet/cardano-testnet.cabal | 2 +- cardano-tracer/cardano-tracer.cabal | 2 +- trace-forward/trace-forward.cabal | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bench/locli/locli.cabal b/bench/locli/locli.cabal index 90335b330cf..282c9c16712 100644 --- a/bench/locli/locli.cabal +++ b/bench/locli/locli.cabal @@ -127,7 +127,7 @@ library , hashable , optparse-applicative , ouroboros-consensus:ouroboros-consensus - , ouroboros-network:api ^>= 1.0 + , ouroboros-network:api ^>= 1.1 , sop-core , split , sqlite-easy >= 1.1.0.1 diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index c7f9101ba29..f3c0568a417 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -184,7 +184,7 @@ library , nothunks , optparse-applicative , ouroboros-consensus:{ouroboros-consensus, lmdb, lsm, cardano, diffusion, protocol} ^>= 1.0 - , ouroboros-network:{api, ouroboros-network, orphan-instances, framework, protocols, framework-tracing, tracing} ^>= 1.0 + , ouroboros-network:{api, ouroboros-network, orphan-instances, framework, protocols, framework-tracing, tracing} ^>= 1.1 , cardano-diffusion:{api, cardano-diffusion, orphan-instances, tracing} ^>=1.0 , prettyprinter , prettyprinter-ansi-terminal diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index 4852fdf0900..c8e380c0f2b 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -84,7 +84,7 @@ library , network , network-mux , optparse-applicative-fork - , ouroboros-network:{api, framework, ouroboros-network} ^>= 1.0 + , ouroboros-network:{api, framework, ouroboros-network} ^>= 1.1 , cardano-diffusion:{api, cardano-diffusion} ^>= 1.0 , prettyprinter , process diff --git a/cardano-tracer/cardano-tracer.cabal b/cardano-tracer/cardano-tracer.cabal index 4987bc59d89..48fc156cf2f 100644 --- a/cardano-tracer/cardano-tracer.cabal +++ b/cardano-tracer/cardano-tracer.cabal @@ -187,7 +187,7 @@ library , network , network-mux >= 0.8 , optparse-applicative - , ouroboros-network:{api, framework} ^>= 1.0 + , ouroboros-network:{api, framework} ^>= 1.1 , signal , slugify , smtp-mail ^>= 0.5 diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index a7539dd9172..77b489be267 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -69,7 +69,7 @@ library , io-classes , network , network-mux - , ouroboros-network:{api, framework} ^>= 1.0 + , ouroboros-network:{api, framework} ^>= 1.1 , ekg-core , ekg-forward >= 1.2 , singletons ^>= 3.0 From c5a319350988f96cd4b36dac9b79fd6a68c9e98c Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 18 Mar 2026 11:25:37 +0100 Subject: [PATCH 38/54] cardano-submit-api: adapt to API and Network changes --- .../Cardano/TxSubmit/Tracing/TraceSubmitApi.hs | 2 ++ cardano-submit-api/src/Cardano/TxSubmit/Types.hs | 2 ++ cardano-submit-api/src/Cardano/TxSubmit/Web.hs | 15 ++++++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cardano-submit-api/src/Cardano/TxSubmit/Tracing/TraceSubmitApi.hs b/cardano-submit-api/src/Cardano/TxSubmit/Tracing/TraceSubmitApi.hs index a1924ecb434..58ef4f47578 100644 --- a/cardano-submit-api/src/Cardano/TxSubmit/Tracing/TraceSubmitApi.hs +++ b/cardano-submit-api/src/Cardano/TxSubmit/Tracing/TraceSubmitApi.hs @@ -52,6 +52,8 @@ renderTxCmdError (TxCmdTxSubmitValidationError e) = "transaction submit error " <> textShow validationErr TxValidationEraMismatch eraMismatch -> "transaction submit era mismatch" <> textShow eraMismatch +renderTxCmdError (TxCmdTxSubmitConnectionError e) = + "transaction connection error " <> textShow e instance LogFormatting TraceSubmitApi where forMachine _ ApplicationStopping = mempty diff --git a/cardano-submit-api/src/Cardano/TxSubmit/Types.hs b/cardano-submit-api/src/Cardano/TxSubmit/Types.hs index 07d5f29df4e..ccbccd3e4cf 100644 --- a/cardano-submit-api/src/Cardano/TxSubmit/Types.hs +++ b/cardano-submit-api/src/Cardano/TxSubmit/Types.hs @@ -93,6 +93,7 @@ data TxCmdError = TxCmdSocketEnvError EnvSocketError | TxCmdTxReadError !RawCborDecodeError | TxCmdTxSubmitValidationError !TxValidationErrorInCardanoMode + | TxCmdTxSubmitConnectionError !Text deriving instance Generic TxCmdError @@ -108,6 +109,7 @@ renderTxCmdError = \case case e of TxValidationErrorInCardanoMode err -> "transaction submit error " <> T.pack (show err) TxValidationEraMismatch eraMismatch -> "transaction submit era mismatch" <> textShow eraMismatch + TxCmdTxSubmitConnectionError msg -> "transaction submit connection error: " <> msg -- | Servant API which provides access to tx submission webapi type TxSubmitApi = "api" :> ToServantApi TxSubmitApiRecord diff --git a/cardano-submit-api/src/Cardano/TxSubmit/Web.hs b/cardano-submit-api/src/Cardano/TxSubmit/Web.hs index f646bb0422a..307c79e16ce 100644 --- a/cardano-submit-api/src/Cardano/TxSubmit/Web.hs +++ b/cardano-submit-api/src/Cardano/TxSubmit/Web.hs @@ -17,8 +17,10 @@ import Cardano.Api (AllegraEra, AnyCardanoEra (AnyCardanoEra), AsType IsCardanoEra (..), LocalNodeConnectInfo (LocalNodeConnectInfo, localConsensusModeParams, localNodeNetworkId, localNodeSocketPath), NetworkId, SerialiseAsCBOR (..), ShelleyBasedEra (..), ShelleyEra, SocketPath, - ToJSON, Tx, TxId (..), TxInMode (TxInMode), TxValidationErrorInCardanoMode (..), + ToJSON, Tx, TxId (..), TxInMode (TxInMode), + TxValidationErrorInCardanoMode (..), getTxBody, getTxId, submitTxToNodeLocal) +import qualified Cardano.Api import Cardano.Binary (DecoderError (..)) import qualified Cardano.Crypto.Hash.Class as Crypto @@ -28,7 +30,8 @@ import qualified Cardano.TxSubmit.Rest.Web as Web import Cardano.TxSubmit.Tracing.TraceSubmitApi (TraceSubmitApi (..)) import Cardano.TxSubmit.Types (EnvSocketError (..), RawCborDecodeError (..), TxCmdError (..), TxSubmitApi, TxSubmitApiRecord (..), - TxSubmitWebApiError (TxSubmitFail), renderTxCmdError) + TxSubmitWebApiError, renderTxCmdError) +import qualified Cardano.TxSubmit.Types as Types import Cardano.TxSubmit.Util (logException) import Ouroboros.Consensus.Cardano.Block (EraMismatch (..)) import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx @@ -140,11 +143,13 @@ txSubmitPost trace p@(CardanoModeParams cModeParams) networkId socketPath txByte res <- liftIO $ submitTxToNodeLocal localNodeConnInfo txInMode case res of - Net.Tx.SubmitSuccess -> do + Cardano.Api.TxSubmitSuccess -> do liftIO $ T.putStrLn "Transaction successfully submitted." return $ getTxId (getTxBody tx) - Net.Tx.SubmitFail e -> + Cardano.Api.TxSubmitFail e -> left $ TxCmdTxSubmitValidationError e + Cardano.Api.TxSubmitError e -> + left $ TxCmdTxSubmitConnectionError (T.pack (show e)) where handle :: ExceptT TxCmdError IO TxId -> Handler TxId handle f = do @@ -161,7 +166,7 @@ txSubmitPost trace p@(CardanoModeParams cModeParams) networkId socketPath txByte case res of Left err -> do liftIO $ traceWith trace $ EndpointFailedToSubmitTransaction err - errorResponse (TxSubmitFail err) + errorResponse (Types.TxSubmitFail err) Right txid -> do liftIO $ traceWith trace $ EndpointSubmittedTransaction txid pure txid From 5cf7fc178a6387430b771361d7ed3a2f62fb57b5 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 18 Mar 2026 11:34:06 +0100 Subject: [PATCH 39/54] tx-generator: adapt to changes in API and Network --- .../src/Cardano/Benchmarking/OuroborosImports.hs | 5 ++--- .../src/Cardano/Benchmarking/Script/Core.hs | 10 +++++++--- bench/tx-generator/src/Cardano/TxGenerator/Utils.hs | 3 +-- bench/tx-generator/tx-generator.cabal | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/OuroborosImports.hs b/bench/tx-generator/src/Cardano/Benchmarking/OuroborosImports.hs index 38bbb53d0cf..f16d6dd0f69 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/OuroborosImports.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/OuroborosImports.hs @@ -23,7 +23,7 @@ module Cardano.Benchmarking.OuroborosImports import Cardano.Api (BlockType (..), ConsensusModeParams (..), EpochSlots (..), LocalNodeConnectInfo (..), NetworkId (..), PaymentKey, SigningKey, SocketPath, - TxInMode, TxValidationErrorInCardanoMode, protocolInfo, submitTxToNodeLocal) + TxInMode, TxSubmitResult (..), protocolInfo, submitTxToNodeLocal) import Cardano.CLI.Type.Common (SigningKeyFile) import Cardano.Ledger.Shelley.Genesis (ShelleyGenesis) @@ -35,7 +35,6 @@ import Ouroboros.Consensus.Config (TopLevelConfig, configBlock, config import Ouroboros.Consensus.Config.SupportsNode (ConfigSupportsNode (..), getNetworkMagic) import Ouroboros.Consensus.Node (ProtocolInfo (..)) import Ouroboros.Consensus.Shelley.Eras (StandardCrypto) -import Ouroboros.Network.Protocol.LocalTxSubmission.Type (SubmitResult (..)) import Prelude @@ -61,4 +60,4 @@ makeLocalConnectInfo :: NetworkId -> SocketPath -> LocalNodeConnectInfo makeLocalConnectInfo networkId socketPath = LocalNodeConnectInfo (CardanoModeParams (EpochSlots 21600)) networkId socketPath -type LocalSubmitTx = (TxInMode -> IO (SubmitResult TxValidationErrorInCardanoMode)) +type LocalSubmitTx = (TxInMode -> IO TxSubmitResult) diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs b/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs index 291be5f4b85..cfb742008dd 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs @@ -207,16 +207,20 @@ waitForEra era = do liftIO $ threadDelay 1_000_000 waitForEra era -localSubmitTx :: TxInMode -> ActionM (SubmitResult TxValidationErrorInCardanoMode) +localSubmitTx :: TxInMode -> ActionM TxSubmitResult localSubmitTx tx = do submit <- getLocalSubmitTx ret <- liftIO $ submit tx case ret of - SubmitSuccess -> return ret - SubmitFail e -> do + TxSubmitSuccess -> return ret + TxSubmitFail e -> do let msg = concat [ "local submit failed: " , show e , " (" , show tx , ")" ] traceDebug msg return ret + TxSubmitError e -> do + let msg = concat [ "local submit error: " , show e , " (" , show tx , ")" ] + traceDebug msg + return ret -- throwE $ ApiError msg -- TODO: diff --git a/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs b/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs index d6d5ed65adf..6565dbc1575 100644 --- a/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs +++ b/bench/tx-generator/src/Cardano/TxGenerator/Utils.hs @@ -18,7 +18,6 @@ import qualified Cardano.Ledger.Coin as L import Cardano.TxGenerator.Types import Data.Maybe (fromJust) -import Data.Maybe.Strict import GHC.Stack @@ -77,7 +76,7 @@ mkTxFee = TxFeeExplicit shelleyBasedEra -- `TxValidityNoUpperBound` with the constraint of `IsShelleyBasedEra`. mkTxValidityUpperBound :: forall era. IsShelleyBasedEra era => SlotNo -> TxValidityUpperBound era mkTxValidityUpperBound slotNo = - TxValidityUpperBound (fromJust $ forEraMaybeEon (cardanoEra @era)) (SJust slotNo) + TxValidityUpperBound (fromJust $ forEraMaybeEon (cardanoEra @era)) (Just slotNo) -- | `mkTxInModeCardano` never uses the `TxInByronSpecial` constructor -- because its type enforces it being a Shelley-based era. diff --git a/bench/tx-generator/tx-generator.cabal b/bench/tx-generator/tx-generator.cabal index 2e0ae8f93a6..260e7eb4cee 100644 --- a/bench/tx-generator/tx-generator.cabal +++ b/bench/tx-generator/tx-generator.cabal @@ -140,7 +140,7 @@ library , network-mux , optparse-applicative , ouroboros-consensus:{ouroboros-consensus, cardano, diffusion} >= 1.0 - , ouroboros-network:{api, framework, framework-tracing, ouroboros-network, protocols} + , ouroboros-network:{api, framework, framework-tracing, ouroboros-network, protocols} >= 1.1 , plutus-ledger-api , plutus-tx , random From 44e38b86d0a929d07c466a5f35b905e3470dca34 Mon Sep 17 00:00:00 2001 From: Georgy Lukyanov Date: Wed, 18 Mar 2026 11:40:26 +0100 Subject: [PATCH 40/54] cardano-testnet: adapt to changes in `TxSubmitResult` --- .../Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs index 3aa0e5b1a3b..11bb2908424 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs @@ -13,7 +13,6 @@ where import Cardano.Api hiding (txId) import qualified Cardano.Api.Ledger as L import qualified Cardano.Api.Network as Net -import qualified Cardano.Api.Network as Net.Tx import qualified Cardano.Api.UTxO as Utxo import Cardano.Testnet @@ -298,8 +297,9 @@ submitTx submitTx sbe connectionInfo tx = withFrozenCallStack $ H.evalIO (submitTxToNodeLocal connectionInfo (TxInMode sbe tx)) >>= \case - Net.Tx.SubmitFail reason -> pure . Left $ reason - Net.Tx.SubmitSuccess -> pure $ Right () + TxSubmitFail reason -> pure . Left $ reason + TxSubmitSuccess -> pure $ Right () + TxSubmitError err -> error $ "submitTxToNodeLocal connection error: " <> show err expectTxSubmissionSuccess :: HasCallStack From 03212082c1e8ecfe930dc199903d81b98e7e9fa9 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 15:48:26 -0600 Subject: [PATCH 41/54] nixosTests: add ci test for db tools vs node compatibility --- nix/nixos/tests/cardano-node-dbtools.nix | 123 +++++++++++++++++++++++ nix/nixos/tests/default.nix | 3 + 2 files changed, 126 insertions(+) create mode 100644 nix/nixos/tests/cardano-node-dbtools.nix diff --git a/nix/nixos/tests/cardano-node-dbtools.nix b/nix/nixos/tests/cardano-node-dbtools.nix new file mode 100644 index 00000000000..5cf699d99fe --- /dev/null +++ b/nix/nixos/tests/cardano-node-dbtools.nix @@ -0,0 +1,123 @@ +{pkgs, ...}: let + inherit (lib) getExe; + inherit (pkgs) cardanoNodePackages lib; + synthAsserted = cardanoNodePackages.db-synthesizer.passthru.asserted; + + # NixosTest script fns supporting a timeout have a default of 900 seconds. + # + # There is no pre-existing history for chain synthesis, and default + # cardano-testnet genesis parameters set epochs to be short and fast, so a 30 + # second global timeout should be more than sufficient. + globalTimeout = 30; + + testDir = "testnet"; +in { + inherit globalTimeout; + + name = "cardano-node-dbtools-test"; + nodes = { + machine = _: { + nixpkgs.pkgs = pkgs; + + environment = { + systemPackages = with cardanoNodePackages; [ + cardano-cli + cardano-node + cardano-testnet + db-analyser + db-synthesizer + db-truncater + ]; + + variables = { + CARDANO_CLI = getExe cardanoNodePackages.cardano-cli; + CARDANO_NODE = getExe cardanoNodePackages.cardano-node; + KES_KEY = "${testDir}/pools-keys/pool1/kes.skey"; + OPCERT = "${testDir}/pools-keys/pool1/opcert.cert"; + VRF_KEY = "${testDir}/pools-keys/pool1/vrf.skey"; + }; + }; + }; + }; + + testScript = '' + import re + countRegex = r'Counted (\d+) blocks\.' + + start_all() + print(machine.succeed("cardano-node --version")) + print(machine.succeed("cardano-cli --version")) + print(machine.succeed("cardano-testnet version")) + + # For create-env the default security parameter is 5, active slot coeff = 0.05. + # Epoch length should be >= 2 * stability_window = 2 * 3 * k / f = 600 slots + # Epoch length ideally should also be divisible by 10k = 500 slots + print(machine.succeed("cardano-testnet create-env --epoch-length 1000 --output ${testDir}")) + + print(machine.succeed("echo Synthesize one epoch")) + print(machine.succeed("db-synthesizer \ + --config ${testDir}/configuration.yaml \ + --db db \ + --shelley-operational-certificate $OPCERT \ + --shelley-vrf-key $VRF_KEY \ + --shelley-kes-key $KES_KEY \ + --epochs 1 \ + 2>&1") + ) + + print(machine.succeed("echo Analyze synthesized chain")) + out = machine.succeed("db-analyser \ + --db db \ + --count-blocks \ + --in-mem \ + --config ${testDir}/configuration.yaml \ + 2>&1" + ) + print(out) + match = re.search(countRegex, out) + assert match is not None, f"Could not find block count in post-synthesis output: {out}" + blocks_before = int(match.group(1)) + print(f"Found {blocks_before} blocks post synthesis") + + assert blocks_before > 0, f"No blocks were synthesized: {blocks_before}" + + print(machine.succeed("echo Truncate synthesized chain")) + print(machine.succeed("db-truncater \ + --db db \ + --truncate-after-block 1 \ + --verbose \ + --config ${testDir}/configuration.yaml \ + 2>&1") + ) + + print(machine.succeed("echo Analyze truncated chain")) + out = machine.succeed("db-analyser \ + --db db \ + --count-blocks \ + --in-mem \ + --config ${testDir}/configuration.yaml \ + 2>&1" + ) + print(out) + match = re.search(countRegex, out) + assert match is not None, f"Could not find block count in post-truncation output: {out}" + blocks_after = int(match.group(1)) + print(f"Found {blocks_after} blocks post truncation") + + # Blocks are zero indexed, so truncation after 1 leaves block 0 and block 1 expected to remain. + assert blocks_after == 2, f"Expected exactly 2 blocks after truncation, got {blocks_after}" + assert blocks_before > blocks_after, f"Pre-truncation blockHeight of {blocks_before} should be larger than post-truncation blockHeight of {blocks_after}" + + # Run with GHC asserts enabled -- a non-zero exit here indicates an assertion violation + print(machine.succeed("echo Check chain synthesis for assertion failures")) + print(machine.succeed("${synthAsserted}/bin/db-synthesizer \ + --config ${testDir}/configuration.yaml \ + --db db-asserted \ + --shelley-operational-certificate $OPCERT \ + --shelley-vrf-key $VRF_KEY \ + --shelley-kes-key $KES_KEY \ + --epochs 1 \ + 2>&1") + ) + ''; +} diff --git a/nix/nixos/tests/default.nix b/nix/nixos/tests/default.nix index ad54ec401c6..c058a7d00e3 100644 --- a/nix/nixos/tests/default.nix +++ b/nix/nixos/tests/default.nix @@ -25,6 +25,9 @@ in { # Tests the linux release binary envs with pre-bundled config. cardanoNodeArtifact = callTest ./cardano-node-artifact.nix {inherit cardano-node-linux;}; + # Tests db-tools (synthesizer, analyser, truncater) against a cardano-testnet create-env environment. + cardanoNodeDbtools = callTest ./cardano-node-dbtools.nix {}; + # Tests a mainnet edge node with submit-api using nixos service config. cardanoNodeEdge = callTest ./cardano-node-edge.nix {}; } From caf568e0ce7a5741aa838aba8b2d9f96fc08c738 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Mon, 2 Mar 2026 19:14:13 -0600 Subject: [PATCH 42/54] releaseBins: add kes-agent bins for linux arches only --- flake.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 142d99015f5..8b6d8311e80 100644 --- a/flake.nix +++ b/flake.nix @@ -134,6 +134,7 @@ # Add some executables from other relevant packages inherit (bech32.components.exes) bech32; inherit (ouroboros-consensus.components.exes) db-analyser db-synthesizer db-truncater snapshot-converter; + inherit (kes-agent.components.exes) kes-agent kes-agent-control; # Add cardano-node, cardano-cli and tx-generator with their git revision stamp. # Keep available an alternative without the git revision, like the other # passthru (profiled and asserted in nix/haskell.nix) that @@ -312,10 +313,15 @@ "db-analyser" "db-synthesizer" "db-truncater" + "kes-agent" + "kes-agent-control" "snapshot-converter" "tx-generator" ]; + # Binaries only supported on Linux; excluded from Windows and Darwin releases. + linuxOnlyBins = ["kes-agent" "kes-agent-control"]; + ciJobsVariants = mapAttrs ( _: p: @@ -383,7 +389,7 @@ inherit (exes.cardano-node.identifier) version; platform = "win"; exes = collect isDerivation ( - filterAttrs (n: _: elem n releaseBins) projectExes + filterAttrs (n: _: elem n releaseBins && !(elem n linuxOnlyBins)) projectExes ); }; internal.roots.project = windowsProject.roots; @@ -403,7 +409,7 @@ inherit (exes.cardano-node.identifier) version; platform = "macos"; exes = collect isDerivation ( - filterAttrs (n: _: elem n releaseBins) (collectExes project) + filterAttrs (n: _: elem n releaseBins && !(elem n linuxOnlyBins)) (collectExes project) ); }; shells = removeAttrs devShells ["profiled"]; From daf6ec4b40a496098e682b9d210df7ba22548523 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Fri, 13 Feb 2026 13:14:12 -0600 Subject: [PATCH 43/54] cardano-tracer: rename runCommandNoCCLocal for nixpkgs 25.11 --- nix/nixos/cardano-tracer-service.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/nixos/cardano-tracer-service.nix b/nix/nixos/cardano-tracer-service.nix index 0309b549e9b..8d62104ce53 100644 --- a/nix/nixos/cardano-tracer-service.nix +++ b/nix/nixos/cardano-tracer-service.nix @@ -82,7 +82,7 @@ with builtins; let // cfg.extraConfig; prettyConfig = - (pkgs.runCommandNoCCLocal "cardano-tracer-config.json" {} '' + (pkgs.runCommandLocal "cardano-tracer-config.json" {} '' ${getExe pkgs.jq} --sort-keys \ < ${toFile "cardano-tracer-unpretty-config.json" (toJSON tracerConfig)} \ > $out From 7dad5c2520c9c5d80e7a3b27478e9ba8bb9f126c Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 16:14:40 -0600 Subject: [PATCH 44/54] releaseBins: add dmq-node todo --- flake.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flake.nix b/flake.nix index 8b6d8311e80..71deab85cde 100644 --- a/flake.nix +++ b/flake.nix @@ -133,6 +133,8 @@ // (with project.hsPkgs; { # Add some executables from other relevant packages inherit (bech32.components.exes) bech32; + # TODO-SRE + # inherit (dmq-node.components.exes) dmq-node; inherit (ouroboros-consensus.components.exes) db-analyser db-synthesizer db-truncater snapshot-converter; inherit (kes-agent.components.exes) kes-agent kes-agent-control; # Add cardano-node, cardano-cli and tx-generator with their git revision stamp. @@ -313,6 +315,8 @@ "db-analyser" "db-synthesizer" "db-truncater" + # TODO-SRE + # "dmq-node" "kes-agent" "kes-agent-control" "snapshot-converter" @@ -520,6 +524,8 @@ db-analyser db-synthesizer db-truncater + # TODO-SRE: + # dmq-node locli snapshot-converter tx-generator; From e278b6d242614d63a4317b43ad702cf499e3a111 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 18:36:34 -0600 Subject: [PATCH 45/54] oci: improve the launch run-node script --- nix/docker/context/node/bin/run-node | 142 ++++++++++++--------------- 1 file changed, 64 insertions(+), 78 deletions(-) diff --git a/nix/docker/context/node/bin/run-node b/nix/docker/context/node/bin/run-node index c666b8b1b04..478cea823a2 100755 --- a/nix/docker/context/node/bin/run-node +++ b/nix/docker/context/node/bin/run-node @@ -1,52 +1,66 @@ #!/bin/env bash -set -eo pipefail +set -euo pipefail echo "Running cardano node ..." -[[ -n $DEBUG ]] && set -x +[[ -n ${DEBUG:-} ]] && set -x # Define a few defaults CARDANO_CONFIG_BASE="/opt/cardano/config" -if [[ -z $CARDANO_CONFIG ]]; then +if [[ -z ${CARDANO_CONFIG:-} ]]; then CARDANO_CONFIG="$CARDANO_CONFIG_BASE/mainnet/config.json" fi -if [[ -z $CARDANO_TOPOLOGY ]]; then +if [[ -z ${CARDANO_TOPOLOGY:-} ]]; then CARDANO_TOPOLOGY="$CARDANO_CONFIG_BASE/mainnet/topology.json" fi # Breaking change from the historical default of: /opt/cardano/data # in order to align both the "scripts" and "custom" modes of image operation. # Prefer root mountpoints for consistency via symlink /opt/cardano/data -> /data -if [[ -z $CARDANO_DATABASE_PATH ]]; then +if [[ -z ${CARDANO_DATABASE_PATH:-} ]]; then CARDANO_DATABASE_PATH="/data/db" fi # Breaking change from the historical default of: /opt/cardano/ipc/socket # in order to align both the "scripts" and "custom" modes of image operation. # Prefer root mountpoints for consistency via symlink /opt/cardano/ipc -> /ipc -if [[ -z $CARDANO_SOCKET_PATH ]]; then +if [[ -z ${CARDANO_SOCKET_PATH:-} ]]; then CARDANO_SOCKET_PATH="/ipc/node.socket" fi -# Prefer root mountpoints for consistency via symlink /opt/cardano/ipc -> /ipc -if [[ -z $CARDANO_LOG_DIR ]]; then +if [[ -z ${CARDANO_LOG_DIR:-} ]]; then CARDANO_LOG_DIR="/opt/cardano/logs" fi -if [[ -z $CARDANO_BIND_ADDR ]]; then +if [[ -z ${CARDANO_BIND_ADDR:-} ]]; then CARDANO_BIND_ADDR="0.0.0.0" fi -if [[ -z $CARDANO_PORT ]]; then +if [[ -z ${CARDANO_PORT:-} ]]; then CARDANO_PORT=3001 fi -if [[ -z $CARDANO_BLOCK_PRODUCER ]]; then +if [[ -z ${CARDANO_BLOCK_PRODUCER:-} ]]; then CARDANO_BLOCK_PRODUCER=false fi +# Block producer key defaults -- only relevant when CARDANO_BLOCK_PRODUCER=true +if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then + if [[ -z ${CARDANO_SHELLEY_KES_KEY:-} ]]; then + CARDANO_SHELLEY_KES_KEY="$CARDANO_CONFIG_BASE/keys/kes.skey" + fi + + if [[ -z ${CARDANO_SHELLEY_VRF_KEY:-} ]]; then + CARDANO_SHELLEY_VRF_KEY="$CARDANO_CONFIG_BASE/keys/vrf.skey" + fi + + if [[ -z ${CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE:-} ]]; then + CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE="$CARDANO_CONFIG_BASE/keys/node.cert" + fi +fi + ##################################################################### # # Print run environment @@ -61,23 +75,10 @@ printRunEnv () { echo "CARDANO_PORT=$CARDANO_PORT" echo "CARDANO_SOCKET_PATH=$CARDANO_SOCKET_PATH" echo "CARDANO_TOPOLOGY=$CARDANO_TOPOLOGY" - [[ -n $CARDANO_TRACER_SOCKET_PATH_ACCEPT ]] && echo "CARDANO_TRACER_SOCKET_PATH_ACCEPT=$CARDANO_TRACER_SOCKET_PATH_ACCEPT" - [[ -n $CARDANO_TRACER_SOCKET_PATH_CONNECT ]] && echo "CARDANO_TRACER_SOCKET_PATH_CONNECT=$CARDANO_TRACER_SOCKET_PATH_CONNECT" + [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]] && echo "CARDANO_TRACER_SOCKET_PATH_ACCEPT=$CARDANO_TRACER_SOCKET_PATH_ACCEPT" + [[ -n ${CARDANO_TRACER_SOCKET_PATH_CONNECT:-} ]] && echo "CARDANO_TRACER_SOCKET_PATH_CONNECT=$CARDANO_TRACER_SOCKET_PATH_CONNECT" if [[ ${CARDANO_BLOCK_PRODUCER} == true ]]; then - - if [[ -z ${CARDANO_SHELLEY_KES_KEY} ]]; then - CARDANO_SHELLEY_KES_KEY="$CARDANO_CONFIG_BASE/keys/kes.skey" - fi - - if [[ -z ${CARDANO_SHELLEY_VRF_KEY} ]]; then - CARDANO_SHELLEY_VRF_KEY="$CARDANO_CONFIG_BASE/keys/vrf.skey" - fi - - if [[ -z ${CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE} ]]; then - CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE="$CARDANO_CONFIG_BASE/keys/node.cert" - fi - echo "CARDANO_SHELLEY_KES_KEY=$CARDANO_SHELLEY_KES_KEY" echo "CARDANO_SHELLEY_VRF_KEY=$CARDANO_SHELLEY_VRF_KEY" echo "CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE" @@ -96,12 +97,12 @@ cat << EOF > /usr/local/bin/env # Docker run ENV vars EOF -if [[ -n $CARDANO_TRACER_SOCKET_PATH_ACCEPT ]]; then +if [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]]; then echo "CARDANO_TRACER_SOCKET_PATH_ACCEPT=\"$CARDANO_TRACER_SOCKET_PATH_ACCEPT\"" \ >> /usr/local/bin/env fi -if [[ -n $CARDANO_TRACER_SOCKET_PATH_CONNECT ]]; then +if [[ -n ${CARDANO_TRACER_SOCKET_PATH_CONNECT:-} ]]; then echo "CARDANO_TRACER_SOCKET_PATH_CONNECT=\"$CARDANO_TRACER_SOCKET_PATH_CONNECT\"" \ >> /usr/local/bin/env fi @@ -116,18 +117,16 @@ CARDANO_PORT=$CARDANO_PORT CARDANO_SOCKET_PATH="$CARDANO_SOCKET_PATH" CARDANO_TOPOLOGY="$CARDANO_TOPOLOGY" -CARDANO_PUBLIC_IP="$CARDANO_PUBLIC_IP" -CARDANO_CUSTOM_PEERS="$CARDANO_CUSTOM_PEERS" +CARDANO_PUBLIC_IP="${CARDANO_PUBLIC_IP:-}" +CARDANO_CUSTOM_PEERS="${CARDANO_CUSTOM_PEERS:-}" # Mapping for topologyUpdater -CNODE_HOSTNAME="$CARDANO_PUBLIC_IP" +CNODE_HOSTNAME="${CARDANO_PUBLIC_IP:-}" CNODE_PORT=$CARDANO_PORT -CUSTOM_PEERS="$CARDANO_CUSTOM_PEERS" +CUSTOM_PEERS="${CARDANO_CUSTOM_PEERS:-}" -# Breaking change from the historical default of: -# $CARDANO_CONFIG_BASE/mainnet-shelley-genesis.json in order to align -# with network organized configuration files. -GENESIS_JSON="$CARDANO_CONFIG_BASE/mainnet/shelley-genesis.json" +# Derived from CARDANO_CONFIG to support non-mainnet deployments +GENESIS_JSON="$(dirname "$CARDANO_CONFIG")/shelley-genesis.json" TOPOLOGY="$CARDANO_TOPOLOGY" LOG_DIR="$CARDANO_LOG_DIR" @@ -136,48 +135,29 @@ EOF ##################################################################### # -# Run the relay node in the background +# Run the node (relay or block producer depending on CARDANO_BLOCK_PRODUCER) # -runRelayNode () { +runNode () { effopts=( - "--config" "$CARDANO_CONFIG" \ - "--topology" "$CARDANO_TOPOLOGY" \ - "--database-path" "$CARDANO_DATABASE_PATH" \ - "--socket-path" "$CARDANO_SOCKET_PATH" \ - "--host-addr" "$CARDANO_BIND_ADDR" \ + "--config" "$CARDANO_CONFIG" + "--topology" "$CARDANO_TOPOLOGY" + "--database-path" "$CARDANO_DATABASE_PATH" + "--socket-path" "$CARDANO_SOCKET_PATH" + "--host-addr" "$CARDANO_BIND_ADDR" "--port" "$CARDANO_PORT" ) - [[ -n $CARDANO_TRACER_SOCKET_PATH_ACCEPT ]] && effopts+=("--tracer-socket-path-accept" "$CARDANO_TRACER_SOCKET_PATH_ACCEPT") - [[ -n $CARDANO_TRACER_SOCKET_PATH_CONNECT ]] && effopts+=("--tracer-socket-path-connect" "$CARDANO_TRACER_SOCKET_PATH_CONNECT") - - effopts+=("${filteredOpts[@]}") - - echo "cardano-node run ${effopts[*]}" - exec /usr/local/bin/cardano-node run "${effopts[@]}" -} - -##################################################################### -# -# Run the block producer in the background -# -runBlockProducerNode () { - - effopts=( - "--config" "$CARDANO_CONFIG" \ - "--topology" "$CARDANO_TOPOLOGY" \ - "--database-path" "$CARDANO_DATABASE_PATH" \ - "--socket-path" "$CARDANO_SOCKET_PATH" \ - "--host-addr" "$CARDANO_BIND_ADDR" \ - "--port" "$CARDANO_PORT" \ - "--shelley-kes-key" "$CARDANO_SHELLEY_KES_KEY" \ - "--shelley-vrf-key" "$CARDANO_SHELLEY_VRF_KEY" \ - "--shelley-operational-certificate" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE" - ) + if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then + effopts+=( + "--shelley-kes-key" "$CARDANO_SHELLEY_KES_KEY" + "--shelley-vrf-key" "$CARDANO_SHELLEY_VRF_KEY" + "--shelley-operational-certificate" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE" + ) + fi - [[ -n $CARDANO_TRACER_SOCKET_PATH_ACCEPT ]] && effopts+=("--tracer-socket-path-accept" "$CARDANO_TRACER_SOCKET_PATH_ACCEPT") - [[ -n $CARDANO_TRACER_SOCKET_PATH_CONNECT ]] && effopts+=("--tracer-socket-path-connect" "$CARDANO_TRACER_SOCKET_PATH_CONNECT") + [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]] && effopts+=("--tracer-socket-path-accept" "$CARDANO_TRACER_SOCKET_PATH_ACCEPT") + [[ -n ${CARDANO_TRACER_SOCKET_PATH_CONNECT:-} ]] && effopts+=("--tracer-socket-path-connect" "$CARDANO_TRACER_SOCKET_PATH_CONNECT") effopts+=("${filteredOpts[@]}") @@ -185,7 +165,7 @@ runBlockProducerNode () { exec /usr/local/bin/cardano-node run "${effopts[@]}" } -# Shift the first option by one index +# Discard the leading subcommand argument (e.g. "run") passed by the entrypoint shift # Override default values with explicit options @@ -195,7 +175,7 @@ for i in "${!options[@]}" do j=$((i + 1)) key=${options[i]} - val=${options[j]} + val=${options[j]:-} found=false # echo "$i/$j: ${key} ${val}" @@ -229,11 +209,17 @@ done printRunEnv writeRootEnv +# Verify required files exist before launching +for f in "$CARDANO_CONFIG" "$CARDANO_TOPOLOGY"; do + [[ -f $f ]] || { echo "ERROR: required file not found: $f"; exit 1; } +done +if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then + for f in "$CARDANO_SHELLEY_KES_KEY" "$CARDANO_SHELLEY_VRF_KEY" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE"; do + [[ -f $f ]] || { echo "ERROR: required block producer key file not found: $f"; exit 1; } + done +fi + # The IPC socket dir is not created on demand mkdir -p "$(dirname "$CARDANO_SOCKET_PATH")" -if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then - runBlockProducerNode -else - runRelayNode -fi +runNode From 89a3e48f89bba694ed4322a9617cd9592a6611f8 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 18:39:40 -0600 Subject: [PATCH 46/54] oci: add tracer network opts to run-node script --- nix/docker/context/node/bin/run-node | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nix/docker/context/node/bin/run-node b/nix/docker/context/node/bin/run-node index 478cea823a2..2a678af74ae 100755 --- a/nix/docker/context/node/bin/run-node +++ b/nix/docker/context/node/bin/run-node @@ -75,6 +75,8 @@ printRunEnv () { echo "CARDANO_PORT=$CARDANO_PORT" echo "CARDANO_SOCKET_PATH=$CARDANO_SOCKET_PATH" echo "CARDANO_TOPOLOGY=$CARDANO_TOPOLOGY" + [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_ACCEPT:-} ]] && echo "CARDANO_TRACER_SOCKET_NETWORK_ACCEPT=$CARDANO_TRACER_SOCKET_NETWORK_ACCEPT" + [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_CONNECT:-} ]] && echo "CARDANO_TRACER_SOCKET_NETWORK_CONNECT=$CARDANO_TRACER_SOCKET_NETWORK_CONNECT" [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]] && echo "CARDANO_TRACER_SOCKET_PATH_ACCEPT=$CARDANO_TRACER_SOCKET_PATH_ACCEPT" [[ -n ${CARDANO_TRACER_SOCKET_PATH_CONNECT:-} ]] && echo "CARDANO_TRACER_SOCKET_PATH_CONNECT=$CARDANO_TRACER_SOCKET_PATH_CONNECT" @@ -97,6 +99,16 @@ cat << EOF > /usr/local/bin/env # Docker run ENV vars EOF +if [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_ACCEPT:-} ]]; then + echo "CARDANO_TRACER_SOCKET_NETWORK_ACCEPT=\"$CARDANO_TRACER_SOCKET_NETWORK_ACCEPT\"" \ + >> /usr/local/bin/env +fi + +if [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_CONNECT:-} ]]; then + echo "CARDANO_TRACER_SOCKET_NETWORK_CONNECT=\"$CARDANO_TRACER_SOCKET_NETWORK_CONNECT\"" \ + >> /usr/local/bin/env +fi + if [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]]; then echo "CARDANO_TRACER_SOCKET_PATH_ACCEPT=\"$CARDANO_TRACER_SOCKET_PATH_ACCEPT\"" \ >> /usr/local/bin/env @@ -156,6 +168,8 @@ runNode () { ) fi + [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_ACCEPT:-} ]] && effopts+=("--tracer-socket-network-accept" "$CARDANO_TRACER_SOCKET_NETWORK_ACCEPT") + [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_CONNECT:-} ]] && effopts+=("--tracer-socket-network-connect" "$CARDANO_TRACER_SOCKET_NETWORK_CONNECT") [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]] && effopts+=("--tracer-socket-path-accept" "$CARDANO_TRACER_SOCKET_PATH_ACCEPT") [[ -n ${CARDANO_TRACER_SOCKET_PATH_CONNECT:-} ]] && effopts+=("--tracer-socket-path-connect" "$CARDANO_TRACER_SOCKET_PATH_CONNECT") @@ -190,6 +204,8 @@ do --shelley-kes-key) CARDANO_SHELLEY_KES_KEY=${val}; found=true;; --shelley-vrf-key) CARDANO_SHELLEY_VRF_KEY=${val}; found=true;; --shelley-operational-certificate) CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=${val}; found=true;; + --tracer-socket-network-accept) CARDANO_TRACER_SOCKET_NETWORK_ACCEPT=${val}; found=true;; + --tracer-socket-network-connect) CARDANO_TRACER_SOCKET_NETWORK_CONNECT=${val}; found=true;; --tracer-socket-path-accept) CARDANO_TRACER_SOCKET_PATH_ACCEPT=${val}; found=true;; --tracer-socket-path-connect) CARDANO_TRACER_SOCKET_PATH_CONNECT=${val}; found=true;; esac From 9f4458908d799f9e4dcd0e653fad50d8e5b84f39 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 18:53:01 -0600 Subject: [PATCH 47/54] oci: improve the launch run-client script --- nix/docker/context/node/bin/run-client | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nix/docker/context/node/bin/run-client b/nix/docker/context/node/bin/run-client index dc785d0f8b8..21522eac198 100755 --- a/nix/docker/context/node/bin/run-client +++ b/nix/docker/context/node/bin/run-client @@ -1,14 +1,15 @@ #!/bin/env bash +set -euo pipefail -[[ -n $DEBUG ]] && set -x +[[ -n ${DEBUG:-} ]] && set -x -# Shift the first option by one index +# Discard the leading subcommand argument (e.g. "cli") passed by the entrypoint shift -if [[ -z $CARDANO_NODE_SOCKET_PATH ]]; then +if [[ -z ${CARDANO_NODE_SOCKET_PATH:-} ]]; then # Breaking change from the historical default of: /opt/cardano/ipc/socket # in order to align both the "scripts" and "custom" modes of image operation. export CARDANO_NODE_SOCKET_PATH="/ipc/node.socket" fi -/usr/local/bin/cardano-cli "$@" +exec /usr/local/bin/cardano-cli "$@" From bccc85e6108b9f74b84e9d4a7fa016326d4062b0 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 19:05:44 -0600 Subject: [PATCH 48/54] oci: improve the launch run-tracer script --- nix/docker/context/tracer/bin/run-tracer | 30 +++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/nix/docker/context/tracer/bin/run-tracer b/nix/docker/context/tracer/bin/run-tracer index f14a27f6e3a..3c0bf3f48f7 100755 --- a/nix/docker/context/tracer/bin/run-tracer +++ b/nix/docker/context/tracer/bin/run-tracer @@ -1,17 +1,22 @@ #!/bin/env bash -set -eo pipefail +set -euo pipefail echo "Running cardano tracer ..." -[[ -n $DEBUG ]] && set -x +[[ -n ${DEBUG:-} ]] && set -x # Define a few defaults CARDANO_CONFIG_BASE="/opt/cardano/config" -if [[ -z $CARDANO_CONFIG ]]; then +if [[ -z ${CARDANO_CONFIG:-} ]]; then CARDANO_CONFIG="$CARDANO_CONFIG_BASE/mainnet/tracer-config.json" fi +# Prefer root mountpoints for consistency via symlink /opt/cardano/data -> /data +if [[ -z ${CARDANO_STATE_DIR:-} ]]; then + CARDANO_STATE_DIR="/data/tracer" +fi + ##################################################################### # # Print run environment @@ -19,8 +24,8 @@ fi printRunEnv () { echo "CARDANO_CONFIG=$CARDANO_CONFIG" - echo "CARDANO_MIN_LOG_SEVERITY=$CARDANO_MIN_LOG_SEVERITY" echo "CARDANO_STATE_DIR=$CARDANO_STATE_DIR" + [[ -n ${CARDANO_MIN_LOG_SEVERITY:-} ]] && echo "CARDANO_MIN_LOG_SEVERITY=$CARDANO_MIN_LOG_SEVERITY" } ##################################################################### @@ -34,14 +39,18 @@ cat << EOF > /usr/local/bin/env # Docker run ENV vars CARDANO_CONFIG="$CARDANO_CONFIG" -CARDANO_MIN_LOG_SEVERITY="$CARDANO_MIN_LOG_SEVERITY" CARDANO_STATE_DIR="$CARDANO_STATE_DIR" EOF + +if [[ -n ${CARDANO_MIN_LOG_SEVERITY:-} ]]; then + echo "CARDANO_MIN_LOG_SEVERITY=\"$CARDANO_MIN_LOG_SEVERITY\"" \ + >> /usr/local/bin/env +fi } ##################################################################### # -# Run the relay node in the background +# Run the tracer # runTracer () { @@ -50,13 +59,15 @@ runTracer () { "--state-dir" "$CARDANO_STATE_DIR" ) + [[ -n ${CARDANO_MIN_LOG_SEVERITY:-} ]] && effopts+=("--min-log-severity" "$CARDANO_MIN_LOG_SEVERITY") + effopts+=("${filteredOpts[@]}") echo "cardano-tracer ${effopts[*]}" exec /usr/local/bin/cardano-tracer "${effopts[@]}" } -# Shift the first option by one index +# Discard the leading subcommand argument (e.g. "run") passed by the entrypoint shift # Override default values with explicit options @@ -67,7 +78,7 @@ for i in "${!options[@]}" do j=$((i + 1)) key=${options[i]} - val=${options[j]} + val=${options[j]:-} found=false # echo "$i/$j: ${key} ${val}" @@ -93,4 +104,7 @@ done printRunEnv writeRootEnv +# Verify required files exist before launching +[[ -f $CARDANO_CONFIG ]] || { echo "ERROR: required file not found: $CARDANO_CONFIG"; exit 1; } + runTracer From 825df95d97550564060d37cb368741ddbb58da10 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 19:18:25 -0600 Subject: [PATCH 49/54] oci: improve the node entrypoint --- nix/docker/context/node/bin/entrypoint | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/nix/docker/context/node/bin/entrypoint b/nix/docker/context/node/bin/entrypoint index 7011656170e..a160f641cb0 100755 --- a/nix/docker/context/node/bin/entrypoint +++ b/nix/docker/context/node/bin/entrypoint @@ -1,16 +1,17 @@ #!/bin/env bash +set -euo pipefail -[[ -n $DEBUG ]] && set -x +[[ -n ${DEBUG:-} ]] && set -x # If the NETWORK env var is set to a valid cardano network, pre-defined # configuration will be used. -if [[ -n $NETWORK ]]; then +if [[ -n ${NETWORK:-} ]]; then # If either CARDANO__JSON_MERGE env vars are set, iohk-nix # pre-defined NETWORK configuration will be used as a starting point and # merged with custom configuration provided as json in the environment # variable(s). - if [[ -n $CARDANO_CONFIG_JSON_MERGE || -n $CARDANO_TOPOLOGY_JSON_MERGE ]]; then + if [[ -n ${CARDANO_CONFIG_JSON_MERGE:-} || -n ${CARDANO_TOPOLOGY_JSON_MERGE:-} ]]; then CFG="/opt/cardano/config" if ! [[ -f $CFG/$NETWORK/config.json && -f $CFG/$NETWORK/topology.json ]]; then @@ -27,7 +28,9 @@ if [[ -n $NETWORK ]]; then # In a jq deep merge, arrays are replaced, primitive values in the second # object override the first, different types for the same key result in # full replacement and null values persist. - if [[ -n $CARDANO_CONFIG_JSON_MERGE ]]; then + # + # jq -S sorts output keys alphabetically for deterministic diffs. + if [[ -n ${CARDANO_CONFIG_JSON_MERGE:-} ]]; then jq -S \ --argjson deepMerge "$CARDANO_CONFIG_JSON_MERGE" \ '. * $deepMerge' \ @@ -38,7 +41,7 @@ if [[ -n $NETWORK ]]; then export CARDANO_CONFIG="$CFG/$NETWORK/config.json" fi - if [[ -n $CARDANO_TOPOLOGY_JSON_MERGE ]]; then + if [[ -n ${CARDANO_TOPOLOGY_JSON_MERGE:-} ]]; then jq -S \ --argjson deepMerge "$CARDANO_TOPOLOGY_JSON_MERGE" \ '. * $deepMerge' \ @@ -49,7 +52,7 @@ if [[ -n $NETWORK ]]; then export CARDANO_TOPOLOGY="$CFG/$NETWORK/topology.json" fi - if [[ -n $DEBUG ]]; then + if [[ -n ${DEBUG:-} ]]; then echo "Cardano config in merge mode is:" cat "$CARDANO_CONFIG" echo @@ -61,7 +64,7 @@ if [[ -n $NETWORK ]]; then # Run cardano-node using iohk-nix base config merged with provided custom # config for the requested NETWORK. unset NETWORK - if [[ $1 == "run" ]]; then + if [[ ${1:-} == "run" ]]; then exec /usr/local/bin/run-node "$@" else exec /usr/local/bin/run-node run "$@" @@ -72,16 +75,15 @@ if [[ -n $NETWORK ]]; then exec /usr/local/bin/run-network "$@" fi -elif [[ $1 == "run" ]]; then +elif [[ ${1:-} == "run" ]]; then # Run cardano-node using "custom" mode. exec /usr/local/bin/run-node "$@" -elif [[ $1 == "cli" ]]; then +elif [[ ${1:-} == "cli" ]]; then # Run cardano-cli with the provided entrypoint args exec /usr/local/bin/run-client "$@" else - echo "Nothing to do! Available modes of operation are:" echo echo "Scripts mode:" From f85521a109280640c29295c35c9c68e0e396695b Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 19:34:53 -0600 Subject: [PATCH 50/54] oci: improve the tracer entrypoint --- nix/docker/context/tracer/bin/entrypoint | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nix/docker/context/tracer/bin/entrypoint b/nix/docker/context/tracer/bin/entrypoint index ec2a752d1b4..d6f9ff1cfc8 100755 --- a/nix/docker/context/tracer/bin/entrypoint +++ b/nix/docker/context/tracer/bin/entrypoint @@ -1,16 +1,17 @@ #!/bin/env bash +set -euo pipefail -[[ -n $DEBUG ]] && set -x +[[ -n ${DEBUG:-} ]] && set -x # If the NETWORK env var is set to a valid cardano network, pre-defined # configuration will be used. -if [[ -n $NETWORK ]]; then +if [[ -n ${NETWORK:-} ]]; then # If CARDANO_CONFIG_JSON_MERGE env var is set, iohk-nix # pre-defined NETWORK configuration will be used as a starting point and # merged with custom configuration provided as json in the environment # variable(s). - if [[ -n $CARDANO_CONFIG_JSON_MERGE ]]; then + if [[ -n ${CARDANO_CONFIG_JSON_MERGE:-} ]]; then CFG="/opt/cardano/config" if ! [[ -f $CFG/$NETWORK/tracer-config.json ]]; then @@ -27,7 +28,9 @@ if [[ -n $NETWORK ]]; then # In a jq deep merge, arrays are replaced, primitive values in the second # object override the first, different types for the same key result in # full replacement and null values persist. - if [[ -n $CARDANO_CONFIG_JSON_MERGE ]]; then + # + # jq -S sorts output keys alphabetically for deterministic diffs. + if [[ -n ${CARDANO_CONFIG_JSON_MERGE:-} ]]; then jq -S \ --argjson deepMerge "$CARDANO_CONFIG_JSON_MERGE" \ '. * $deepMerge' \ @@ -38,7 +41,7 @@ if [[ -n $NETWORK ]]; then export CARDANO_CONFIG="$CFG/$NETWORK/tracer-config.json" fi - if [[ -n $DEBUG ]]; then + if [[ -n ${DEBUG:-} ]]; then echo "Cardano config in merge mode is:" cat "$CARDANO_CONFIG" echo @@ -47,7 +50,7 @@ if [[ -n $NETWORK ]]; then # Run cardano-tracer using iohk-nix base config merged with provided custom # config for the requested NETWORK. unset NETWORK - if [[ $1 == "run" ]]; then + if [[ ${1:-} == "run" ]]; then exec /usr/local/bin/run-tracer "$@" else exec /usr/local/bin/run-tracer run "$@" @@ -58,12 +61,11 @@ if [[ -n $NETWORK ]]; then exec /usr/local/bin/run-network "$@" fi -elif [[ $1 == "run" ]]; then +elif [[ ${1:-} == "run" ]]; then # Run cardano-tracer using "custom" mode. exec /usr/local/bin/run-tracer "$@" else - echo "Nothing to do! Available modes of operation are:" echo echo "Scripts mode:" From ca53559d800b1a12b174608cda529bad99084470 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 19:58:23 -0600 Subject: [PATCH 51/54] nodeNixosSvc: add independent lsm db paths and asserts --- nix/nixos/cardano-node-service.nix | 26 ++++++++++++++++++++++---- nix/workbench/service/nodes.nix | 1 + 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/nix/nixos/cardano-node-service.nix b/nix/nixos/cardano-node-service.nix index 293f486a153..871cf9185c8 100644 --- a/nix/nixos/cardano-node-service.nix +++ b/nix/nixos/cardano-node-service.nix @@ -120,7 +120,7 @@ let // optionalAttrs (cfg.withUtxoHdLsmt i){ LedgerDB = { Backend = "V2LSM"; - LSMDatabasePath = cfg.lmdbDatabasePath i; + LSMDatabasePath = cfg.lsmDatabasePath i; }; } // optionalAttrs (cfg.withUtxoHdLmdb i){ @@ -434,7 +434,17 @@ in { default = null; apply = x : if lib.isFunction x then x else if x == null then _: null else _: x; description = '' - A node UTxO-HD on-disk (LMDB or LSM-trees) path for performant disk I/O, for each instance. + A node UTxO-HD on-disk LMDB path for performant disk I/O, for each instance. + This could point to a direct-access SSD, with a specifically created journal-less file system and optimized mount options. + ''; + }; + + lsmDatabasePath = mkOption { + type = funcToOr nullOrStr; + default = null; + apply = x : if lib.isFunction x then x else if x == null then _: null else _: x; + description = '' + A node UTxO-HD on-disk LSM-trees path for performant disk I/O, for each instance. This could point to a direct-access SSD, with a specifically created journal-less file system and optimized mount options. ''; }; @@ -904,6 +914,7 @@ in { config = mkIf cfg.enable ( let lmdbPaths = filter (x: x != null) (map (e: cfg.lmdbDatabasePath e) (genList trivial.id cfg.instances)); + lsmPaths = filter (x: x != null) (map (e: cfg.lsmDatabasePath e) (genList trivial.id cfg.instances)); genInstanceConf = f: listToAttrs (if cfg.instances > 1 then genList (i: let n = "cardano-node-${toString i}"; in nameValuePair n (f n i)) cfg.instances else [ (nameValuePair "cardano-node" (f "cardano-node" 0)) ]); in mkMerge [ @@ -1004,8 +1015,7 @@ in { { assertions = [ { - assertion = all (i: hasPrefix cfg.stateDirBase (cfg.stateDir i)) - (genList trivial.id cfg.instances); + assertion = all (i: hasPrefix cfg.stateDirBase (cfg.stateDir i)) (genList trivial.id cfg.instances); message = "The option services.cardano-node.stateDir should have ${cfg.stateDirBase} as a prefix, for each instance!"; } @@ -1021,6 +1031,14 @@ in { assertion = (length lmdbPaths) == (length (lists.unique lmdbPaths)); message = "When configuring multiple LMDB enabled nodes on one instance, lmdbDatabasePath must be unique."; } + { + assertion = (length lsmPaths) == (length (lists.unique lsmPaths)); + message = "When configuring multiple LSM enabled nodes on one instance, lsmDatabasePath must be unique."; + } + { + assertion = all (i: !(cfg.withUtxoHdLmdb i && cfg.withUtxoHdLsmt i)) (genList trivial.id cfg.instances); + message = "Each instance can only declare either withUtxoHdLmdb or withUtxoHdLsmt"; + } { assertion = count (o: o != null) (with cfg; [ (tracerSocketPathAccept i) diff --git a/nix/workbench/service/nodes.nix b/nix/workbench/service/nodes.nix index 27a4ddcfcf2..22e5a5f85cd 100644 --- a/nix/workbench/service/nodes.nix +++ b/nix/workbench/service/nodes.nix @@ -78,6 +78,7 @@ let withUtxoHdLmdb = profile.node.utxo_lmdb && isProducer; withUtxoHdLsmt = profile.node.utxo_lsmt && isProducer; lmdbDatabasePath = liveTablesPath i; + lsmDatabasePath = liveTablesPath i; ## Combine: ## 0. baseNodeConfig (coming cardanoLib's testnet environ) From 22b61a5c01d494a743c07181e3705a66f00f3732 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 5 Mar 2026 20:09:51 -0600 Subject: [PATCH 52/54] sre: todo prior to tagging --- nix/docker/context/node/bin/run-node | 2 ++ nix/nixos/cardano-node-service.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nix/docker/context/node/bin/run-node b/nix/docker/context/node/bin/run-node index 2a678af74ae..506d4c4e2ee 100755 --- a/nix/docker/context/node/bin/run-node +++ b/nix/docker/context/node/bin/run-node @@ -99,6 +99,8 @@ cat << EOF > /usr/local/bin/env # Docker run ENV vars EOF +# TODO-SRE: Add kes-agent CLI arg once available + if [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_ACCEPT:-} ]]; then echo "CARDANO_TRACER_SOCKET_NETWORK_ACCEPT=\"$CARDANO_TRACER_SOCKET_NETWORK_ACCEPT\"" \ >> /usr/local/bin/env diff --git a/nix/nixos/cardano-node-service.nix b/nix/nixos/cardano-node-service.nix index 871cf9185c8..6e9145fd840 100644 --- a/nix/nixos/cardano-node-service.nix +++ b/nix/nixos/cardano-node-service.nix @@ -909,6 +909,8 @@ in { `cardano-cli query ledger-peer-snapshot` ''; }; + + # TODO-SRE: Add kes-agent CLI arg opts once available }; }; From 81200f74e572bb4f18ccae2a3ad59b631eac08a3 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Tue, 10 Mar 2026 15:36:13 -0500 Subject: [PATCH 53/54] oci/nodeNixosSvc: add kes agent cli arg support --- nix/docker/context/node/bin/run-node | 36 +++++++++++++++++++++++----- nix/nixos/cardano-node-service.nix | 34 ++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/nix/docker/context/node/bin/run-node b/nix/docker/context/node/bin/run-node index 506d4c4e2ee..1229631f801 100755 --- a/nix/docker/context/node/bin/run-node +++ b/nix/docker/context/node/bin/run-node @@ -48,7 +48,8 @@ fi # Block producer key defaults -- only relevant when CARDANO_BLOCK_PRODUCER=true if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then - if [[ -z ${CARDANO_SHELLEY_KES_KEY:-} ]]; then + # Only default the KES key when not using a KES agent socket + if [[ -z ${CARDANO_SHELLEY_KES_AGENT_SOCKET:-} && -z ${CARDANO_SHELLEY_KES_KEY:-} ]]; then CARDANO_SHELLEY_KES_KEY="$CARDANO_CONFIG_BASE/keys/kes.skey" fi @@ -81,7 +82,11 @@ printRunEnv () { [[ -n ${CARDANO_TRACER_SOCKET_PATH_CONNECT:-} ]] && echo "CARDANO_TRACER_SOCKET_PATH_CONNECT=$CARDANO_TRACER_SOCKET_PATH_CONNECT" if [[ ${CARDANO_BLOCK_PRODUCER} == true ]]; then - echo "CARDANO_SHELLEY_KES_KEY=$CARDANO_SHELLEY_KES_KEY" + if [[ -n ${CARDANO_SHELLEY_KES_AGENT_SOCKET:-} ]]; then + echo "CARDANO_SHELLEY_KES_AGENT_SOCKET=$CARDANO_SHELLEY_KES_AGENT_SOCKET" + else + echo "CARDANO_SHELLEY_KES_KEY=$CARDANO_SHELLEY_KES_KEY" + fi echo "CARDANO_SHELLEY_VRF_KEY=$CARDANO_SHELLEY_VRF_KEY" echo "CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE" fi @@ -99,7 +104,10 @@ cat << EOF > /usr/local/bin/env # Docker run ENV vars EOF -# TODO-SRE: Add kes-agent CLI arg once available +if [[ -n ${CARDANO_SHELLEY_KES_AGENT_SOCKET:-} ]]; then + echo "CARDANO_SHELLEY_KES_AGENT_SOCKET=\"$CARDANO_SHELLEY_KES_AGENT_SOCKET\"" \ + >> /usr/local/bin/env +fi if [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_ACCEPT:-} ]]; then echo "CARDANO_TRACER_SOCKET_NETWORK_ACCEPT=\"$CARDANO_TRACER_SOCKET_NETWORK_ACCEPT\"" \ @@ -163,13 +171,20 @@ runNode () { ) if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then + if [[ -n ${CARDANO_SHELLEY_KES_AGENT_SOCKET:-} ]]; then + effopts+=( + "--shelley-kes-agent-socket" "$CARDANO_SHELLEY_KES_AGENT_SOCKET" + ) + else + effopts+=( + "--shelley-kes-key" "$CARDANO_SHELLEY_KES_KEY" + ) + fi effopts+=( - "--shelley-kes-key" "$CARDANO_SHELLEY_KES_KEY" "--shelley-vrf-key" "$CARDANO_SHELLEY_VRF_KEY" "--shelley-operational-certificate" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE" ) fi - [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_ACCEPT:-} ]] && effopts+=("--tracer-socket-network-accept" "$CARDANO_TRACER_SOCKET_NETWORK_ACCEPT") [[ -n ${CARDANO_TRACER_SOCKET_NETWORK_CONNECT:-} ]] && effopts+=("--tracer-socket-network-connect" "$CARDANO_TRACER_SOCKET_NETWORK_CONNECT") [[ -n ${CARDANO_TRACER_SOCKET_PATH_ACCEPT:-} ]] && effopts+=("--tracer-socket-path-accept" "$CARDANO_TRACER_SOCKET_PATH_ACCEPT") @@ -203,6 +218,7 @@ do --socket-path) CARDANO_SOCKET_PATH=${val}; found=true;; --host-addr) CARDANO_BIND_ADDR=${val}; found=true;; --port) CARDANO_PORT=${val}; found=true;; + --shelley-kes-agent-socket) CARDANO_SHELLEY_KES_AGENT_SOCKET=${val}; found=true;; --shelley-kes-key) CARDANO_SHELLEY_KES_KEY=${val}; found=true;; --shelley-vrf-key) CARDANO_SHELLEY_VRF_KEY=${val}; found=true;; --shelley-operational-certificate) CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=${val}; found=true;; @@ -224,6 +240,11 @@ for arg in "${options[@]}"; do [[ -n $arg ]] && filteredOpts+=("$arg") done +if [[ -n ${CARDANO_SHELLEY_KES_KEY:-} && -n ${CARDANO_SHELLEY_KES_AGENT_SOCKET:-} ]]; then + echo "ERROR: CARDANO_SHELLEY_KES_KEY and CARDANO_SHELLEY_KES_AGENT_SOCKET are mutually exclusive; use one or the other, not both." + exit 1 +fi + printRunEnv writeRootEnv @@ -232,7 +253,10 @@ for f in "$CARDANO_CONFIG" "$CARDANO_TOPOLOGY"; do [[ -f $f ]] || { echo "ERROR: required file not found: $f"; exit 1; } done if [[ $CARDANO_BLOCK_PRODUCER == true ]]; then - for f in "$CARDANO_SHELLEY_KES_KEY" "$CARDANO_SHELLEY_VRF_KEY" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE"; do + if [[ -z ${CARDANO_SHELLEY_KES_AGENT_SOCKET:-} ]]; then + [[ -f $CARDANO_SHELLEY_KES_KEY ]] || { echo "ERROR: required block producer key file not found: $CARDANO_SHELLEY_KES_KEY"; exit 1; } + fi + for f in "$CARDANO_SHELLEY_VRF_KEY" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE"; do [[ -f $f ]] || { echo "ERROR: required block producer key file not found: $f"; exit 1; } done fi diff --git a/nix/nixos/cardano-node-service.nix b/nix/nixos/cardano-node-service.nix index 6e9145fd840..86843a617b0 100644 --- a/nix/nixos/cardano-node-service.nix +++ b/nix/nixos/cardano-node-service.nix @@ -147,6 +147,8 @@ let "--shelley-kes-key ${cfg.kesKey}"}" "${optionalString (cfg.operationalCertificate != null) "--shelley-operational-certificate ${cfg.operationalCertificate}"}" + "${optionalString (cfg.shelleyKesAgentSocket != null) + "--shelley-kes-agent-socket ${cfg.shelleyKesAgentSocket}"}" ]; Cardano = [ "${optionalString (cfg.signingKey != null) @@ -159,6 +161,8 @@ let "--shelley-kes-key ${cfg.kesKey}"}" "${optionalString (cfg.operationalCertificate != null) "--shelley-operational-certificate ${cfg.operationalCertificate}"}" + "${optionalString (cfg.shelleyKesAgentSocket != null) + "--shelley-kes-agent-socket ${cfg.shelleyKesAgentSocket}"}" ]; }; instanceDbPath = cfg.databasePath i; @@ -449,6 +453,14 @@ in { ''; }; + shelleyKesAgentSocket = mkOption { + type = nullOr (either str path); + default = null; + description = '' + Path to the KES agent socket. + ''; + }; + socketPath = mkOption { type = funcToOr str; default = i : "${runtimeDir i}/node.socket"; @@ -909,8 +921,6 @@ in { `cardano-cli query ledger-peer-snapshot` ''; }; - - # TODO-SRE: Add kes-agent CLI arg opts once available }; }; @@ -1022,8 +1032,24 @@ in { as a prefix, for each instance!"; } { - assertion = (cfg.kesKey == null) == (cfg.vrfKey == null) && (cfg.kesKey == null) == (cfg.operationalCertificate == null); - message = "Shelley Era: all of three [operationalCertificate kesKey vrfKey] options must be defined (or none of them)."; + assertion = let + hasKes = cfg.kesKey != null; + hasVrf = cfg.vrfKey != null; + hasOpcert = cfg.operationalCertificate != null; + hasAgent = cfg.shelleyKesAgentSocket != null; + in + # (1) No forging: none of the four options set + (!hasKes && !hasVrf && !hasOpcert && !hasAgent) + # (2) Direct KES forging: kesKey + vrfKey + operationalCertificate, no agent socket + || (hasKes && !hasAgent && hasVrf && hasOpcert) + # (3) KES agent forging: shelleyKesAgentSocket + vrfKey + operationalCertificate, no kesKey + || (!hasKes && hasAgent && hasVrf && hasOpcert); + message = '' + Shelley Era: valid forging configurations are: + (1) none of [operationalCertificate kesKey vrfKey shelleyKesAgentSocket] (relay/non-producer node), + (2) all of [operationalCertificate kesKey vrfKey] without shelleyKesAgentSocket (direct KES key forging), or + (3) [operationalCertificate vrfKey shelleyKesAgentSocket] without kesKey (KES agent forging). + ''; } { assertion = !(cfg.systemdSocketActivation && (cfg.useNewTopology != false)); From e6e55a58e64168ef3a1bfba04149a68880c13790 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Wed, 18 Mar 2026 14:15:48 -0500 Subject: [PATCH 54/54] bump: iohkNix and adjust ci --- .../cardano/mainnet-peer-snapshot.json | 5639 +++++++++-------- flake.lock | 7 +- flake.nix | 2 +- 3 files changed, 2889 insertions(+), 2759 deletions(-) diff --git a/configuration/cardano/mainnet-peer-snapshot.json b/configuration/cardano/mainnet-peer-snapshot.json index c59a1ce01cc..b39a8c0ad5f 100644 --- a/configuration/cardano/mainnet-peer-snapshot.json +++ b/configuration/cardano/mainnet-peer-snapshot.json @@ -1,17 +1,24 @@ { + "NetworkMagic": 764824073, + "NodeToClientVersion": 23, + "Point": { + "blockPointHash": "951c71eeab01925ea3dd63125e7fe72b13d599bbd59321d4cd6104e481143352", + "blockPointSlot": 182277508 + }, "bigLedgerPools": [ { - "accumulatedStake": 0.007040952665183603, - "relativeStake": 0.007040952665183603, + "accumulatedStake": 0.005624384116166084, + "relativeStake": 0.005624384116166084, "relays": [ { - "address": "relay-pool-3-mainnet.cardano.aeq5f.com" + "address": "92a8429c.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.012260480826076652, - "relativeStake": 0.005219528160893049, + "accumulatedStake": 0.01106492483626304, + "relativeStake": 0.005440540720096956, "relays": [ { "address": "relay-trustwallet-5-0.cardano.mainnet.kiln.fi", @@ -28,55 +35,89 @@ ] }, { - "accumulatedStake": 0.016673909630655348, - "relativeStake": 0.004413428804578697, + "accumulatedStake": 0.016034919651443075, + "relativeStake": 0.0049699948151800365, "relays": [ { - "address": "relay-pool-ledger-2-mainnet.cardano.aeq5f.com" + "address": "relay-kiln-9-0.cardano.mainnet.kiln.fi", + "port": 3001 + }, + { + "address": "relay-kiln-9-1.cardano.mainnet.kiln.fi", + "port": 3001 + }, + { + "address": "relay-kiln-9-2.cardano.mainnet.kiln.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.02057818958007044, - "relativeStake": 0.003904279949415089, + "accumulatedStake": 0.020550315817728794, + "relativeStake": 0.004515396166285717, "relays": [ { - "address": "relay-kiln-7-0.cardano.mainnet.kiln.fi", - "port": 3001 - }, + "address": "relay-pool-3-mainnet.cardano.aeq5f.com" + } + ] + }, + { + "accumulatedStake": 0.02488697695537983, + "relativeStake": 0.004336661137651035, + "relays": [ { - "address": "relay-kiln-7-1.cardano.mainnet.kiln.fi", - "port": 3001 - }, + "address": "relay-pool-ledger-2-mainnet.cardano.aeq5f.com" + } + ] + }, + { + "accumulatedStake": 0.028937056180075006, + "relativeStake": 0.004050079224695179, + "relays": [ { - "address": "relay-kiln-7-2.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "relay-pool-2-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.024409366287064, - "relativeStake": 0.0038311767069935626, + "accumulatedStake": 0.03257854928892488, + "relativeStake": 0.0036414931088498735, "relays": [ { - "address": "92a8429c.cardano-relay.herd.run", - "port": 1338 + "address": "Relay1.NordicPool.org", + "port": 3005 + }, + { + "address": "Relay2.NordicPool.org", + "port": 3005 + }, + { + "address": "Relay3.NordicPool.org", + "port": 3005 } ] }, { - "accumulatedStake": 0.02814182415778864, - "relativeStake": 0.003732457870724637, + "accumulatedStake": 0.036194949107623116, + "relativeStake": 0.003616399818698232, "relays": [ { - "address": "94c3c6d3.cardano-relay.herd.run", - "port": 1338 + "address": "Relay1.NordicPool.org", + "port": 3005 + }, + { + "address": "Relay2.NordicPool.org", + "port": 3005 + }, + { + "address": "Relay3.NordicPool.org", + "port": 3005 } ] }, { - "accumulatedStake": 0.03181134340831358, - "relativeStake": 0.0036695192505249432, + "accumulatedStake": 0.039800466825486436, + "relativeStake": 0.0036055177178633217, "relays": [ { "address": "gateway.adavault.com", @@ -97,18 +138,8 @@ ] }, { - "accumulatedStake": 0.03547801676041318, - "relativeStake": 0.0036666733520995943, - "relays": [ - { - "address": "162.120.71.180", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.03912110617712331, - "relativeStake": 0.00364308941671014, + "accumulatedStake": 0.04338824604102516, + "relativeStake": 0.003587779215538729, "relays": [ { "address": "cardanosuisse.com", @@ -125,58 +156,28 @@ ] }, { - "accumulatedStake": 0.04276053940466634, - "relativeStake": 0.003639433227543028, + "accumulatedStake": 0.04696715454056126, + "relativeStake": 0.003578908499536093, "relays": [ { - "address": "relays.bladepool.com", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.0463982359572458, - "relativeStake": 0.003637696552579459, - "relays": [ - { - "address": "47.cardano.staked.cloud", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.05003592437903673, - "relativeStake": 0.003637688421790924, - "relays": [ - { - "address": "44.cardano.staked.cloud", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.053673450890071896, - "relativeStake": 0.0036375265110351732, - "relays": [ - { - "address": "46.cardano.staked.cloud", + "address": "48.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.057310871273825024, - "relativeStake": 0.0036374203837531284, + "accumulatedStake": 0.050545918205633714, + "relativeStake": 0.0035787636650724563, "relays": [ { - "address": "48.cardano.staked.cloud", + "address": "27.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.06094827136212569, - "relativeStake": 0.0036374000883006613, + "accumulatedStake": 0.054124575123092655, + "relativeStake": 0.0035786569174589434, "relays": [ { "address": "26.cardano.staked.cloud", @@ -185,38 +186,26 @@ ] }, { - "accumulatedStake": 0.0645855629008221, - "relativeStake": 0.0036372915386964017, + "accumulatedStake": 0.05770296092091576, + "relativeStake": 0.003578385797823104, "relays": [ { - "address": "45.cardano.staked.cloud", + "address": "relay-kiln-4-0.cardano.mainnet.kiln.fi", "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.06822281981209978, - "relativeStake": 0.0036372569112776837, - "relays": [ + }, { - "address": "27.cardano.staked.cloud", + "address": "relay-kiln-4-1.cardano.mainnet.kiln.fi", "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.07185748751151297, - "relativeStake": 0.0036346676994132012, - "relays": [ + }, { - "address": "28.cardano.staked.cloud", + "address": "relay-kiln-4-2.cardano.mainnet.kiln.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.07549213544774457, - "relativeStake": 0.0036346479362315927, + "accumulatedStake": 0.06128106276939354, + "relativeStake": 0.0035781018484777783, "relays": [ { "address": "cf1r1.mainnet.pool.cardanofoundation.org", @@ -229,8 +218,8 @@ ] }, { - "accumulatedStake": 0.07912671147043639, - "relativeStake": 0.0036345760226918155, + "accumulatedStake": 0.06485856384252382, + "relativeStake": 0.0035775010731302773, "relays": [ { "address": "cf4r1.mainnet.pool.cardanofoundation.org", @@ -243,8 +232,8 @@ ] }, { - "accumulatedStake": 0.08276128747219841, - "relativeStake": 0.0036345760017620233, + "accumulatedStake": 0.06843606489505297, + "relativeStake": 0.0035775010525291528, "relays": [ { "address": "cf2r1.mainnet.pool.cardanofoundation.org", @@ -257,8 +246,8 @@ ] }, { - "accumulatedStake": 0.08639586346661086, - "relativeStake": 0.0036345759944124644, + "accumulatedStake": 0.07201356594034797, + "relativeStake": 0.0035775010452950063, "relays": [ { "address": "cf3r1.mainnet.pool.cardanofoundation.org", @@ -271,8 +260,8 @@ ] }, { - "accumulatedStake": 0.0900159800495038, - "relativeStake": 0.003620116582892932, + "accumulatedStake": 0.07559104733611886, + "relativeStake": 0.003577481395770893, "relays": [ { "address": "13.236.12.204", @@ -281,122 +270,132 @@ ] }, { - "accumulatedStake": 0.09363417461293769, - "relativeStake": 0.0036181945634338776, + "accumulatedStake": 0.07916720647986882, + "relativeStake": 0.003576159143749945, "relays": [ { - "address": "13.211.73.179", - "port": 8332 + "address": "28.cardano.staked.cloud", + "port": 3001 } ] }, { - "accumulatedStake": 0.09725164650651495, - "relativeStake": 0.0036174718935772653, + "accumulatedStake": 0.08274240275255344, + "relativeStake": 0.003575196272684625, "relays": [ { - "address": "relays.wavepool.digital", - "port": 3001 + "address": "13.211.73.179", + "port": 8332 } ] }, { - "accumulatedStake": 0.10085406745784406, - "relativeStake": 0.0036024209513291134, + "accumulatedStake": 0.086312631041465, + "relativeStake": 0.003570228288911561, "relays": [ { - "address": "49.cardano.staked.cloud", + "address": "relays.wavepool.digital", "port": 3001 } ] }, { - "accumulatedStake": 0.10445046572404727, - "relativeStake": 0.003596398266203215, + "accumulatedStake": 0.08987432377110156, + "relativeStake": 0.0035616927296365686, "relays": [ { - "address": "cf5r1.mainnet.pool.cardanofoundation.org", + "address": "relay-kiln-3-0.cardano.mainnet.kiln.fi", "port": 3001 }, { - "address": "cf5r2.mainnet.pool.cardanofoundation.org", + "address": "relay-kiln-3-1.cardano.mainnet.kiln.fi", + "port": 3001 + }, + { + "address": "relay-kiln-3-2.cardano.mainnet.kiln.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.10804686283659035, - "relativeStake": 0.0035963971125430663, + "accumulatedStake": 0.09343350608564953, + "relativeStake": 0.003559182314547962, "relays": [ { - "address": "cf6r1.mainnet.pool.cardanofoundation.org", + "address": "relay-kiln-2-0.cardano.mainnet.kiln.fi", "port": 3001 }, { - "address": "cf6r2.mainnet.pool.cardanofoundation.org", + "address": "relay-kiln-2-1.cardano.mainnet.kiln.fi", + "port": 3001 + }, + { + "address": "relay-kiln-2-2.cardano.mainnet.kiln.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.11163559537936364, - "relativeStake": 0.003588732542773297, + "accumulatedStake": 0.09697918800462044, + "relativeStake": 0.0035456819189709095, "relays": [ { - "address": "Relay1.NordicPool.org", - "port": 3005 - }, - { - "address": "Relay2.NordicPool.org", - "port": 3005 - }, - { - "address": "Relay3.NordicPool.org", - "port": 3005 + "address": "162.120.71.180", + "port": 6000 } ] }, { - "accumulatedStake": 0.11522372455624257, - "relativeStake": 0.0035881291768789275, + "accumulatedStake": 0.10052069775702885, + "relativeStake": 0.003541509752408406, "relays": [ { - "address": "relay-kiln-3-0.cardano.mainnet.kiln.fi", + "address": "50.cardano.staked.cloud", "port": 3001 - }, + } + ] + }, + { + "accumulatedStake": 0.10406062059160943, + "relativeStake": 0.0035399228345805935, + "relays": [ { - "address": "relay-kiln-3-1.cardano.mainnet.kiln.fi", + "address": "cf5r1.mainnet.pool.cardanofoundation.org", "port": 3001 }, { - "address": "relay-kiln-3-2.cardano.mainnet.kiln.fi", + "address": "cf5r2.mainnet.pool.cardanofoundation.org", "port": 3001 } ] }, { - "accumulatedStake": 0.1187971366643067, - "relativeStake": 0.0035734121080641373, + "accumulatedStake": 0.1076005422906462, + "relativeStake": 0.003539921699036752, "relays": [ { - "address": "r1.spirestaking.com", + "address": "cf6r1.mainnet.pool.cardanofoundation.org", + "port": 3001 + }, + { + "address": "cf6r2.mainnet.pool.cardanofoundation.org", "port": 3001 } ] }, { - "accumulatedStake": 0.12235657574598685, - "relativeStake": 0.0035594390816801485, + "accumulatedStake": 0.11113046925205745, + "relativeStake": 0.0035299269614112597, "relays": [ { - "address": "relays.wavepool.digital", + "address": "r1.spirestaking.com", "port": 3001 } ] }, { - "accumulatedStake": 0.12591582532379567, - "relativeStake": 0.003559249577808824, + "accumulatedStake": 0.11465004878991707, + "relativeStake": 0.003519579537859622, "relays": [ { "address": "relays.wavepool.digital", @@ -405,54 +404,46 @@ ] }, { - "accumulatedStake": 0.12947296068710584, - "relativeStake": 0.0035571353633101657, + "accumulatedStake": 0.11816507359163282, + "relativeStake": 0.003515024801715747, "relays": [ { - "address": "40.cardano.staked.cloud", + "address": "relays.wavepool.digital", "port": 3001 } ] }, { - "accumulatedStake": 0.13302701752901291, - "relativeStake": 0.0035540568419070817, + "accumulatedStake": 0.12166666643850171, + "relativeStake": 0.0035015928468689, "relays": [ { - "address": "Relay1.NordicPool.org", - "port": 3005 - }, - { - "address": "Relay2.NordicPool.org", - "port": 3005 + "address": "178.128.79.219", + "port": 3001 }, { - "address": "Relay3.NordicPool.org", - "port": 3005 + "address": "104.131.122.73", + "port": 3001 } ] }, { - "accumulatedStake": 0.13657934932434398, - "relativeStake": 0.0035523317953310572, + "accumulatedStake": 0.1251509307901025, + "relativeStake": 0.0034842643516007723, "relays": [ { - "address": "relay-kiln-2-0.cardano.mainnet.kiln.fi", - "port": 3001 - }, - { - "address": "relay-kiln-2-1.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "r1.1percentpool.eu", + "port": 19001 }, { - "address": "relay-kiln-2-2.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "r2.1percentpool.eu", + "port": 19002 } ] }, { - "accumulatedStake": 0.14012343061847246, - "relativeStake": 0.0035440812941284756, + "accumulatedStake": 0.12862765529631218, + "relativeStake": 0.003476724506209674, "relays": [ { "address": "Relay1.NordicPool.org", @@ -469,102 +460,78 @@ ] }, { - "accumulatedStake": 0.14366648883858013, - "relativeStake": 0.0035430582201076725, + "accumulatedStake": 0.1320989591290814, + "relativeStake": 0.0034713038327692414, "relays": [ { - "address": "relay-kiln-4-0.cardano.mainnet.kiln.fi", - "port": 3001 - }, - { - "address": "relay-kiln-4-1.cardano.mainnet.kiln.fi", - "port": 3001 - }, - { - "address": "relay-kiln-4-2.cardano.mainnet.kiln.fi", + "address": "relays.bladepool.com", "port": 3001 } ] }, { - "accumulatedStake": 0.14720836338748425, - "relativeStake": 0.0035418745489041326, + "accumulatedStake": 0.13557002699436385, + "relativeStake": 0.003471067865282442, "relays": [ { - "address": "relays.wavepool.digital", + "address": "47.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.1507411209830257, - "relativeStake": 0.0035327575955414327, + "accumulatedStake": 0.13904107616838862, + "relativeStake": 0.0034710491740247715, "relays": [ { - "address": "178.128.79.219", - "port": 3001 - }, - { - "address": "104.131.122.73", + "address": "42.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.15427352641642864, - "relativeStake": 0.0035324054334029474, + "accumulatedStake": 0.1425119759035131, + "relativeStake": 0.0034708997351244994, "relays": [ { - "address": "gateway.adavault.com", - "port": 4021 - }, - { - "address": "gateway.adavault.com", - "port": 4022 - }, - { - "address": "gateway.adavault.com", - "port": 4026 - }, - { - "address": "gateway.adavault.com", - "port": 4027 + "address": "44.cardano.staked.cloud", + "port": 3001 } ] }, { - "accumulatedStake": 0.15779999851648296, - "relativeStake": 0.0035264721000543148, + "accumulatedStake": 0.1459828009573176, + "relativeStake": 0.0034708250538044764, "relays": [ { - "address": "41.cardano.staked.cloud", + "address": "45.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.1613263752294734, - "relativeStake": 0.0035263767129904582, + "accumulatedStake": 0.1494535885694131, + "relativeStake": 0.0034707876120955035, "relays": [ { - "address": "42.cardano.staked.cloud", + "address": "41.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.16484038072195914, - "relativeStake": 0.00351400549248573, + "accumulatedStake": 0.1529241333769774, + "relativeStake": 0.0034705448075643174, "relays": [ { - "address": "26e894b1.cardano-relay.herd.run", - "port": 1338 + "address": "46.cardano.staked.cloud", + "port": 3001 } ] }, { - "accumulatedStake": 0.16835398601574036, - "relativeStake": 0.003513605293781226, + "accumulatedStake": 0.15639305734827177, + "relativeStake": 0.0034689239712943653, "relays": [ { "address": "bd-cardano-main-relay-12-a.bdnodes.net", @@ -577,26 +544,18 @@ ] }, { - "accumulatedStake": 0.17186274559352668, - "relativeStake": 0.003508759577786308, + "accumulatedStake": 0.15985710093835995, + "relativeStake": 0.0034640435900881667, "relays": [ { - "address": "95.154.235.142", - "port": 6000 - }, - { - "address": "217.155.18.115", - "port": 6003 - }, - { - "address": "217.155.18.115", - "port": 6001 + "address": "relays.wavepool.digital", + "port": 3001 } ] }, { - "accumulatedStake": 0.17534954731661617, - "relativeStake": 0.0034868017230895052, + "accumulatedStake": 0.16330947172094296, + "relativeStake": 0.0034523707825830042, "relays": [ { "address": "gateway.adavault.com", @@ -617,68 +576,40 @@ ] }, { - "accumulatedStake": 0.1788328612356637, - "relativeStake": 0.0034833139190475156, + "accumulatedStake": 0.16675344091532693, + "relativeStake": 0.003443969194383975, "relays": [ { - "address": "relay1.mainnet.pool.cardano.services", - "port": 3001 + "address": "Relay1.NordicPool.org", + "port": 3005 }, { - "address": "relay2.mainnet.pool.cardano.services", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.18231377867355839, - "relativeStake": 0.0034809174378946863, - "relays": [ - { - "address": "r-eu-0.titanstaking.io", - "port": 4321 - }, - { - "address": "r-eu-1.titanstaking.io", - "port": 4321 + "address": "Relay2.NordicPool.org", + "port": 3005 }, { - "address": "r-eu-2.titanstaking.io", - "port": 4321 + "address": "Relay3.NordicPool.org", + "port": 3005 } ] }, { - "accumulatedStake": 0.18578670274154657, - "relativeStake": 0.0034729240679881924, + "accumulatedStake": 0.17018501137735717, + "relativeStake": 0.0034315704620302475, "relays": [ { - "address": "relays.wavepool.digital", + "address": "relay1.mainnet.pool.cardano.services", "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.18924943530119828, - "relativeStake": 0.003462732559651713, - "relays": [ - { - "address": "Relay1.NordicPool.org", - "port": 3005 }, { - "address": "Relay2.NordicPool.org", - "port": 3005 - }, - { - "address": "Relay3.NordicPool.org", - "port": 3005 + "address": "relay2.mainnet.pool.cardano.services", + "port": 3001 } ] }, { - "accumulatedStake": 0.192708844068249, - "relativeStake": 0.003459408767050707, + "accumulatedStake": 0.17360037251356633, + "relativeStake": 0.0034153611362091533, "relays": [ { "address": "olive-geonosis-edffc.cardano.bdnodes.net", @@ -691,18 +622,26 @@ ] }, { - "accumulatedStake": 0.19614957409912898, - "relativeStake": 0.0034407300308799808, + "accumulatedStake": 0.17700780940107058, + "relativeStake": 0.0034074368875042535, "relays": [ { - "address": "relays.wavepool.digital", - "port": 3001 + "address": "95.154.235.142", + "port": 6000 + }, + { + "address": "217.155.18.115", + "port": 6003 + }, + { + "address": "217.155.18.115", + "port": 6001 } ] }, { - "accumulatedStake": 0.199569277586167, - "relativeStake": 0.003419703487038024, + "accumulatedStake": 0.18040514155841397, + "relativeStake": 0.003397332157343391, "relays": [ { "address": "eu.relays.cardanians.io", @@ -715,32 +654,80 @@ ] }, { - "accumulatedStake": 0.20295598947689789, - "relativeStake": 0.003386711890730896, + "accumulatedStake": 0.18379625445679793, + "relativeStake": 0.0033911128983839466, "relays": [ { - "address": "46.101.9.225", + "address": "r-eu-0.titanstaking.io", + "port": 4321 + }, + { + "address": "r-eu-1.titanstaking.io", + "port": 4321 + }, + { + "address": "r-eu-2.titanstaking.io", + "port": 4321 + } + ] + }, + { + "accumulatedStake": 0.18716899530586173, + "relativeStake": 0.003372740849063801, + "relays": [ + { + "address": "relay01.ca.lovelace.community", "port": 3001 }, { - "address": "64.227.46.95", + "address": "relay02.ca.lovelace.community", + "port": 3001 + }, + { + "address": "relay01.fr.lovelace.community", + "port": 3001 + }, + { + "address": "relay01.de.lovelace.community", "port": 3001 } ] }, { - "accumulatedStake": 0.20631597868284215, - "relativeStake": 0.0033599892059442585, + "accumulatedStake": 0.1905173960545174, + "relativeStake": 0.0033484007486556835, "relays": [ { - "address": "7ddb9c28.cardano-relay.bison.run", - "port": 1338 + "address": "gateway.adavault.com", + "port": 4021 + }, + { + "address": "gateway.adavault.com", + "port": 4022 + }, + { + "address": "gateway.adavault.com", + "port": 4026 + }, + { + "address": "gateway.adavault.com", + "port": 4027 + } + ] + }, + { + "accumulatedStake": 0.19386481885254717, + "relativeStake": 0.003347422798029769, + "relays": [ + { + "address": "40.cardano.staked.cloud", + "port": 3001 } ] }, { - "accumulatedStake": 0.20967533150617065, - "relativeStake": 0.0033593528233285047, + "accumulatedStake": 0.19719678911313354, + "relativeStake": 0.003331970260586354, "relays": [ { "address": "relay1.nihaocardano.com", @@ -753,66 +740,74 @@ ] }, { - "accumulatedStake": 0.21303427362777558, - "relativeStake": 0.0033589421216049164, + "accumulatedStake": 0.20052837613980612, + "relativeStake": 0.0033315870266725804, "relays": [ { - "address": "r-eu-0.titanstaking.io", - "port": 4321 - }, - { - "address": "r-eu-1.titanstaking.io", - "port": 4321 + "address": "46.101.9.225", + "port": 3001 }, { - "address": "r-eu-2.titanstaking.io", - "port": 4321 + "address": "64.227.46.95", + "port": 3001 } ] }, { - "accumulatedStake": 0.21639026524813626, - "relativeStake": 0.0033559916203606873, + "accumulatedStake": 0.20385728866077066, + "relativeStake": 0.003328912520964552, "relays": [ { - "address": "cof-1.cardanocafe.org", - "port": 3005 - }, + "address": "26e894b1.cardano-relay.herd.run", + "port": 1338 + } + ] + }, + { + "accumulatedStake": 0.20717875864580632, + "relativeStake": 0.003321469985035645, + "relays": [ { - "address": "cof-2.cardanocafe.org", - "port": 3010 + "address": "relay1.cardanotech.io", + "port": 6000 }, { - "address": "cap-1.cardanocafe.org", - "port": 4000 - }, + "address": "relay2.cardanotech.io", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.21049553812720598, + "relativeStake": 0.0033167794813996833, + "relays": [ { - "address": "cap-2.cardanocafe.org", - "port": 4005 + "address": "relay-kiln-6-0.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "lat-1.cardanocafe.org", - "port": 5001 + "address": "relay-kiln-6-1.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "lat-2.cardanocafe.org", - "port": 5002 + "address": "relay-kiln-6-2.cardano.mainnet.kiln.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.21974065899973816, - "relativeStake": 0.0033503937516018815, + "accumulatedStake": 0.21380278995206206, + "relativeStake": 0.003307251824856066, "relays": [ { - "address": "8d6f8de4.cardano-relay.herd.run", + "address": "7ddb9c28.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.22309067032189697, - "relativeStake": 0.0033500113221588243, + "accumulatedStake": 0.21710076933681843, + "relativeStake": 0.00329797938475638, "relays": [ { "address": "b3e201f4.cardano-relay.bison.run", @@ -821,8 +816,18 @@ ] }, { - "accumulatedStake": 0.22644054578973447, - "relativeStake": 0.0033498754678374988, + "accumulatedStake": 0.22039854760573588, + "relativeStake": 0.0032977782689174403, + "relays": [ + { + "address": "8d6f8de4.cardano-relay.herd.run", + "port": 1338 + } + ] + }, + { + "accumulatedStake": 0.22369468552988767, + "relativeStake": 0.0032961379241517896, "relays": [ { "address": "relays.wavepool.digital", @@ -831,8 +836,8 @@ ] }, { - "accumulatedStake": 0.2297844247283593, - "relativeStake": 0.0033438789386248443, + "accumulatedStake": 0.22698614354512048, + "relativeStake": 0.0032914580152328273, "relays": [ { "address": "b3bbbcac.cardano-relay.bison.run", @@ -841,8 +846,8 @@ ] }, { - "accumulatedStake": 0.23312782157276107, - "relativeStake": 0.0033433968444017657, + "accumulatedStake": 0.23027723951914958, + "relativeStake": 0.0032910959740290982, "relays": [ { "address": "ddbb5a06.cardano-relay.herd.run", @@ -851,70 +856,58 @@ ] }, { - "accumulatedStake": 0.23646640489242832, - "relativeStake": 0.0033385833196672263, + "accumulatedStake": 0.23356292898779013, + "relativeStake": 0.0032856894686405405, "relays": [ { - "address": "35.75.32.253", - "port": 6000 + "address": "e4527900.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.23980456467800174, - "relativeStake": 0.0033381597855734425, + "accumulatedStake": 0.2368476707541861, + "relativeStake": 0.003284741766395994, "relays": [ { - "address": "relay01.ca.lovelace.community", - "port": 3001 - }, - { - "address": "relay02.ca.lovelace.community", - "port": 3001 - }, - { - "address": "relay01.fr.lovelace.community", - "port": 3001 - }, - { - "address": "relay01.de.lovelace.community", - "port": 3001 + "address": "50809bee.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.24314227260921223, - "relativeStake": 0.003337707931210473, + "accumulatedStake": 0.24013218371576628, + "relativeStake": 0.003284512961580141, "relays": [ { - "address": "e4527900.cardano-relay.herd.run", + "address": "9a956262.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.24647923548454306, - "relativeStake": 0.0033369628753308483, + "accumulatedStake": 0.24341658555395723, + "relativeStake": 0.0032844018381909725, "relays": [ { - "address": "a94da6a8.cardano-relay.bison.run", - "port": 1338 + "address": "35.75.32.253", + "port": 6000 } ] }, { - "accumulatedStake": 0.24981584692751427, - "relativeStake": 0.0033366114429712016, + "accumulatedStake": 0.2467009088822046, + "relativeStake": 0.003284323328247383, "relays": [ { - "address": "9a956262.cardano-relay.bison.run", + "address": "a94da6a8.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.25315224808449227, - "relativeStake": 0.0033364011569780093, + "accumulatedStake": 0.24998502800137634, + "relativeStake": 0.003284119119171711, "relays": [ { "address": "9dc533bf.cardano-relay.herd.run", @@ -923,8 +916,8 @@ ] }, { - "accumulatedStake": 0.25648850683730573, - "relativeStake": 0.003336258752813467, + "accumulatedStake": 0.2532687831378998, + "relativeStake": 0.0032837551365234724, "relays": [ { "address": "f84db19f.cardano-relay.bison.run", @@ -933,150 +926,177 @@ ] }, { - "accumulatedStake": 0.25982436778498536, - "relativeStake": 0.003335860947679626, + "accumulatedStake": 0.25655205954774923, + "relativeStake": 0.003283276409849445, "relays": [ { - "address": "bb78d57d.cardano-relay.bison.run", + "address": "72e508af.cardano-relay.herd.run", "port": 1338 } ] }, { - "accumulatedStake": 0.2631601277673958, - "relativeStake": 0.003335759982410378, + "accumulatedStake": 0.2598353013763964, + "relativeStake": 0.0032832418286471436, "relays": [ { - "address": "778cb679.cardano-relay.bison.run", + "address": "dbe22510.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.2664957111116869, - "relativeStake": 0.0033355833442911494, + "accumulatedStake": 0.263118521551285, + "relativeStake": 0.0032832201748886104, "relays": [ { - "address": "dbe22510.cardano-relay.bison.run", + "address": "778cb679.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.269831257511858, - "relativeStake": 0.0033355464001710625, + "accumulatedStake": 0.2664016375873957, + "relativeStake": 0.0032831160361106895, "relays": [ { - "address": "d699483e.cardano-relay.bison.run", + "address": "a5f2af9f.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.2731667989021145, - "relativeStake": 0.0033355413902565177, + "accumulatedStake": 0.26968469738502304, + "relativeStake": 0.003283059797627328, "relays": [ { - "address": "a5f2af9f.cardano-relay.bison.run", + "address": "d489c136.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.27650229031736695, - "relativeStake": 0.0033354914152524543, + "accumulatedStake": 0.2729677339377178, + "relativeStake": 0.003283036552694748, "relays": [ { - "address": "72e508af.cardano-relay.herd.run", + "address": "d89eeea0.cardano-relay.herd.run", "port": 1338 } ] }, { - "accumulatedStake": 0.2798376722666829, - "relativeStake": 0.003335381949315953, + "accumulatedStake": 0.2762506908229386, + "relativeStake": 0.0032829568852208394, "relays": [ { - "address": "d489c136.cardano-relay.bison.run", + "address": "d699483e.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.28317294814399274, - "relativeStake": 0.0033352758773098636, + "accumulatedStake": 0.27953360058135496, + "relativeStake": 0.003282909758416363, "relays": [ { - "address": "d89eeea0.cardano-relay.herd.run", + "address": "94cc7304.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.28650816573293464, - "relativeStake": 0.0033352175889418585, + "accumulatedStake": 0.28281637950599664, + "relativeStake": 0.003282778924641654, "relays": [ { - "address": "94cc7304.cardano-relay.bison.run", + "address": "bb78d57d.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.2898384559326371, - "relativeStake": 0.0033302901997024703, + "accumulatedStake": 0.28609842655734435, + "relativeStake": 0.003282047051347706, + "relays": [ + { + "address": "35.75.32.253", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.2893568264527578, + "relativeStake": 0.0032583998954134755, "relays": [ { - "address": "relay-kiln-1-0.cardano.mainnet.kiln.fi", + "address": "lucerne.datadyne.earth", "port": 3001 }, { - "address": "relay-kiln-1-1.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "g5.datadyne.earth", + "port": 3002 }, { - "address": "relay-kiln-1-2.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "drcaroll.datadyne.earth", + "port": 3003 } ] }, { - "accumulatedStake": 0.29314649570175627, - "relativeStake": 0.003308039769119194, + "accumulatedStake": 0.2926150825676592, + "relativeStake": 0.0032582561149014405, "relays": [ { - "address": "cardano-relays.autostake.com", - "port": 3001 + "address": "relay-pool-figment-19-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.296443223165876, - "relativeStake": 0.003296727464119745, + "accumulatedStake": 0.2958509504720694, + "relativeStake": 0.0032358679044101474, "relays": [ { - "address": "r1.1percentpool.eu", - "port": 19001 + "address": "ada-relay01.biglazycat.com", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.29904745619019385, + "relativeStake": 0.00319650571812443, + "relays": [ + { + "address": "relays.stakepool.at", + "port": 3001 }, { - "address": "r2.1percentpool.eu", - "port": 19002 + "address": "relay-1.stakepool.at", + "port": 3001 + }, + { + "address": "relay-2.stakepool.at", + "port": 3001 } ] }, { - "accumulatedStake": 0.29973918280903133, - "relativeStake": 0.003295959643155289, + "accumulatedStake": 0.3022416091547415, + "relativeStake": 0.003194152964547723, "relays": [ { - "address": "relays.wavepool.digital", - "port": 3001 + "address": "relay.cardano.securestaking.io", + "port": 3000 + }, + { + "address": "secur2.cardano.securestaking.io", + "port": 3000 } ] }, { - "accumulatedStake": 0.3030304164478762, - "relativeStake": 0.0032912336388449073, + "accumulatedStake": 0.3054160566294121, + "relativeStake": 0.00317444747467059, "relays": [ { "address": "relay1-dl.aichi-stakepool.com", @@ -1093,174 +1113,158 @@ ] }, { - "accumulatedStake": 0.3062489448969954, - "relativeStake": 0.0032185284491191885, + "accumulatedStake": 0.3085791408173079, + "relativeStake": 0.0031630841878957663, "relays": [ { - "address": "Relay1.NordicPool.org", + "address": "94c3c6d3.cardano-relay.herd.run", + "port": 1338 + } + ] + }, + { + "accumulatedStake": 0.31171967793074645, + "relativeStake": 0.00314053711343854, + "relays": [ + { + "address": "cof-1.cardanocafe.org", "port": 3005 }, { - "address": "Relay2.NordicPool.org", - "port": 3005 + "address": "cof-2.cardanocafe.org", + "port": 3010 }, { - "address": "Relay3.NordicPool.org", - "port": 3005 - } - ] - }, - { - "accumulatedStake": 0.3094599581228526, - "relativeStake": 0.0032110132258571867, - "relays": [ + "address": "cap-1.cardanocafe.org", + "port": 4000 + }, { - "address": "relays.stakepool.at", - "port": 3001 + "address": "cap-2.cardanocafe.org", + "port": 4005 }, { - "address": "relay-1.stakepool.at", - "port": 3001 + "address": "lat-1.cardanocafe.org", + "port": 5001 }, { - "address": "relay-2.stakepool.at", - "port": 3001 + "address": "lat-2.cardanocafe.org", + "port": 5002 } ] }, { - "accumulatedStake": 0.3126577065285003, - "relativeStake": 0.0031977484056476845, + "accumulatedStake": 0.3148587446057767, + "relativeStake": 0.0031390666750302524, "relays": [ { - "address": "ada-relay01.biglazycat.com", - "port": 6000 + "address": "11.relays.happystaking.io", + "port": 3001 + }, + { + "address": "12.relays.happystaking.io", + "port": 3001 } ] }, { - "accumulatedStake": 0.31584540243260867, - "relativeStake": 0.003187695904108419, + "accumulatedStake": 0.3179361183766701, + "relativeStake": 0.0030773737708933726, "relays": [ { - "address": "lucerne.datadyne.earth", - "port": 3001 - }, - { - "address": "g5.datadyne.earth", - "port": 3002 + "address": "relay1.clovernodes.io", + "port": 6000 }, { - "address": "drcaroll.datadyne.earth", - "port": 3003 + "address": "relay2.clovernodes.io", + "port": 6000 } ] }, { - "accumulatedStake": 0.3190161860021902, - "relativeStake": 0.0031707835695815216, + "accumulatedStake": 0.3209790999345109, + "relativeStake": 0.0030429815578408184, "relays": [ { - "address": "relay-kiln-6-0.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "r-eu-0.titanstaking.io", + "port": 4321 }, { - "address": "relay-kiln-6-1.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "r-eu-1.titanstaking.io", + "port": 4321 }, { - "address": "relay-kiln-6-2.cardano.mainnet.kiln.fi", - "port": 3001 + "address": "r-eu-2.titanstaking.io", + "port": 4321 } ] }, { - "accumulatedStake": 0.32218619639085544, - "relativeStake": 0.003170010388665244, + "accumulatedStake": 0.3240045767015962, + "relativeStake": 0.003025476767085335, "relays": [ { - "address": "relay1.cardanotech.io", - "port": 6000 + "address": "170.23.181.50", + "port": 6001 }, { - "address": "relay2.cardanotech.io", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.32534269222492496, - "relativeStake": 0.0031564958340695062, - "relays": [ - { - "address": "relay1.clovernodes.io", - "port": 6000 + "address": "170.23.181.50", + "port": 6002 }, { - "address": "relay2.clovernodes.io", - "port": 6000 + "address": "170.23.181.50", + "port": 6003 } ] }, { - "accumulatedStake": 0.32849864361000297, - "relativeStake": 0.003155951385078021, + "accumulatedStake": 0.3270294544783557, + "relativeStake": 0.0030248777767594897, "relays": [ { - "address": "relay.cardano.securestaking.io", - "port": 3000 - }, - { - "address": "secur2.cardano.securestaking.io", - "port": 3000 + "address": "octaluso.dyndns.org", + "port": 3002 } ] }, { - "accumulatedStake": 0.33161625184754756, - "relativeStake": 0.003117608237544572, + "accumulatedStake": 0.33004274588989, + "relativeStake": 0.0030132914115343296, "relays": [ { - "address": "85.215.129.208", + "address": "157.173.120.233", "port": 3001 }, { - "address": "154.26.158.189", - "port": 3001 + "address": "157.173.120.233", + "port": 3002 }, { - "address": "5.104.83.174", + "address": "5.252.53.68", "port": 3001 } ] }, { - "accumulatedStake": 0.3347149639514287, - "relativeStake": 0.003098712103881109, + "accumulatedStake": 0.33305486748942686, + "relativeStake": 0.0030121215995368425, "relays": [ { - "address": "relay1.snakepool.link", - "port": 3001 + "address": "Relay1.NordicPool.org", + "port": 3005 }, { - "address": "relay2.snakepool.link", - "port": 3002 - } - ] - }, - { - "accumulatedStake": 0.3378133317031735, - "relativeStake": 0.003098367751744833, - "relays": [ + "address": "Relay2.NordicPool.org", + "port": 3005 + }, { - "address": "octaluso.dyndns.org", - "port": 3002 + "address": "Relay3.NordicPool.org", + "port": 3005 } ] }, { - "accumulatedStake": 0.3409088165845525, - "relativeStake": 0.0030954848813790035, + "accumulatedStake": 0.3360632065642291, + "relativeStake": 0.0030083390748022417, "relays": [ { "address": "rel01.fairpool.eu", @@ -1281,50 +1285,42 @@ ] }, { - "accumulatedStake": 0.34397477105730967, - "relativeStake": 0.0030659544727571477, + "accumulatedStake": 0.3390674374767554, + "relativeStake": 0.0030042309125262673, "relays": [ { - "address": "11.relays.happystaking.io", - "port": 3001 - }, - { - "address": "12.relays.happystaking.io", - "port": 3001 + "address": "c2504518.cardano-relay.bison.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.3470311068935071, - "relativeStake": 0.003056335836197423, + "accumulatedStake": 0.3420381444761067, + "relativeStake": 0.002970706999351332, "relays": [ { - "address": "157.173.120.233", + "address": "91.242.214.33", "port": 3001 }, { - "address": "157.173.120.233", - "port": 3002 - }, - { - "address": "5.252.53.68", + "address": "186.233.187.33", "port": 3001 } ] }, { - "accumulatedStake": 0.35004031733706353, - "relativeStake": 0.0030092104435564667, + "accumulatedStake": 0.3449737981902648, + "relativeStake": 0.0029356537141580577, "relays": [ { - "address": "50809bee.cardano-relay.herd.run", - "port": 1338 + "address": "cardano-relays.autostake.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.35300991328801223, - "relativeStake": 0.002969595950948682, + "accumulatedStake": 0.3479075923937727, + "relativeStake": 0.002933794203507963, "relays": [ { "address": "173.15.110.154", @@ -1337,8 +1333,8 @@ ] }, { - "accumulatedStake": 0.3559533485765597, - "relativeStake": 0.002943435288547477, + "accumulatedStake": 0.35082220006730663, + "relativeStake": 0.0029146076735338997, "relays": [ { "address": "cardano-main.everstake.one", @@ -1363,22 +1359,36 @@ ] }, { - "accumulatedStake": 0.35889343367319565, - "relativeStake": 0.002940085096635935, + "accumulatedStake": 0.35373254100949597, + "relativeStake": 0.0029103409421893122, "relays": [ { - "address": "57.128.184.33", + "address": "relay1.snakepool.link", "port": 3001 }, { - "address": "57.128.184.31", + "address": "relay2.snakepool.link", + "port": 3002 + } + ] + }, + { + "accumulatedStake": 0.3566369690000247, + "relativeStake": 0.002904427990528695, + "relays": [ + { + "address": "57.129.24.185", + "port": 3001 + }, + { + "address": "57.129.28.178", "port": 3001 } ] }, { - "accumulatedStake": 0.36182262056968556, - "relativeStake": 0.002929186896489927, + "accumulatedStake": 0.35952435252437503, + "relativeStake": 0.0028873835243503868, "relays": [ { "address": "52.6.109.221", @@ -1387,8 +1397,8 @@ ] }, { - "accumulatedStake": 0.3647429817417032, - "relativeStake": 0.0029203611720176295, + "accumulatedStake": 0.3624033796068719, + "relativeStake": 0.002879027082496888, "relays": [ { "address": "relays.stakepool.at", @@ -1405,79 +1415,74 @@ ] }, { - "accumulatedStake": 0.3676543924059137, - "relativeStake": 0.0029114106642104997, + "accumulatedStake": 0.36526145585608305, + "relativeStake": 0.002858076249211119, "relays": [ { - "address": "relay-pool-2-mainnet.cardano.aeq5f.com" + "address": "6398a55d.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.37055296879652583, - "relativeStake": 0.0028985763906121433, + "accumulatedStake": 0.368107680022731, + "relativeStake": 0.002846224166647955, "relays": [ { - "address": "57.129.24.185", - "port": 3001 - }, - { - "address": "57.129.28.178", + "address": "relays.digi.pro", "port": 3001 } ] }, { - "accumulatedStake": 0.37344728660334886, - "relativeStake": 0.002894317806823036, + "accumulatedStake": 0.3709511616321207, + "relativeStake": 0.002843481609389736, "relays": [ { - "address": "6398a55d.cardano-relay.herd.run", - "port": 1338 - } - ] - }, - { - "accumulatedStake": 0.3763107037345207, - "relativeStake": 0.0028634171311718174, - "relays": [ + "address": "85.215.129.208", + "port": 3001 + }, { - "address": "relays.digi.pro", + "address": "154.26.158.189", + "port": 3001 + }, + { + "address": "5.104.83.174", "port": 3001 } ] }, { - "accumulatedStake": 0.3791724205979013, - "relativeStake": 0.002861716863380589, + "accumulatedStake": 0.3737922027586682, + "relativeStake": 0.002841041126547493, "relays": [ { - "address": "54.37.87.63", - "port": 6000 - }, - { - "address": "54.36.178.85", - "port": 6000 + "address": "77cb3f75.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.38203148669832204, - "relativeStake": 0.00285906610042078, + "accumulatedStake": 0.3766256274161481, + "relativeStake": 0.0028334246574798286, "relays": [ { - "address": "35.211.17.86", - "port": 3000 + "address": "relay-kiln-0-0.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "34.23.88.7", - "port": 3000 + "address": "relay-kiln-0-1.cardano.mainnet.kiln.fi", + "port": 3001 + }, + { + "address": "relay-kiln-0-2.cardano.mainnet.kiln.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.38488999553401787, - "relativeStake": 0.0028585088356957934, + "accumulatedStake": 0.37942946023090585, + "relativeStake": 0.0028038328147577695, "relays": [ { "address": "cardano-main.everstake.one", @@ -1502,231 +1507,278 @@ ] }, { - "accumulatedStake": 0.38774104512368157, - "relativeStake": 0.0028510495896637445, + "accumulatedStake": 0.3822326954808714, + "relativeStake": 0.002803235249965583, "relays": [ { - "address": "r-eu-1.polypool.io", - "port": 4001 - }, - { - "address": "r-sg-1.polypool.io", - "port": 4001 + "address": "129.80.153.243", + "port": 3001 } ] }, { - "accumulatedStake": 0.3905909917398672, - "relativeStake": 0.0028499466161856467, + "accumulatedStake": 0.38501922279216483, + "relativeStake": 0.0027865273112933973, "relays": [ { - "address": "rockyrelay1.ddns.net", - "port": 3001 + "address": "35.211.17.86", + "port": 3000 }, { - "address": "rockyrelay2.ddns.net", - "port": 3002 - } - ] - }, - { - "accumulatedStake": 0.3934399968010388, - "relativeStake": 0.002849005061171563, - "relays": [ - { - "address": "relays.onyxstakepool.com", - "port": 3001 + "address": "34.23.88.7", + "port": 3000 } ] }, { - "accumulatedStake": 0.39628473152155835, - "relativeStake": 0.0028447347205195575, + "accumulatedStake": 0.3878041387754049, + "relativeStake": 0.0027849159832401306, "relays": [ { - "address": "20.61.229.103", - "port": 3001 - }, - { - "address": "20.61.228.218", - "port": 3001 - }, - { - "address": "108.142.42.221", + "address": "rockyrelay1.ddns.net", "port": 3001 }, { - "address": "108.142.42.161", - "port": 3001 + "address": "rockyrelay2.ddns.net", + "port": 3002 } ] }, { - "accumulatedStake": 0.3991132713398471, - "relativeStake": 0.0028285398182887017, + "accumulatedStake": 0.3905651835140288, + "relativeStake": 0.0027610447386238685, "relays": [ { - "address": "st3ak.1337.cx", + "address": "148.113.17.23", "port": 6000 }, { - "address": "st3ak.mooo.com", + "address": "158.69.25.103", "port": 6000 }, { - "address": "st3ak.root.sx", + "address": "46.4.53.238", + "port": 6000 + }, + { + "address": "149.102.140.164", "port": 6000 } ] }, { - "accumulatedStake": 0.40193021371681176, - "relativeStake": 0.002816942376964709, + "accumulatedStake": 0.39332084896407665, + "relativeStake": 0.002755665450047866, "relays": [ { - "address": "129.80.153.243", - "port": 3001 + "address": "76cf1dd1.cardano-relay.bison.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.404732708126729, - "relativeStake": 0.0028024944099172638, + "accumulatedStake": 0.3960737043172269, + "relativeStake": 0.002752855353150195, "relays": [ { - "address": "148.113.17.23", - "port": 6000 - }, - { - "address": "158.69.25.103", - "port": 6000 + "address": "relay-kiln-7-0.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "46.4.53.238", - "port": 6000 + "address": "relay-kiln-7-1.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "149.102.140.164", - "port": 6000 + "address": "relay-kiln-7-2.cardano.mainnet.kiln.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.4075014469995334, - "relativeStake": 0.0027687388728043494, + "accumulatedStake": 0.3988262066246909, + "relativeStake": 0.002752502307464065, "relays": [ { - "address": "relay-pool-ledger-3-mainnet.cardano.aeq5f.com" + "address": "cardano-main.everstake.one", + "port": 3001 + }, + { + "address": "cardano-main2.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay1.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay2.everstake.one", + "port": 3001 } ] }, { - "accumulatedStake": 0.4102603304896993, - "relativeStake": 0.002758883490165883, + "accumulatedStake": 0.4015622373245946, + "relativeStake": 0.002736030699903695, "relays": [ { - "address": "77cb3f75.cardano-relay.herd.run", - "port": 1338 + "address": "57.128.184.33", + "port": 3001 + }, + { + "address": "57.128.184.31", + "port": 3001 } ] }, { - "accumulatedStake": 0.4130018195956508, - "relativeStake": 0.002741489105951544, + "accumulatedStake": 0.40429758746283956, + "relativeStake": 0.002735350138244913, "relays": [ { - "address": "relaynode1.bravostakepool.nl", - "port": 3001 + "address": "bd-cardano-main-relay-5-a.bdnodes.net", + "port": 6000 }, { - "address": "relaynode2.bravostakepool.nl", - "port": 3001 - }, + "address": "bd-cardano-main-relay-5-b.bdnodes.net", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.4070297167304597, + "relativeStake": 0.002732129267620131, + "relays": [ { - "address": "relaynode3.bravostakepool.nl", - "port": 3001 + "address": "relays.cardanowithpaul.com", + "port": 1069 } ] }, { - "accumulatedStake": 0.4157404500279526, - "relativeStake": 0.0027386304323017956, + "accumulatedStake": 0.40975759495669134, + "relativeStake": 0.0027278782262316692, "relays": [ { - "address": "relay1.nedscave.io", - "port": 3001 + "address": "r-eu-1.polypool.io", + "port": 4001 }, { - "address": "relay2.nedscave.io", - "port": 3001 - }, + "address": "r-sg-1.polypool.io", + "port": 4001 + } + ] + }, + { + "accumulatedStake": 0.4124796920828253, + "relativeStake": 0.0027220971261339454, + "relays": [ { - "address": "relay3.nedscave.io", - "port": 3001 + "address": "rev-cardano-main-relay-01-a.bdnodes.net", + "port": 6000 }, { - "address": "relay4.nedscave.io", - "port": 3001 + "address": "rev-cardano-main-relay-01-b.bdnodes.net", + "port": 6000 } ] }, { - "accumulatedStake": 0.41847201978179366, - "relativeStake": 0.0027315697538410452, + "accumulatedStake": 0.41519530076754774, + "relativeStake": 0.002715608684722465, "relays": [ { - "address": "relay1-dl.aichi-stakepool.com", - "port": 6000 + "address": "relay-kiln-8-0.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "relay2-jp.aichi-stakepool.com", - "port": 6000 + "address": "relay-kiln-8-1.cardano.mainnet.kiln.fi", + "port": 3001 }, { - "address": "relay3-li.aichi-stakepool.com", - "port": 6000 + "address": "relay-kiln-8-2.cardano.mainnet.kiln.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.4211745086294269, - "relativeStake": 0.0027024888476332412, + "accumulatedStake": 0.4179101992805863, + "relativeStake": 0.002714898513038538, "relays": [ { - "address": "relay.anonaf.com", - "port": 3333 + "address": "180.150.102.25", + "port": 8376 + }, + { + "address": "180.150.96.245", + "port": 8376 + }, + { + "address": "144.6.112.28", + "port": 8376 + }, + { + "address": "154.38.173.238", + "port": 8376 + }, + { + "address": "152.53.55.29", + "port": 8376 + }, + { + "address": "relays.terminada.io", + "port": 8376 } ] }, { - "accumulatedStake": 0.4238751254936669, - "relativeStake": 0.0027006168642400227, + "accumulatedStake": 0.4206203480321787, + "relativeStake": 0.002710148751592389, "relays": [ { - "address": "cardano-main.everstake.one", + "address": "relaynode1.bravostakepool.nl", "port": 3001 }, { - "address": "cardano-main2.everstake.one", + "address": "relaynode2.bravostakepool.nl", "port": 3001 }, { - "address": "cardano-relay.everstake.one", + "address": "relaynode3.bravostakepool.nl", "port": 3001 - }, + } + ] + }, + { + "accumulatedStake": 0.4233285901203706, + "relativeStake": 0.002708242088191927, + "relays": [ { - "address": "cardano-relay1.everstake.one", - "port": 3001 + "address": "relay.cardano.securestaking.io", + "port": 3000 }, { - "address": "cardano-relay2.everstake.one", - "port": 3001 + "address": "secur2.cardano.securestaking.io", + "port": 3000 } ] }, { - "accumulatedStake": 0.4265707512320244, - "relativeStake": 0.0026956257383574894, + "accumulatedStake": 0.42603420141848, + "relativeStake": 0.0027056112981093863, + "relays": [ + { + "address": "f9395b98.cardano-relay.herd.run", + "port": 1338 + } + ] + }, + { + "accumulatedStake": 0.42873186628427434, + "relativeStake": 0.0026976648657943765, "relays": [ { "address": "sydney.cardanode.com.au", @@ -1747,22 +1799,30 @@ ] }, { - "accumulatedStake": 0.4292582366262798, - "relativeStake": 0.002687485394255423, + "accumulatedStake": 0.43140439375335043, + "relativeStake": 0.002672527469076086, "relays": [ { - "address": "relay.cardano.securestaking.io", - "port": 3000 + "address": "20.61.229.103", + "port": 3001 }, { - "address": "secur2.cardano.securestaking.io", - "port": 3000 + "address": "20.61.228.218", + "port": 3001 + }, + { + "address": "108.142.42.221", + "port": 3001 + }, + { + "address": "108.142.42.161", + "port": 3001 } ] }, { - "accumulatedStake": 0.4319176751028028, - "relativeStake": 0.002659438476522997, + "accumulatedStake": 0.434075207960416, + "relativeStake": 0.002670814207065531, "relays": [ { "address": "cork.queenada.com", @@ -1771,138 +1831,199 @@ ] }, { - "accumulatedStake": 0.4345728140615006, - "relativeStake": 0.00265513895869781, + "accumulatedStake": 0.4367323959114714, + "relativeStake": 0.00265718795105539, "relays": [ { - "address": "f9395b98.cardano-relay.herd.run", - "port": 1338 + "address": "relay.anonaf.com", + "port": 3333 } ] }, { - "accumulatedStake": 0.4372271843000207, - "relativeStake": 0.0026543702385200575, + "accumulatedStake": 0.43938683646372284, + "relativeStake": 0.0026544405522514747, "relays": [ { - "address": "644dd09c.cardano-relay.herd.run", - "port": 1338 + "address": "st3ak.1337.cx", + "port": 6000 + }, + { + "address": "st3ak.mooo.com", + "port": 6000 + }, + { + "address": "st3ak.root.sx", + "port": 6000 } ] }, { - "accumulatedStake": 0.43986038744518074, - "relativeStake": 0.0026332031451600296, + "accumulatedStake": 0.4420409758525711, + "relativeStake": 0.0026541393888483015, "relays": [ { - "address": "relays.cardanowithpaul.com", - "port": 1069 + "address": "relay1.str8pool.com", + "port": 7421 + }, + { + "address": "relay2.str8pool.com", + "port": 3611 } ] }, { - "accumulatedStake": 0.4424626193558399, - "relativeStake": 0.002602231910659203, + "accumulatedStake": 0.4446744567271612, + "relativeStake": 0.002633480874590054, "relays": [ { - "address": "20.61.229.103", + "address": "relay.cardano.securestaking.io", + "port": 3000 + }, + { + "address": "secur2.cardano.securestaking.io", + "port": 3000 + } + ] + }, + { + "accumulatedStake": 0.4472992488548879, + "relativeStake": 0.0026247921277267315, + "relays": [ + { + "address": "cardano-main.everstake.one", "port": 3001 }, { - "address": "20.61.228.218", + "address": "cardano-main2.everstake.one", "port": 3001 }, { - "address": "108.142.42.221", + "address": "cardano-relay.everstake.one", "port": 3001 }, { - "address": "108.142.42.161", + "address": "cardano-relay1.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay2.everstake.one", "port": 3001 } ] }, { - "accumulatedStake": 0.4450645382110888, - "relativeStake": 0.002601918855248898, + "accumulatedStake": 0.4499127967123031, + "relativeStake": 0.0026135478574151635, "relays": [ { - "address": "relay-kiln-0-0.cardano.mainnet.kiln.fi", + "address": "relay1.nedscave.io", "port": 3001 }, { - "address": "relay-kiln-0-1.cardano.mainnet.kiln.fi", + "address": "relay2.nedscave.io", "port": 3001 }, { - "address": "relay-kiln-0-2.cardano.mainnet.kiln.fi", + "address": "relay3.nedscave.io", + "port": 3001 + }, + { + "address": "relay4.nedscave.io", "port": 3001 } ] }, { - "accumulatedStake": 0.44763631973309886, - "relativeStake": 0.0025717815220100615, + "accumulatedStake": 0.45252358969318374, + "relativeStake": 0.0026107929808806196, "relays": [ { - "address": "bd-cardano-main-relay-5-a.bdnodes.net", + "address": "relay1-dl.aichi-stakepool.com", "port": 6000 }, { - "address": "bd-cardano-main-relay-5-b.bdnodes.net", + "address": "relay2-jp.aichi-stakepool.com", + "port": 6000 + }, + { + "address": "relay3-li.aichi-stakepool.com", "port": 6000 } ] }, { - "accumulatedStake": 0.45018881570067165, - "relativeStake": 0.002552495967572768, + "accumulatedStake": 0.4550992087208691, + "relativeStake": 0.0025756190276854237, "relays": [ { - "address": "fr.relays.cardanians.io", - "port": 1000 + "address": "54.37.87.63", + "port": 6000 }, { - "address": "ca.relays.cardanians.io", - "port": 1000 + "address": "54.36.178.85", + "port": 6000 } ] }, { - "accumulatedStake": 0.45273055033978343, - "relativeStake": 0.002541734639111789, + "accumulatedStake": 0.45766899256467397, + "relativeStake": 0.0025697838438048385, "relays": [ { - "address": "relay1.able-pool.io", - "port": 4555 - }, + "address": "relay-pool-ledger-3-mainnet.cardano.aeq5f.com" + } + ] + }, + { + "accumulatedStake": 0.4602371204260182, + "relativeStake": 0.002568127861344214, + "relays": [ { - "address": "relay2.able-pool.io", - "port": 4419 + "address": "644dd09c.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.45525222583320435, - "relativeStake": 0.002521675493420892, + "accumulatedStake": 0.46279848833835785, + "relativeStake": 0.002561367912339629, "relays": [ { - "address": "49.12.198.221", - "port": 6000 + "address": "20.61.229.103", + "port": 3001 }, { - "address": "89.58.18.51", - "port": 6000 + "address": "20.61.228.218", + "port": 3001 }, { - "address": "131.153.199.82", - "port": 6000 + "address": "108.142.42.221", + "port": 3001 + }, + { + "address": "108.142.42.161", + "port": 3001 } ] }, { - "accumulatedStake": 0.45776879480264443, - "relativeStake": 0.0025165689694401174, + "accumulatedStake": 0.46531841133700746, + "relativeStake": 0.002519922998649633, + "relays": [ + { + "address": "fr.relays.cardanians.io", + "port": 1000 + }, + { + "address": "ca.relays.cardanians.io", + "port": 1000 + } + ] + }, + { + "accumulatedStake": 0.467803814453146, + "relativeStake": 0.002485403116138525, "relays": [ { "address": "a0e18895.cardano-relay.bison.run", @@ -1911,50 +2032,58 @@ ] }, { - "accumulatedStake": 0.46024841404452665, - "relativeStake": 0.0024796192418821855, + "accumulatedStake": 0.47028043592594915, + "relativeStake": 0.0024766214728031365, "relays": [ { - "address": "relay1.str8pool.com", - "port": 7421 + "address": "norway.adanorthpool.com", + "port": 9011 }, { - "address": "relay2.str8pool.com", - "port": 3611 + "address": "norway.adanorthpool.com", + "port": 9012 + }, + { + "address": "norway.adanorthpool.com", + "port": 9014 + }, + { + "address": "norway2.adanorthpool.com", + "port": 9014 + }, + { + "address": "norway2.adanorthpool.com", + "port": 9013 } ] }, { - "accumulatedStake": 0.4627273275916672, - "relativeStake": 0.002478913547140534, + "accumulatedStake": 0.47275620635229443, + "relativeStake": 0.002475770426345324, "relays": [ { - "address": "r1.1percentpool.eu", - "port": 19001 + "address": "relay1.able-pool.io", + "port": 4555 }, { - "address": "r2.1percentpool.eu", - "port": 19002 + "address": "relay2.able-pool.io", + "port": 4419 } ] }, { - "accumulatedStake": 0.46519999080607216, - "relativeStake": 0.0024726632144049794, + "accumulatedStake": 0.47522604882645125, + "relativeStake": 0.0024698424741568244, "relays": [ { - "address": "relay.cardano.securestaking.io", - "port": 3000 - }, - { - "address": "secur2.cardano.securestaking.io", - "port": 3000 + "address": "c61ace08.cardano-relay.herd.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.46766945259607184, - "relativeStake": 0.002469461789999716, + "accumulatedStake": 0.4776952455433105, + "relativeStake": 0.0024691967168592537, "relays": [ { "address": "r1.adastat.net", @@ -1971,48 +2100,22 @@ ] }, { - "accumulatedStake": 0.47013730025962014, - "relativeStake": 0.0024678476635482823, + "accumulatedStake": 0.4801630395397893, + "relativeStake": 0.0024677939964787435, "relays": [ { - "address": "3.217.90.52", - "port": 6000 - }, - { - "address": "3.219.254.127", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.47259011824325753, - "relativeStake": 0.0024528179836373672, - "relays": [ - { - "address": "relay1.adaocean.com", - "port": 6000 - }, - { - "address": "relay2.adaocean.com", - "port": 6000 - }, - { - "address": "relay3.adaocean.com", - "port": 6000 - }, - { - "address": "relay4.adaocean.com", - "port": 6000 + "address": "r1.1percentpool.eu", + "port": 19001 }, { - "address": "relay5.adaocean.com", - "port": 6000 + "address": "r2.1percentpool.eu", + "port": 19002 } ] }, { - "accumulatedStake": 0.4750334069240584, - "relativeStake": 0.002443288680800852, + "accumulatedStake": 0.48260385111903215, + "relativeStake": 0.0024408115792428704, "relays": [ { "address": "cardano-main.everstake.one", @@ -2037,32 +2140,18 @@ ] }, { - "accumulatedStake": 0.4774697458286534, - "relativeStake": 0.0024363389045950765, + "accumulatedStake": 0.48501218858278106, + "relativeStake": 0.0024083374637488978, "relays": [ { - "address": "eu.relays.cardanians.io", - "port": 1000 - }, - { - "address": "ca.relays.cardanians.io", - "port": 1000 - } - ] - }, - { - "accumulatedStake": 0.47990009550081136, - "relativeStake": 0.0024303496721579097, - "relays": [ - { - "address": "ada-relay02.biglazycat.com", - "port": 6000 + "address": "relays.onyxstakepool.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.48232358900286676, - "relativeStake": 0.002423493502055408, + "accumulatedStake": 0.4873753240105113, + "relativeStake": 0.0023631354277302884, "relays": [ { "address": "cardano-main.everstake.one", @@ -2087,100 +2176,125 @@ ] }, { - "accumulatedStake": 0.48474632017799746, - "relativeStake": 0.002422731175130697, + "accumulatedStake": 0.48973727829241853, + "relativeStake": 0.0023619542819072197, "relays": [ { - "address": "relay-pool-ledger-1-mainnet.cardano.aeq5f.com" + "address": "relay-pool-figment-6-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.48716220745539046, - "relativeStake": 0.002415887277393024, + "accumulatedStake": 0.49209847736707246, + "relativeStake": 0.0023611990746539133, "relays": [ { - "address": "c61ace08.cardano-relay.herd.run", - "port": 1338 + "address": "ACLrelay1.cardanoland.com", + "port": 6000 + }, + { + "address": "ACLrelay2.cardanoland.com", + "port": 7000 + }, + { + "address": "ACLrelay3.cardanoland.com", + "port": 8000 + }, + { + "address": "ACLrelay4.cardanoland.com", + "port": 6000 + }, + { + "address": "ACLrelay5.cardanoland.com", + "port": 7000 + }, + { + "address": "ACLrelay6.cardanoland.com", + "port": 8000 } ] }, { - "accumulatedStake": 0.48956691742596126, - "relativeStake": 0.0024047099705707697, + "accumulatedStake": 0.494455657294716, + "relativeStake": 0.0023571799276435514, "relays": [ { - "address": "35.156.192.95", + "address": "3.217.90.52", "port": 6000 }, { - "address": "18.197.51.215", + "address": "3.219.254.127", "port": 6000 } ] }, { - "accumulatedStake": 0.491958528465123, - "relativeStake": 0.0023916110391617564, + "accumulatedStake": 0.49681049895830043, + "relativeStake": 0.002354841663584441, "relays": [ { - "address": "relay-pool-figment-6-mainnet.cardano.aeq5f.com" + "address": "ada-relay02.biglazycat.com", + "port": 6000 } ] }, { - "accumulatedStake": 0.4943478555877694, - "relativeStake": 0.0023893271226463684, + "accumulatedStake": 0.49916351514528895, + "relativeStake": 0.0023530161869884983, "relays": [ { - "address": "relay1.pptg1.mainnet.cardano.p2p.org", - "port": 6001 + "address": "152.53.21.151", + "port": 6000 }, { - "address": "relay2.pptg1.mainnet.cardano.p2p.org", - "port": 6001 + "address": "149.102.152.63", + "port": 6000 } ] }, { - "accumulatedStake": 0.49673643048094185, - "relativeStake": 0.002388574893172475, + "accumulatedStake": 0.5015130382059434, + "relativeStake": 0.0023495230606544065, "relays": [ { - "address": "relay1.apexfusionhosting.com", - "port": 3001 + "address": "178.156.128.18", + "port": 6001 }, { - "address": "relay2.apexfusionhosting.com", - "port": 3001 + "address": "65.21.7.149", + "port": 6001 + }, + { + "address": "137.220.49.160", + "port": 6001 + }, + { + "address": "149.28.106.237", + "port": 6001 } ] }, { - "accumulatedStake": 0.4991184831507228, - "relativeStake": 0.002382052669780996, + "accumulatedStake": 0.5038579295468899, + "relativeStake": 0.0023448913409465444, "relays": [ { - "address": "20.61.229.103", - "port": 3001 - }, - { - "address": "20.61.228.218", - "port": 3001 + "address": "49.12.198.221", + "port": 6000 }, { - "address": "108.142.42.221", - "port": 3001 + "address": "89.58.18.51", + "port": 6000 }, { - "address": "108.142.42.161", - "port": 3001 + "address": "131.153.199.82", + "port": 6000 } ] }, { - "accumulatedStake": 0.5015002215233386, - "relativeStake": 0.0023817383726158197, + "accumulatedStake": 0.5062025760002355, + "relativeStake": 0.002344646453345665, "relays": [ { "address": "20.61.229.103", @@ -2201,8 +2315,8 @@ ] }, { - "accumulatedStake": 0.5038819532779512, - "relativeStake": 0.002381731754612495, + "accumulatedStake": 0.5085469129981557, + "relativeStake": 0.002344336997920081, "relays": [ { "address": "20.61.229.103", @@ -2223,8 +2337,8 @@ ] }, { - "accumulatedStake": 0.5062636838582042, - "relativeStake": 0.002381730580253057, + "accumulatedStake": 0.5108912423729653, + "relativeStake": 0.0023443293748097475, "relays": [ { "address": "20.61.229.103", @@ -2245,8 +2359,8 @@ ] }, { - "accumulatedStake": 0.508645407505416, - "relativeStake": 0.0023817236472117825, + "accumulatedStake": 0.5132355704287384, + "relativeStake": 0.002344328055773013, "relays": [ { "address": "20.61.229.103", @@ -2267,8 +2381,8 @@ ] }, { - "accumulatedStake": 0.5110271268483847, - "relativeStake": 0.002381719342968736, + "accumulatedStake": 0.5155798929324923, + "relativeStake": 0.0023443225037539346, "relays": [ { "address": "20.61.229.103", @@ -2289,8 +2403,8 @@ ] }, { - "accumulatedStake": 0.5134088457785327, - "relativeStake": 0.00238171893014799, + "accumulatedStake": 0.5179242106994834, + "relativeStake": 0.002344317766990997, "relays": [ { "address": "20.61.229.103", @@ -2311,66 +2425,22 @@ ] }, { - "accumulatedStake": 0.515787326418052, - "relativeStake": 0.002378480639519313, + "accumulatedStake": 0.5202513851321492, + "relativeStake": 0.0023271744326658047, "relays": [ { - "address": "152.53.21.151", + "address": "35.156.192.95", "port": 6000 }, { - "address": "149.102.152.63", + "address": "18.197.51.215", "port": 6000 } ] }, { - "accumulatedStake": 0.5181328145680575, - "relativeStake": 0.002345488150005396, - "relays": [ - { - "address": "137.220.49.160", - "port": 6001 - }, - { - "address": "149.28.106.237", - "port": 6001 - } - ] - }, - { - "accumulatedStake": 0.5204753974319234, - "relativeStake": 0.0023425828638659195, - "relays": [ - { - "address": "180.150.102.25", - "port": 8376 - }, - { - "address": "180.150.96.245", - "port": 8376 - }, - { - "address": "144.6.112.28", - "port": 8376 - }, - { - "address": "154.38.173.238", - "port": 8376 - }, - { - "address": "152.53.55.29", - "port": 8376 - }, - { - "address": "relays.terminada.io", - "port": 8376 - } - ] - }, - { - "accumulatedStake": 0.5228136862969002, - "relativeStake": 0.0023382888649767864, + "accumulatedStake": 0.5225661781107586, + "relativeStake": 0.002314792978609375, "relays": [ { "address": "188.165.236.202", @@ -2383,8 +2453,8 @@ ] }, { - "accumulatedStake": 0.5251439317690774, - "relativeStake": 0.0023302454721772733, + "accumulatedStake": 0.5248729353595707, + "relativeStake": 0.0023067572488121345, "relays": [ { "address": "relay0.fimi.vn", @@ -2401,8 +2471,8 @@ ] }, { - "accumulatedStake": 0.5274511615442526, - "relativeStake": 0.0023072297751751737, + "accumulatedStake": 0.5271723731551283, + "relativeStake": 0.0022994377955577274, "relays": [ { "address": "eu1.stakecool.io", @@ -2419,88 +2489,54 @@ ] }, { - "accumulatedStake": 0.5297536779324911, - "relativeStake": 0.002302516388238515, + "accumulatedStake": 0.5294446773307174, + "relativeStake": 0.0022723041755890534, "relays": [ { - "address": "relay1.0aaaa.org", + "address": "57.128.184.27", "port": 3001 }, { - "address": "relay2.0aaaa.org", + "address": "57.128.184.86", "port": 3001 } ] }, { - "accumulatedStake": 0.5320435249656567, - "relativeStake": 0.002289847033165546, + "accumulatedStake": 0.5317122504848985, + "relativeStake": 0.002267573154181023, "relays": [ { - "address": "ACLrelay1.cardanoland.com", - "port": 6000 - }, - { - "address": "ACLrelay2.cardanoland.com", - "port": 7000 - }, - { - "address": "ACLrelay3.cardanoland.com", - "port": 8000 - }, - { - "address": "ACLrelay4.cardanoland.com", - "port": 6000 - }, - { - "address": "ACLrelay5.cardanoland.com", - "port": 7000 + "address": "relay1.apexfusionhosting.com", + "port": 3001 }, { - "address": "ACLrelay6.cardanoland.com", - "port": 8000 + "address": "relay2.apexfusionhosting.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.5343247256935919, - "relativeStake": 0.002281200727935221, + "accumulatedStake": 0.5339627919019266, + "relativeStake": 0.0022505414170281564, "relays": [ { - "address": "cardano-main.everstake.one", - "port": 3001 - }, - { - "address": "cardano-main2.everstake.one", - "port": 3001 - }, - { - "address": "cardano-relay.everstake.one", - "port": 3001 + "address": "150.136.111.193", + "port": 6001 }, { - "address": "cardano-relay1.everstake.one", - "port": 3001 + "address": "150.136.84.82", + "port": 6001 }, { - "address": "cardano-relay2.everstake.one", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.5365923602235667, - "relativeStake": 0.0022676345299747886, - "relays": [ - { - "address": "76cf1dd1.cardano-relay.bison.run", - "port": 1338 + "address": "158.101.99.150", + "port": 6001 } ] }, { - "accumulatedStake": 0.5388580159105366, - "relativeStake": 0.002265655686969912, + "accumulatedStake": 0.536202836611862, + "relativeStake": 0.0022400447099353423, "relays": [ { "address": "35.211.17.86", @@ -2513,8 +2549,8 @@ ] }, { - "accumulatedStake": 0.5411173325175883, - "relativeStake": 0.002259316607051685, + "accumulatedStake": 0.5384370244092833, + "relativeStake": 0.0022341877974213485, "relays": [ { "address": "relay0.viperstaking.com", @@ -2523,22 +2559,26 @@ ] }, { - "accumulatedStake": 0.5433571588591675, - "relativeStake": 0.002239826341579211, + "accumulatedStake": 0.5406374778941677, + "relativeStake": 0.0022004534848843833, "relays": [ { - "address": "relay.cardano.securestaking.io", - "port": 3000 + "address": "86.80.128.65", + "port": 3001 }, { - "address": "secur2.cardano.securestaking.io", - "port": 3000 + "address": "86.80.128.65", + "port": 3002 + }, + { + "address": "86.80.128.65", + "port": 3003 } ] }, { - "accumulatedStake": 0.5455773051694255, - "relativeStake": 0.0022201463102580377, + "accumulatedStake": 0.542829563688235, + "relativeStake": 0.0021920857940673044, "relays": [ { "address": "relay-pool-bitvavo-1-mainnet.cardano.aeq5f.com" @@ -2546,198 +2586,297 @@ ] }, { - "accumulatedStake": 0.5477861313151963, - "relativeStake": 0.002208826145770814, + "accumulatedStake": 0.545017385735282, + "relativeStake": 0.002187822047047032, "relays": [ { - "address": "86.80.128.65", - "port": 3001 + "address": "germany.cardanode.io", + "port": 6000 }, { - "address": "86.80.128.65", - "port": 3002 + "address": "missouri.cardanode.io", + "port": 6000 }, { - "address": "86.80.128.65", - "port": 3003 + "address": "la.cardanode.io", + "port": 6000 + }, + { + "address": "perth.cardanode.io", + "port": 6000 } ] }, { - "accumulatedStake": 0.5499925270238811, - "relativeStake": 0.0022063957086848438, + "accumulatedStake": 0.5471989129097393, + "relativeStake": 0.002181527174457328, "relays": [ { - "address": "150.136.111.193", - "port": 6001 + "address": "relay1.adaocean.com", + "port": 6000 }, { - "address": "150.136.84.82", - "port": 6001 + "address": "relay2.adaocean.com", + "port": 6000 }, { - "address": "158.101.99.150", - "port": 6001 + "address": "relay3.adaocean.com", + "port": 6000 + }, + { + "address": "relay4.adaocean.com", + "port": 6000 + }, + { + "address": "relay5.adaocean.com", + "port": 6000 } ] }, { - "accumulatedStake": 0.5521578904443382, - "relativeStake": 0.002165363420456944, + "accumulatedStake": 0.5493794384924475, + "relativeStake": 0.002180525582708133, "relays": [ { - "address": "germany.cardanode.io", - "port": 6000 - }, + "address": "relays.wavepool.digital", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.5515475259093724, + "relativeStake": 0.0021680874169249403, + "relays": [ { - "address": "missouri.cardanode.io", - "port": 6000 + "address": "relay.azureada.com", + "port": 3001 }, { - "address": "la.cardanode.io", - "port": 6000 + "address": "relay.azureada.com", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.5537110675740752, + "relativeStake": 0.0021635416647027253, + "relays": [ + { + "address": "relay1.0aaaa.org", + "port": 3001 }, { - "address": "perth.cardanode.io", - "port": 6000 + "address": "relay2.0aaaa.org", + "port": 3001 } ] }, { - "accumulatedStake": 0.5543129888651501, - "relativeStake": 0.0021550984208120595, + "accumulatedStake": 0.5558384006867865, + "relativeStake": 0.0021273331127113085, "relays": [ { - "address": "109.123.231.213", - "port": 6000 + "address": "relay-pool-bitvavo-2-mainnet.cardano.aeq5f.com" + } + ] + }, + { + "accumulatedStake": 0.5579557593684276, + "relativeStake": 0.002117358681641092, + "relays": [ + { + "address": "cardano-main.everstake.one", + "port": 3001 + }, + { + "address": "cardano-main2.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay1.everstake.one", + "port": 3001 }, { - "address": "89.58.45.244", - "port": 6000 + "address": "cardano-relay2.everstake.one", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.5600717746319206, + "relativeStake": 0.0021160152634930817, + "relays": [ + { + "address": "relay-pool-bitvavo-3-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.5564671999732174, - "relativeStake": 0.0021542111080672167, + "accumulatedStake": 0.5621862580417112, + "relativeStake": 0.0021144834097905564, "relays": [ { - "address": "relay-pool-bitvavo-2-mainnet.cardano.aeq5f.com" + "address": "relays.wavepool.digital", + "port": 3001 } ] }, { - "accumulatedStake": 0.5586111022647909, - "relativeStake": 0.002143902291573502, + "accumulatedStake": 0.5642982017388849, + "relativeStake": 0.0021119436971737257, "relays": [ { - "address": "relay.azureada.com", + "address": "57.128.184.28", "port": 3001 }, { - "address": "relay.azureada.com", + "address": "57.128.184.30", "port": 3001 } ] }, { - "accumulatedStake": 0.5607546506875275, - "relativeStake": 0.002143548422736603, + "accumulatedStake": 0.5663910833035803, + "relativeStake": 0.0020928815646953894, "relays": [ { - "address": "35.75.32.253", + "address": "109.123.231.213", + "port": 6000 + }, + { + "address": "89.58.45.244", "port": 6000 } ] }, { - "accumulatedStake": 0.5628976512455293, - "relativeStake": 0.002143000558001772, + "accumulatedStake": 0.5684592703652375, + "relativeStake": 0.0020681870616571915, "relays": [ { - "address": "relay-pool-bitvavo-3-mainnet.cardano.aeq5f.com" + "address": "relay.cardano.securestaking.io", + "port": 3000 + }, + { + "address": "secur2.cardano.securestaking.io", + "port": 3000 } ] }, { - "accumulatedStake": 0.5650298390331597, - "relativeStake": 0.002132187787630446, + "accumulatedStake": 0.5705273639022838, + "relativeStake": 0.0020680935370462877, "relays": [ { - "address": "25.cardano.staked.cloud", - "port": 3001 + "address": "eu-relay.hermes-stakepool.com", + "port": 1000 + }, + { + "address": "us-relay.hermes-stakepool.com", + "port": 1000 } ] }, { - "accumulatedStake": 0.5671325192428994, - "relativeStake": 0.0021026802097396722, + "accumulatedStake": 0.5725600079323763, + "relativeStake": 0.002032644030092499, "relays": [ { - "address": "eu.relays.cardanians.io", - "port": 1000 + "address": "ada10753.allnodes.me", + "port": 3001 }, { - "address": "ca.relays.cardanians.io", - "port": 1000 + "address": "ada12179.allnodes.me", + "port": 3001 + }, + { + "address": "ada20364.allnodes.me", + "port": 3001 + }, + { + "address": "ada21853.allnodes.me", + "port": 3001 } ] }, { - "accumulatedStake": 0.5692254394747088, - "relativeStake": 0.0020929202318094144, + "accumulatedStake": 0.5745459019311394, + "relativeStake": 0.0019858939987631554, "relays": [ { - "address": "norway.adanorthpool.com", - "port": 9011 + "address": "relay1-us.xstakepool.com", + "port": 3001 }, { - "address": "norway.adanorthpool.com", - "port": 9012 + "address": "relay2-eu.xstakepool.com", + "port": 3001 }, { - "address": "norway.adanorthpool.com", - "port": 9014 + "address": "relay3-sg.xstakepool.com", + "port": 3001 }, { - "address": "norway2.adanorthpool.com", - "port": 9014 - }, + "address": "relay4-ae.xstakepool.com", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.5765242966819681, + "relativeStake": 0.001978394750828746, + "relays": [ { - "address": "norway2.adanorthpool.com", - "port": 9013 + "address": "relay-pool-figment-8-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.5713095513917918, - "relativeStake": 0.002084111917083091, + "accumulatedStake": 0.5784878073678886, + "relativeStake": 0.0019635106859204397, "relays": [ { - "address": "relay1.adaocean.com", - "port": 6000 + "address": "gateway.adavault.com", + "port": 4021 }, { - "address": "relay2.adaocean.com", - "port": 6000 + "address": "gateway.adavault.com", + "port": 4022 }, { - "address": "relay3.adaocean.com", - "port": 6000 + "address": "gateway.adavault.com", + "port": 4026 }, { - "address": "relay4.adaocean.com", - "port": 6000 + "address": "gateway.adavault.com", + "port": 4027 }, { - "address": "relay5.adaocean.com", - "port": 6000 + "address": "gateway2.adavault.com", + "port": 4060 + }, + { + "address": "gateway2.adavault.com", + "port": 4061 + } + ] + }, + { + "accumulatedStake": 0.5804401707483577, + "relativeStake": 0.0019523633804691169, + "relays": [ + { + "address": "relays.wavepool.digital", + "port": 3001 } ] }, { - "accumulatedStake": 0.5733880629576701, - "relativeStake": 0.002078511565878172, + "accumulatedStake": 0.5823881066833779, + "relativeStake": 0.0019479359350201527, "relays": [ { "address": "relay1.blueocean.sg", @@ -2754,132 +2893,134 @@ ] }, { - "accumulatedStake": 0.5754597694714244, - "relativeStake": 0.0020717065137542965, + "accumulatedStake": 0.5843339141454863, + "relativeStake": 0.0019458074621083678, "relays": [ { - "address": "57.128.184.27", - "port": 3001 + "address": "cardano-relays-1.nu.fi", + "port": 3003 }, { - "address": "57.128.184.86", + "address": "cardano-relays-2.nu.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.5775256882993607, - "relativeStake": 0.0020659188279363366, + "accumulatedStake": 0.5862755192690736, + "relativeStake": 0.0019416051235873247, "relays": [ { - "address": "eu-relay.hermes-stakepool.com", + "address": "eu.relays.cardanians.io", "port": 1000 }, { - "address": "us-relay.hermes-stakepool.com", + "address": "ca.relays.cardanians.io", "port": 1000 } ] }, { - "accumulatedStake": 0.5795511453165509, - "relativeStake": 0.0020254570171902467, + "accumulatedStake": 0.588215845239637, + "relativeStake": 0.001940325970563445, "relays": [ { - "address": "ada10753.allnodes.me", - "port": 3001 - }, - { - "address": "ada12179.allnodes.me", - "port": 3001 - }, - { - "address": "ada20364.allnodes.me", - "port": 3001 + "address": "cardano-relay1.nodes.lgns.xyz", + "port": 6000 }, { - "address": "ada21853.allnodes.me", - "port": 3001 + "address": "cardano-relay2.nodes.lgns.xyz", + "port": 6000 } ] }, { - "accumulatedStake": 0.5815654627267759, - "relativeStake": 0.0020143174102249493, + "accumulatedStake": 0.5901531233722824, + "relativeStake": 0.00193727813264542, "relays": [ { - "address": "66.160.158.69", - "port": 6000 - }, - { - "address": "66.160.158.70", - "port": 6000 + "address": "18.157.253.103", + "port": 8381 } ] }, { - "accumulatedStake": 0.5835773990577382, - "relativeStake": 0.0020119363309623463, + "accumulatedStake": 0.5920878607012943, + "relativeStake": 0.0019347373290118039, "relays": [ { - "address": "relay1-us.xstakepool.com", + "address": "cardano-main.everstake.one", "port": 3001 }, { - "address": "relay2-eu.xstakepool.com", + "address": "cardano-main2.everstake.one", "port": 3001 }, { - "address": "relay3-sg.xstakepool.com", + "address": "cardano-relay.everstake.one", "port": 3001 }, { - "address": "relay4-ae.xstakepool.com", + "address": "cardano-relay1.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay2.everstake.one", "port": 3001 } ] }, { - "accumulatedStake": 0.5855553650319111, - "relativeStake": 0.001977965974172875, + "accumulatedStake": 0.5940132691552562, + "relativeStake": 0.0019254084539619336, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 + "address": "cardano-main.everstake.one", + "port": 3001 }, { - "address": "cardano-relays-2.nu.fi", + "address": "cardano-main2.everstake.one", "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.5875292655291925, - "relativeStake": 0.001973900497281409, - "relays": [ + }, { - "address": "18.157.253.103", - "port": 8381 + "address": "cardano-relay.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay1.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay2.everstake.one", + "port": 3001 } ] }, { - "accumulatedStake": 0.5894941580122505, - "relativeStake": 0.0019648924830579255, + "accumulatedStake": 0.5959224901785553, + "relativeStake": 0.0019092210232990996, "relays": [ { - "address": "cardano-relay1.nodes.lgns.xyz", - "port": 6000 + "address": "20.61.229.103", + "port": 3001 }, { - "address": "cardano-relay2.nodes.lgns.xyz", - "port": 6000 + "address": "20.61.228.218", + "port": 3001 + }, + { + "address": "108.142.42.221", + "port": 3001 + }, + { + "address": "108.142.42.161", + "port": 3001 } ] }, { - "accumulatedStake": 0.5914316952687905, - "relativeStake": 0.0019375372565400722, + "accumulatedStake": 0.5978036347192763, + "relativeStake": 0.001881144540721049, "relays": [ { "address": "relay1.adaocean.com", @@ -2904,44 +3045,22 @@ ] }, { - "accumulatedStake": 0.5933523212344156, - "relativeStake": 0.0019206259656250988, + "accumulatedStake": 0.5996727793047445, + "relativeStake": 0.0018691445854681792, "relays": [ { - "address": "cardano-main.everstake.one", - "port": 3001 - }, - { - "address": "cardano-main2.everstake.one", - "port": 3001 - }, - { - "address": "cardano-relay.everstake.one", - "port": 3001 - }, - { - "address": "cardano-relay1.everstake.one", - "port": 3001 + "address": "66.160.158.69", + "port": 6000 }, { - "address": "cardano-relay2.everstake.one", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.5952445725361046, - "relativeStake": 0.0018922513016890075, - "relays": [ - { - "address": "adar1.stakit.io", - "port": 30500 + "address": "66.160.158.70", + "port": 6000 } ] }, { - "accumulatedStake": 0.5971233494255492, - "relativeStake": 0.001878776889444656, + "accumulatedStake": 0.601520469740498, + "relativeStake": 0.0018476904357534356, "relays": [ { "address": "157.245.228.134", @@ -2962,74 +3081,89 @@ ] }, { - "accumulatedStake": 0.5989851890942257, - "relativeStake": 0.0018618396686764297, + "accumulatedStake": 0.603346089963336, + "relativeStake": 0.0018256202228380917, "relays": [ { - "address": "relay-1.minswap.org", - "port": 3001 - }, - { - "address": "relay-2.minswap.org", - "port": 3001 + "address": "relay-pool-ledger-1-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.6008337739994766, - "relativeStake": 0.0018485849052508787, + "accumulatedStake": 0.6051676930610724, + "relativeStake": 0.0018216030977363923, "relays": [ { - "address": "relays.digi.pro", + "address": "relay-1.minswap.org", + "port": 3001 + }, + { + "address": "relay-2.minswap.org", "port": 3001 } ] }, { - "accumulatedStake": 0.6026379780371811, - "relativeStake": 0.0018042040377045253, + "accumulatedStake": 0.6069841407878498, + "relativeStake": 0.0018164477267773732, "relays": [ { - "address": "relays.smaug.pool.pm", - "port": 3001 + "address": "relay1.adaocean.com", + "port": 6000 + }, + { + "address": "relay2.adaocean.com", + "port": 6000 + }, + { + "address": "relay3.adaocean.com", + "port": 6000 + }, + { + "address": "relay4.adaocean.com", + "port": 6000 + }, + { + "address": "relay5.adaocean.com", + "port": 6000 } ] }, { - "accumulatedStake": 0.6044382821677639, - "relativeStake": 0.00180030413058274, + "accumulatedStake": 0.6087644759586577, + "relativeStake": 0.001780335170807912, "relays": [ - { - "address": "148.113.17.23", - "port": 6000 + { + "address": "relay1.zetetic.tech", + "port": 3001 }, { - "address": "158.69.25.103", - "port": 6000 + "address": "relay2.zetetic.tech", + "port": 3001 }, { - "address": "95.216.70.238", - "port": 6000 + "address": "relay3.zetetic.tech", + "port": 3001 }, { - "address": "149.102.140.196", - "port": 6000 + "address": "relay4.zetetic.tech", + "port": 3001 } ] }, { - "accumulatedStake": 0.6062330836337303, - "relativeStake": 0.001794801465966416, + "accumulatedStake": 0.6105421647277266, + "relativeStake": 0.001777688769068936, "relays": [ { - "address": "europe-2.katanapool.net", - "port": 3001 + "address": "adar1.stakit.io", + "port": 30500 } ] }, { - "accumulatedStake": 0.6080261394938581, - "relativeStake": 0.0017930558601278643, + "accumulatedStake": 0.6123175641882551, + "relativeStake": 0.001775399460528437, "relays": [ { "address": "170.187.203.117", @@ -3042,115 +3176,100 @@ ] }, { - "accumulatedStake": 0.6098071998023872, - "relativeStake": 0.0017810603085290325, + "accumulatedStake": 0.6140867149360767, + "relativeStake": 0.0017691507478216357, "relays": [ { - "address": "relay.sunnyada.com", - "port": 5001 + "address": "64.176.49.224", + "port": 6000 + }, + { + "address": "149.28.161.63", + "port": 6000 } ] }, { - "accumulatedStake": 0.6115769773912034, - "relativeStake": 0.001769777588816232, + "accumulatedStake": 0.6158553574910489, + "relativeStake": 0.0017686425549722194, "relays": [ { - "address": "217.160.14.223", - "port": 6000 + "address": "europe-2.katanapool.net", + "port": 3001 } ] }, { - "accumulatedStake": 0.6133276142128308, - "relativeStake": 0.001750636821627385, + "accumulatedStake": 0.6176200577878549, + "relativeStake": 0.0017647002968059346, "relays": [ { - "address": "gateway.adavault.com", - "port": 4021 - }, - { - "address": "gateway.adavault.com", - "port": 4022 - }, - { - "address": "gateway.adavault.com", - "port": 4026 - }, - { - "address": "gateway.adavault.com", - "port": 4027 - }, - { - "address": "gateway2.adavault.com", - "port": 4060 - }, - { - "address": "gateway2.adavault.com", - "port": 4061 + "address": "217.160.14.223", + "port": 6000 } ] }, { - "accumulatedStake": 0.6150750825645935, - "relativeStake": 0.0017474683517628008, + "accumulatedStake": 0.6193620958621975, + "relativeStake": 0.001742038074342562, "relays": [ { - "address": "35.154.118.137", - "port": 6000 - }, - { - "address": "3.6.81.137", - "port": 6000 + "address": "relay.sunnyada.com", + "port": 5001 } ] }, { - "accumulatedStake": 0.616821791559333, - "relativeStake": 0.0017467089947394287, + "accumulatedStake": 0.621091650861335, + "relativeStake": 0.0017295549991375584, "relays": [ { - "address": "relay-pool-figment-3-mainnet.cardano.aeq5f.com" + "address": "north-america-relay.jpn-sp.net", + "port": 3001 } ] }, { - "accumulatedStake": 0.618568413692504, - "relativeStake": 0.001746622133171016, + "accumulatedStake": 0.6228210278826258, + "relativeStake": 0.0017293770212908697, "relays": [ { - "address": "57.128.184.28", - "port": 3001 + "address": "eu.relays.cardanians.io", + "port": 1000 }, { - "address": "57.128.184.30", - "port": 3001 + "address": "ca.relays.cardanians.io", + "port": 1000 } ] }, { - "accumulatedStake": 0.6203135047519096, - "relativeStake": 0.0017450910594056267, + "accumulatedStake": 0.624524673109576, + "relativeStake": 0.0017036452269501932, "relays": [ { - "address": "north-america-relay.jpn-sp.net", + "address": "32.cardano.staked.cloud", "port": 3001 } ] }, { - "accumulatedStake": 0.6220574404431934, - "relativeStake": 0.0017439356912838295, + "accumulatedStake": 0.6262259520776995, + "relativeStake": 0.0017012789681234083, "relays": [ { - "address": "20.69.213.207", - "port": 3000 + "address": "cardano-relays-1.nu.fi", + "port": 3003 + }, + { + "address": "cardano-relays-2.nu.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.623780757348501, - "relativeStake": 0.0017233169053075144, + "accumulatedStake": 0.6279106628348828, + "relativeStake": 0.0016847107571834137, "relays": [ { "address": "relay1.adaocean.com", @@ -3175,158 +3294,178 @@ ] }, { - "accumulatedStake": 0.6255034983433727, - "relativeStake": 0.0017227409948717396, + "accumulatedStake": 0.6295945627025578, + "relativeStake": 0.0016838998676748183, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 - }, + "address": "1339aecb.cardano-relay.herd.run", + "port": 1338 + } + ] + }, + { + "accumulatedStake": 0.6312703422088141, + "relativeStake": 0.0016757795062563743, + "relays": [ { - "address": "cardano-relays-2.nu.fi", + "address": "relays.digi.pro", "port": 3001 } ] }, { - "accumulatedStake": 0.6272252121485401, - "relativeStake": 0.0017217138051673676, + "accumulatedStake": 0.6329461095139719, + "relativeStake": 0.0016757673051578715, "relays": [ { - "address": "c2504518.cardano-relay.bison.run", - "port": 1338 + "address": "20.69.213.207", + "port": 3000 } ] }, { - "accumulatedStake": 0.6289371178964914, - "relativeStake": 0.0017119057479513722, + "accumulatedStake": 0.634621450992894, + "relativeStake": 0.0016753414789220595, "relays": [ { - "address": "150.136.84.82", - "port": 6001 + "address": "cardano-relay-1.upbit.com", + "port": 30800 }, { - "address": "158.101.99.150", - "port": 6001 + "address": "cardano-relay-2.upbit.com", + "port": 30800 }, { - "address": "150.136.111.193", - "port": 6001 + "address": "cardano-relay-3.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.6306437666417609, - "relativeStake": 0.001706648745269409, + "accumulatedStake": 0.6362944620066422, + "relativeStake": 0.0016730110137481615, "relays": [ { - "address": "13.235.131.115", - "port": 3001 + "address": "cardano-relay-1.upbit.com", + "port": 30800 + }, + { + "address": "cardano-relay-2.upbit.com", + "port": 30800 + }, + { + "address": "cardano-relay-3.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.6323428277775559, - "relativeStake": 0.0016990611357949772, + "accumulatedStake": 0.6379670153535618, + "relativeStake": 0.0016725533469196677, "relays": [ { - "address": "157.245.228.134", + "address": "25.cardano.staked.cloud", "port": 3001 - }, + } + ] + }, + { + "accumulatedStake": 0.6396390126601265, + "relativeStake": 0.0016719973065646445, + "relays": [ { - "address": "159.89.120.164", - "port": 3001 + "address": "cardano-relay-1.upbit.com", + "port": 30800 }, { - "address": "209.97.186.44", - "port": 3001 + "address": "cardano-relay-2.upbit.com", + "port": 30800 }, { - "address": "eu.bloompool.io", - "port": 3001 + "address": "cardano-relay-3.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.6340370148765812, - "relativeStake": 0.00169418709902533, + "accumulatedStake": 0.6413097005571066, + "relativeStake": 0.0016706878969800683, "relays": [ { - "address": "139.180.198.13", - "port": 6000 + "address": "150.136.84.82", + "port": 6001 }, { - "address": "207.148.77.122", - "port": 6000 + "address": "158.101.99.150", + "port": 6001 + }, + { + "address": "150.136.111.193", + "port": 6001 } ] }, { - "accumulatedStake": 0.6357305505914533, - "relativeStake": 0.001693535714872174, + "accumulatedStake": 0.6429800638019684, + "relativeStake": 0.001670363244861775, "relays": [ { - "address": "cardano-main.everstake.one", - "port": 3001 - }, - { - "address": "cardano-main2.everstake.one", + "address": "157.245.228.134", "port": 3001 }, { - "address": "cardano-relay.everstake.one", + "address": "159.89.120.164", "port": 3001 }, { - "address": "cardano-relay1.everstake.one", + "address": "209.97.186.44", "port": 3001 }, { - "address": "cardano-relay2.everstake.one", + "address": "eu.bloompool.io", "port": 3001 } ] }, { - "accumulatedStake": 0.6374182980858351, - "relativeStake": 0.0016877474943816772, + "accumulatedStake": 0.6446503487797992, + "relativeStake": 0.0016702849778308891, "relays": [ { - "address": "cardano-relay-1.upbit.com", + "address": "cardano-relay-2.upbit.com", "port": 30800 }, { - "address": "cardano-relay-2.upbit.com", + "address": "cardano-relay-3.upbit.com", "port": 30800 }, { - "address": "cardano-relay-3.upbit.com", + "address": "cardano-relay-1.upbit.com", "port": 30800 } ] }, { - "accumulatedStake": 0.6391027179668958, - "relativeStake": 0.0016844198810607265, + "accumulatedStake": 0.6463199385856379, + "relativeStake": 0.0016695898058386265, "relays": [ { - "address": "cardano-relay-1.upbit.com", + "address": "cardano-relay-2.upbit.com", "port": 30800 }, { - "address": "cardano-relay-2.upbit.com", + "address": "cardano-relay-3.upbit.com", "port": 30800 }, { - "address": "cardano-relay-3.upbit.com", + "address": "cardano-relay-1.upbit.com", "port": 30800 } ] }, { - "accumulatedStake": 0.640786800455779, - "relativeStake": 0.0016840824888832086, + "accumulatedStake": 0.6479887163528796, + "relativeStake": 0.0016687777672417456, "relays": [ { "address": "cardano-relay-1.upbit.com", @@ -3343,70 +3482,72 @@ ] }, { - "accumulatedStake": 0.642470582591998, - "relativeStake": 0.0016837821362189467, + "accumulatedStake": 0.6496564092068314, + "relativeStake": 0.0016676928539518924, "relays": [ { - "address": "cardano-main.everstake.one", - "port": 3001 + "address": "cardano-relay-1.upbit.com", + "port": 30800 }, { - "address": "cardano-main2.everstake.one", - "port": 3001 + "address": "cardano-relay-2.upbit.com", + "port": 30800 }, { - "address": "cardano-relay.everstake.one", - "port": 3001 - }, + "address": "cardano-relay-3.upbit.com", + "port": 30800 + } + ] + }, + { + "accumulatedStake": 0.6513240715571031, + "relativeStake": 0.0016676623502716581, + "relays": [ { - "address": "cardano-relay1.everstake.one", - "port": 3001 + "address": "139.180.198.13", + "port": 6000 }, { - "address": "cardano-relay2.everstake.one", - "port": 3001 + "address": "207.148.77.122", + "port": 6000 } ] }, { - "accumulatedStake": 0.6441524954984484, - "relativeStake": 0.0016819129064505624, + "accumulatedStake": 0.6529913314890687, + "relativeStake": 0.001667259931965641, "relays": [ { - "address": "cardano-relay-2.upbit.com", + "address": "cardano-relay-1.upbit.com", "port": 30800 }, { - "address": "cardano-relay-3.upbit.com", + "address": "cardano-relay-2.upbit.com", "port": 30800 }, { - "address": "cardano-relay-1.upbit.com", + "address": "cardano-relay-3.upbit.com", "port": 30800 } ] }, { - "accumulatedStake": 0.6458338606919665, - "relativeStake": 0.0016813651935179835, + "accumulatedStake": 0.6546578385151776, + "relativeStake": 0.0016665070261087343, "relays": [ { - "address": "cardano-relay-2.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-3.upbit.com", - "port": 30800 + "address": "35.154.118.137", + "port": 6000 }, { - "address": "cardano-relay-1.upbit.com", - "port": 30800 + "address": "3.6.81.137", + "port": 6000 } ] }, { - "accumulatedStake": 0.6475151528950657, - "relativeStake": 0.0016812922030992287, + "accumulatedStake": 0.6563237670411108, + "relativeStake": 0.0016659285259333625, "relays": [ { "address": "cardano-relay-1.upbit.com", @@ -3423,67 +3564,65 @@ ] }, { - "accumulatedStake": 0.6491956047248745, - "relativeStake": 0.0016804518298087644, + "accumulatedStake": 0.6579739203186702, + "relativeStake": 0.001650153277559273, "relays": [ { - "address": "cardano-relay-1.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-2.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-3.upbit.com", - "port": 30800 + "address": "13.235.131.115", + "port": 3001 } ] }, { - "accumulatedStake": 0.6508747824534005, - "relativeStake": 0.0016791777285259993, + "accumulatedStake": 0.659620026635378, + "relativeStake": 0.0016461063167078967, "relays": [ { - "address": "cardano-relay-1.upbit.com", - "port": 30800 + "address": "cardano-main.everstake.one", + "port": 3001 }, { - "address": "cardano-relay-2.upbit.com", - "port": 30800 + "address": "cardano-main2.everstake.one", + "port": 3001 }, { - "address": "cardano-relay-3.upbit.com", - "port": 30800 + "address": "cardano-relay.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay1.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay2.everstake.one", + "port": 3001 } ] }, { - "accumulatedStake": 0.6525539070859258, - "relativeStake": 0.0016791246325253346, + "accumulatedStake": 0.6612633166816051, + "relativeStake": 0.0016432900462270928, "relays": [ { - "address": "cardano-relay-1.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-2.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-3.upbit.com", - "port": 30800 + "address": "3ef2283d.cardano-relay.bison.run", + "port": 1338 } ] }, { - "accumulatedStake": 0.6542317504971656, - "relativeStake": 0.0016778434112398083, + "accumulatedStake": 0.6629061614292528, + "relativeStake": 0.001642844747647747, "relays": [ { - "address": "cardano-relay-1.upbit.com", - "port": 30800 - }, + "address": "53e378bf.cardano-relay.bison.run", + "port": 1338 + } + ] + }, + { + "accumulatedStake": 0.664548392746531, + "relativeStake": 0.0016422313172780618, + "relays": [ { "address": "cardano-relay-2.upbit.com", "port": 30800 @@ -3491,22 +3630,16 @@ { "address": "cardano-relay-3.upbit.com", "port": 30800 - } - ] - }, - { - "accumulatedStake": 0.6559000595700458, - "relativeStake": 0.0016683090728801624, - "relays": [ + }, { - "address": "a1666f4c.cardano-relay.herd.run", - "port": 1338 + "address": "cardano-relay-1.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.6575683156960264, - "relativeStake": 0.0016682561259806408, + "accumulatedStake": 0.6661905916891434, + "relativeStake": 0.0016421989426124812, "relays": [ { "address": "fdd5329e.cardano-relay.bison.run", @@ -3515,18 +3648,18 @@ ] }, { - "accumulatedStake": 0.6592363078207983, - "relativeStake": 0.0016679921247719077, + "accumulatedStake": 0.6678325625396374, + "relativeStake": 0.001641970850493925, "relays": [ { - "address": "07f6ea55.cardano-relay.herd.run", + "address": "a1666f4c.cardano-relay.herd.run", "port": 1338 } ] }, { - "accumulatedStake": 0.6609042056063178, - "relativeStake": 0.001667897785519471, + "accumulatedStake": 0.6694744552783704, + "relativeStake": 0.001641892738732957, "relays": [ { "address": "0b2a2fd4.cardano-relay.bison.run", @@ -3535,28 +3668,28 @@ ] }, { - "accumulatedStake": 0.6625720878604807, - "relativeStake": 0.0016678822541629531, + "accumulatedStake": 0.6711162820953072, + "relativeStake": 0.0016418268169368993, "relays": [ { - "address": "3ef2283d.cardano-relay.bison.run", + "address": "e646e266.cardano-relay.bison.run", "port": 1338 } ] }, { - "accumulatedStake": 0.6642398572387123, - "relativeStake": 0.0016677693782314827, + "accumulatedStake": 0.6727580936950337, + "relativeStake": 0.0016418115997265225, "relays": [ { - "address": "e646e266.cardano-relay.bison.run", + "address": "07f6ea55.cardano-relay.herd.run", "port": 1338 } ] }, { - "accumulatedStake": 0.6659075585798659, - "relativeStake": 0.0016677013411537562, + "accumulatedStake": 0.674399757672749, + "relativeStake": 0.0016416639777152649, "relays": [ { "address": "84cbba68.cardano-relay.herd.run", @@ -3565,18 +3698,26 @@ ] }, { - "accumulatedStake": 0.6675749883410492, - "relativeStake": 0.0016674297611832362, + "accumulatedStake": 0.6760412592732798, + "relativeStake": 0.0016415016005309057, "relays": [ { - "address": "1339aecb.cardano-relay.herd.run", - "port": 1338 + "address": "cardano-relay-2.upbit.com", + "port": 30800 + }, + { + "address": "cardano-relay-3.upbit.com", + "port": 30800 + }, + { + "address": "cardano-relay-1.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.6692379477941992, - "relativeStake": 0.001662959453149935, + "accumulatedStake": 0.6776827486744375, + "relativeStake": 0.0016414894011574932, "relays": [ { "address": "cardano-relay-1.upbit.com", @@ -3593,218 +3734,237 @@ ] }, { - "accumulatedStake": 0.670898674807738, - "relativeStake": 0.0016607270135388374, + "accumulatedStake": 0.6793180409536981, + "relativeStake": 0.0016352922792607217, "relays": [ { - "address": "relays.cardanowithpaul.com", - "port": 1069 + "address": "195.201.143.213", + "port": 3001 + }, + { + "address": "194.233.70.237", + "port": 3001 + }, + { + "address": "89.58.59.127", + "port": 3001 } ] }, { - "accumulatedStake": 0.6725526802802476, - "relativeStake": 0.0016540054725096337, + "accumulatedStake": 0.6809523749363431, + "relativeStake": 0.0016343339826450094, "relays": [ { - "address": "cardano-relay-2.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-3.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-1.upbit.com", - "port": 30800 + "address": "relays.wavepool.digital", + "port": 3001 } ] }, { - "accumulatedStake": 0.6742060374271442, - "relativeStake": 0.0016533571468966188, + "accumulatedStake": 0.6825775910248615, + "relativeStake": 0.0016252160885183275, "relays": [ { - "address": "cardano-relay-2.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-3.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-1.upbit.com", - "port": 30800 + "address": "relays.cardanowithpaul.com", + "port": 1069 } ] }, { - "accumulatedStake": 0.6758588847042977, - "relativeStake": 0.0016528472771534719, + "accumulatedStake": 0.6841966962129706, + "relativeStake": 0.001619105188109192, "relays": [ { - "address": "cardano-relay-1.upbit.com", - "port": 30800 - }, - { - "address": "cardano-relay-2.upbit.com", - "port": 30800 - }, + "address": "52.6.109.221", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.6857979650940152, + "relativeStake": 0.0016012688810446124, + "relays": [ { - "address": "cardano-relay-3.upbit.com", - "port": 30800 + "address": "relay-pool-figment-3-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.6775104660654446, - "relativeStake": 0.0016515813611468959, + "accumulatedStake": 0.6873875516359903, + "relativeStake": 0.0015895865419750354, "relays": [ { - "address": "cardano-relay-1.upbit.com", - "port": 30800 - }, + "address": "202.61.246.91", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.6889761130156862, + "relativeStake": 0.001588561379695911, + "relays": [ { - "address": "cardano-relay-2.upbit.com", - "port": 30800 + "address": "relay1.ada-stake.com", + "port": 3001 }, { - "address": "cardano-relay-3.upbit.com", - "port": 30800 + "address": "relay2.ada-stake.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.6791596604987189, - "relativeStake": 0.0016491944332742868, + "accumulatedStake": 0.6905550145204441, + "relativeStake": 0.0015789015047578715, "relays": [ { - "address": "195.201.143.213", - "port": 3001 + "address": "rho.relay.easy1staking.com", + "port": 30020 }, { - "address": "194.233.70.237", - "port": 3001 + "address": "pi.relay.easy1staking.com", + "port": 30021 }, { - "address": "89.58.59.127", - "port": 3001 + "address": "eu-central-1.relay.easy1staking.com", + "port": 30000 + }, + { + "address": "us-east-1.relay.easy1staking.com", + "port": 30000 } ] }, { - "accumulatedStake": 0.6808021481571963, - "relativeStake": 0.0016424876584773724, + "accumulatedStake": 0.6921281777105447, + "relativeStake": 0.0015731631901006642, "relays": [ { - "address": "cardano-main.everstake.one", - "port": 3001 + "address": "truth.kiwipool.org", + "port": 9630 }, { - "address": "cardano-main2.everstake.one", - "port": 3001 + "address": "love.kiwipool.org", + "port": 9630 }, { - "address": "cardano-relay.everstake.one", - "port": 3001 + "address": "liberty.kiwipool.org", + "port": 9630 }, { - "address": "cardano-relay1.everstake.one", - "port": 3001 + "address": "freedom.kiwipool.org", + "port": 9630 }, { - "address": "cardano-relay2.everstake.one", - "port": 3001 + "address": "peace.kiwipool.org", + "port": 9630 + }, + { + "address": "aspire.kiwipool.org", + "port": 9630 } ] }, { - "accumulatedStake": 0.6824416386774111, - "relativeStake": 0.0016394905202148438, + "accumulatedStake": 0.6937001972302053, + "relativeStake": 0.0015720195196605538, "relays": [ { - "address": "52.6.109.221", + "address": "relays.smaug.pool.pm", "port": 3001 } ] }, { - "accumulatedStake": 0.6840782565070976, - "relativeStake": 0.0016366178296865718, + "accumulatedStake": 0.695268161256444, + "relativeStake": 0.0015679640262386838, "relays": [ { - "address": "64.176.49.224", - "port": 6000 - }, - { - "address": "149.28.161.63", - "port": 6000 + "address": "relays.digi.pro", + "port": 3001 } ] }, { - "accumulatedStake": 0.6857145516186253, - "relativeStake": 0.0016362951115276273, + "accumulatedStake": 0.6968320402336844, + "relativeStake": 0.0015638789772404464, "relays": [ { - "address": "104.131.47.170", - "port": 6000 - }, - { - "address": "128.199.64.13", - "port": 6000 - }, + "address": "3.234.66.234", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.6983934749536242, + "relativeStake": 0.0015614347199397974, + "relays": [ { - "address": "165.232.180.100", - "port": 6000 + "address": "3.234.66.234", + "port": 3001 } ] }, { - "accumulatedStake": 0.6873504496792117, - "relativeStake": 0.0016358980605863022, + "accumulatedStake": 0.6999519607028227, + "relativeStake": 0.0015584857491985305, "relays": [ { - "address": "relay-kiln-8-0.cardano.mainnet.kiln.fi", + "address": "cardano-main.everstake.one", "port": 3001 }, { - "address": "relay-kiln-8-1.cardano.mainnet.kiln.fi", + "address": "cardano-main2.everstake.one", "port": 3001 }, { - "address": "relay-kiln-8-2.cardano.mainnet.kiln.fi", + "address": "cardano-relay.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay1.everstake.one", + "port": 3001 + }, + { + "address": "cardano-relay2.everstake.one", "port": 3001 } ] }, { - "accumulatedStake": 0.688978924648202, - "relativeStake": 0.00162847496899034, + "accumulatedStake": 0.7015087823583013, + "relativeStake": 0.0015568216554785225, "relays": [ { - "address": "rev-cardano-main-relay-01-a.bdnodes.net", - "port": 6000 - }, + "address": "34.192.61.190", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.7030634691306413, + "relativeStake": 0.0015546867723400786, + "relays": [ { - "address": "rev-cardano-main-relay-01-b.bdnodes.net", - "port": 6000 + "address": "3.234.185.23", + "port": 3001 } ] }, { - "accumulatedStake": 0.6905931349467452, - "relativeStake": 0.001614210298543254, + "accumulatedStake": 0.7046179625186462, + "relativeStake": 0.0015544933880048573, "relays": [ { - "address": "202.61.246.91", + "address": "3.234.185.23", "port": 3001 } ] }, { - "accumulatedStake": 0.6921994517713902, - "relativeStake": 0.0016063168246450094, + "accumulatedStake": 0.706162555625103, + "relativeStake": 0.0015445931064568324, "relays": [ { "address": "cardano-main.everstake.one", @@ -3829,335 +3989,283 @@ ] }, { - "accumulatedStake": 0.6937947984435094, - "relativeStake": 0.0015953466721192315, + "accumulatedStake": 0.7077033016863388, + "relativeStake": 0.0015407460612357506, "relays": [ { - "address": "truth.kiwipool.org", - "port": 9630 - }, - { - "address": "love.kiwipool.org", - "port": 9630 + "address": "185.161.193.91", + "port": 6010 }, { - "address": "liberty.kiwipool.org", - "port": 9630 + "address": "185.161.193.92", + "port": 6010 }, { - "address": "freedom.kiwipool.org", - "port": 9630 + "address": "2a07:c700:0:700::91", + "port": 6010 }, { - "address": "peace.kiwipool.org", - "port": 9630 + "address": "2a07:c700:0:700::92", + "port": 6010 }, { - "address": "aspire.kiwipool.org", - "port": 9630 - } - ] - }, - { - "accumulatedStake": 0.6953845179190733, - "relativeStake": 0.0015897194755638015, - "relays": [ - { - "address": "relay-pool-figment-8-mainnet.cardano.aeq5f.com" - } - ] - }, - { - "accumulatedStake": 0.6969711435127536, - "relativeStake": 0.0015866255936803596, - "relays": [ - { - "address": "3.234.66.234", - "port": 3001 + "address": "80.211.123.84", + "port": 6010 } ] }, { - "accumulatedStake": 0.6985563389373673, - "relativeStake": 0.0015851954246137471, + "accumulatedStake": 0.7092230141672969, + "relativeStake": 0.0015197124809581079, "relays": [ { - "address": "cardano-main.everstake.one", - "port": 3001 - }, - { - "address": "cardano-main2.everstake.one", - "port": 3001 - }, - { - "address": "cardano-relay.everstake.one", - "port": 3001 + "address": "198.71.57.191", + "port": 6000 }, { - "address": "cardano-relay1.everstake.one", - "port": 3001 + "address": "154.12.240.223", + "port": 6000 }, { - "address": "cardano-relay2.everstake.one", - "port": 3001 + "address": "94.16.113.130", + "port": 6000 } ] }, { - "accumulatedStake": 0.7001403648824277, - "relativeStake": 0.0015840259450603375, + "accumulatedStake": 0.7107374546747671, + "relativeStake": 0.0015144405074701858, "relays": [ { - "address": "3.234.66.234", + "address": "18.207.62.97", "port": 3001 } ] }, { - "accumulatedStake": 0.7017232666278087, - "relativeStake": 0.0015829017453810287, + "accumulatedStake": 0.712250417725277, + "relativeStake": 0.0015129630505099293, "relays": [ { - "address": "private-pools.fivebinaries.com", + "address": "23.21.195.62", "port": 3001 } ] }, { - "accumulatedStake": 0.70330459701552, - "relativeStake": 0.0015813303877112086, + "accumulatedStake": 0.7137631279136731, + "relativeStake": 0.0015127101883961353, "relays": [ { - "address": "relays.digi.pro", + "address": "relays.wavepool.digital", "port": 3001 } ] }, { - "accumulatedStake": 0.7048842675128233, - "relativeStake": 0.0015796704973033444, + "accumulatedStake": 0.7152705732956584, + "relativeStake": 0.001507445381985213, "relays": [ { - "address": "3.231.62.160", + "address": "23.23.190.5", "port": 3001 } ] }, { - "accumulatedStake": 0.7064638922320711, - "relativeStake": 0.0015796247192477516, + "accumulatedStake": 0.7167778775117531, + "relativeStake": 0.0015073042160947837, "relays": [ { - "address": "3.228.183.84", + "address": "23.23.190.5", "port": 3001 } ] }, { - "accumulatedStake": 0.7080435168529361, - "relativeStake": 0.0015796246208650952, + "accumulatedStake": 0.7182839576800469, + "relativeStake": 0.0015060801682938371, "relays": [ { - "address": "3.231.62.160", + "address": "18.207.62.97", "port": 3001 } ] }, { - "accumulatedStake": 0.7096228691251539, - "relativeStake": 0.0015793522722178208, + "accumulatedStake": 0.7197893089096696, + "relativeStake": 0.0015053512296226263, "relays": [ { - "address": "34.192.61.190", + "address": "3.231.140.4", "port": 3001 } ] }, { - "accumulatedStake": 0.7112017539110858, - "relativeStake": 0.0015788847859317826, + "accumulatedStake": 0.7212939455900499, + "relativeStake": 0.0015046366803802835, "relays": [ { - "address": "3.228.183.84", + "address": "3.221.94.137", "port": 3001 } ] }, { - "accumulatedStake": 0.7127799937430569, - "relativeStake": 0.0015782398319711432, + "accumulatedStake": 0.7227977469143688, + "relativeStake": 0.001503801324318907, "relays": [ { - "address": "3.225.242.57", + "address": "3.221.94.137", "port": 3001 } ] }, { - "accumulatedStake": 0.7143574441039034, - "relativeStake": 0.0015774503608466167, + "accumulatedStake": 0.724300133470892, + "relativeStake": 0.00150238655652313, "relays": [ { - "address": "3.234.185.23", + "address": "3.231.140.4", "port": 3001 } ] }, { - "accumulatedStake": 0.7159346386835459, - "relativeStake": 0.0015771945796424543, + "accumulatedStake": 0.7258023209807051, + "relativeStake": 0.0015021875098131098, "relays": [ { - "address": "3.234.185.23", + "address": "3.221.184.134", "port": 3001 } ] }, { - "accumulatedStake": 0.7175016004667607, - "relativeStake": 0.0015669617832147534, + "accumulatedStake": 0.727304264948581, + "relativeStake": 0.0015019439678760208, "relays": [ { - "address": "32.cardano.staked.cloud", + "address": "3.221.184.134", "port": 3001 } ] }, { - "accumulatedStake": 0.7190580115180147, - "relativeStake": 0.0015564110512540279, + "accumulatedStake": 0.7287958666732369, + "relativeStake": 0.0014916017246559107, "relays": [ { - "address": "185.161.193.91", - "port": 6010 - }, - { - "address": "185.161.193.92", - "port": 6010 - }, - { - "address": "2a07:c700:0:700::91", - "port": 6010 + "address": "cardano-relay-1.upbit.com", + "port": 30800 }, { - "address": "2a07:c700:0:700::92", - "port": 6010 + "address": "cardano-relay-2.upbit.com", + "port": 30800 }, { - "address": "80.211.123.84", - "port": 6010 + "address": "cardano-relay-3.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.7206008697053982, - "relativeStake": 0.0015428581873834233, + "accumulatedStake": 0.730286161140597, + "relativeStake": 0.001490294467359952, "relays": [ { - "address": "relay1.ada-stake.com", - "port": 3001 + "address": "104.131.47.170", + "port": 6000 }, { - "address": "relay2.ada-stake.com", - "port": 3001 + "address": "128.199.64.13", + "port": 6000 + }, + { + "address": "165.232.180.100", + "port": 6000 } ] }, { - "accumulatedStake": 0.7221365115523786, - "relativeStake": 0.0015356418469804653, + "accumulatedStake": 0.7317705098455068, + "relativeStake": 0.0014843487049099238, "relays": [ { - "address": "52.8.37.3", - "port": 3001 + "address": "148.113.17.23", + "port": 6000 }, { - "address": "3.125.252.182", - "port": 3001 + "address": "158.69.25.103", + "port": 6000 }, { - "address": "52.63.225.190", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7236713354953548, - "relativeStake": 0.0015348239429761783, - "relays": [ - { - "address": "23.21.195.62", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7252008672706788, - "relativeStake": 0.001529531775323985, - "relays": [ + "address": "95.216.4.252", + "port": 6000 + }, { - "address": "18.207.62.97", - "port": 3001 + "address": "178.18.250.204", + "port": 6000 } ] }, { - "accumulatedStake": 0.7267293539234382, - "relativeStake": 0.0015284866527593983, + "accumulatedStake": 0.7332376887548759, + "relativeStake": 0.0014671789093690568, "relays": [ { - "address": "18.207.62.97", - "port": 3001 + "address": "relay-pool-figment-9-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.7282529810532984, - "relativeStake": 0.0015236271298602405, + "accumulatedStake": 0.7347001223136951, + "relativeStake": 0.0014624335588192274, "relays": [ { - "address": "relay1.zetetic.tech", - "port": 3001 + "address": "148.113.17.23", + "port": 6000 }, { - "address": "relay2.zetetic.tech", - "port": 3001 + "address": "158.69.25.103", + "port": 6000 }, { - "address": "relay3.zetetic.tech", - "port": 3001 + "address": "95.216.70.238", + "port": 6000 }, { - "address": "relay4.zetetic.tech", - "port": 3001 + "address": "149.102.140.196", + "port": 6000 } ] }, { - "accumulatedStake": 0.7297682860579591, - "relativeStake": 0.0015153050046606159, + "accumulatedStake": 0.7361619993704461, + "relativeStake": 0.0014618770567510076, "relays": [ { - "address": "148.113.17.23", - "port": 6000 + "address": "a-r1.elitestakepool.com", + "port": 7011 }, { - "address": "158.69.25.103", - "port": 6000 + "address": "a-r2.elitestakepool.com", + "port": 7012 }, { - "address": "95.216.4.252", - "port": 6000 + "address": "b-r3.elitestakepool.com", + "port": 7013 }, { - "address": "178.18.250.204", - "port": 6000 + "address": "b-r4.elitestakepool.com", + "port": 7014 } ] }, { - "accumulatedStake": 0.7312699370548164, - "relativeStake": 0.0015016509968572838, + "accumulatedStake": 0.737621974817746, + "relativeStake": 0.0014599754472998851, "relays": [ { "address": "asia-pacific-zzzrelay.zzzpool.net", @@ -4166,8 +4274,8 @@ ] }, { - "accumulatedStake": 0.7327661194340236, - "relativeStake": 0.0014961823792072936, + "accumulatedStake": 0.7390644959091505, + "relativeStake": 0.0014425210914044183, "relays": [ { "address": "35.211.17.86", @@ -4180,54 +4288,26 @@ ] }, { - "accumulatedStake": 0.7342615616197515, - "relativeStake": 0.0014954421857279153, + "accumulatedStake": 0.7405063468379972, + "relativeStake": 0.0014418509288468015, "relays": [ { - "address": "3.225.242.57", + "address": "52.8.37.3", "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7357539347343058, - "relativeStake": 0.001492373114554367, - "relays": [ - { - "address": "158.101.99.150", - "port": 6001 - }, - { - "address": "150.136.111.193", - "port": 6001 - }, - { - "address": "150.136.84.82", - "port": 6001 - } - ] - }, - { - "accumulatedStake": 0.7372424258096614, - "relativeStake": 0.0014884910753555367, - "relays": [ - { - "address": "198.71.57.191", - "port": 6000 }, { - "address": "154.12.240.223", - "port": 6000 + "address": "3.125.252.182", + "port": 3001 }, { - "address": "94.16.113.130", - "port": 6000 + "address": "52.63.225.190", + "port": 3001 } ] }, { - "accumulatedStake": 0.7387246198069557, - "relativeStake": 0.0014821939972943046, + "accumulatedStake": 0.741944533701984, + "relativeStake": 0.0014381868639867334, "relays": [ { "address": "relay.pasklab.com", @@ -4244,36 +4324,26 @@ ] }, { - "accumulatedStake": 0.7402007185303852, - "relativeStake": 0.0014760987234294263, + "accumulatedStake": 0.7433797693374719, + "relativeStake": 0.0014352356354879082, "relays": [ { - "address": "52.8.37.3", - "port": 3001 + "address": "158.101.99.150", + "port": 6001 }, { - "address": "3.125.252.182", - "port": 3001 + "address": "150.136.111.193", + "port": 6001 }, { - "address": "52.63.225.190", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7416751879611881, - "relativeStake": 0.001474469430802964, - "relays": [ - { - "address": "relays.mainnet.fortepool.io", - "port": 3001 + "address": "150.136.84.82", + "port": 6001 } ] }, { - "accumulatedStake": 0.7431415284534736, - "relativeStake": 0.0014663404922854533, + "accumulatedStake": 0.7448004228207765, + "relativeStake": 0.001420653483304617, "relays": [ { "address": "relays.staking4ada.org", @@ -4286,45 +4356,46 @@ ] }, { - "accumulatedStake": 0.7445934353183526, - "relativeStake": 0.0014519068648790661, + "accumulatedStake": 0.7462157045245867, + "relativeStake": 0.0014152817038102427, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 - }, - { - "address": "cardano-relays-2.nu.fi", + "address": "relays.mainnet.fortepool.io", "port": 3001 } ] }, { - "accumulatedStake": 0.7460077521317379, - "relativeStake": 0.0014143168133851913, + "accumulatedStake": 0.7476247015315195, + "relativeStake": 0.0014089970069327696, "relays": [ { - "address": "relay-pool-figment-9-mainnet.cardano.aeq5f.com" + "address": "cardano-relays-1.nu.fi", + "port": 3003 + }, + { + "address": "cardano-relays-2.nu.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.7474220173850878, - "relativeStake": 0.0014142652533500643, + "accumulatedStake": 0.7490296902813058, + "relativeStake": 0.0014049887497863043, "relays": [ { - "address": "benitoite-rohan-d68b9.cardano.bdnodes.net", - "port": 6000 + "address": "89.58.38.12", + "port": 6001 }, { - "address": "brown-lagos-6a470.cardano.bdnodes.net", - "port": 6000 + "address": "37.120.189.7", + "port": 6001 } ] }, { - "accumulatedStake": 0.7488320762510241, - "relativeStake": 0.0014100588659362403, + "accumulatedStake": 0.7504330497943363, + "relativeStake": 0.0014033595130305556, "relays": [ { "address": "157.245.228.134", @@ -4345,68 +4416,108 @@ ] }, { - "accumulatedStake": 0.750201516550147, - "relativeStake": 0.0013694402991228842, + "accumulatedStake": 0.7518285261520552, + "relativeStake": 0.0013954763577188475, "relays": [ { - "address": "relays.digi.pro", + "address": "52.8.37.3", + "port": 3001 + }, + { + "address": "3.125.252.182", + "port": 3001 + }, + { + "address": "52.63.225.190", "port": 3001 } ] }, { - "accumulatedStake": 0.7515655696117686, - "relativeStake": 0.0013640530616215805, + "accumulatedStake": 0.7531976280674301, + "relativeStake": 0.0013691019153748859, "relays": [ { - "address": "148.113.17.23", - "port": 6000 - }, - { - "address": "158.69.25.103", - "port": 6000 + "address": "relay1.hyperlinkpool.kr", + "port": 3002 }, { - "address": "168.119.13.158", - "port": 6000 + "address": "relay2.hyperlinkpool.kr", + "port": 3003 }, { - "address": "149.102.140.207", - "port": 6000 + "address": "relay3.hyperlinkpool.kr", + "port": 3004 } ] }, { - "accumulatedStake": 0.7529266112576212, - "relativeStake": 0.001361041645852588, + "accumulatedStake": 0.7545459627768972, + "relativeStake": 0.0013483347094670657, "relays": [ { - "address": "eu-de-blue-cdn-relays.cardano.fans", + "address": "relay1-us.xstakepool.com", "port": 3001 }, { - "address": "us-us-blue-cdn-relays.cardano.fans", + "address": "relay2-eu.xstakepool.com", + "port": 3001 + }, + { + "address": "relay3-sg.xstakepool.com", + "port": 3001 + }, + { + "address": "relay4-ae.xstakepool.com", "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.7558868962984265, + "relativeStake": 0.001340933521529312, + "relays": [ + { + "address": "cardano-relay-1.upbit.com", + "port": 30800 + }, + { + "address": "cardano-relay-2.upbit.com", + "port": 30800 }, { - "address": "eu-fr-blue-cdn-relays.cardano.fans", + "address": "cardano-relay-3.upbit.com", + "port": 30800 + } + ] + }, + { + "accumulatedStake": 0.757214746023954, + "relativeStake": 0.0013278497255274685, + "relays": [ + { + "address": "private-pools.fivebinaries.com", "port": 3001 } ] }, { - "accumulatedStake": 0.7542729174204668, - "relativeStake": 0.0013463061628455214, + "accumulatedStake": 0.7585310542993202, + "relativeStake": 0.0013163082753662857, "relays": [ { - "address": "relays.wavepool.digital", + "address": "relay1.cardanesia.com", + "port": 3001 + }, + { + "address": "relay2.cardanesia.com", "port": 3001 } ] }, { - "accumulatedStake": 0.7556125723817932, - "relativeStake": 0.0013396549613265288, + "accumulatedStake": 0.7598387025418954, + "relativeStake": 0.0013076482425752572, "relays": [ { "address": "r1.1percentpool.eu", @@ -4419,210 +4530,168 @@ ] }, { - "accumulatedStake": 0.7569442245157928, - "relativeStake": 0.0013316521339996107, + "accumulatedStake": 0.7611423809458638, + "relativeStake": 0.0013036784039683067, "relays": [ { - "address": "65.109.12.161", - "port": 6001 + "address": "148.113.17.23", + "port": 6000 }, { - "address": "116.203.131.106", - "port": 6002 - } - ] - }, - { - "accumulatedStake": 0.7582726557461604, - "relativeStake": 0.0013284312303676242, - "relays": [ + "address": "158.69.25.103", + "port": 6000 + }, { - "address": "3.139.50.19", + "address": "168.119.13.158", "port": 6000 }, { - "address": "3.137.129.218", + "address": "149.102.140.207", "port": 6000 } ] }, { - "accumulatedStake": 0.7595813612535243, - "relativeStake": 0.0013087055073638348, + "accumulatedStake": 0.7624431188387898, + "relativeStake": 0.0013007378929260195, "relays": [ { - "address": "ipclub29-1.relay.my-ip.at", - "port": 3001 - }, - { - "address": "ipclub29-1.relay.my-ip.at", - "port": 3002 + "address": "65.109.12.161", + "port": 6001 }, { - "address": "ipclub29-2.relay.my-ip.at", - "port": 3001 + "address": "116.203.131.106", + "port": 6002 } ] }, { - "accumulatedStake": 0.7608743677870793, - "relativeStake": 0.0012930065335549508, + "accumulatedStake": 0.7637329020885809, + "relativeStake": 0.001289783249791046, "relays": [ { - "address": "relay1.nedscave.io", - "port": 3001 - }, - { - "address": "relay2.nedscave.io", - "port": 3001 - }, - { - "address": "relay3.nedscave.io", - "port": 3001 + "address": "relay1.angelstakepool.net", + "port": 5001 }, { - "address": "relay4.nedscave.io", - "port": 3001 + "address": "relay2.angelstakepool.net", + "port": 5002 } ] }, { - "accumulatedStake": 0.7621667516378232, - "relativeStake": 0.0012923838507439723, + "accumulatedStake": 0.7650201878234272, + "relativeStake": 0.0012872857348463329, "relays": [ { - "address": "rho.relay.easy1staking.com", - "port": 30020 - }, - { - "address": "pi.relay.easy1staking.com", - "port": 30021 - }, - { - "address": "eu-central-1.relay.easy1staking.com", - "port": 30000 + "address": "btc-cardano-main-relay-00-a.bdnodes.net", + "port": 6000 }, { - "address": "us-east-1.relay.easy1staking.com", - "port": 30000 + "address": "btc-cardano-main-relay-00-b.bdnodes.net", + "port": 6000 } ] }, { - "accumulatedStake": 0.7634526487915643, - "relativeStake": 0.0012858971537410007, + "accumulatedStake": 0.7663073870019743, + "relativeStake": 0.0012871991785471425, "relays": [ { - "address": "relay1.cardanesia.com", + "address": "eu-de-blue-cdn-relays.cardano.fans", "port": 3001 }, { - "address": "relay2.cardanesia.com", + "address": "us-us-blue-cdn-relays.cardano.fans", + "port": 3001 + }, + { + "address": "eu-fr-blue-cdn-relays.cardano.fans", "port": 3001 } ] }, { - "accumulatedStake": 0.7647325867864769, - "relativeStake": 0.001279937994912654, + "accumulatedStake": 0.7675836114089347, + "relativeStake": 0.0012762244069603375, "relays": [ { - "address": "btc-cardano-main-relay-00-a.bdnodes.net", + "address": "3.139.50.19", "port": 6000 }, { - "address": "btc-cardano-main-relay-00-b.bdnodes.net", + "address": "3.137.129.218", "port": 6000 } ] }, { - "accumulatedStake": 0.7660118966583003, - "relativeStake": 0.0012793098718233502, + "accumulatedStake": 0.7688581599863797, + "relativeStake": 0.0012745485774450194, "relays": [ { - "address": "89.58.38.12", - "port": 6001 - }, - { - "address": "37.120.189.7", - "port": 6001 + "address": "relays.wavepool.digital", + "port": 3001 } ] }, { - "accumulatedStake": 0.7672755950146795, - "relativeStake": 0.0012636983563791972, + "accumulatedStake": 0.7701254154599034, + "relativeStake": 0.0012672554735237121, "relays": [ { - "address": "34.146.212.90", - "port": 6000 + "address": "ipclub29-1.relay.my-ip.at", + "port": 3001 }, { - "address": "34.175.85.49", - "port": 6000 + "address": "ipclub29-1.relay.my-ip.at", + "port": 3002 + }, + { + "address": "ipclub29-2.relay.my-ip.at", + "port": 3001 } ] }, { - "accumulatedStake": 0.7685359891516174, - "relativeStake": 0.0012603941369379462, + "accumulatedStake": 0.7713738961559374, + "relativeStake": 0.0012484806960340032, "relays": [ { - "address": "relay1.hyperlinkpool.kr", - "port": 3002 + "address": "relay1.nedscave.io", + "port": 3001 }, { - "address": "relay2.hyperlinkpool.kr", - "port": 3003 + "address": "relay2.nedscave.io", + "port": 3001 }, { - "address": "relay3.hyperlinkpool.kr", - "port": 3004 - } - ] - }, - { - "accumulatedStake": 0.7697935621982311, - "relativeStake": 0.0012575730466137932, - "relays": [ - { - "address": "cardano-relays-1.nu.fi", - "port": 3003 + "address": "relay3.nedscave.io", + "port": 3001 }, { - "address": "cardano-relays-2.nu.fi", + "address": "relay4.nedscave.io", "port": 3001 } ] }, { - "accumulatedStake": 0.7710508878892935, - "relativeStake": 0.0012573256910623294, + "accumulatedStake": 0.7726169932731277, + "relativeStake": 0.0012430971171903476, "relays": [ { - "address": "89.58.11.57", + "address": "34.146.212.90", "port": 6000 }, { - "address": "185.207.104.130", + "address": "34.175.85.49", "port": 6000 } ] }, { - "accumulatedStake": 0.7723075629276973, - "relativeStake": 0.0012566750384037553, - "relays": [ - { - "address": "relays.liqwid.finance", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7735633386911227, - "relativeStake": 0.001255775763425405, + "accumulatedStake": 0.7738586466837956, + "relativeStake": 0.0012416534106677382, "relays": [ { "address": "cardano-relays-1.nu.fi", @@ -4635,80 +4704,70 @@ ] }, { - "accumulatedStake": 0.774818587573698, - "relativeStake": 0.001255248882575365, + "accumulatedStake": 0.7750940024215712, + "relativeStake": 0.0012353557377756774, "relays": [ { - "address": "relays.liqwid.finance", + "address": "relays.digi.pro", "port": 3001 } ] }, { - "accumulatedStake": 0.7760578267584975, - "relativeStake": 0.0012392391847995334, + "accumulatedStake": 0.7763071141751364, + "relativeStake": 0.0012131117535652458, "relays": [ { - "address": "relay1.angelstakepool.net", - "port": 5001 + "address": "benitoite-rohan-d68b9.cardano.bdnodes.net", + "port": 6000 }, { - "address": "relay2.angelstakepool.net", - "port": 5002 + "address": "brown-lagos-6a470.cardano.bdnodes.net", + "port": 6000 } ] }, { - "accumulatedStake": 0.7772953038891778, - "relativeStake": 0.0012374771306802696, + "accumulatedStake": 0.7775199527799337, + "relativeStake": 0.0012128386047972409, "relays": [ { - "address": "asia.jazzstakepool.net", - "port": 3001 + "address": "89.58.11.57", + "port": 6000 + }, + { + "address": "185.207.104.130", + "port": 6000 } ] }, { - "accumulatedStake": 0.7785292906280414, - "relativeStake": 0.0012339867388635574, + "accumulatedStake": 0.7787231739260179, + "relativeStake": 0.0012032211460841576, "relays": [ { - "address": "77.68.30.20", + "address": "132.145.98.48", "port": 6000 }, { - "address": "132.145.98.48", + "address": "82.165.230.141", "port": 6000 } ] }, { - "accumulatedStake": 0.7797598041804203, - "relativeStake": 0.0012305135523789463, + "accumulatedStake": 0.7799232639534962, + "relativeStake": 0.0012000900274783735, "relays": [ { - "address": "3.111.14.60", + "address": "asia.jazzstakepool.net", "port": 3001 } ] }, { - "accumulatedStake": 0.7809823480969313, - "relativeStake": 0.001222543916511007, - "relays": [ - { - "address": "20.42.119.172", - "port": 6000 - }, - { - "address": "160.251.196.40", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.7822001316214382, - "relativeStake": 0.0012177835245068256, + "accumulatedStake": 0.7811171796030892, + "relativeStake": 0.001193915649593001, "relays": [ { "address": "cardano-relays-1.nu.fi", @@ -4721,22 +4780,22 @@ ] }, { - "accumulatedStake": 0.7834121202455203, - "relativeStake": 0.0012119886240821425, + "accumulatedStake": 0.7823107350050861, + "relativeStake": 0.0011935554019969015, "relays": [ { - "address": "relay1.kaizn.kaizencrypto.com", + "address": "20.42.119.172", "port": 6000 }, { - "address": "relay2.kaizn.kaizencrypto.com", + "address": "160.251.196.40", "port": 6000 } ] }, { - "accumulatedStake": 0.7846064893995908, - "relativeStake": 0.0011943691540704082, + "accumulatedStake": 0.7834898330403242, + "relativeStake": 0.0011790980352380956, "relays": [ { "address": "relaynode1.kaldano.work", @@ -4749,82 +4808,64 @@ ] }, { - "accumulatedStake": 0.7857946331661941, - "relativeStake": 0.0011881437666033945, + "accumulatedStake": 0.7846606135698613, + "relativeStake": 0.001170780529537031, "relays": [ { - "address": "relay1-us.xstakepool.com", - "port": 3001 - }, - { - "address": "relay2-eu.xstakepool.com", - "port": 3001 + "address": "cardano-relay-1.upbit.com", + "port": 30800 }, { - "address": "relay3-sg.xstakepool.com", - "port": 3001 + "address": "cardano-relay-2.upbit.com", + "port": 30800 }, { - "address": "relay4-ae.xstakepool.com", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7869776334980847, - "relativeStake": 0.0011830003318905305, - "relays": [ - { - "address": "relays.wavepool.digital", - "port": 3001 + "address": "cardano-relay-3.upbit.com", + "port": 30800 } ] }, { - "accumulatedStake": 0.7881524294154099, - "relativeStake": 0.0011747959173251732, + "accumulatedStake": 0.7858244737114545, + "relativeStake": 0.0011638601415932099, "relays": [ { - "address": "152.53.121.193", + "address": "relay1.kaizn.kaizencrypto.com", "port": 6000 }, { - "address": "84.247.163.186", + "address": "relay2.kaizn.kaizencrypto.com", "port": 6000 } ] }, { - "accumulatedStake": 0.7893119722522259, - "relativeStake": 0.0011595428368161103, + "accumulatedStake": 0.7869838449051492, + "relativeStake": 0.0011593711936946994, "relays": [ { - "address": "89.58.57.185", - "port": 4000 - }, - { - "address": "5.250.178.133", - "port": 4000 + "address": "3.111.14.60", + "port": 3001 } ] }, { - "accumulatedStake": 0.7904646967062897, - "relativeStake": 0.0011527244540638082, + "accumulatedStake": 0.7881177431202667, + "relativeStake": 0.0011338982151175413, "relays": [ { - "address": "168.119.124.16", - "port": 3001 + "address": "cardano-relays-1.nu.fi", + "port": 3003 }, { - "address": "202.61.246.91", + "address": "cardano-relays-2.nu.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.7916149709596001, - "relativeStake": 0.0011502742533103588, + "accumulatedStake": 0.7892507593125041, + "relativeStake": 0.0011330161922374498, "relays": [ { "address": "r1.isp-r1.wjg.jp", @@ -4837,174 +4878,138 @@ ] }, { - "accumulatedStake": 0.7927625716081703, - "relativeStake": 0.001147600648570193, + "accumulatedStake": 0.790383413531752, + "relativeStake": 0.0011326542192478697, "relays": [ { - "address": "asia.jazzstakepool.net", - "port": 3001 + "address": "152.53.121.193", + "port": 6000 + }, + { + "address": "84.247.163.186", + "port": 6000 } ] }, { - "accumulatedStake": 0.7938954740815372, - "relativeStake": 0.0011329024733668389, + "accumulatedStake": 0.7915054361583694, + "relativeStake": 0.0011220226266174685, "relays": [ { - "address": "private-pools.fivebinaries.com", + "address": "relays.planetstake.com", "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.7950260155583156, - "relativeStake": 0.0011305414767785156, - "relays": [ + }, { - "address": "asia.jazzstakepool.net", + "address": "161.97.90.20", "port": 3001 } ] }, { - "accumulatedStake": 0.7961512756730728, - "relativeStake": 0.0011252601147570657, + "accumulatedStake": 0.7926215052559584, + "relativeStake": 0.001116069097589006, "relays": [ { - "address": "europe1-zzz3relay.zzzpool.net", + "address": "asia.jazzstakepool.net", "port": 3001 } ] }, { - "accumulatedStake": 0.7972739662920263, - "relativeStake": 0.0011226906189536266, + "accumulatedStake": 0.7937303817074872, + "relativeStake": 0.0011088764515287284, "relays": [ { - "address": "a-r1.elitestakepool.com", - "port": 7011 - }, - { - "address": "a-r2.elitestakepool.com", - "port": 7012 - }, - { - "address": "b-r3.elitestakepool.com", - "port": 7013 - }, - { - "address": "b-r4.elitestakepool.com", - "port": 7014 + "address": "relays.liqwid.finance", + "port": 3001 } ] }, { - "accumulatedStake": 0.7983933124881956, - "relativeStake": 0.0011193461961691914, + "accumulatedStake": 0.7948375564104727, + "relativeStake": 0.001107174702985494, "relays": [ { - "address": "relays.planetstake.com", - "port": 3001 - }, - { - "address": "161.97.90.20", + "address": "relays.liqwid.finance", "port": 3001 } ] }, { - "accumulatedStake": 0.7995008865217716, - "relativeStake": 0.0011075740335761053, + "accumulatedStake": 0.7959419390311377, + "relativeStake": 0.0011043826206650472, "relays": [ { - "address": "3.6.124.226", - "port": 3001 - }, - { - "address": "18.193.92.87", - "port": 3001 - }, - { - "address": "54.219.241.10", + "address": "asia.jazzstakepool.net", "port": 3001 } ] }, { - "accumulatedStake": 0.8006061864395967, - "relativeStake": 0.0011052999178250704, + "accumulatedStake": 0.7970462314513641, + "relativeStake": 0.0011042924202263136, "relays": [ { - "address": "relays.wavepool.digital", + "address": "202.61.246.91", "port": 3001 } ] }, { - "accumulatedStake": 0.8017063558931173, - "relativeStake": 0.001100169453520647, + "accumulatedStake": 0.7981471641274794, + "relativeStake": 0.0011009326761153974, "relays": [ { - "address": "relay1.cerostakepool.com", - "port": 3001 - }, - { - "address": "relay2.cerostakepool.com", - "port": 3001 - }, - { - "address": "relay3.cerostakepool.com", - "port": 3001 - }, - { - "address": "relay4.cerostakepool.com", + "address": "europe1-zzz3relay.zzzpool.net", "port": 3001 } ] }, { - "accumulatedStake": 0.8027981420115549, - "relativeStake": 0.0010917861184374608, + "accumulatedStake": 0.7992403348970045, + "relativeStake": 0.0010931707695250644, "relays": [ { - "address": "relay1.nedscave.io", - "port": 3001 - }, - { - "address": "relay2.nedscave.io", + "address": "3.6.124.226", "port": 3001 }, { - "address": "relay3.nedscave.io", + "address": "18.193.92.87", "port": 3001 }, { - "address": "relay4.nedscave.io", + "address": "54.219.241.10", "port": 3001 } ] }, { - "accumulatedStake": 0.8038851310930409, - "relativeStake": 0.0010869890814861729, + "accumulatedStake": 0.8003292502163932, + "relativeStake": 0.0010889153193887106, "relays": [ { - "address": "135.181.194.233", - "port": 6000 + "address": "89.58.57.185", + "port": 4000 }, { - "address": "168.119.101.200", - "port": 6000 - }, + "address": "5.250.178.133", + "port": 4000 + } + ] + }, + { + "accumulatedStake": 0.8014053272565285, + "relativeStake": 0.001076077040135204, + "relays": [ { - "address": "5.161.59.12", + "address": "161.35.209.217", "port": 6000 } ] }, { - "accumulatedStake": 0.8049681399132783, - "relativeStake": 0.0010830088202373371, + "accumulatedStake": 0.8024711039461423, + "relativeStake": 0.0010657766896138671, "relays": [ { "address": "europe-de.popsp.net", @@ -5013,8 +5018,8 @@ ] }, { - "accumulatedStake": 0.8060488683863665, - "relativeStake": 0.001080728473088181, + "accumulatedStake": 0.8035266146461709, + "relativeStake": 0.0010555107000286715, "relays": [ { "address": "102.130.127.242", @@ -5027,48 +5032,68 @@ ] }, { - "accumulatedStake": 0.8071153156883287, - "relativeStake": 0.0010664473019622116, + "accumulatedStake": 0.8045660478776575, + "relativeStake": 0.0010394332314865298, "relays": [ { - "address": "161.35.209.217", + "address": "135.181.194.233", + "port": 6000 + }, + { + "address": "168.119.101.200", + "port": 6000 + }, + { + "address": "5.161.59.12", "port": 6000 } ] }, { - "accumulatedStake": 0.8081747280183362, - "relativeStake": 0.0010594123300075023, + "accumulatedStake": 0.8056027731684823, + "relativeStake": 0.0010367252908248118, "relays": [ { - "address": "private-pools.fivebinaries.com", + "address": "relay1.nedscave.io", + "port": 3001 + }, + { + "address": "relay2.nedscave.io", + "port": 3001 + }, + { + "address": "relay3.nedscave.io", + "port": 3001 + }, + { + "address": "relay4.nedscave.io", "port": 3001 } ] }, { - "accumulatedStake": 0.8092246656880435, - "relativeStake": 0.0010499376697072622, + "accumulatedStake": 0.806635795722039, + "relativeStake": 0.0010330225535567256, "relays": [ { - "address": "20.69.213.207", - "port": 3000 + "address": "43.cardano.staked.cloud", + "port": 3001 } ] }, { - "accumulatedStake": 0.810267543475379, - "relativeStake": 0.0010428777873355282, + "accumulatedStake": 0.8076652215631651, + "relativeStake": 0.0010294258411260651, "relays": [ { - "address": "relay1.bluecheesestakehouse.com", - "port": 5001 + "address": "20.69.213.207", + "port": 3000 } ] }, { - "accumulatedStake": 0.811309867161586, - "relativeStake": 0.0010423236862070614, + "accumulatedStake": 0.8086901352019924, + "relativeStake": 0.0010249136388273017, "relays": [ { "address": "20.91.236.57", @@ -5081,76 +5106,93 @@ ] }, { - "accumulatedStake": 0.812348973736307, - "relativeStake": 0.0010391065747209546, + "accumulatedStake": 0.8097146598956924, + "relativeStake": 0.001024524693700001, "relays": [ { - "address": "europe3-zzz5relay.zzzpool.net", - "port": 3001 + "address": "relay-pool-figment-10-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.8133822998185983, - "relativeStake": 0.0010333260822913564, + "accumulatedStake": 0.8107323444270654, + "relativeStake": 0.001017684531373001, "relays": [ { - "address": "52.167.20.127", - "port": 4000 + "address": "relay.azureada.com", + "port": 3001 + }, + { + "address": "relay.azureada.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.814414901643139, - "relativeStake": 0.001032601824540663, + "accumulatedStake": 0.8117441883215332, + "relativeStake": 0.0010118438944677842, "relays": [ { - "address": "34.84.0.241", - "port": 3000 - }, + "address": "relay1.bluecheesestakehouse.com", + "port": 5001 + } + ] + }, + { + "accumulatedStake": 0.8127401330887197, + "relativeStake": 0.0009959447671864994, + "relays": [ { - "address": "34.146.198.77", - "port": 3000 + "address": "52.167.20.127", + "port": 4000 } ] }, { - "accumulatedStake": 0.8154466940849497, - "relativeStake": 0.0010317924418106503, + "accumulatedStake": 0.8137355954715615, + "relativeStake": 0.0009954623828418007, "relays": [ { - "address": "adaboy-mainnet-2a.gleeze.com", - "port": 6000 + "address": "relay1.cerostakepool.com", + "port": 3001 }, { - "address": "adaboy-mainnet-3a.gleeze.com", - "port": 6000 + "address": "relay2.cerostakepool.com", + "port": 3001 + }, + { + "address": "relay3.cerostakepool.com", + "port": 3001 + }, + { + "address": "relay4.cerostakepool.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.8164702783180751, - "relativeStake": 0.001023584233125396, + "accumulatedStake": 0.8147246138479882, + "relativeStake": 0.0009890183764267244, "relays": [ { - "address": "20.69.213.207", - "port": 3000 + "address": "europe3-zzz5relay.zzzpool.net", + "port": 3001 } ] }, { - "accumulatedStake": 0.8174745745876191, - "relativeStake": 0.0010042962695439447, + "accumulatedStake": 0.8157117451407783, + "relativeStake": 0.0009871312927900544, "relays": [ { - "address": "cardano-relays.autostake.com", + "address": "private-pools.fivebinaries.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8184745945384282, - "relativeStake": 0.0010000199508091152, + "accumulatedStake": 0.8166930299823046, + "relativeStake": 0.0009812848415263874, "relays": [ { "address": "relay0.bluecheesestakehouse.com", @@ -5159,22 +5201,18 @@ ] }, { - "accumulatedStake": 0.8194715061948533, - "relativeStake": 0.000996911656425184, + "accumulatedStake": 0.817672188360478, + "relativeStake": 0.000979158378173252, "relays": [ { - "address": "relay.azureada.com", - "port": 3001 - }, - { - "address": "relay.azureada.com", - "port": 3001 + "address": "20.69.213.207", + "port": 3000 } ] }, { - "accumulatedStake": 0.8204538590521596, - "relativeStake": 0.0009823528573063328, + "accumulatedStake": 0.8186433384263827, + "relativeStake": 0.0009711500659047956, "relays": [ { "address": "109.123.231.213", @@ -5187,106 +5225,70 @@ ] }, { - "accumulatedStake": 0.8214318313798653, - "relativeStake": 0.000977972327705597, - "relays": [ - { - "address": "private-pools.fivebinaries.com", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.8223956877038378, - "relativeStake": 0.0009638563239724515, + "accumulatedStake": 0.819602275851924, + "relativeStake": 0.0009589374255412625, "relays": [ { - "address": "relay1.alfa-pool.gr", - "port": 6001 - }, - { - "address": "relay2.alfa-pool.gr", - "port": 6000 - }, - { - "address": "relay3.alfa-pool.gr", + "address": "adaboy-mainnet-2a.gleeze.com", "port": 6000 }, { - "address": "relay4.alfa-pool.gr", + "address": "adaboy-mainnet-3a.gleeze.com", "port": 6000 } ] }, { - "accumulatedStake": 0.823356291834748, - "relativeStake": 0.0009606041309102739, + "accumulatedStake": 0.8205533012164307, + "relativeStake": 0.0009510253645066538, "relays": [ { - "address": "35.154.123.251", - "port": 3001 - }, - { - "address": "15.206.230.107", - "port": 3001 + "address": "relay1.viperstaking.com", + "port": 4444 } ] }, { - "accumulatedStake": 0.8243128132451997, - "relativeStake": 0.0009565214104516711, + "accumulatedStake": 0.8214995692135476, + "relativeStake": 0.0009462679971170091, "relays": [ { - "address": "relay.azureada.com", - "port": 3001 - }, - { - "address": "relay.azureada.com", + "address": "cardano-relays.autostake.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8252664656944173, - "relativeStake": 0.0009536524492175963, + "accumulatedStake": 0.8224424729880954, + "relativeStake": 0.0009429037745477667, "relays": [ { - "address": "relay0.crimsonpool.com", - "port": 5100 - }, - { - "address": "relay1.crimsonpool.com", - "port": 5101 + "address": "35.154.123.251", + "port": 3001 }, { - "address": "relay2.crimsonpool.com", - "port": 5102 + "address": "15.206.230.107", + "port": 3001 } ] }, { - "accumulatedStake": 0.8262026142188929, - "relativeStake": 0.0009361485244755767, + "accumulatedStake": 0.8233769481097518, + "relativeStake": 0.0009344751216563667, "relays": [ { - "address": "relay1.viperstaking.com", - "port": 4444 - } - ] - }, - { - "accumulatedStake": 0.827138213320599, - "relativeStake": 0.0009355991017061916, - "relays": [ + "address": "relay.azureada.com", + "port": 3001 + }, { - "address": "206.81.3.194", + "address": "relay.azureada.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8280693306327191, - "relativeStake": 0.0009311173121201396, + "accumulatedStake": 0.8242977686438321, + "relativeStake": 0.000920820534080327, "relays": [ { "address": "154.38.174.71", @@ -5303,60 +5305,40 @@ ] }, { - "accumulatedStake": 0.8289985629374851, - "relativeStake": 0.0009292323047659374, + "accumulatedStake": 0.8252181326601427, + "relativeStake": 0.0009203640163105332, "relays": [ { - "address": "57.129.28.179", - "port": 3001 + "address": "125.250.255.197", + "port": 8000 }, { - "address": "57.129.28.180", - "port": 3001 + "address": "75.119.158.164", + "port": 6000 } ] }, { - "accumulatedStake": 0.8299276949872151, - "relativeStake": 0.0009291320497300387, + "accumulatedStake": 0.8261335217521255, + "relativeStake": 0.0009153890919828674, "relays": [ { - "address": "ipclub29-1.relay.my-ip.at", - "port": 3001 + "address": "relay0.crimsonpool.com", + "port": 5100 }, { - "address": "ipclub29-1.relay.my-ip.at", - "port": 3002 + "address": "relay1.crimsonpool.com", + "port": 5101 }, { - "address": "ipclub29-2.relay.my-ip.at", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.8308523503902405, - "relativeStake": 0.0009246554030253804, - "relays": [ - { - "address": "relay1.mazza.vc", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.8317760156823469, - "relativeStake": 0.0009236652921064437, - "relays": [ - { - "address": "relays.xray.app", - "port": 3000 + "address": "relay2.crimsonpool.com", + "port": 5102 } ] }, { - "accumulatedStake": 0.8326979732858267, - "relativeStake": 0.0009219576034797491, + "accumulatedStake": 0.8270476859805773, + "relativeStake": 0.0009141642284518056, "relays": [ { "address": "relay-ca.ada.psiloblox.io", @@ -5371,32 +5353,64 @@ "port": 3003 }, { - "address": "relay-jp.ada.psiloblox.io", - "port": 3001 + "address": "relay-jp.ada.psiloblox.io", + "port": 3001 + }, + { + "address": "relay-de.ada.psiloblox.io", + "port": 3002 + } + ] + }, + { + "accumulatedStake": 0.8279518487954441, + "relativeStake": 0.0009041628148668343, + "relays": [ + { + "address": "relay1.alfa-pool.gr", + "port": 6001 + }, + { + "address": "relay2.alfa-pool.gr", + "port": 6000 + }, + { + "address": "relay3.alfa-pool.gr", + "port": 6000 }, { - "address": "relay-de.ada.psiloblox.io", - "port": 3002 + "address": "relay4.alfa-pool.gr", + "port": 6000 } ] }, { - "accumulatedStake": 0.833617250121804, - "relativeStake": 0.0009192768359772336, + "accumulatedStake": 0.8288534175543489, + "relativeStake": 0.0009015687589047565, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 + "address": "relays.xray.app", + "port": 3000 + } + ] + }, + { + "accumulatedStake": 0.8297524871599838, + "relativeStake": 0.0008990696056349906, + "relays": [ + { + "address": "194.233.70.42", + "port": 57997 }, { - "address": "cardano-relays-2.nu.fi", - "port": 3001 + "address": "194.233.71.183", + "port": 51180 } ] }, { - "accumulatedStake": 0.8345305161434945, - "relativeStake": 0.0009132660216905814, + "accumulatedStake": 0.8306472099874058, + "relativeStake": 0.0008947228274219014, "relays": [ { "address": "75.119.157.236", @@ -5409,22 +5423,22 @@ ] }, { - "accumulatedStake": 0.8354412940566016, - "relativeStake": 0.00091077791310706, + "accumulatedStake": 0.8315392232211808, + "relativeStake": 0.0008920132337749792, "relays": [ { - "address": "194.233.70.42", - "port": 57997 + "address": "143.110.217.207", + "port": 6000 }, { - "address": "194.233.71.183", - "port": 51180 + "address": "167.99.88.198", + "port": 6000 } ] }, { - "accumulatedStake": 0.8363509041631871, - "relativeStake": 0.0009096101065855006, + "accumulatedStake": 0.8324287529909317, + "relativeStake": 0.0008895297697508698, "relays": [ { "address": "relay01.nekota.work", @@ -5441,62 +5455,86 @@ ] }, { - "accumulatedStake": 0.8372450692264785, - "relativeStake": 0.0008941650632913925, + "accumulatedStake": 0.8333109365207326, + "relativeStake": 0.0008821835298009825, "relays": [ { - "address": "144.126.145.189", + "address": "relay1.adaocean.com", "port": 6000 }, { - "address": "144.126.145.190", - "port": 7001 + "address": "relay2.adaocean.com", + "port": 6000 + }, + { + "address": "relay3.adaocean.com", + "port": 6000 + }, + { + "address": "relay4.adaocean.com", + "port": 6000 + }, + { + "address": "relay5.adaocean.com", + "port": 6000 } ] }, { - "accumulatedStake": 0.8381256067025119, - "relativeStake": 0.0008805374760333918, + "accumulatedStake": 0.8341925909451167, + "relativeStake": 0.0008816544243840736, "relays": [ { - "address": "34.175.101.127", + "address": "144.126.145.189", "port": 6000 }, { - "address": "34.175.85.49", - "port": 6000 + "address": "144.126.145.190", + "port": 7001 } ] }, { - "accumulatedStake": 0.8390057854652602, - "relativeStake": 0.0008801787627482697, + "accumulatedStake": 0.8350740081109559, + "relativeStake": 0.0008814171658392364, "relays": [ { - "address": "relay1.adaocean.com", + "address": "relay1.mazza.vc", "port": 6000 - }, + } + ] + }, + { + "accumulatedStake": 0.8359537015105147, + "relativeStake": 0.0008796933995588361, + "relays": [ { - "address": "relay2.adaocean.com", - "port": 6000 + "address": "57.129.28.179", + "port": 3001 }, { - "address": "relay3.adaocean.com", - "port": 6000 - }, + "address": "57.129.28.180", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.8368296327011965, + "relativeStake": 0.0008759311906817679, + "relays": [ { - "address": "relay4.adaocean.com", - "port": 6000 + "address": "cardano-relays-1.nu.fi", + "port": 3003 }, { - "address": "relay5.adaocean.com", - "port": 6000 + "address": "cardano-relays-2.nu.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.8398845058336135, - "relativeStake": 0.000878720368353352, + "accumulatedStake": 0.8376988449921292, + "relativeStake": 0.0008692122909327091, "relays": [ { "address": "ram-relay1.irota.xyz", @@ -5509,32 +5547,60 @@ ] }, { - "accumulatedStake": 0.8407626014358093, - "relativeStake": 0.0008780956021957749, + "accumulatedStake": 0.8385655594351753, + "relativeStake": 0.0008667144430460358, "relays": [ { - "address": "13.208.79.46", - "port": 6000 + "address": "private-pools.fivebinaries.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.8416404089728793, - "relativeStake": 0.0008778075370699934, + "accumulatedStake": 0.8394318996326311, + "relativeStake": 0.0008663401974558026, "relays": [ { - "address": "178.128.79.219", + "address": "ipclub29-1.relay.my-ip.at", "port": 3001 }, { - "address": "104.131.122.73", + "address": "ipclub29-1.relay.my-ip.at", + "port": 3002 + }, + { + "address": "ipclub29-2.relay.my-ip.at", "port": 3001 } ] }, { - "accumulatedStake": 0.8425141971931969, - "relativeStake": 0.000873788220317628, + "accumulatedStake": 0.8402973270561428, + "relativeStake": 0.0008654274235117347, + "relays": [ + { + "address": "104.236.24.187", + "port": 5281 + }, + { + "address": "23.24.140.149", + "port": 5282 + } + ] + }, + { + "accumulatedStake": 0.8411609207100412, + "relativeStake": 0.0008635936538984055, + "relays": [ + { + "address": "13.208.79.46", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.8420185391092674, + "relativeStake": 0.0008576183992261982, "relays": [ { "address": "52.167.20.127", @@ -5543,32 +5609,50 @@ ] }, { - "accumulatedStake": 0.8433861339508509, - "relativeStake": 0.0008719367576540434, + "accumulatedStake": 0.8428716213706673, + "relativeStake": 0.0008530822613998441, "relays": [ { - "address": "relays.banderini.net", + "address": "relay1.nedscave.io", + "port": 3001 + }, + { + "address": "relay2.nedscave.io", + "port": 3001 + }, + { + "address": "relay3.nedscave.io", + "port": 3001 + }, + { + "address": "relay4.nedscave.io", "port": 3001 } ] }, { - "accumulatedStake": 0.8442565250063524, - "relativeStake": 0.0008703910555014519, + "accumulatedStake": 0.8437181502738306, + "relativeStake": 0.000846528903163302, "relays": [ { - "address": "143.110.217.207", - "port": 6000 - }, + "address": "cardano-relays.atomicwallet.io", + "port": 6001 + } + ] + }, + { + "accumulatedStake": 0.8445555949696387, + "relativeStake": 0.0008374446958081908, + "relays": [ { - "address": "167.99.88.198", + "address": "77.110.114.135", "port": 6000 } ] }, { - "accumulatedStake": 0.8451150266266417, - "relativeStake": 0.0008585016202892969, + "accumulatedStake": 0.8453923274506314, + "relativeStake": 0.000836732480992623, "relays": [ { "address": "135.181.194.233", @@ -5585,78 +5669,106 @@ ] }, { - "accumulatedStake": 0.8459673519155322, - "relativeStake": 0.0008523252888905521, + "accumulatedStake": 0.846227754768476, + "relativeStake": 0.0008354273178446716, "relays": [ { - "address": "45.77.67.30", + "address": "34.84.0.241", "port": 3000 }, { - "address": "45.32.153.230", + "address": "34.146.198.77", "port": 3000 } ] }, { - "accumulatedStake": 0.8468134308473911, - "relativeStake": 0.0008460789318588861, + "accumulatedStake": 0.8470623723622231, + "relativeStake": 0.0008346175937470577, "relays": [ { - "address": "cardano-relays.atomicwallet.io", + "address": "206.81.3.194", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.8478909836129518, + "relativeStake": 0.0008286112507286418, + "relays": [ + { + "address": "cpr1.sargatxet.cloud", + "port": 6001 + }, + { + "address": "cpr2.sargatxet.cloud", + "port": 6001 + }, + { + "address": "cpr3.sargatxet.cloud", "port": 6001 } ] }, { - "accumulatedStake": 0.8476543289664465, - "relativeStake": 0.0008408981190554688, + "accumulatedStake": 0.8487183867904875, + "relativeStake": 0.0008274031775357175, "relays": [ { - "address": "r1.adaism.uk", - "port": 8081 + "address": "178.128.79.219", + "port": 3001 }, { - "address": "r2.adaism.uk", - "port": 8081 + "address": "104.131.122.73", + "port": 3001 } ] }, { - "accumulatedStake": 0.8484952056091135, - "relativeStake": 0.0008408766426668728, + "accumulatedStake": 0.8495428064953148, + "relativeStake": 0.0008244197048273633, "relays": [ { - "address": "125.250.255.197", - "port": 8000 + "address": "relay1.toiro.love", + "port": 6000 }, { - "address": "75.119.158.164", + "address": "relay2.toiro.love", "port": 6000 } ] }, { - "accumulatedStake": 0.8493351257647472, - "relativeStake": 0.0008399201556337887, + "accumulatedStake": 0.850363996653932, + "relativeStake": 0.000821190158617238, "relays": [ { - "address": "cpr1.sargatxet.cloud", - "port": 6001 + "address": "85.215.147.174", + "port": 6000 }, { - "address": "cpr2.sargatxet.cloud", - "port": 6001 + "address": "85.215.187.104", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.85118212320122, + "relativeStake": 0.000818126547287911, + "relays": [ + { + "address": "eu.relays.cardanians.io", + "port": 1000 }, { - "address": "cpr3.sargatxet.cloud", - "port": 6001 + "address": "ca.relays.cardanians.io", + "port": 1000 } ] }, { - "accumulatedStake": 0.8501733514269861, - "relativeStake": 0.0008382256622388891, + "accumulatedStake": 0.8519965415551772, + "relativeStake": 0.0008144183539572845, "relays": [ { "address": "ACLrelay1.cardanoland.com", @@ -5685,32 +5797,22 @@ ] }, { - "accumulatedStake": 0.8510107923039849, - "relativeStake": 0.0008374408769987264, + "accumulatedStake": 0.8528069451330912, + "relativeStake": 0.0008104035779139112, "relays": [ { - "address": "relay1.toiro.love", - "port": 6000 + "address": "relay1.cashflowpool.com", + "port": 3001 }, { - "address": "relay2.toiro.love", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.8518401174651036, - "relativeStake": 0.0008293251611186991, - "relays": [ - { - "address": "168.119.124.16", + "address": "relay2.cashflowpool.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8526662899192433, - "relativeStake": 0.0008261724541397673, + "accumulatedStake": 0.8536156791119288, + "relativeStake": 0.0008087339788376497, "relays": [ { "address": "LANDrelay1.cardanoland.com", @@ -5739,60 +5841,18 @@ ] }, { - "accumulatedStake": 0.8534921567457877, - "relativeStake": 0.0008258668265444158, - "relays": [ - { - "address": "85.215.147.174", - "port": 6000 - }, - { - "address": "85.215.187.104", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.854315308572521, - "relativeStake": 0.0008231518267333162, - "relays": [ - { - "address": "104.236.24.187", - "port": 5281 - }, - { - "address": "23.24.140.149", - "port": 5282 - } - ] - }, - { - "accumulatedStake": 0.8551372119467925, - "relativeStake": 0.0008219033742714314, - "relays": [ - { - "address": "relay1.cashflowpool.com", - "port": 3001 - }, - { - "address": "relay2.cashflowpool.com", - "port": 3001 - } - ] - }, - { - "accumulatedStake": 0.8559586697835107, - "relativeStake": 0.0008214578367182025, + "accumulatedStake": 0.8544218373209725, + "relativeStake": 0.0008061582090436945, "relays": [ { - "address": "cardano-relay.atomicwallet.io", + "address": "cardano-relays.atomicwallet.io", "port": 6001 } ] }, { - "accumulatedStake": 0.8567733706647876, - "relativeStake": 0.0008147008812769568, + "accumulatedStake": 0.8552261895118938, + "relativeStake": 0.0008043521909212164, "relays": [ { "address": "1f018fdb.cardano-relay.bison.run", @@ -5801,22 +5861,18 @@ ] }, { - "accumulatedStake": 0.857579056233559, - "relativeStake": 0.000805685568771309, + "accumulatedStake": 0.8560238452430919, + "relativeStake": 0.0007976557311982022, "relays": [ { - "address": "116.80.93.53", - "port": 6000 - }, - { - "address": "5.104.85.79", - "port": 6000 + "address": "202.61.246.91", + "port": 3001 } ] }, { - "accumulatedStake": 0.8583798268151279, - "relativeStake": 0.0008007705815689653, + "accumulatedStake": 0.8568144922676356, + "relativeStake": 0.0007906470245436949, "relays": [ { "address": "europe1-relay.jpn-sp.net", @@ -5825,54 +5881,46 @@ ] }, { - "accumulatedStake": 0.8591677602159178, - "relativeStake": 0.0007879334007898624, + "accumulatedStake": 0.8575888229228082, + "relativeStake": 0.0007743306551726713, "relays": [ { - "address": "148.113.17.23", - "port": 6000 - }, - { - "address": "158.69.25.103", - "port": 6000 - }, - { - "address": "95.216.70.238", - "port": 6000 + "address": "45.77.67.30", + "port": 3000 }, { - "address": "149.102.140.234", - "port": 6000 + "address": "45.32.153.230", + "port": 3000 } ] }, { - "accumulatedStake": 0.8599544000038138, - "relativeStake": 0.0007866397878960337, + "accumulatedStake": 0.8583624341986797, + "relativeStake": 0.0007736112758714668, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 - }, - { - "address": "cardano-relays-2.nu.fi", + "address": "relays.banderini.net", "port": 3001 } ] }, { - "accumulatedStake": 0.8607301895960374, - "relativeStake": 0.0007757895922235596, + "accumulatedStake": 0.8591308579949659, + "relativeStake": 0.0007684237962861838, "relays": [ { - "address": "168.119.124.16", + "address": "cardano-relays-1.nu.fi", + "port": 3003 + }, + { + "address": "cardano-relays-2.nu.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.8615050101724641, - "relativeStake": 0.0007748205764266411, + "accumulatedStake": 0.8598975582074256, + "relativeStake": 0.0007667002124597204, "relays": [ { "address": "r1.1percentpool.eu", @@ -5885,8 +5933,8 @@ ] }, { - "accumulatedStake": 0.8622785348783704, - "relativeStake": 0.0007735247059063853, + "accumulatedStake": 0.8606515250860334, + "relativeStake": 0.0007539668786076959, "relays": [ { "address": "157.245.228.134", @@ -5907,54 +5955,54 @@ ] }, { - "accumulatedStake": 0.8630473720115088, - "relativeStake": 0.0007688371331384618, + "accumulatedStake": 0.8614026705672106, + "relativeStake": 0.0007511454811772888, "relays": [ { - "address": "157.245.228.134", - "port": 3001 - }, - { - "address": "159.89.120.164", - "port": 3001 - }, - { - "address": "209.97.186.44", - "port": 3001 - }, - { - "address": "na.bloompool.io", + "address": "private-pools.fivebinaries.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8638160715029939, - "relativeStake": 0.0007686994914850239, + "accumulatedStake": 0.8621509221279966, + "relativeStake": 0.0007482515607859499, "relays": [ { - "address": "private-pools.fivebinaries.com", - "port": 3001 + "address": "csn.relay1.cardanoscan.io", + "port": 3101 + }, + { + "address": "csn.relay2.cardanoscan.io", + "port": 3101 } ] }, { - "accumulatedStake": 0.8645724447911947, - "relativeStake": 0.000756373288200804, + "accumulatedStake": 0.8628905797523294, + "relativeStake": 0.0007396576243327929, "relays": [ { - "address": "eu.relays.cardanians.io", - "port": 1000 + "address": "148.113.17.23", + "port": 6000 }, { - "address": "ca.relays.cardanians.io", - "port": 1000 + "address": "158.69.25.103", + "port": 6000 + }, + { + "address": "95.216.70.238", + "port": 6000 + }, + { + "address": "149.102.140.234", + "port": 6000 } ] }, { - "accumulatedStake": 0.8653248312895322, - "relativeStake": 0.0007523864983374496, + "accumulatedStake": 0.8636243475687287, + "relativeStake": 0.0007337678163993805, "relays": [ { "address": "r1.1percentpool.eu", @@ -5967,18 +6015,8 @@ ] }, { - "accumulatedStake": 0.8660674728703528, - "relativeStake": 0.0007426415808206627, - "relays": [ - { - "address": "adar2.stakit.io", - "port": 30501 - } - ] - }, - { - "accumulatedStake": 0.8668097109118685, - "relativeStake": 0.0007422380415157421, + "accumulatedStake": 0.8643571888933576, + "relativeStake": 0.000732841324628815, "relays": [ { "address": "cardano1.vampyre.fund", @@ -5999,8 +6037,8 @@ ] }, { - "accumulatedStake": 0.8675484184260763, - "relativeStake": 0.0007387075142078063, + "accumulatedStake": 0.8650842960430492, + "relativeStake": 0.0007271071496915514, "relays": [ { "address": "20.61.229.103", @@ -6021,131 +6059,79 @@ ] }, { - "accumulatedStake": 0.8682843532684063, - "relativeStake": 0.0007359348423299242, + "accumulatedStake": 0.8658106233548666, + "relativeStake": 0.000726327311817411, "relays": [ { - "address": "relay-pool-1-mainnet.cardano.aeq5f.com" + "address": "adar2.stakit.io", + "port": 30501 } ] }, { - "accumulatedStake": 0.8690142761039922, - "relativeStake": 0.0007299228355859063, + "accumulatedStake": 0.8665365503044483, + "relativeStake": 0.0007259269495818007, "relays": [ { - "address": "51.195.91.118", - "port": 3001 - }, - { - "address": "51.161.35.246", - "port": 3001 - }, - { - "address": "49.12.123.178", - "port": 3001 - }, - { - "address": "95.217.58.124", - "port": 3001 + "address": "relay-pool-1-mainnet.cardano.aeq5f.com" } ] }, { - "accumulatedStake": 0.8697438102046939, - "relativeStake": 0.0007295341007017719, + "accumulatedStake": 0.8672556154393306, + "relativeStake": 0.0007190651348822756, "relays": [ { - "address": "157.245.228.134", - "port": 3001 - }, - { - "address": "159.89.120.164", - "port": 3001 - }, - { - "address": "209.97.186.44", - "port": 3001 - }, - { - "address": "eu.bloompool.io", - "port": 3001 + "address": "149.28.106.59", + "port": 6000 } ] }, { - "accumulatedStake": 0.8704731167935593, - "relativeStake": 0.0007293065888653924, + "accumulatedStake": 0.8679710677978387, + "relativeStake": 0.0007154523585080676, "relays": [ { - "address": "otg-relay-1.adamantium.online", - "port": 6001 + "address": "116.80.93.53", + "port": 6000 }, { - "address": "otg-relay-2.adamantium.online", - "port": 6002 - } - ] - }, - { - "accumulatedStake": 0.8712021467737162, - "relativeStake": 0.0007290299801568808, - "relays": [ - { - "address": "149.28.106.59", + "address": "5.104.85.79", "port": 6000 } ] }, { - "accumulatedStake": 0.8719091160708089, - "relativeStake": 0.0007069692970926349, + "accumulatedStake": 0.8686845936175166, + "relativeStake": 0.0007135258196778847, "relays": [ { - "address": "csn.relay1.cardanoscan.io", - "port": 3101 + "address": "34.175.101.127", + "port": 6000 }, { - "address": "csn.relay2.cardanoscan.io", - "port": 3101 + "address": "34.175.85.49", + "port": 6000 } ] }, { - "accumulatedStake": 0.8726150861495645, - "relativeStake": 0.0007059700787556813, + "accumulatedStake": 0.8693855363077436, + "relativeStake": 0.0007009426902270571, "relays": [ { - "address": "germany.cardanode.io", - "port": 6000 - }, - { - "address": "missouri.cardanode.io", - "port": 6000 - }, - { - "address": "la.cardanode.io", + "address": "relay1.thevikingpool.com", "port": 6000 }, { - "address": "perth.cardanode.io", + "address": "relay2.thevikingpool.com", "port": 6000 } ] }, { - "accumulatedStake": 0.8733166619148997, - "relativeStake": 0.0007015757653351441, - "relays": [ - { - "address": "relay.armadastakepool.com", - "port": 5100 - } - ] - }, - { - "accumulatedStake": 0.8740169517592804, - "relativeStake": 0.0007002898443807643, + "accumulatedStake": 0.8700855901806929, + "relativeStake": 0.0007000538729492572, "relays": [ { "address": "54.150.77.128", @@ -6158,8 +6144,8 @@ ] }, { - "accumulatedStake": 0.8747166997004007, - "relativeStake": 0.0006997479411202623, + "accumulatedStake": 0.8707848501047212, + "relativeStake": 0.0006992599240282642, "relays": [ { "address": "relay1.adaverse.com", @@ -6172,78 +6158,124 @@ ] }, { - "accumulatedStake": 0.8754106752492539, - "relativeStake": 0.0006939755488531397, + "accumulatedStake": 0.8714769664327201, + "relativeStake": 0.0006921163279989886, "relays": [ { - "address": "asia-pacific-japan.popsp.net", + "address": "51.195.91.118", + "port": 3001 + }, + { + "address": "51.161.35.246", + "port": 3001 + }, + { + "address": "49.12.123.178", + "port": 3001 + }, + { + "address": "95.217.58.124", + "port": 3001 + }, + { + "address": "51.195.91.118", + "port": 3001 + }, + { + "address": "51.161.35.246", + "port": 3001 + }, + { + "address": "49.12.123.178", + "port": 3001 + }, + { + "address": "95.217.58.124", "port": 3001 } ] }, { - "accumulatedStake": 0.8761015878213314, - "relativeStake": 0.0006909125720775169, + "accumulatedStake": 0.8721649987034145, + "relativeStake": 0.0006880322706943222, "relays": [ { - "address": "20.61.229.103", + "address": "157.245.228.134", "port": 3001 }, { - "address": "20.61.228.218", + "address": "159.89.120.164", "port": 3001 }, { - "address": "108.142.42.221", + "address": "209.97.186.44", "port": 3001 }, { - "address": "108.142.42.161", + "address": "eu.bloompool.io", "port": 3001 } ] }, { - "accumulatedStake": 0.8767852240231864, - "relativeStake": 0.0006836362018549885, + "accumulatedStake": 0.8728465372292654, + "relativeStake": 0.0006815385258509849, "relays": [ { - "address": "r1.relaypool.online", - "port": 3000 + "address": "relay1.powerstakepool.com", + "port": 6000 + }, + { + "address": "relay2.powerstakepool.com", + "port": 6000 } ] }, { - "accumulatedStake": 0.8774675068046006, - "relativeStake": 0.0006822827814142167, + "accumulatedStake": 0.8735269466285409, + "relativeStake": 0.0006804093992755044, "relays": [ { - "address": "r1.21ada.ca", - "port": 6000 - }, + "address": "asia-pacific-japan.popsp.net", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.8742051157300589, + "relativeStake": 0.0006781691015179352, + "relays": [ { - "address": "r2.21ada.ca", - "port": 6000 + "address": "r1.relaypool.online", + "port": 3000 } ] }, { - "accumulatedStake": 0.8781494806901141, - "relativeStake": 0.0006819738855135079, + "accumulatedStake": 0.8748764607797828, + "relativeStake": 0.0006713450497238363, "relays": [ { - "address": "relay1.powerstakepool.com", - "port": 6000 + "address": "157.245.228.134", + "port": 3001 }, { - "address": "relay2.powerstakepool.com", - "port": 6000 + "address": "159.89.120.164", + "port": 3001 + }, + { + "address": "209.97.186.44", + "port": 3001 + }, + { + "address": "na.bloompool.io", + "port": 3001 } ] }, { - "accumulatedStake": 0.8788288036510894, - "relativeStake": 0.0006793229609753443, + "accumulatedStake": 0.8755407744814095, + "relativeStake": 0.0006643137016268544, "relays": [ { "address": "137.117.180.0", @@ -6260,22 +6292,8 @@ ] }, { - "accumulatedStake": 0.879505032235919, - "relativeStake": 0.000676228584829626, - "relays": [ - { - "address": "white-denver-a41cf.cardano.bdnodes.net", - "port": 6000 - }, - { - "address": "cinnabar-prague-71400.cardano.bdnodes.net", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.8801788897705471, - "relativeStake": 0.00067385753462804, + "accumulatedStake": 0.8762048709920652, + "relativeStake": 0.0006640965106556832, "relays": [ { "address": "34.192.61.190", @@ -6284,46 +6302,44 @@ ] }, { - "accumulatedStake": 0.8808514603542049, - "relativeStake": 0.0006725705836577843, - "relays": [ - { - "address": "relay1.thevikingpool.com", - "port": 6000 - }, - { - "address": "relay2.thevikingpool.com", - "port": 6000 - } - ] - }, - { - "accumulatedStake": 0.8815220936837553, - "relativeStake": 0.0006706333295504453, + "accumulatedStake": 0.8768676994756336, + "relativeStake": 0.0006628284835682907, "relays": [ { - "address": "relay1.squidpool.com", - "port": 3001 + "address": "r1.adaism.uk", + "port": 8081 }, { - "address": "relay2.squidpool.com", - "port": 3001 + "address": "r2.adaism.uk", + "port": 8081 } ] }, { - "accumulatedStake": 0.8821926372125145, - "relativeStake": 0.0006705435287591987, + "accumulatedStake": 0.8775278020882246, + "relativeStake": 0.0006601026125910174, "relays": [ { - "address": "78.47.119.91", - "port": 3001 + "address": "germany.cardanode.io", + "port": 6000 + }, + { + "address": "missouri.cardanode.io", + "port": 6000 + }, + { + "address": "la.cardanode.io", + "port": 6000 + }, + { + "address": "perth.cardanode.io", + "port": 6000 } ] }, { - "accumulatedStake": 0.8828509876724789, - "relativeStake": 0.0006583504599643599, + "accumulatedStake": 0.8781858596421002, + "relativeStake": 0.0006580575538755809, "relays": [ { "address": "223.25.73.249", @@ -6340,64 +6356,60 @@ ] }, { - "accumulatedStake": 0.8835080414308445, - "relativeStake": 0.0006570537583656217, + "accumulatedStake": 0.8788330189426898, + "relativeStake": 0.0006471593005897048, "relays": [ { - "address": "57.128.184.29", - "port": 3001 - }, - { - "address": "57.128.184.32", + "address": "78.47.119.91", "port": 3001 } ] }, { - "accumulatedStake": 0.8841621361976123, - "relativeStake": 0.000654094766767844, + "accumulatedStake": 0.8794795721111512, + "relativeStake": 0.000646553168461384, "relays": [ { - "address": "relay1.pudim.cat", - "port": 3002 + "address": "r1.cosd.com", + "port": 5250 }, { - "address": "relay2.pudim.cat", - "port": 3002 + "address": "r2.cosd.com", + "port": 5250 } ] }, { - "accumulatedStake": 0.884812499157051, - "relativeStake": 0.0006503629594385654, + "accumulatedStake": 0.8801253104550608, + "relativeStake": 0.000645738343909519, "relays": [ { - "address": "re1.reservoir.network", - "port": 3001 + "address": "relay1.pudim.cat", + "port": 3002 }, { - "address": "re2.reservoir.network", - "port": 3001 + "address": "relay2.pudim.cat", + "port": 3002 } ] }, { - "accumulatedStake": 0.885452883530109, - "relativeStake": 0.0006403843730580054, + "accumulatedStake": 0.8807698519948719, + "relativeStake": 0.0006445415398111695, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 + "address": "relay1.squidpool.com", + "port": 3001 }, { - "address": "cardano-relays-2.nu.fi", + "address": "relay2.squidpool.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8860930397900143, - "relativeStake": 0.0006401562599053274, + "accumulatedStake": 0.8814019712113352, + "relativeStake": 0.0006321192164632496, "relays": [ { "address": "relay1-ada.cex.io", @@ -6414,58 +6426,64 @@ ] }, { - "accumulatedStake": 0.8867301068354493, - "relativeStake": 0.000637067045435059, + "accumulatedStake": 0.8820333442427105, + "relativeStake": 0.0006313730313753691, "relays": [ { - "address": "135.181.194.233", - "port": 6000 + "address": "re1.reservoir.network", + "port": 3001 }, { - "address": "168.119.101.200", - "port": 6000 - }, + "address": "re2.reservoir.network", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.8826643808386406, + "relativeStake": 0.0006310365959300425, + "relays": [ { - "address": "5.161.59.12", - "port": 6000 + "address": "relays.onyxstakepool.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.8873646311296278, - "relativeStake": 0.0006345242941785038, + "accumulatedStake": 0.8832913964369937, + "relativeStake": 0.000627015598353071, "relays": [ { - "address": "r1.cosd.com", - "port": 5250 + "address": "eu1.stakecool.io", + "port": 4001 }, { - "address": "r2.cosd.com", - "port": 5250 + "address": "eu2.stakecool.io", + "port": 4001 + }, + { + "address": "ca1.stakecool.io", + "port": 4001 } ] }, { - "accumulatedStake": 0.8879987497590431, - "relativeStake": 0.000634118629415319, + "accumulatedStake": 0.8839115709512115, + "relativeStake": 0.000620174514217867, "relays": [ { - "address": "mound.adastack.net", - "port": 3001 - }, - { - "address": "pack.adastack.net", - "port": 3001 + "address": "cardano-relays-1.nu.fi", + "port": 3003 }, { - "address": "heap.adastack.net", + "address": "cardano-relays-2.nu.fi", "port": 3001 } ] }, { - "accumulatedStake": 0.8886285882077983, - "relativeStake": 0.0006298384487551711, + "accumulatedStake": 0.8845278989187342, + "relativeStake": 0.0006163279675226348, "relays": [ { "address": "r1.isp-r1.wjg.jp", @@ -6478,22 +6496,32 @@ ] }, { - "accumulatedStake": 0.8892577608805693, - "relativeStake": 0.0006291726727709483, + "accumulatedStake": 0.8851396666454671, + "relativeStake": 0.0006117677267328818, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 + "address": "relay.armadastakepool.com", + "port": 5100 + } + ] + }, + { + "accumulatedStake": 0.8857499434875613, + "relativeStake": 0.00061027684209428, + "relays": [ + { + "address": "40.160.1.159", + "port": 6000 }, { - "address": "cardano-relays-2.nu.fi", - "port": 3001 + "address": "15.204.108.52", + "port": 6000 } ] }, { - "accumulatedStake": 0.8898860936985412, - "relativeStake": 0.0006283328179719971, + "accumulatedStake": 0.8863587854610916, + "relativeStake": 0.0006088419735302651, "relays": [ { "address": "bra-relay.cardanistas.io", @@ -6510,102 +6538,149 @@ ] }, { - "accumulatedStake": 0.8904955365214037, - "relativeStake": 0.0006094428228624029, + "accumulatedStake": 0.8869653499925783, + "relativeStake": 0.0006065645314866251, "relays": [ { - "address": "relays.wavepool.digital", - "port": 3001 + "address": "r1-1.cardanocafe.org", + "port": 3000 + }, + { + "address": "r1-2.cardanocafe.org", + "port": 3005 + }, + { + "address": "r1-3.cardanocafe.org", + "port": 3010 + }, + { + "address": "r2-1.cardanocafe.org", + "port": 4000 + }, + { + "address": "r2-2.cardanocafe.org", + "port": 4005 + }, + { + "address": "r2-3.cardanocafe.org", + "port": 4008 + }, + { + "address": "r3-1.cardanocafe.org", + "port": 5000 } ] }, { - "accumulatedStake": 0.8911007093772574, - "relativeStake": 0.0006051728558537089, + "accumulatedStake": 0.8875710106178578, + "relativeStake": 0.0006056606252796287, "relays": [ { - "address": "relay1.astra-pool.com", - "port": 6000 + "address": "cardano-relays-1.nu.fi", + "port": 3003 }, { - "address": "relay2.astra-pool.com", - "port": 6000 + "address": "cardano-relays-2.nu.fi", + "port": 3001 } ] }, { - "accumulatedStake": 0.8917012820550106, - "relativeStake": 0.000600572677753323, + "accumulatedStake": 0.8881755439520491, + "relativeStake": 0.0006045333341912545, "relays": [ { - "address": "15.237.92.158", - "port": 16661 + "address": "57.128.184.29", + "port": 3001 + }, + { + "address": "57.128.184.32", + "port": 3001 } ] }, { - "accumulatedStake": 0.8923006509226254, - "relativeStake": 0.0005993688676148023, + "accumulatedStake": 0.8887751145924825, + "relativeStake": 0.0005995706404333223, "relays": [ { - "address": "202.61.225.111", + "address": "135.181.194.233", "port": 6000 }, { - "address": "46.38.241.110", + "address": "168.119.101.200", + "port": 6000 + }, + { + "address": "5.161.59.12", "port": 6000 } ] }, { - "accumulatedStake": 0.8928928839496696, - "relativeStake": 0.0005922330270441341, + "accumulatedStake": 0.8893740347337954, + "relativeStake": 0.0005989201413129765, "relays": [ { - "address": "r1.1percentpool.eu", - "port": 19001 + "address": "white-denver-a41cf.cardano.bdnodes.net", + "port": 6000 }, { - "address": "r2.1percentpool.eu", - "port": 19002 + "address": "cinnabar-prague-71400.cardano.bdnodes.net", + "port": 6000 } ] }, { - "accumulatedStake": 0.8934759687990363, - "relativeStake": 0.0005830848493667025, + "accumulatedStake": 0.8899695261930107, + "relativeStake": 0.0005954914592153131, "relays": [ { - "address": "cardano-relays.atomicwallet.io", + "address": "otg-relay-1.adamantium.online", "port": 6001 + }, + { + "address": "otg-relay-2.adamantium.online", + "port": 6002 } ] }, { - "accumulatedStake": 0.8940567466017298, - "relativeStake": 0.0005807778026935519, + "accumulatedStake": 0.8905605343539847, + "relativeStake": 0.0005910081609740461, "relays": [ { - "address": "relay1-pub.ahlnet.nu", - "port": 2111 + "address": "202.61.225.111", + "port": 6000 }, { - "address": "relay2-pub.ahlnet.nu", - "port": 2111 - }, + "address": "46.38.241.110", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.8911436331574114, + "relativeStake": 0.0005830988034266726, + "relays": [ { - "address": "relay3-pub.ahlnet.nu", - "port": 2111 - }, + "address": "relay-pool-figment-20-mainnet.cardano.aeq5f.com" + } + ] + }, + { + "accumulatedStake": 0.8917250121170454, + "relativeStake": 0.0005813789596339322, + "relays": [ { - "address": "relay-fallback.ahlnet.nu", - "port": 55218 + "address": "private-pools.fivebinaries.com", + "port": 3001 } ] }, { - "accumulatedStake": 0.8946364544434265, - "relativeStake": 0.0005797078416967097, + "accumulatedStake": 0.8923016933285998, + "relativeStake": 0.0005766812115544127, "relays": [ { "address": "cardano-relays-1.nu.fi", @@ -6618,66 +6693,94 @@ ] }, { - "accumulatedStake": 0.8952161509584969, - "relativeStake": 0.0005796965150703127, + "accumulatedStake": 0.8928756626565895, + "relativeStake": 0.0005739693279896269, "relays": [ { - "address": "relays.cardaspians.io", + "address": "relays.wavepool.digital", "port": 3001 } ] }, { - "accumulatedStake": 0.8957933449523511, - "relativeStake": 0.0005771939938542115, + "accumulatedStake": 0.8934492985112303, + "relativeStake": 0.0005736358546409553, "relays": [ { - "address": "133.167.33.31", - "port": 6000 - }, - { - "address": "162.43.71.205", - "port": 6000 + "address": "cardano-relays.atomicwallet.io", + "port": 6001 } ] }, { - "accumulatedStake": 0.8963666205755846, - "relativeStake": 0.000573275623233451, + "accumulatedStake": 0.8940225783214181, + "relativeStake": 0.0005732798101876767, "relays": [ { - "address": "cardano-relays-1.nu.fi", - "port": 3003 - }, + "address": "15.237.92.158", + "port": 16661 + } + ] + }, + { + "accumulatedStake": 0.8945954230479142, + "relativeStake": 0.0005728447264961475, + "relays": [ { - "address": "cardano-relays-2.nu.fi", + "address": "r1.spirestaking.com", "port": 3001 } ] }, { - "accumulatedStake": 0.8969398505420113, - "relativeStake": 0.0005732299664267878, + "accumulatedStake": 0.8951681360136513, + "relativeStake": 0.0005727129657371665, "relays": [ { - "address": "relays.xray.app", - "port": 3000 + "address": "r1.1percentpool.eu", + "port": 19001 + }, + { + "address": "r2.1percentpool.eu", + "port": 19002 } ] }, { - "accumulatedStake": 0.8975092414063524, - "relativeStake": 0.0005693908643410063, + "accumulatedStake": 0.8957359437943629, + "relativeStake": 0.0005678077807115678, "relays": [ { - "address": "relays.digi.pro", + "address": "mound.adastack.net", + "port": 3001 + }, + { + "address": "pack.adastack.net", + "port": 3001 + }, + { + "address": "heap.adastack.net", "port": 3001 } ] }, { - "accumulatedStake": 0.8980760128464301, - "relativeStake": 0.0005667714400777406, + "accumulatedStake": 0.896303487748306, + "relativeStake": 0.0005675439539431166, + "relays": [ + { + "address": "133.167.33.31", + "port": 6000 + }, + { + "address": "162.43.71.205", + "port": 6000 + } + ] + }, + { + "accumulatedStake": 0.8968684828134537, + "relativeStake": 0.000564995065147591, "relays": [ { "address": "54.228.75.154", @@ -6698,50 +6801,76 @@ ] }, { - "accumulatedStake": 0.8986374087649219, - "relativeStake": 0.0005613959184918541, + "accumulatedStake": 0.8974303529801412, + "relativeStake": 0.0005618701666875684, "relays": [ { - "address": "152.32.221.114", - "port": 5000 + "address": "relays.digi.pro", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.8979872731855907, + "relativeStake": 0.0005569202054495193, + "relays": [ + { + "address": "202.61.246.91", + "port": 3001 + } + ] + }, + { + "accumulatedStake": 0.8985353580402337, + "relativeStake": 0.0005480848546428952, + "relays": [ + { + "address": "relay.cardano.stakepools.info", + "port": 30001 }, { - "address": "152.32.255.32", - "port": 5000 + "address": "relay-2.cardano.stakepools.info", + "port": 30001 } ] }, { - "accumulatedStake": 0.8991943670892567, - "relativeStake": 0.000556958324334773, + "accumulatedStake": 0.8990808009014679, + "relativeStake": 0.0005454428612342884, "relays": [ { - "address": "iog1-relays.cardano.iog.io", + "address": "relays.cardaspians.io", "port": 3001 } ] }, { - "accumulatedStake": 0.899748015968516, - "relativeStake": 0.0005536488792591755, + "accumulatedStake": 0.8996260656383023, + "relativeStake": 0.0005452647368344223, "relays": [ { - "address": "north-america.katanapool.net", - "port": 3001 + "address": "relays.xray.app", + "port": 3000 } ] }, { - "accumulatedStake": 0.9002995402014915, - "relativeStake": 0.000551524232975579, + "accumulatedStake": 0.9001687280539324, + "relativeStake": 0.0005426624156300743, "relays": [ { - "address": "asia.jazzstakepool.net", - "port": 3001 + "address": "170.23.181.50", + "port": 6001 + }, + { + "address": "170.23.181.50", + "port": 6002 + }, + { + "address": "170.23.181.50", + "port": 6003 } ] } - ], - "slotNo": 177901519, - "version": 2 + ] } diff --git a/flake.lock b/flake.lock index fb5da695363..f79d76ee5b8 100644 --- a/flake.lock +++ b/flake.lock @@ -604,15 +604,16 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1770069549, - "narHash": "sha256-jHgw8KL0/TFGY2aVwxhD0DeDq7sl5Ti7jAp8T3RLNb0=", + "lastModified": 1773845823, + "narHash": "sha256-h8fLDUM8WJm6q7ZNRDI7CRm/eP5TIT/xDzCXWP25LIM=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "0ce7cc21b9a4cfde41871ef486d01a8fafbf9627", + "rev": "912bd8dd65c1a40d27f48fe80424017ffc7525bc", "type": "github" }, "original": { "owner": "input-output-hk", + "ref": "jl/dijkstra-respin-2026-02-19", "repo": "iohk-nix", "type": "github" } diff --git a/flake.nix b/flake.nix index 71deab85cde..8f5f8f0b24e 100644 --- a/flake.nix +++ b/flake.nix @@ -48,7 +48,7 @@ incl.url = "github:divnix/incl"; iohkNix = { - url = "github:input-output-hk/iohk-nix"; + url = "github:input-output-hk/iohk-nix/jl/dijkstra-respin-2026-02-19"; inputs.nixpkgs.follows = "nixpkgs"; };