-
Notifications
You must be signed in to change notification settings - Fork 86
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
generalize Node.run for invocation from both real node and from ThreadNet tests and refine interface used by real node #2720
Conversation
8b3dc4a
to
4f85f26
Compare
I integrated the simplifications we discussed. |
dee7a16
to
7f1976e
Compare
7f1976e
to
2d2e158
Compare
2d2e158
to
5ce77c8
Compare
I've updated the PR description and pushed a commit that satisfies everything we discussed. I'm marking this as ready to review. |
Adds the following parameters to the DiIffusionApplications record type, so that it can be used both for the real diffusion layer and for a mock layer in the ThreadNet tests. * addresses: real uses RemoteAddress and LocalAddress, ThreadNet uses CoreNodeId * version data: real uses NodeToNodeVersionData and NodeToClientVersionData, ThreadNet uses UnversionedProtocolData * monad: real uses IO, ThreadNet uses IOLike m => m
The ThreadNet tests will run a mock diffusion layer. It's simpler than the real diffusion layer, and it's connection/disconnection timeline can be scripted according to each generated " test plan " (eg enabling shrinking to an explicitly static topology).
The ThreadNet tests use a mock filesystem, so .run must not directly use Ouroboros.Consensus.Storage.FS.IO.ioHasFS to initialize the ChainDB. Moreover, the tests use fully separate mock FSs for each internal database, for example to better localize reporting of unclosed file handles. So .run should not even directly organize the internal databases as sibling folders.
Moreover, the ThreadNet tests limit the ChainSync delays by construction instead of dynamically.
The ThreadNet tests uses CoreNodeId whereas the real node uses RemoteAddress (ie SockAddr) and LocalAddress (ie FilePath).
The cardano-node invocation currently uses these functions. We therefore add sufficient corresponding fields to StdRunNodeArgs so that the cardano-node invocation can be simplified: it just passes the data without having to first interpret it as these customisation functions.
It is not an option the real node likely has to override, better to not require them to provide it.
5ce77c8
to
e8c011c
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.
@nfrisby I left a number of comments, but you can ignore them as I addressed (most of) them. I have pushed a few more commits. Let me know whether you agree with them.
In IntersectMBO/ouroboros-network#2720 we reorganised the arguments to `Node.run` so that the consensus ThreadNet tests can use the same `Node.run` function as the real node while using a custom network layer. In this commit we propagate that change. For people that want to override some arguments that now seem to have disappeared: they have been moved to the `LowLevelRunNodeArgs` record in consensus. See the `stdLowLevelRunNodeArgsIO` and `Node.runWith` functions for constructing and running with custom `LowLevelRunNodeArgs`.
I have opened a draft PR in |
In IntersectMBO/ouroboros-network#2720 we reorganised the arguments to `Node.run` so that the consensus ThreadNet tests can use the same `Node.run` function as the real node while using a custom network layer. In this commit we propagate that change. For people that want to override some arguments that now seem to have disappeared: they have been moved to the `LowLevelRunNodeArgs` record in consensus. See the `stdLowLevelRunNodeArgsIO` and `Node.runWith` functions for constructing and running with custom `LowLevelRunNodeArgs`.
For consistency.
Left-over from alignment in the distant past.
In `cardano-node`, the default values for node-to-node and node-to-client versions are used. The only reason for having them in `RunNodeArgs` was to make it possible for the network team to test the node with different versions. They can still do this by using `.runWith` and `stdLowLevelRunNodeArgsIO`, and overriding the fields manually.
`RunNodeArgs` contains the `ProtocolInfo`, which already contains the `NetworkMagic`. So don't require it in `StdRunNodeArgs` but derive it from the `RunNodeArgs`. This means we have to pass `RunNodeArgs` to `stdLowLevelRunNodeArgsIO`.
e8c011c
to
df460d0
Compare
bors merge |
In IntersectMBO/ouroboros-network#2720 we reorganised the arguments to `Node.run` so that the consensus ThreadNet tests can use the same `Node.run` function as the real node while using a custom network layer. In this commit we propagate that change. For people that want to override some arguments that now seem to have disappeared: they have been moved to the `LowLevelRunNodeArgs` record in consensus. See the `stdLowLevelRunNodeArgsIO` and `Node.runWith` functions for constructing and running with custom `LowLevelRunNodeArgs`.
Build succeeded: |
2080: Adapt to the reorganised Node.run arguments in consensus r=intricate a=mrBliss In IntersectMBO/ouroboros-network#2720 we reorganised the arguments to `Node.run` so that the consensus ThreadNet tests can use the same `Node.run` function as the real node while using a custom network layer. In this commit we propagate that change. For people that want to override some arguments that now seem to have disappeared: they have been moved to the `LowLevelRunNodeArgs` record in consensus. See the `stdLowLevelRunNodeArgsIO` and `Node.runWith` functions for constructing and running with custom `LowLevelRunNodeArgs`. Co-authored-by: Thomas Winant <thomas@well-typed.com>
This PR makes three changes to the
RunNodeArgs
interface.It splits off some arguments of
RunNodeArgs
into a separateLowLevelRunNodeArgs
record.RunNodeArgs
are necessary arguments torun
.LowLeveRunNodeArgs
are the kinds of arguments that a "power user" such as the tests would use.It introduces a new record
StdRunNodeArgs
that captures the exact fields that the real invocation fromcardano-node
would like to provide when invokingrun
. We also provide a function that mapsStdRunNodeArgs
toLowLevelRunNodeArgs
by providing defaults, setting typical file paths, etc. This is how we hideLowLevelRunNodeArgs
from the real invocation incardano-node
.It renames the internal
NodeArgs
toNodeKernelArgs
.