Skip to content
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

Merged
merged 17 commits into from
Nov 12, 2020

Commits on Nov 12, 2020

  1. network: parameterize DiffusionApplications record

    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
    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    13a83ed View commit details
    Browse the repository at this point in the history
  2. consensus: parameterize Node.run over the diffusion layer

    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).
    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    7b11665 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    46535b0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    47ef31e View commit details
    Browse the repository at this point in the history
  5. consensus: decouple Node.run from ChainDB file system

    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.
    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    d55a362 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bfe17fb View commit details
    Browse the repository at this point in the history
  7. consensus: decouple Node.run from randomIO, including ChainSyncTimeout

    Moreover, the ThreadNet tests limit the ChainSync delays by construction
    instead of dynamically.
    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    7f9af2a View commit details
    Browse the repository at this point in the history
  8. consensus: parameterize Node.run over the address types

    The ThreadNet tests uses CoreNodeId whereas the real node uses RemoteAddress
    (ie SockAddr) and LocalAddress (ie FilePath).
    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    f8897d0 View commit details
    Browse the repository at this point in the history
  9. consensus: re-simplify Node.run interface

    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    715c39f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3749cc3 View commit details
    Browse the repository at this point in the history
  11. consensus: move customise* fields of RunNodeArgs to LowLevelRunNodeArgs

    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.
    nfrisby authored and mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    6284dc2 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2e36e67 View commit details
    Browse the repository at this point in the history
  13. consensus: move clock skew from RunNodeArgs to LowLevelRunNodeArgs

    It is not an option the real node likely has to override, better to not require
    them to provide it.
    mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    88386d6 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    932fb0c View commit details
    Browse the repository at this point in the history
  15. consensus: fix whitespace

    Left-over from alignment in the distant past.
    mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    ab290ca View commit details
    Browse the repository at this point in the history
  16. consensus: make the protocol versions a low-level argument

    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.
    mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    fa567f3 View commit details
    Browse the repository at this point in the history
  17. consensus: don't require NetworkMagic in StdRunNodeArgs

    `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`.
    mrBliss committed Nov 12, 2020
    Configuration menu
    Copy the full SHA
    df460d0 View commit details
    Browse the repository at this point in the history