Skip to content

Commit

Permalink
Expose ability to configure mempoolCapacityOverride
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 12, 2021
1 parent c834f35 commit e220de8
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions ouroboros-consensus/src/Ouroboros/Consensus/Node.hs
Expand Up @@ -636,21 +636,23 @@ stdRunDataDiffusion = runDataDiffusion
--
-- See 'stdLowLevelRunNodeArgsIO'.
data StdRunNodeArgs m blk = StdRunNodeArgs
{ srnBfcMaxConcurrencyBulkSync :: Maybe Word
, srnBfcMaxConcurrencyDeadline :: Maybe Word
, srnChainDbValidateOverride :: Bool
{ srnBfcMaxConcurrencyBulkSync :: Maybe Word
, srnBfcMaxConcurrencyDeadline :: Maybe Word
, srnChainDbValidateOverride :: Bool
-- ^ If @True@, validate the ChainDB on init no matter what
, srnSnapshotInterval :: SnapshotInterval
, srnDatabasePath :: FilePath
, srnSnapshotInterval :: SnapshotInterval
, srnDatabasePath :: FilePath
-- ^ Location of the DBs
, srnDiffusionArguments :: DiffusionArguments
, srnDiffusionTracers :: DiffusionTracers
, srnEnableInDevelopmentVersions :: Bool
, srnDiffusionArguments :: DiffusionArguments
, srnDiffusionTracers :: DiffusionTracers
, srnEnableInDevelopmentVersions :: Bool
-- ^ If @False@, then the node will limit the negotiated NTN and NTC
-- versions to the latest " official " release (as chosen by Network and
-- Consensus Team, with input from Node Team)
, srnTraceChainDB :: Tracer m (ChainDB.TraceEvent blk)
-- ^ ChainDB Tracer
, srnTraceChainDB :: Tracer m (ChainDB.TraceEvent blk)
, srnMaybeMempoolCapacityOverride :: Maybe MempoolCapacityBytesOverride
-- ^ Determine whether to use the system default mempool capacity or explicitly set
-- capacity of the mempool.
}

-- | Conveniently packaged 'LowLevelRunNodeArgs' arguments from a standard
Expand Down Expand Up @@ -728,6 +730,7 @@ stdLowLevelRunNodeArgsIO RunNodeArgs{ rnProtocolInfo } StdRunNodeArgs{..} = do
-> NodeKernelArgs m (ConnectionId addrNTN) (ConnectionId addrNTC) blk
llrnCustomiseNodeKernelArgs =
overBlockFetchConfiguration modifyBlockFetchConfiguration
. modifyMempoolCapacityOverride
where
modifyBlockFetchConfiguration =
maybe id
Expand All @@ -736,6 +739,10 @@ stdLowLevelRunNodeArgsIO RunNodeArgs{ rnProtocolInfo } StdRunNodeArgs{..} = do
. maybe id
(\mc bfc -> bfc { bfcMaxConcurrencyBulkSync = mc })
srnBfcMaxConcurrencyBulkSync
modifyMempoolCapacityOverride =
maybe id
(\mc nka -> nka { mempoolCapacityOverride = mc })
srnMaybeMempoolCapacityOverride

-- Limit the node version unless srnEnableInDevelopmentVersions is set
limitToLatestReleasedVersion :: forall k v.
Expand Down

0 comments on commit e220de8

Please sign in to comment.