From 5abd332e5e4f51feba05dc88b04fb321aae9c8a9 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Sun, 30 Aug 2026 13:29:18 -0500 Subject: [PATCH] Update o-c and add tracer for LeiosTally Bumps ouroboros-consensus to pick up the running per-point vote tally trace, and registers the Consensus.LeiosKernel.Tally namespace it needs. The bump spans two consensus commits: the trace itself, and keeping the per-point total in the vote state rather than resumming the voter map on every accepted vote. The tally is the certification margin. Only certified points reach the chain, so a point that stalls below minCertificationThreshold currently leaves no record of how close it came, and a diffusion near miss cannot be told apart from a structural shortfall. Registration is the usual three sites: forHuman, namespaceFor and allNamespaces. privacyFor, detailsFor and metricsDocFor take their class defaults and documentFor is covered by the instance catch-all. forHuman renders the adding seat and its weight alongside the tally and threshold, so the human format carries the same five fields as forMachine. Severity falls through to the Info default, matching the neighbouring Voted and VoteAcquired traces. Note that puts it below the Notice root threshold in the configs shipped here, so the trace is inert unless the deployment lowers Consensus.LeiosKernel, as the playground config does. A metric would sidestep the threshold entirely and is worth considering when log-derived values move to Prometheus. --- cabal.project | 6 +++--- .../src/Cardano/Node/Tracing/Tracers/Consensus.hs | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cabal.project b/cabal.project index c07ddd9e18a..fd0aa359a8d 100644 --- a/cabal.project +++ b/cabal.project @@ -92,12 +92,12 @@ allow-older: -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. --- Points to ouroboros-consensus/leios-prototype +-- Points to ouroboros-consensus/jl/leios-prototype-w35-patched source-repository-package type: git location: https://github.com/IntersectMBO/ouroboros-consensus - tag: 1820edf5e496fbec5aa230a8bee56397c76f474b - --sha256: sha256-fKHnMyMNfPtVakRXQOEXpONh8AKNtxybaL3sMe6hdNw= + tag: bf1eeafff6f226affeb1de708f00a078a1657aa5 + --sha256: sha256-uak6xmfDtKZSPhpkfCErYaaLU9ZpgDFQth52yOPRvzY= -- Points to nfrisby-pr93-lookahead-merge-commit tag source-repository-package diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index 838d91373f8..e0014daca78 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -2465,6 +2465,12 @@ instance LogFormatting TraceLeiosKernel where "EB certified at slot " <> showT atSlot <> ": " <> Text.pack (show certifiedPoint) TraceLeiosVoted{weight} -> "Leios voted, weight=" <> showT (fromRational @Double weight) TraceLeiosVoteAcquired{} -> "Leios vote acquired" + TraceLeiosTally{rbHash, seatId, weight, tally, threshold} -> + "Leios tally for RB " <> Text.pack (show rbHash) + <> ": seat " <> showT (Leios.leiosSeatIndex seatId) + <> " added " <> showT (fromRational @Double weight) + <> ", now " <> showT (fromRational @Double tally) + <> " against a threshold of " <> showT (fromRational @Double threshold) TraceLeiosCertified{rbHash} -> "Leios cert assembled for RB " <> Text.pack (show rbHash) TraceLeiosVoteScheduled{ebPoint, voteIn, deadlineIn} -> "Leios vote scheduled for " <> Text.pack (show ebPoint) @@ -2529,6 +2535,7 @@ instance MetaTrace TraceLeiosKernel where namespaceFor TraceLeiosBlockCertified{} = Namespace [] ["BlockCertified"] namespaceFor TraceLeiosVoted{} = Namespace [] ["Voted"] namespaceFor TraceLeiosVoteAcquired{} = Namespace [] ["VoteAcquired"] + namespaceFor TraceLeiosTally{} = Namespace [] ["Tally"] namespaceFor TraceLeiosCertified{} = Namespace [] ["Certified"] namespaceFor TraceLeiosNotVoted{} = Namespace [] ["NotVoted"] namespaceFor TraceLeiosVoteScheduled{} = Namespace [] ["VoteScheduled"] @@ -2578,6 +2585,7 @@ instance MetaTrace TraceLeiosKernel where , Namespace [] ["BlockCertified"] , Namespace [] ["Voted"] , Namespace [] ["VoteAcquired"] + , Namespace [] ["Tally"] , Namespace [] ["Certified"] , Namespace [] ["NotVoted"] , Namespace [] ["VoteScheduled"]