Skip to content

Commit 3f81bef

Browse files
Merge pull request #62 from input-output-hk/mwojtowicz/genesis-config
Information on how to configure Genesis mode
2 parents 2733ee7 + 6538676 commit 3f81bef

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/getting-started/understanding-config-files.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ A minimal version of this file looks like this:
8686
"port": 3003
8787
}
8888
]
89+
"peerSnapshotFile": "path/to/big-ledger-peer-snapshot.json"
8990
}
9091
```
9192

@@ -174,6 +175,20 @@ With bootstrap peers enabled the node will trace:
174175
- `TraceOnlyBootstrap`: Once the node transitions to `TooOld` the node will disconnect from all non-trusted peers and reconnect to only trusted ones in order to sync from trusted sources only.
175176
This tracing message means that the node has successfully purged all non-trusted connections and is only going to connect to trusted peers.
176177

178+
### [Ouroboros Genesis](https://iohk.io/en/blog/posts/2024/05/08/ouroboros-genesis-design-update/)
179+
180+
Ouroboros Genesis is the upcoming mechanism of trustless syncing in P2P environment which is expected to supercede bootstrap peers described in the previous section.
181+
This feature is included starting with node 10.2, and at the time of this writing it is disabled by default - refer to config.json file
182+
section below on instructions how to enable this by toggling a feature flag. Once enabled, this mode is incompatibile with bootstrap peers, and will disable the latter by overriding
183+
the configuration if they are defined in the topology file, and emit a trace of such occurence to inform the operator.
184+
From the perspective of the topology file a new entry must be added:
185+
186+
`"peerSnapshotFile": "path/to/snapshot.json"`
187+
188+
The file contains a snapshot of so-called big ledger peers which are the largest peers registered on the ledger which cumulatively hold 90% of stake at some arbitrary slot number. By virtue of the size of their stake
189+
in the system, they are postulated to be a proxy for honest ledger state. When syncing in this mode, these peers are sampled and connected with to bootstrap the process.
190+
Such a snapshot file can be created manually apriori with cardano-cli from a synced node, and may be distributed with a node release in the future.
191+
177192
## The genesis.json file
178193

179194
The genesis file is generated with the `cardano-cli` by reading a `genesis.spec.json` file, which is out of scope for this document.
@@ -429,6 +444,12 @@ It is also possible to have more fine grained control over filtering of trace ou
429444

430445
To run a node in P2P mode, configure the `EnableP2P` setting to `true`, which is the default value since `cardano-node-8.10`, in the configuration file. Additionally, ensure you specify the topology in the new format as described above.
431446

447+
Starting with node 10.2, a new means of trustless syncing is available to users. To enable this experimental (at the time of this writing) [Ouroboros Genesis](https://iohk.io/en/blog/posts/2024/05/08/ouroboros-genesis-design-update/) mechanism, you should add the flag:
448+
449+
`"ConsensusMode": "GenesisMode"`
450+
451+
and follow the instructions in the topology configuration section of this guide. Also, refer to the outbound governor section below for some additional configuration options.
452+
432453
There are a few new tracers and configuration options that you can set (listed below by
433454
component):
434455

@@ -447,6 +468,27 @@ options:
447468
peers (including local roots, ledger peers)
448469
* `TargetNumberOfActivePeers` (_default value: `20`_) - a target for _hot_ peers, which
449470
engage in the consensus protocol.
471+
* `TargetNumberOfKnownBigLedgerPeers`, `TargetNumberOfEstablishedBigLedgerPeers`,
472+
`TargetNumberOfActiveBigLedgerPeers` which are analogous to the preceding items
473+
but concern the largest peers registered on the ledger which cumulatively hold
474+
90% of the total stake.
475+
476+
In Ouroboros Genesis, the preceding targets are leveraged by the governor when a node is
477+
decided to be caught up, and are also referred to as the deadline targets. When the
478+
consensus mechanism within the node, based on the information obtained from connected peers,
479+
decides that the node is behind, a separate set of targets are used to sync up by
480+
downloading blocks from big ledger peers. If the node's ledger state is significantly out-of-date,
481+
or blank, a snapshot file of big ledger peers will be required to complete the syncing process.
482+
Refer to the topology section of this guide for more information. In this mode, there
483+
are alternative targets for big ledger peers, and these are the refered to as the sync targets:
484+
485+
* `SyncTargetNumberOfKnownBigLedgerPeers`, `SyncTargetNumberOfEstablishedBigLedgerPeers`, and
486+
`SyncTargetNumberOfActiveBigLedgerPeers`. It is recommended to use at least 30 for the last
487+
option as larger diversity provides stronger assurance of finishing on the honest chain
488+
if there are adverserial nodes on the network.
489+
* `MinBigLedgerPeersForTrustedState` is the minimum number of big ledger peers in active state
490+
that must be maintained by the node in order to continue the syncing process, or otherwise
491+
the syncing is paused while awaiting for new connections.
450492

451493
Let's take note of two additional targets. In the topology file, you have the option to include local root peers. This comprises a list of peer groups, with each group having its own valency. The outbound governor ensures a connection with every local root peer and ensures that at least the specified number of them (the valency) are actively connected (hot). Consequently, the values for `TargetNumberOfKnownPeers`, `TargetNumberOfEstablishedPeers`, and `TargetNumberOfActivePeers` should be set sufficiently high to accommodate these local root peers.
452494

0 commit comments

Comments
 (0)