Skip to content

Commit d8e931d

Browse files
committed
improve multiline defaults
1 parent 9cc7294 commit d8e931d

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

stackslib/src/config/mod.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,8 @@ pub struct BurnchainConfig {
12601260
/// The network-specific identifier used in P2P communication and database initialization.
12611261
/// ---
12621262
/// @default: |
1263-
/// - [`CHAIN_ID_MAINNET`] if [`BurnchainConfig::mode`] is `"mainnet"`
1264-
/// - [`CHAIN_ID_TESTNET`] otherwise
1263+
/// - if [`BurnchainConfig::mode`] is `"mainnet"`: [`CHAIN_ID_MAINNET`]
1264+
/// - else: [`CHAIN_ID_TESTNET`]
12651265
/// @notes:
12661266
/// - **Warning:** Do not modify this unless you really know what you're doing.
12671267
/// - This is intended strictly for testing purposes.
@@ -1270,8 +1270,8 @@ pub struct BurnchainConfig {
12701270
/// This parameter cannot be set via the configuration file.
12711271
/// ---
12721272
/// @default: |
1273-
/// - [`PEER_VERSION_MAINNET`] if [`BurnchainConfig::mode`] is `"mainnet"`
1274-
/// - [`PEER_VERSION_TESTNET`] otherwise
1273+
/// - if [`BurnchainConfig::mode`] is `"mainnet"`: [`PEER_VERSION_MAINNET`]
1274+
/// - else: [`PEER_VERSION_TESTNET`]
12751275
/// @notes:
12761276
/// - **Warning:** Do not modify this unless you really know what you're doing.
12771277
pub peer_version: u32,
@@ -1348,8 +1348,8 @@ pub struct BurnchainConfig {
13481348
/// Configured as a 2-character ASCII string (e.g., "X2" for mainnet).
13491349
/// ---
13501350
/// @default: |
1351-
/// - `"T2"` if [`BurnchainConfig::mode`] is `"xenon"`
1352-
/// - `"X2"` otherwise
1351+
/// - if [`BurnchainConfig::mode`] is `"xenon"`: `"T2"`
1352+
/// - else: `"X2"`
13531353
pub magic_bytes: MagicBytes,
13541354
/// The public key associated with the local mining address for the underlying Bitcoin regtest node.
13551355
/// Provided as a hex string representing an uncompressed public key.
@@ -2204,9 +2204,7 @@ pub struct NodeConfig {
22042204
/// - If `false`: Burnchain processing continues without waiting. Allows miners to operate optimistically
22052205
/// but may necessitate unwinding later if the affirmed block alters the chain state.
22062206
/// ---
2207-
/// @default: |
2208-
/// - `true` if [`NodeConfig::miner`] is `false`
2209-
/// - `false` if [`NodeConfig::miner`] is `true`
2207+
/// @default: Derived from the inverse of [`NodeConfig::miner`] value.
22102208
pub require_affirmed_anchor_blocks: bool,
22112209
/// Controls if the node must strictly wait for any PoX anchor block selected by the core consensus mechanism.
22122210
/// - If `true`: Halts burnchain processing immediately whenever a selected anchor block is missing locally
@@ -2250,10 +2248,10 @@ pub struct NodeConfig {
22502248
/// e.g., "SP000000000000000000002Q6VF78.pox-3") that this node should actively replicate.
22512249
/// ---
22522250
/// @default: |
2253-
/// - If [`NodeConfig::miner`] is `true` or [`NodeConfig::stacker`] is `true`, relevant system contracts
2251+
/// - if [`NodeConfig::miner`] is `true` or [`NodeConfig::stacker`] is `true`: relevant system contracts
22542252
/// (like `.miners`, `.signers-*`) are automatically added in addition to any contracts
22552253
/// specified in the configuration file.
2256-
/// - Otherwise, defaults to an empty list `[]` if not specified in the TOML.
2254+
/// - else: defaults to an empty list `[]`.
22572255
/// @notes:
22582256
/// - Values are strings representing qualified contract identifiers.
22592257
/// @toml_example: |
@@ -2803,8 +2801,8 @@ pub struct MinerConfig {
28032801
/// This key must be present at runtime for mining operations to succeed.
28042802
/// ---
28052803
/// @default: |
2806-
/// - [`NodeConfig::seed`] if the `[miner]` section *is present* in the config file
2807-
/// - `None` if the `[miner]` section *is not present*
2804+
/// - if the `[miner]` section *is present* in the config file: [`NodeConfig::seed`]
2805+
/// - else: `None`
28082806
pub mining_key: Option<Secp256k1PrivateKey>,
28092807
/// Amount of time while mining in nakamoto to wait in between mining interim blocks.
28102808
/// ---
@@ -3449,8 +3447,8 @@ pub struct ConnectionOptionsFile {
34493447
/// how much historical inventory information is requested in each sync attempt.
34503448
/// ---
34513449
/// @default: |
3452-
/// - `3` if [`BurnchainConfig::mode`] is `"mainnet"`
3453-
/// - [`INV_REWARD_CYCLES_TESTNET`] otherwise
3450+
/// - if [`BurnchainConfig::mode`] is `"mainnet"`: `3`
3451+
/// - else: [`INV_REWARD_CYCLES_TESTNET`]
34543452
/// @units: PoX reward cycles
34553453
pub inv_reward_cycles: Option<u64>,
34563454
/// The Public IPv4 address and port (e.g. "203.0.113.42:20444") to advertise to other nodes.
@@ -3492,6 +3490,9 @@ pub struct ConnectionOptionsFile {
34923490
/// ---
34933491
/// @default: `None` (feature disabled)
34943492
/// @notes:
3493+
/// - If set to a positive value, the node will periodically disconnect all of its P2P peers at
3494+
/// roughly this interval.
3495+
/// - This simulates network churn or partitioning for testing node resilience.
34953496
/// - The code enforcing this behavior is conditionally compiled using `cfg!(test)` and is
34963497
/// only active during test runs.
34973498
/// - This setting has no effect in standard production builds.

0 commit comments

Comments
 (0)