-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull out Cardano specifics to different modules
There's a cyclic dependency issue in this commit that is fixed in the next one. The problem is that I pulled out `ConsensusModePeerTargets` which depend on `PeerSelectionTargets` and then the module that defines `PeerSelectionTargets` requires `ConsensusModePeerTargets`. This is fixed by abstracting over Cardano Node specific types such as `ConsensusModePeerTargets`. Add extension points to Diffusion data structures Reorganised and refactored Diffusion modules Moved Diffusion Cardano specifics to their own folder, separating utilities and functions accordingly. Changed Diffusion selection by splitting P2P in two: P2PCardano and P2P. The former instantiates diffusion using Cardano Node specifics. The latter is able to accommodate with other use cases. Added a Minimal/Node.hs that is incomplete but will hold the minimal Node diffusion instantiation example that highlights how one can use their own custom types. Refactor localRootPeers and PeerSelectionActions - Removed PeerSelectionActionsArgs: This data type was bit redundant. - Reorganized DNSActions and LedgerPeersArgs - Improved API for PeerSelectionActions Renamed Cardano.Node to Cardano.Network Refactored ConsensusModePeerTargets Refactor PeerSelection{Views, Counters} Make PeerSelection{Views, Counters} extensible by third party users. Generalised PublicRootPeers First refactor of Outbound Governor Make Diffusion Module Fully General and Polymorphic - Generalize MinimalP2P Module - `MinimalP2P` is _the_ module for diffusion initialization. - Updated parameter plumbing to support generalization and polymorphism. - Enhance ArgumentsExtra - Added additional parameters to `ArgumentsExtra` to facilitate a more general and polymorphic diffusion setup. This includes `requestPublicRootPeers`, `peerChurnGovernor`, etc.. - Refactor PeerSelection.Governor.Monitor - Moved Cardano-specific monitoring actions to a separate module. - Implemented general `localRoots` and `targetPeers` monitoring actions. - Pulled out Cardano specific implementation details that allowed to generalise the minimal set of monitoring actions. Added fields to `ExtraGuardedDecisions` so that 3rd party users can pass their own `localRoots` and `targetPeers` actions and also backdoors/callbacks like `abortGovernor`, `updateWithState` to not only support Cardano specific needs but to give more power/flexibility to 3rd party users. - Polymorphize Diffusion Module - Removed `CardanoP2P` dependencies from the `Diffusion` module. - Ensured the `Diffusion` module remains fully polymorphic and adaptable to different use cases. - Refactored test suite to compile with new changes. Update CHaP and Fix build Remove daBlockFetchMode Address Review Feedback Fix Churn no timeouts test Moved Cardano folder to Ouroboros folder Increase shortDelay when churning to fix test Recover sigusr1 signal handler Make addresses polymorphic Refactor extraDebugState appropriately Added P2PDecisionType and Refactored requestPublicRootPeers type Address Review Feedback
- Loading branch information
Showing
68 changed files
with
7,143 additions
and
3,870 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
2 changes: 1 addition & 1 deletion
2
...pi/src/Ouroboros/Network/ConsensusMode.hs → ...-api/src/Cardano/Network/ConsensusMode.hs
This file contains 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
5 changes: 2 additions & 3 deletions
5
...oboros/Network/PeerSelection/Bootstrap.hs → ...ardano/Network/PeerSelection/Bootstrap.hs
This file contains 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
2 changes: 1 addition & 1 deletion
2
...s/Network/PeerSelection/LocalRootPeers.hs → ...o/Network/PeerSelection/LocalRootPeers.hs
This file contains 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
2 changes: 1 addition & 1 deletion
2
...os/Network/PeerSelection/PeerTrustable.hs → ...no/Network/PeerSelection/PeerTrustable.hs
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE DerivingStrategies #-} | ||
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
|
||
module Cardano.Network.Types where | ||
|
||
import Data.Aeson (FromJSON) | ||
import GHC.Generics (Generic) | ||
import NoThunks.Class (NoThunks) | ||
|
||
-- | Wether the node is caught up or fell too far behind the chain | ||
data LedgerStateJudgement = YoungEnough | TooOld | ||
deriving (Eq, Show, Generic) | ||
|
||
instance NoThunks LedgerStateJudgement | ||
|
||
-- | Minimum number of hot big ledger peers in Genesis mode | ||
-- for trusted state to be signalled to Consensus. This number | ||
-- should be smaller than the `targetNumberOfActiveBigLedgerPeers` | ||
-- but greater than 1. In Genesis, we may demote a big ledger peer | ||
-- for underperformance, but not promote a replacement immediately | ||
-- to guard against adversaries which may want to slow down our | ||
-- progress. | ||
-- | ||
newtype NumberOfBigLedgerPeers = | ||
NumberOfBigLedgerPeers { getNumberOfBigLedgerPeers :: Int } | ||
deriving stock (Eq, Show) | ||
deriving newtype (FromJSON) | ||
|
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
...Ouroboros/Network/Testnet/Node/ChainDB.hs → ...roboros/Network/Diffusion/Node/ChainDB.hs
This file contains 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
This file contains 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
Oops, something went wrong.