Align BlockFetch.Decision and ClientMetrics namespaces with what is emitted - #6669
Open
pucedoteth wants to merge 1 commit into
Open
Align BlockFetch.Decision and ClientMetrics namespaces with what is emitted#6669pucedoteth wants to merge 1 commit into
pucedoteth wants to merge 1 commit into
Conversation
…mitted blockFetchDecisionTracer has carried TraceDecisionEvent since ouroboros-consensus-4.1.0.0, and Tracers.hs wires that field, so the node emits PeersFetch and PeerStarvedUs under BlockFetch.Decision. Both declaration sites still spelled the pre-TraceDecisionEvent type by hand, so documentation and the config check knew only EmptyPeersFetch, Accept and Decline. The effect is that the three documented namespaces can never fire, while the two that do fire are unknown to checkTraceConfiguration and so cannot be re-levelled or silenced from a config file. BlockFetch.Client.ClientMetrics had the mirror-image problem: it is composed onto the blockfetch client tracer and documented, but getAllNamespaces never mentioned it, so naming it in a configuration produced a Config namespace error. Annotate both sites with the record's own type and add a ClientMetrics entry at the BlockFetch.Client prefix, then regenerate the namespace list. The now-unused Ouroboros.Network.BlockFetch.Decision import goes with it, since FetchDecision was its only use in either module. Fixes IntersectMBO#6667
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #6667, taking the localized approach @mgmeier suggested there — restoring consistency across usage, documentation and configuration inside the existing pattern, rather than deriving all three from one place.
BlockFetch.Decision.Consensus.blockFetchDecisionTracerhas carriedTraceDecisionEventsinceouroboros-consensus-4.1.0.0, andTracers.hs:385wires that field, so the node emitsPeersFetchandPeerStarvedUs. Both declaration sites still spelled the pre-TraceDecisionEventtype by hand:whose namespaces are
EmptyPeersFetch,AcceptandDecline. So the three documented namespaces can never fire, and the two that do fire are unknown tocheckTraceConfiguration— they cannot be re-levelled or silenced from a config file.BlockFetch.Client.ClientMetricshad the mirror-image problem: composed onto the blockfetch client tracer inTracers.hs:389and documented at the["BlockFetch","Client"]prefix, but absent fromgetAllNamespaces, so naming it in a configuration produced aConfig namespace error.Both sites are now annotated with the record's own type,
ClientMetricsis added at theBlockFetch.Clientprefix, andnewNamespaces.txtis updated accordingly (Accept/Decline/EmptyPeersFetchout,PeerStarvedUs/PeersFetchin; the file stays C-locale sorted).The
Ouroboros.Network.BlockFetch.Decisionimport is dropped from both modules, sinceFetchDecisionwas its only use in either andcabal.projectsets-Werror.Notes for the reviewer
I could not build this. I have no GHC/cabal toolchain available, and a cardano-node build needs libsodium/secp256k1/blst besides. Rather than guess, here is what I did check statically — please let CI be the judge:
ClientMetricsis exported fromCardano.Node.Tracing.Tracers.Consensus(export list line 21), so the new import inConsistency.hsresolves.Tracers.Consensusdoes not importConsistency, and it was already reachable viaConsistency -> Documentation -> Tracers.Consensus.Decisionimport is safe in both modules:FetchDecisionwas its only symbol in use, whilePoint(fromOuroboros.Network.Block) and the qualifiedBlockFetch.(fromBlockFetch.ClientState) are still used 12x/7x and 26x respectively, so those imports stay live.TraceDecisionEventis spelled exactly asTracers/Consensus.hs:79imports it, and applied at the arity used by theMetaTraceinstance at line 657 and the consensus record field.I have not run
hlintorstylish-haskelleither, for the same reason.Checklist
checkTraceConfigurationcomparesgetAllNamespacesagainst the configuration, andnewNamespaces.txtis the golden list this PR updates.CHANGELOG.mdfor affected package.cabalfiles are updated — not applicable, no dependency change