New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracing documentation improvements #3500
Conversation
b253f50
to
7f3a215
Compare
Can you add some background information? For example, an example run, example output, screen capture, documentation or ticket? |
1. [Cardano.Node.AcceptPolicy.ConnectionHardLimit](#cardanonodeacceptpolicyconnectionhardlimit) | ||
1. [Cardano.Node.BlockFetch.NodeToNode.Send.BatchDone](#cardanonodeblockfetchnodetonodesendbatchdone) | ||
1. [Cardano.Node.BlockFetch.NodeToNode.Send.Block](#cardanonodeblockfetchnodetonodesendblock) | ||
1. [Cardano.Node.BlockFetch.NodeToNode.Send.ClientDone](#cardanonodeblockfetchnodetonodesendclientdone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this renumbering it all ones intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newhoggy, we're relying on Github's markdown auto-numbering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, but we read markdowns not only on github.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so sure about having the trace documentation as an additional command in the cardano-node
executable. This would make more sense living in cardano-cli
under the Miscellanous Commands
heading.
Is the plan to re-generate the documentation at doc/new-tracing/tracers_doc_generated.md
each time the relevant Documented
values change?
Yes, precisely, that's the goal. |
Then |
( Show t | ||
, forall result. Show (Query blk result) | ||
docTracers :: forall blk peer remotePeer. | ||
(forall result. Show (Query blk result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forall result. Show (Query blk result)
is unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
( Show t | ||
, forall result. Show (Query blk result) | ||
docTracers :: forall blk peer remotePeer. | ||
(forall result. Show (Query blk result) | ||
, TraceConstraints blk | ||
, LogFormatting (ChainDB.InvalidBlockReason blk) | ||
, LedgerSupportsProtocol blk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LedgerSupportsProtocol blk
is unnecessary.
RunNode blk
is pulling in 18 unnecessary constraints. I would consider creating a type synonym for the constraints needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jimbo4350, I've removed what I could, and consolidated the constraints a bit.
..but removing the RunNode
constraint is very difficult as of now, because of how tangled things are at the moment.
I've spent some hours on it, and it's just not easy at all.
It'll be far easier to deal with it at the point when we'll be removing the legacy system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me help you 😄
diff --git a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs
index 887705e29..44d19cb3b 100644
--- a/cardano-node/src/Cardano/Node/Tracing/Documentation.hs
+++ b/cardano-node/src/Cardano/Node/Tracing/Documentation.hs
@@ -47,11 +47,15 @@ import Cardano.Node.Handlers.Shutdown (ShutdownTrace)
import Cardano.Node.Startup
import Cardano.Node.TraceConstraints
+import Ouroboros.Consensus.Block.Forging
import Ouroboros.Consensus.BlockchainTime.WallClock.Types (RelativeTime)
import Ouroboros.Consensus.BlockchainTime.WallClock.Util (TraceBlockchainTimeEvent (..))
import Ouroboros.Consensus.Cardano.Block
-import Ouroboros.Consensus.Ledger.Query (Query)
-import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTxId)
+import Ouroboros.Consensus.Ledger.Inspect
+import Ouroboros.Consensus.Ledger.Query (Query, ShowQuery)
+import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTxId,
+ LedgerSupportsMempool)
+import Ouroboros.Consensus.Ledger.SupportsProtocol
import Ouroboros.Consensus.Mempool.API (TraceEventMempool (..))
import Ouroboros.Consensus.MiniProtocol.BlockFetch.Server
(TraceBlockFetchServerEvent (..))
@@ -59,6 +63,7 @@ import Ouroboros.Consensus.MiniProtocol.ChainSync.Client (TraceChainSy
import Ouroboros.Consensus.MiniProtocol.ChainSync.Server (TraceChainSyncServerEvent)
import Ouroboros.Consensus.MiniProtocol.LocalTxSubmission.Server
(TraceLocalTxSubmissionServerEvent (..))
+import Ouroboros.Consensus.Node.NetworkProtocolVersion
import qualified Ouroboros.Consensus.Node.Run as Consensus
import qualified Ouroboros.Consensus.Node.Tracers as Consensus
import qualified Ouroboros.Consensus.Protocol.Ledger.HotKey as HotKey
@@ -85,8 +90,8 @@ import Ouroboros.Network.PeerSelection.RootPeersDNS (TraceLocalRootPee
TracePublicRootPeers (..))
import Ouroboros.Network.Protocol.BlockFetch.Type (BlockFetch)
import Ouroboros.Network.Protocol.ChainSync.Type (ChainSync)
-import Ouroboros.Network.Protocol.Handshake.Unversioned (UnversionedProtocolData (..),
- UnversionedProtocol (..))
+import Ouroboros.Network.Protocol.Handshake.Unversioned (UnversionedProtocol (..),
+ UnversionedProtocolData (..))
import Ouroboros.Network.Protocol.LocalStateQuery.Type (LocalStateQuery)
import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS
import Ouroboros.Network.Protocol.TxSubmission.Type (TxSubmission)
@@ -152,11 +157,19 @@ runTraceDocumentationCmd TraceDocumentationCmd{..} = do
-- Can be changed, when old tracers have gone
docTracers :: forall blk peer remotePeer.
( TraceConstraints blk
+ , InspectLedger blk
+ , LedgerSupportsMempool blk
+ , LedgerSupportsProtocol blk
+ , Consensus.SerialiseNodeToNodeConstraints blk
, LogFormatting peer
, LogFormatting remotePeer
- , Consensus.RunNode blk
+ , Show (BlockNodeToClientVersion blk)
+ , Show (BlockNodeToNodeVersion blk)
, Show remotePeer
, Show peer
+ , Show (ForgeStateUpdateError blk)
+ , Show (CannotForge blk)
+ , ShowQuery (BlockQuery blk)
)
=> FilePath
-> FilePath
What part in particular was difficult for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jimbo4350, applied your patch -- thanks a lot!
This is for #3510 |
21af766
to
2680968
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just squash the last two commits into one.
Thank you @Jimbo4350 ! |
bors r+ |
3500: Tracing documentation improvements r=deepfire a=deepfire 1. Expose the `trace-documentation` tracer documentation generator as a `cardano-node` subcommand and wire into Makefile 2. Regenerate the tracer documentation 3. Fix a small mistake in the `New Tracing Quickstart` document (thanks `@coot` !). Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io> Co-authored-by: Yupanqui <jnf@arcor.de>
bors cancel |
Canceled. |
import Cardano.Logging (LogFormatting) | ||
import Cardano.Node.Queries (ConvertTxId, GetKESInfo (..), | ||
HasKESInfo (..), HasKESMetricsData (..), LedgerQueries) | ||
import Cardano.BM.Tracing (ToObject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style regression here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undone the change to ImportQualifiedPost
after discussion with @Jimbo4350
Co-Authored-by: Jordan Millar <jordan.millar@iohk.io>
bors r+ |
3500: Tracing documentation improvements r=deepfire a=deepfire 1. Expose the `trace-documentation` tracer documentation generator as a `cardano-node` subcommand and wire into Makefile 2. Regenerate the tracer documentation 3. Fix a small mistake in the `New Tracing Quickstart` document (thanks `@coot` !). Co-authored-by: Kosyrev Serge <serge.kosyrev@iohk.io> Co-authored-by: Yupanqui <jnf@arcor.de>
This PR was included in a batch that successfully built, but then failed to merge into master. It will not be retried. Additional information: {"message":"Waiting on code owner review from denisshevchenko and/or jutaro.","documentation_url":"https://docs.github.com/articles/about-protected-branches"} |
Ok, all checks and reviews passed, but some necessary people are absent, so force-merging this. |
trace-documentation
tracer documentation generator as acardano-node
subcommand and wire into MakefileNew Tracing Quickstart
document (thanks @coot !).