diff --git a/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node/Genesis.hs b/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node/Genesis.hs index 4e01697bad..c599f78676 100644 --- a/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node/Genesis.hs +++ b/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/Node/Genesis.hs @@ -1,5 +1,5 @@ -{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} @@ -60,14 +60,14 @@ data GenesisConfig = GenesisConfig -- | Genesis configuration flags and low-level args, as parsed from config file or CLI data GenesisConfigFlags = GenesisConfigFlags - { gcfEnableCSJ :: Bool - , gcfEnableLoEAndGDD :: Bool - , gcfEnableLoP :: Bool - , gcfBulkSyncGracePeriod :: Maybe Integer - , gcfBucketCapacity :: Maybe Integer - , gcfBucketRate :: Maybe Integer - , gcfCSJJumpSize :: Maybe Integer - , gcfGDDRateLimit :: Maybe DiffTime + { gcfEnableCSJ :: Bool + , gcfEnableLoEAndGDD :: Bool + , gcfEnableLoP :: Bool + , gcfBulkSyncGracePeriod :: Maybe Integer + , gcfBucketCapacity :: Maybe Integer + , gcfBucketRate :: Maybe Integer + , gcfCSJJumpSize :: Maybe Integer + , gcfGDDRateLimit :: Maybe DiffTime } deriving stock (Eq, Generic, Show) defaultGenesisConfigFlags :: GenesisConfigFlags @@ -153,7 +153,7 @@ data LoEAndGDDNodeKernelArgs m blk = LoEAndGDDNodeKernelArgs { -- opened the ChainDB (which happens before we initialize the NodeKernel). -- After that, this TVar will not be modified again. lgnkaLoEFragmentTVar :: !(StrictTVar m (ChainDB.GetLoEFragment m blk)) - , lgnkaGDDRateLimit :: DiffTime + , lgnkaGDDRateLimit :: DiffTime } -- | Create the initial 'GenesisNodeKernelArgs" (with a temporary -- 'ChainDB.GetLoEFragment' that will be replaced via 'setGetLoEFragment') and a diff --git a/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs b/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs index f14c9a2983..cfdba7929b 100644 --- a/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs +++ b/ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs @@ -66,7 +66,8 @@ import Ouroboros.Consensus.MiniProtocol.ChainSync.Client import Ouroboros.Consensus.MiniProtocol.ChainSync.Client.InFutureCheck (SomeHeaderInFutureCheck) import Ouroboros.Consensus.Node.Genesis (GenesisNodeKernelArgs (..), - LoEAndGDDConfig (..), LoEAndGDDNodeKernelArgs (..), setGetLoEFragment) + LoEAndGDDConfig (..), LoEAndGDDNodeKernelArgs (..), + setGetLoEFragment) import Ouroboros.Consensus.Node.GSM (GsmNodeKernelArgs (..)) import qualified Ouroboros.Consensus.Node.GSM as GSM import Ouroboros.Consensus.Node.Run diff --git a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/CSJ.hs b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/CSJ.hs index f468b763c5..3fdf598fa3 100644 --- a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/CSJ.hs +++ b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/CSJ.hs @@ -31,7 +31,8 @@ import Test.Tasty.QuickCheck import Test.Util.Orphans.IOLike () import Test.Util.PartialAccessors import Test.Util.TestBlock (TestBlock) -import Test.Util.TestEnv (adjustQuickCheckMaxSize, adjustQuickCheckTests) +import Test.Util.TestEnv (adjustQuickCheckMaxSize, + adjustQuickCheckTests) tests :: TestTree tests = diff --git a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/DensityDisconnect.hs b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/DensityDisconnect.hs index 2453907644..73c2b2c10f 100644 --- a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/DensityDisconnect.hs +++ b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/DensityDisconnect.hs @@ -31,8 +31,7 @@ import Ouroboros.Consensus.Config.SecurityParam import Ouroboros.Consensus.Genesis.Governor (DensityBounds, densityDisconnect, sharedCandidatePrefix) import Ouroboros.Consensus.MiniProtocol.ChainSync.Client - (ChainSyncClientException (..), - ChainSyncState (..)) + (ChainSyncClientException (..), ChainSyncState (..)) import Ouroboros.Consensus.Util.Condense (condense) import Ouroboros.Network.AnchoredFragment (AnchoredFragment) import qualified Ouroboros.Network.AnchoredFragment as AF @@ -474,10 +473,10 @@ prop_densityDisconnectTriggersChainSel = let othersCount = Map.size (adversarialPeers $ psSchedule gtSchedule) exnCorrect = case exceptionsByComponent ChainSyncClient stateView of - [fromException -> Just DensityTooLow] -> True + [fromException -> Just DensityTooLow] -> True [fromException -> Just CandidateTooSparse{}] -> True - [] | othersCount == 0 -> True - _ -> False + [] | othersCount == 0 -> True + _ -> False tipPointCorrect = Just (getTrunkTip gtBlockTree) == svTipBlock in counterexample "Unexpected exceptions" exnCorrect .&&. diff --git a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoE.hs b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoE.hs index 644707ff2e..f26ffb0c91 100644 --- a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoE.hs +++ b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoE.hs @@ -26,7 +26,8 @@ import Test.Tasty import Test.Tasty.QuickCheck import Test.Util.Orphans.IOLike () import Test.Util.PartialAccessors -import Test.Util.TestEnv (adjustQuickCheckMaxSize, adjustQuickCheckTests) +import Test.Util.TestEnv (adjustQuickCheckMaxSize, + adjustQuickCheckTests) tests :: TestTree tests = diff --git a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoP.hs b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoP.hs index 0ac19660be..6e633e98a4 100644 --- a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoP.hs +++ b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/Genesis/Tests/LoP.hs @@ -31,7 +31,8 @@ import Test.Tasty import Test.Tasty.QuickCheck import Test.Util.Orphans.IOLike () import Test.Util.PartialAccessors -import Test.Util.TestEnv (adjustQuickCheckMaxSize, adjustQuickCheckTests) +import Test.Util.TestEnv (adjustQuickCheckMaxSize, + adjustQuickCheckTests) tests :: TestTree tests = diff --git a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator/Run.hs b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator/Run.hs index e91c71eac6..6f88312ed2 100644 --- a/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator/Run.hs +++ b/ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator/Run.hs @@ -234,7 +234,7 @@ itIsTimeToRestartTheNode :: NodeLifecycle blk m -> DiffTime -> Bool itIsTimeToRestartTheNode NodeLifecycle {nlMinDuration} duration = case nlMinDuration of Just minInterval -> duration > minInterval - Nothing -> False + Nothing -> False -- | The 'Tick' contains a state update for a specific peer. -- If the peer has not terminated by protocol rules, this will update its TMVar diff --git a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs index 39f3a3b488..5d5080ea39 100644 --- a/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs +++ b/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs @@ -253,7 +253,7 @@ sharedCandidatePrefix curChain candidates = -- When there is no intersection, we assume the candidate fragment is -- empty and anchored at the immutable tip. -- See Note [CSJ truncates the candidate fragments]. - Nothing -> (peer, AF.takeOldest 0 curChain) + Nothing -> (peer, AF.takeOldest 0 curChain) Just (_, suffix) -> (peer, suffix) immutableTipSuffixes = diff --git a/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/BlockFetch/Client.hs b/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/BlockFetch/Client.hs index 9b58d13246..56abcb3238 100644 --- a/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/BlockFetch/Client.hs +++ b/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/BlockFetch/Client.hs @@ -52,11 +52,11 @@ import Ouroboros.Consensus.Util.STM (blockUntilJust, forkLinkedWatcher) import Ouroboros.Network.AnchoredFragment (AnchoredFragment) import qualified Ouroboros.Network.AnchoredFragment as AF -import Ouroboros.Network.BlockFetch (BlockFetchConfiguration (..), GenesisBlockFetchConfiguration (..), +import Ouroboros.Network.BlockFetch (BlockFetchConfiguration (..), BlockFetchConsensusInterface (..), FetchMode (..), - blockFetchLogic, bracketFetchClient, - bracketKeepAliveClient, bracketSyncWithFetchClient, - newFetchClientRegistry) + GenesisBlockFetchConfiguration (..), blockFetchLogic, + bracketFetchClient, bracketKeepAliveClient, + bracketSyncWithFetchClient, newFetchClientRegistry) import Ouroboros.Network.BlockFetch.Client (blockFetchClient) import Ouroboros.Network.ControlMessage (ControlMessage (..)) import Ouroboros.Network.Mock.Chain (Chain) diff --git a/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/ChainSync/Client.hs b/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/ChainSync/Client.hs index e674013c6d..511f204835 100644 --- a/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/ChainSync/Client.hs +++ b/ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/ChainSync/Client.hs @@ -84,14 +84,12 @@ import Ouroboros.Consensus.MiniProtocol.ChainSync.Client (CSJConfig (..), ChainDbView (..), ChainSyncClientException, ChainSyncClientHandleCollection (..), - ChainSyncClientResult (..), - ChainSyncLoPBucketConfig (..), ChainSyncState (..), - ChainSyncStateView (..), ConfigEnv (..), Consensus, - DynamicEnv (..), Our (..), Their (..), - TraceChainSyncClientEvent (..), bracketChainSyncClient, - chainSyncClient, chainSyncStateFor, - newChainSyncClientHandleCollection, - viewChainSyncState) + ChainSyncClientResult (..), ChainSyncLoPBucketConfig (..), + ChainSyncState (..), ChainSyncStateView (..), + ConfigEnv (..), Consensus, DynamicEnv (..), Our (..), + Their (..), TraceChainSyncClientEvent (..), + bracketChainSyncClient, chainSyncClient, chainSyncStateFor, + newChainSyncClientHandleCollection, viewChainSyncState) import qualified Ouroboros.Consensus.MiniProtocol.ChainSync.Client.InFutureCheck as InFutureCheck import Ouroboros.Consensus.Node.GsmState (GsmState (Syncing)) import Ouroboros.Consensus.Node.NetworkProtocolVersion