From 21dbd131d2c2f0a7504a6d5e1dc6467c647b2cf8 Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Thu, 31 Jul 2025 11:42:35 -0400 Subject: [PATCH] Make more options internal Change-Id: Id0000000b24f65646acb11fe480124d5bc24e158 --- src/Chainweb/Chainweb/Configuration.hs | 14 +++++++++++--- src/Chainweb/Mempool/P2pConfig.hs | 4 +++- src/Chainweb/Miner/Config.hs | 2 ++ src/Chainweb/PayloadProvider/Pact/Configuration.hs | 2 ++ src/P2P/Node/Configuration.hs | 6 ++++++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Chainweb/Chainweb/Configuration.hs b/src/Chainweb/Chainweb/Configuration.hs index 3d0d47ffe7..5cb5fc501c 100644 --- a/src/Chainweb/Chainweb/Configuration.hs +++ b/src/Chainweb/Chainweb/Configuration.hs @@ -371,14 +371,17 @@ pCutConfig = id <$< cutFetchTimeout .:: option auto % long "cut-fetch-timeout" <> help "The timeout for processing new cuts in microseconds" + <> internal <*< cutInitialBlockHeightLimit .:: fmap (Just . BlockHeight) . option auto % long "initial-block-height-limit" <> help "Reset initial cut to this block height." <> metavar "INT" + <> internal <*< cutFastForwardBlockHeightLimit .:: fmap (Just . BlockHeight) . option auto % long "fast-forward-block-height-limit" <> help "When --only-sync-pact is given fast forward to this height. Ignored otherwise." <> metavar "INT" + <> internal -- -------------------------------------------------------------------------- -- -- Service API Configuration @@ -443,6 +446,7 @@ pServiceApiConfig = id <*< serviceApiPayloadBatchLimit .:: fmap PayloadBatchLimit . option auto % prefixLong service "payload-batch-limit" <> suffixHelp service "upper limit for the size of payload batches on the service API" + <> internal <*< serviceApiConfigValidateSpec .:: enableDisableFlag % prefixLong service "validate-spec" <> internal -- hidden option, for expert use @@ -630,19 +634,23 @@ pChainwebConfiguration = id <> help "Max allowed reorg depth.\ \ Consult https://github.com/kadena-io/chainweb-node/blob/master/docs/RecoveringFromDeepForks.md for\ \ more information. " + <> internal <*< parserOptionGroup "Cut Processing" (configCuts %:: pCutConfig) <*< parserOptionGroup "Service API" (configServiceApi %:: pServiceApiConfig) <*< parserOptionGroup "Mining Coordination" (configMining %:: pMiningConfig) <*< configOnlySync .:: boolOption_ % long "only-sync" <> help "Terminate after synchronizing the pact databases to the latest cut" + <> internal <*< configReadOnlyReplay .:: boolOption_ % long "read-only-replay" <> help "Replay the block history non-destructively" + <> internal <*< configSyncChains .:: fmap Just % jsonOption % long "sync-chains" <> help "The only Pact databases to synchronize. If empty or unset, all chains will be synchronized." <> metavar "JSON list of chain ids" + <> internal <*< parserOptionGroup "Backup" (configBackup %:: pBackupConfig) -- FIXME support payload providers @@ -658,9 +666,9 @@ parseVersion = constructVersion <> metavar (T.unpack $ "[" <> T.intercalate "," (getChainwebVersionName . _versionName <$> knownVersions) <> "]") ) - <*> optional (textOption @Fork (long "fork-upper-bound" <> help "(development mode only) the latest fork the node will enable")) - <*> optional (BlockDelay <$> textOption (long "block-delay" <> help "(development mode only) the block delay in seconds per block")) - <*> switch (long "disable-pow" <> help "(development mode only) disable proof of work check") + <*> optional (textOption @Fork (long "fork-upper-bound" <> help "(development mode only) the latest fork the node will enable" <> internal)) + <*> optional (BlockDelay <$> textOption (long "block-delay" <> help "(development mode only) the block delay in seconds per block" <> internal) ) + <*> switch (long "disable-pow" <> help "(development mode only) disable proof of work check" <> internal) where constructVersion cliVersion fub bd disablePow' oldVersion = winningVersion & versionBlockDelay .~ fromMaybe (_versionBlockDelay winningVersion) bd diff --git a/src/Chainweb/Mempool/P2pConfig.hs b/src/Chainweb/Mempool/P2pConfig.hs index e9c4a541b5..7f56de35bc 100644 --- a/src/Chainweb/Mempool/P2pConfig.hs +++ b/src/Chainweb/Mempool/P2pConfig.hs @@ -80,10 +80,12 @@ pMempoolP2pConfig cid = id <$< mempoolP2pConfigMaxSessionCount .:: option auto % prefixLongCid cid "mempool-p2p-max-session-count" <> helpCid cid "maximum number of sessions that are active at any time" + <> internal <*< mempoolP2pConfigSessionTimeout .:: textOption % prefixLongCid cid "mempool-p2p-session-timeout" <> helpCid cid "timeout for sessions in seconds" + <> internal <*< mempoolP2pConfigPollInterval .:: textOption % prefixLongCid cid "mempool-p2p-poll-interval" <> helpCid cid "poll interval for synchronizing mempools in seconds" - + <> internal diff --git a/src/Chainweb/Miner/Config.hs b/src/Chainweb/Miner/Config.hs index 8774853feb..f2aab612ce 100644 --- a/src/Chainweb/Miner/Config.hs +++ b/src/Chainweb/Miner/Config.hs @@ -174,6 +174,7 @@ pCoordinationConfig = id <*< coordinationUpdateStreamTimeout .:: jsonOption % long "mining-update-stream-timeout" <> help "duration that an update stream is kept open in seconds" + <> internal -- -------------------------------------------------------------------------- -- -- Node Mining Config @@ -206,6 +207,7 @@ pNodeMiningConfig = id <$< nodeMiningEnabled .:: enableDisableFlag % long "node-mining" <> help "ONLY FOR TESTING NETWORKS: whether to enable in node mining" + <> internal defaultNodeMining :: NodeMiningConfig defaultNodeMining = NodeMiningConfig diff --git a/src/Chainweb/PayloadProvider/Pact/Configuration.hs b/src/Chainweb/PayloadProvider/Pact/Configuration.hs index 247f7a221c..a9ff611ee9 100644 --- a/src/Chainweb/PayloadProvider/Pact/Configuration.hs +++ b/src/Chainweb/PayloadProvider/Pact/Configuration.hs @@ -147,6 +147,7 @@ pPactProviderConfig cid = id <$< pactConfigReintroTxs .:: enableDisableFlag % prefixLongCid cid "pact-tx-reintro" <> helpCid cid "whether to enable transaction reintroduction from losing forks" + <> internal <*< pactConfigMempoolP2p %:: pEnableConfigCid "pact-mempool-p2p" cid pMempoolP2pConfig <*< pactConfigBlockGasLimit . iso StableEncoding _stableEncoding .:: jsonOption % prefixLongCid cid "pact-block-gas-limit" @@ -160,6 +161,7 @@ pPactProviderConfig cid = id <*< pactConfigPreInsertCheckTimeout .:: jsonOption % prefixLongCid cid "pact-pre-insert-check-timeout" <> helpCid cid "Max allowed time in microseconds for the transactions validation in the PreInsertCheck command." + <> internal <*< pactConfigAllowReadsInLocal .:: boolOption_ % prefixLongCid cid "pact-allowReadsInLocal" <> helpCid cid "Enable direct database reads of smart contract tables in local queries." diff --git a/src/P2P/Node/Configuration.hs b/src/P2P/Node/Configuration.hs index 5228065663..436ee2ec1b 100644 --- a/src/P2P/Node/Configuration.hs +++ b/src/P2P/Node/Configuration.hs @@ -206,24 +206,30 @@ pP2pConfiguration = id <*< p2pConfigMaxSessionCount .:: option auto % prefixLong net "p2p-max-session-count" <> suffixHelp net "maximum number of sessions that are active at any time" + <> internal <*< p2pConfigMaxPeerCount .:: option auto % prefixLong net "p2p-max-peer-count" <> suffixHelp net "maximum number of entries in the peer database" + <> internal <*< p2pConfigSessionTimeout .:: textOption % prefixLong net "p2p-session-timeout" <> suffixHelp net "timeout for sessions in seconds" + <> internal <*< p2pConfigKnownPeers %:: pLeftMonoidalUpdate (pure <$> pKnownPeerInfo) <*< p2pConfigIgnoreBootstrapNodes .:: enableDisableFlag % prefixLong net "ignore-bootstrap-nodes" <> help "when enabled the hard-coded bootstrap nodes for network are ignored" + <> internal <*< p2pConfigPrivate .:: enableDisableFlag % prefixLong net "private" <> help "when enabled this node becomes private and communicates only with the initially configured known peers" + <> internal <*< p2pConfigBootstrapReachability .:: option auto % prefixLong net "bootstrap-reachability" <> help "the fraction of bootstrap nodes that must be reachable at startup" <> metavar "[0,1]" + <> internal <*< p2pConfigTls .:: enableDisableFlag % prefixLong net "tls" <> internal -- hidden option, only for expert use