Primary Network

P-Chain Configs

This page describes the configuration options available for the P-Chain.

This document provides details about the configuration options available for the PlatformVM.

Standard Configurations

To configure the PlatformVM, create a JSON file at {chain-config-dir}/P/config.json. The default values are:

OptionTypeDefault
networkNetworkDefaultNetwork
block-cache-sizeint64 * units.MiB
tx-cache-sizeint128 * units.MiB
transformed-subnet-tx-cache-sizeint4 * units.MiB
reward-utxos-cache-sizeint2048
chain-cache-sizeint2048
chain-db-cache-sizeint2048
block-id-cache-sizeint8192
fx-owner-cache-sizeint4 * units.MiB
subnet-to-l1-conversion-cache-sizeint4 * units.MiB
l1-weights-cache-sizeint16 * units.KiB
l1-inactive-validators-cache-sizeint256 * units.KiB
l1-subnet-id-node-id-cache-sizeint16 * units.KiB
checksums-enabledboolfalse
mempool-prune-frequencytime.Duration30 * time.Minute
mempool-gas-capacitygas.Gas1_000_000

Default values are overridden only if explicitly specified in the config.

Network Configuration

The Network configuration defines parameters that control the network's gossip and validator behavior. Set these fields in the network object of the JSON file.

Parameters

FieldTypeDefaultDescription
max-validator-set-stalenesstime.Duration1 minuteMaximum age of a validator set used for peer sampling and rate limiting
target-gossip-sizeint20 * units.KiBTarget number of bytes to send when pushing transactions or responding to transaction pull requests
push-gossip-percent-stakefloat640.9Percentage of total stake to target in the initial gossip round. Higher stake nodes are prioritized to minimize network messages
push-gossip-num-validatorsint100Number of validators to push transactions to in the initial gossip round
push-gossip-num-peersint0Number of peers to push transactions to in the initial gossip round
push-regossip-num-validatorsint10Number of validators for subsequent gossip rounds after the initial push
push-regossip-num-peersint0Number of peers for subsequent gossip rounds after the initial push
push-gossip-discarded-cache-sizeint16384Size of the cache storing recently dropped transaction IDs from mempool to avoid re-pushing
push-gossip-max-regossip-frequencytime.Duration30 * time.SecondMaximum frequency limit for re-gossiping a transaction
push-gossip-frequencytime.Duration500 * time.MillisecondFrequency of push gossip rounds
pull-gossip-frequencytime.Duration1500 * time.MillisecondFrequency of pull gossip rounds
pull-gossip-throttling-periodtime.Duration1 * time.HourTime window for throttling pull requests
expected-bloom-filter-elementsint8 * 1024Expected number of elements when creating a new bloom filter. Larger values increase filter size
expected-bloom-filter-false-positive-probabilityfloat640.01Target probability of false positives after inserting the expected number of elements. Lower values increase filter size
max-bloom-filter-false-positive-probabilityfloat640.05Threshold for bloom filter regeneration. Filter is refreshed when false positive probability exceeds this value

Details

The configuration is divided into several key areas:

  • Validator Set Management: Controls how fresh the validator set must be for network operations. The staleness setting ensures the network operates with reasonably current validator information.
  • Gossip Size Controls: Manages the size of gossip messages to maintain efficient network usage while ensuring reliable transaction propagation.
  • Push Gossip Configuration: Defines how transactions are initially propagated through the network, with emphasis on reaching high-stake validators first to optimize network coverage.
  • Pull Gossip Configuration: Controls how nodes request transactions they may have missed, including throttling mechanisms to prevent network overload.
  • Bloom Filter Settings: Configures the trade-off between memory usage and false positive rates in transaction filtering, with automatic filter regeneration when accuracy degrades.

Is this guide helpful?