Skip to main content

Module config

Module config 

Source
Expand description

§Protocol-wide constants

One centralised place for every tunable number that affects on-network behaviour: minimum proof-of-work for each RPC class, blob size limits, bootstrap domains, DDoS thresholds, cache sizes, TLS / HTTP timeouts, bucket durations, certificate renewal cadences, and so on.

§Testing vs production

Two multipliers compensate automatically when running under cfg(test) or debug_assertions:

  • POW_REDUCTION_FACTOR slashes the mandatory PoW so tests finish quickly.
  • CLOCK_LENIENCE_FACTOR widens acceptable clock drift so virtual-clock tests don’t spuriously reject signed messages.

Any constant here that participates in protocol validation must be the same across all peers — changing a POW_MINIMUM_* value is effectively a soft fork.

Constants§

ANNOUNCE_NUM_PEERS
BOOTSTRAP_DOMAINS
BOOTSTRAP_V1_NUM_PEERS
CLIENT_FEEDBACK_POW_NUMERAIRE
CLIENT_MAX_PEERS_CONSIDERED_PER_RESPONSE
Only this many peers from any single peers_nearer / bootstrap list are considered, so one response can’t trigger thousands of verifies.
CLIENT_PEER_TRACKER_MAX_PEERS
Upper bound on the client’s PeerTracker; when full, a newcomer only gets in by out-scoring the weakest peer.
CLIENT_POST_BUNDLE_CACHE_DURATION
CLIENT_POST_BUNDLE_FEEDBACK_CACHE_DURATION
CLIENT_POST_TIMESTAMP_DELTA_THRESHOLD
CLOCK_LENIENCE_FACTOR
ENCODED_POST_BUNDLE_V1_ELAPSED_THRESHOLD_MILLIS
ENCODED_POST_BUNDLE_V1_OVERFLOWED_NUM_POSTS
ENCODED_POST_BUNDLE_V1_OVERFLOWED_NUM_POSTS_GRANTED
HEAL_DONOR_LEADING_AGREEMENT_BITS_SLACK
HTTPS_SERVER_TRANSPORT_BODY_READ_TIMEOUT_SECS
HTTPS_SERVER_TRANSPORT_HEADER_READ_TIMEOUT_SECS
HTTPS_SERVER_TRANSPORT_MAX_CONNECTIONS
HTTPS_SERVER_TRANSPORT_SHUTDOWN_TIMEOUT_SECS
HTTPS_SERVER_TRANSPORT_TLS_HANDSHAKE_TIMEOUT_SECS
MILLIS_TO_WAIT_BETWEEN_ANNOUNCES
MILLIS_TO_WAIT_BETWEEN_BOOTSTRAPS
MILLIS_TO_WAIT_BETWEEN_CERT_RENEWALS
MILLIS_TO_WAIT_BETWEEN_CERT_RENEWAL_CHECKS
MILLIS_TO_WAIT_BETWEEN_CERT_RENEWAL_FAILURES
MILLIS_TO_WAIT_BETWEEN_PEER_DUMPS
MINIMUM_PEERS_TO_STOP_BOOTSTRAPPING
PEER_MAX_FUTURE_TIMESTAMP_MILLIS
How far into our future a gossiped Peer record’s timestamps may be. An honest peer’s pow_current_* timestamps come from RPC PoW it received, which is within one drift of its clock, and its clock is within one drift of ours — hence two hops. Anything further ahead is self-asserted and would let the peer dodge PoW decay (an unbounded Kademlia score).
POW_MAX_CLOCK_DRIFT_MILLIS
POW_MINIMUM_PER_FEEDBACK
POW_MINIMUM_PER_PEER_STATS
POW_MINIMUM_PER_POST
POW_MINIMUM_PER_RPC_SERVER_KNOWN
POW_MINIMUM_PER_RPC_SERVER_UNKNOWN
POW_MINIMUM_PER_URL_FETCH
POW_REDUCTION_FACTOR
PROTOCOL_MAX_BLOB_SIZE_REQUEST
PROTOCOL_MAX_BLOB_SIZE_RESPONSE
REDUNDANT_SERVERS_PER_POST
SERVER_DDOS_BAD_REQUEST_PENALTY
SERVER_DDOS_DECAY_PER_SECOND
SERVER_DDOS_IPSET_SET_NAME
SERVER_DDOS_MAX_CONNECTIONS_PER_IP
SERVER_DDOS_SCORE_THRESHOLD
SERVER_KADEMLIA_MAX_PEERS_PER_BUCKET
SERVER_KEY_POW_MIN
SERVER_POST_BUNDLE_CACHE_MAX_BYTES
SERVER_POST_BUNDLE_CACHE_MAX_ORIGINATORS_PER_LOCATION
SERVER_POST_BUNDLE_FEEDBACK_CACHE_MAX_BYTES
TESTING
TRANSPORT_BYTES_GATHERER_COMPACT_THRESHOLD
URL_FETCH_CONNECT_TIMEOUT_MILLIS
URL_FETCH_DNS_TIMEOUT_MILLIS
URL_FETCH_TOTAL_TIMEOUT_MILLIS
USE_PRODUCTION_LETS_ENCRYPT