Open coot opened 4 years ago
Currently (4a058ccc8
), it looks like this:
runDataDiffusion
:: DiffusionTracers
-> DiffusionArguments
-> DiffusionApplications
-> IO ()
Ouroboros.Consensus.Node.run
receives all sorts of data from from the cardano-node
invocation, including DiffusionTracers
and DiffusionArguments
which is simply passes through. With the rest of that data, run
spawns the ChainDB
and the NodeKernel
. From these it derives the various mini protocol applications, which it then bundles up as DiffusionApplications
, letting it ultimately continue as runDataDiffusion
.
At the moment, NetworkMagic
is passed explicitly to run
, but it's only used in the "bundle up as DiffusionApplications
" step.
I'm not aware of any other network options being passed-through via Node.run
to runDataDiffusion
. Would you share a concrete list of what you (even roughly) had in mind for the contents of NetworkArgumentsRequiredByConsensus
?
For convenience: here's the current cardano-node
invocation:
@nfrisby you maybe right that's only NetworkMagic
. I'll review this once I'm done with connection-manager
& p2p-governor
.
Currently the flow of data in
cardano-node
is not very clear. Partially the confusion comes from the fact thatrunDataDiffusion
is run by consensus application. The current flow is:environment (genesis, config, cli options) → consensus protocol setup → consensus options & network options → consensus starts data diffusion
Some network options go into consensus like network magic (it's needed to start protocols), some not (node addresses for diffusion). We should have something like this:
NetworkArgumentsRequiredByConsensus
would be passed as part ofDiffusionArguments
and they can come from environment (genesis, CLI args, etc), without going through consensus setup first (theprotocolInfo
and friends).