Skip to content

Commit bf7f283

Browse files
update: platformvm config doc (#3694)
Signed-off-by: Ashutosh Tripathi <39340292+ashucoder9@users.noreply.github.com> Co-authored-by: Martin Eckardt <m.eckardt@outlook.com>
1 parent d36f7d3 commit bf7f283

File tree

1 file changed

+54
-219
lines changed

1 file changed

+54
-219
lines changed

vms/platformvm/config/config.md

Lines changed: 54 additions & 219 deletions
Original file line numberDiff line numberDiff line change
@@ -1,226 +1,61 @@
1-
---
2-
tags: [Configs]
3-
description: Reference for all available configuration options and parameters for the PlatformVM.
4-
pagination_label: P-Chain Configs
5-
sidebar_position: 1
6-
---
7-
8-
# P-Chain
9-
101
This document provides details about the configuration options available for the PlatformVM.
112

3+
## Standard Configurations
4+
125
In order to specify a configuration for the PlatformVM, you need to define a `Config` struct and its parameters. The default values for these parameters are:
136

14-
```json
15-
{
16-
"Chains": null,
17-
"Validators": null,
18-
"UptimeLockedCalculator": null,
19-
"SybilProtectionEnabled": false,
20-
"PartialSyncPrimaryNetwork": false,
21-
"TrackedSubnets": [],
22-
"TxFee": 0,
23-
"CreateAssetTxFee": 0,
24-
"CreateSubnetTxFee": 0,
25-
"TransformSubnetTxFee": 0,
26-
"CreateBlockchainTxFee": 0,
27-
"AddPrimaryNetworkValidatorFee": 0,
28-
"AddPrimaryNetworkDelegatorFee": 0,
29-
"AddSubnetValidatorFee": 0,
30-
"AddSubnetDelegatorFee": 0,
31-
"MinValidatorStake": 0,
32-
"MaxValidatorStake": 0,
33-
"MinDelegatorStake": 0,
34-
"MinDelegationFee": 0,
35-
"UptimePercentage": 0,
36-
"MinStakeDuration": "0s",
37-
"MaxStakeDuration": "0s",
38-
"RewardConfig": {},
39-
"ApricotPhase3Time": "0001-01-01T00:00:00Z",
40-
"ApricotPhase5Time": "0001-01-01T00:00:00Z",
41-
"BanffTime": "0001-01-01T00:00:00Z",
42-
"CortinaTime": "0001-01-01T00:00:00Z",
43-
"DurangoTime": "0001-01-01T00:00:00Z",
44-
"EUpgradeTime": "0001-01-01T00:00:00Z",
45-
"UseCurrentHeight": false
46-
}
47-
```
7+
| Option | Type | Default |
8+
| ------------------------ | -------- | ------- |
9+
| `network` | `Network` | `DefaultNetwork` |
10+
| `block-cache-size` | `int` | `64 * units.MiB` |
11+
| `tx-cache-size` | `int` | `128 * units.MiB` |
12+
| `transformed-subnet-tx-cache-size` | `int` | `4 * units.MiB` |
13+
| `reward-utxos-cache-size` | `int` | `2048` |
14+
| `chain-cache-size` | `int` | `2048` |
15+
| `chain-db-cache-size` | `int` | `2048` |
16+
| `block-id-cache-size` | `int` | `8192` |
17+
| `fx-owner-cache-size` | `int` | `4 * units.MiB` |
18+
| `subnet-to-l1-conversion-cache-size` | `int` | `4 * units.MiB` |
19+
| `l1-weights-cache-size` | `int` | `16 * units.KiB` |
20+
| `l1-inactive-validators-cache-size` | `int` | `256 * units.KiB` |
21+
| `l1-subnet-id-node-id-cache-size` | `int` | `16 * units.KiB` |
22+
| `checksums-enabled` | `bool` | `false` |
23+
| `mempool-prune-frequency` | `time.Duration` | `30 * time.Minute` |
4824

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

51-
## Parameters
52-
53-
The parameters are as follows:
54-
55-
### `Chains`
56-
57-
The node's chain manager
58-
59-
### `Validators`
60-
61-
Node's validator set maps SubnetID to validators of the Subnet
62-
63-
- The primary network's validator set should have been added to the manager before calling VM.Initialize.
64-
- The primary network's validator set should be empty before calling VM.Initialize.
65-
66-
### `UptimeLockedCalculator`
67-
68-
Provides access to the uptime manager as a thread-safe data structure
69-
70-
### `SybilProtectionEnabled`
71-
72-
_Boolean_
73-
74-
True if the node is being run with staking enabled
75-
76-
### `PartialSyncPrimaryNetwork`
77-
78-
_Boolean_
79-
80-
If true, only the P-chain will be instantiated on the primary network.
81-
82-
### `TrackedSubnets`
83-
84-
Set of Subnets that this node is validating
85-
86-
### `TxFee`
87-
88-
_Uint64_
89-
90-
Fee that is burned by every non-state creating transaction
91-
92-
### `CreateAssetTxFee`
93-
94-
_Uint64_
95-
96-
Fee that must be burned by every state creating transaction before AP3
97-
98-
### `CreateSubnetTxFee`
99-
100-
_Uint64_
101-
102-
Fee that must be burned by every Subnet creating transaction after AP3
103-
104-
### `TransformSubnetTxFee`
105-
106-
_Uint64_
107-
108-
Fee that must be burned by every transform Subnet transaction
109-
110-
### `CreateBlockchainTxFee`
111-
112-
_Uint64_
113-
114-
Fee that must be burned by every blockchain creating transaction after AP3
115-
116-
### `AddPrimaryNetworkValidatorFee`
117-
118-
_Uint64_
119-
120-
Transaction fee for adding a primary network validator
121-
122-
### `AddPrimaryNetworkDelegatorFee`
123-
124-
_Uint64_
125-
126-
Transaction fee for adding a primary network delegator
127-
128-
### `AddSubnetValidatorFee`
129-
130-
_Uint64_
131-
132-
Transaction fee for adding a Subnet validator
133-
134-
### `AddSubnetDelegatorFee`
135-
136-
_Uint64_
137-
138-
Transaction fee for adding a Subnet delegator
139-
140-
### `MinValidatorStake`
141-
142-
_Uint64_
143-
144-
The minimum amount of tokens one must bond to be a validator
145-
146-
### `MaxValidatorStake`
147-
148-
_Uint64_
149-
150-
The maximum amount of tokens that can be bonded on a validator
151-
152-
### `MinDelegatorStake`
153-
154-
_Uint64_
155-
156-
Minimum stake, in nAVAX, that can be delegated on the primary network
157-
158-
### `MinDelegationFee`
159-
160-
_Uint32_
161-
162-
Minimum fee that can be charged for delegation
163-
164-
### `UptimePercentage`
165-
166-
_Float64_
167-
168-
UptimePercentage is the minimum uptime required to be rewarded for staking
169-
170-
### `MinStakeDuration`
171-
172-
_Duration_
173-
174-
Minimum amount of time to allow a staker to stake
175-
176-
### `MaxStakeDuration`
177-
178-
_Duration_
179-
180-
Maximum amount of time to allow a staker to stake
181-
182-
### `RewardConfig`
183-
184-
Config for the minting function
185-
186-
### `ApricotPhase3Time`
187-
188-
_Time_
189-
190-
Time of the AP3 network upgrade
191-
192-
### `ApricotPhase5Time`
193-
194-
_Time_
195-
196-
Time of the AP5 network upgrade
197-
198-
### `BanffTime`
199-
200-
_Time_
201-
202-
Time of the Banff network upgrade
203-
204-
### `CortinaTime`
205-
206-
_Time_
207-
208-
Time of the Cortina network upgrade
209-
210-
### `DurangoTime`
211-
212-
_Time_
213-
214-
Time of the Durango network upgrade
215-
216-
### `EUpgradeTime`
217-
218-
_Time_
219-
220-
Time of the E network upgrade
221-
222-
### `UseCurrentHeight`
223-
224-
_Boolean_
225-
226-
UseCurrentHeight forces `GetMinimumHeight` to return the current height of the P-Chain instead of the oldest block in the `recentlyAccepted` window. This config is particularly useful for triggering proposervm activation on recently created Subnets (without this, users need to wait for `recentlyAcceptedWindowTTL` to pass for activation to occur).
27+
## Network Configuration
28+
29+
The Network configuration defines parameters that control the network's gossip and validator behavior.
30+
31+
### Parameters
32+
33+
| Field | Type | Default | Description |
34+
|-------|------|---------|-------------|
35+
| `max-validator-set-staleness` | `time.Duration` | `1 minute` | Maximum age of a validator set used for peer sampling and rate limiting |
36+
| `target-gossip-size` | `int` | `20 * units.KiB` | Target number of bytes to send when pushing transactions or responding to transaction pull requests |
37+
| `push-gossip-percent-stake` | `float64` | `0.9` | Percentage of total stake to target in the initial gossip round. Higher stake nodes are prioritized to minimize network messages |
38+
| `push-gossip-num-validators` | `int` | `100` | Number of validators to push transactions to in the initial gossip round |
39+
| `push-gossip-num-peers` | `int` | `0` | Number of peers to push transactions to in the initial gossip round |
40+
| `push-regossip-num-validators` | `int` | `10` | Number of validators for subsequent gossip rounds after the initial push |
41+
| `push-regossip-num-peers` | `int` | `0` | Number of peers for subsequent gossip rounds after the initial push |
42+
| `push-gossip-discarded-cache-size` | `int` | `16384` | Size of the cache storing recently dropped transaction IDs from mempool to avoid re-pushing |
43+
| `push-gossip-max-regossip-frequency` | `time.Duration` | `30 * time.Second` | Maximum frequency limit for re-gossiping a transaction |
44+
| `push-gossip-frequency` | `time.Duration` | `500 * time.Millisecond` | Frequency of push gossip rounds |
45+
| `pull-gossip-poll-size` | `int` | `1` | Number of validators to sample during pull gossip rounds |
46+
| `pull-gossip-frequency` | `time.Duration` | `1500 * time.Millisecond` | Frequency of pull gossip rounds |
47+
| `pull-gossip-throttling-period` | `time.Duration` | `10 * time.Second` | Time window for throttling pull requests |
48+
| `pull-gossip-throttling-limit` | `int` | `2` | Maximum number of pull queries allowed per validator within the throttling window |
49+
| `expected-bloom-filter-elements` | `int` | `8 * 1024` | Expected number of elements when creating a new bloom filter. Larger values increase filter size |
50+
| `expected-bloom-filter-false-positive-probability` | `float64` | `0.01` | Target probability of false positives after inserting the expected number of elements. Lower values increase filter size |
51+
| `max-bloom-filter-false-positive-probability` | `float64` | `0.05` | Threshold for bloom filter regeneration. Filter is refreshed when false positive probability exceeds this value |
52+
53+
### Details
54+
55+
The configuration is divided into several key areas:
56+
57+
- **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.
58+
- **Gossip Size Controls**: Manages the size of gossip messages to maintain efficient network usage while ensuring reliable transaction propagation.
59+
- **Push Gossip Configuration**: Defines how transactions are initially propagated through the network, with emphasis on reaching high-stake validators first to optimize network coverage.
60+
- **Pull Gossip Configuration**: Controls how nodes request transactions they may have missed, including throttling mechanisms to prevent network overload.
61+
- **Bloom Filter Settings**: Configures the trade-off between memory usage and false positive rates in transaction filtering, with automatic filter regeneration when accuracy degrades.

0 commit comments

Comments
 (0)