Skip to content

Commit bb53758

Browse files
committed
Correct config, CLI, and tracing claims in the Genesis mode HOWTO
Address review feedback and re-verify every claim against cardano-node origin/master and ouroboros-network source. - ConsensusMode is the only field that enables Genesis. UseTraceDispatcher and TurnOnLogging are not Genesis prerequisites; they are generic tracing options and have been removed from cardano-node (the new tracing system is now unconditional). - Host addresses come from the --host-addr / --host-ipv6-addr CLI options, not HostIPv4Addr / HostIPv6Addr config.json keys (which do not exist). Rewrite the IPv6 guidance: the node dials literal IPv6 snapshot peers regardless of --host-ipv6-addr; the remedy is host routing or removing the IPv6 peers from the snapshot. - The GSM runs in both Praos and Genesis modes; only CSJ and GDD are Genesis-only. Note MinBigLedgerPeersForTrustedState and LowLevelGenesisOptions as the other Genesis-specific config fields. - The peer snapshot is an optional peerSnapshotFile, not a required peer-snapshot.json. - Fix tracer claims: PeerStarvedUs is silenced by default until BlockFetch.Decision is raised; DMaximum is not required for per-peer decline reasons; the GDD debug info is the TraceGDDDebugInfo kind under Consensus.GDD.TraceGDDEvent; CSJ InitializedAsDynamo needs Genesis mode, a registered peer, and a Debug override. - Clarify that useLedgerAfterSlot: -1 disables ledger peers.
1 parent 9968227 commit bb53758

1 file changed

Lines changed: 39 additions & 21 deletions

File tree

docs/website/contents/howtos/running_genesis_mode.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,51 @@
33
## When to use Genesis mode
44

55
Genesis mode lets a syncing node defend against long-range attacks without trusting recent ledger state for peer evaluation.
6-
It adds defensive components (GSM, LoE, GDD, CSJ, LoP, DBF) on top of existing ChainSync/BlockFetch.
6+
It adds defensive components — LoE, GDD, CSJ, LoP, and Devoted BlockFetch (DBF) — on top of existing ChainSync/BlockFetch, coordinated by the Genesis State Machine (GSM).
7+
The GSM itself runs in both modes: it tracks whether the node is caught up and disables the Genesis-only components once it is.
78
See the [Genesis design doc](../references/miscellaneous/genesis_design.md) for the full component description.
89

910
Use Genesis mode on **relay nodes and syncing nodes** that connect to the public network.
1011

11-
Use Praos mode on **block-producing nodes** that connect only to trusted local relays with `useLedgerAfterSlot: -1`.
12-
A forger with `GenesisMode` + trusted `localRoots` + `useLedgerAfterSlot: -1` will behave like Praos mode in practice (the peer selection targets only differ when `(GenesisMode, TooOld)`), but there is no benefit over Praos mode in that configuration.
12+
Use Praos mode on **block-producing nodes** that connect only to trusted local relays.
13+
Setting `useLedgerAfterSlot: -1` disables ledger peers, so the node uses only its configured roots (`-1` turns ledger peers off; `0` would mean "always use the ledger").
14+
A forger with `GenesisMode` + trusted `localRoots` + ledger peers disabled will behave like Praos mode in practice — the peer-selection target basis differs only in the `(GenesisMode, TooOld)` state — but there is no benefit over Praos mode in that configuration.
1315

1416
## Required configuration
1517

16-
The following `config.json` fields are prerequisites for Genesis mode:
18+
Genesis mode is turned on by one `config.json` field:
1719

1820
```json
19-
"ConsensusMode": "GenesisMode",
20-
"UseTraceDispatcher": true,
21-
"TurnOnLogging": true
21+
"ConsensusMode": "GenesisMode"
2222
```
2323

2424
`ConsensusMode` activates the Genesis defenses.
25-
Praos-mode nodes do not emit GSM, CSJ, or GDD events at all — the tracers exist but are never written to.
25+
The GSM runs in both modes, so a Praos-mode node still emits GSM events.
26+
CSJ and GDD are Genesis-only defenses: a Praos-mode node never writes to those tracers.
2627

27-
The node also requires a peer snapshot file (`peer-snapshot.json`) listed in the topology, which provides the initial set of peers for ledger peer selection.
28+
Two other `config.json` fields only take effect in Genesis mode: `MinBigLedgerPeersForTrustedState` (see [Small testnets](#small-testnets)) and `LowLevelGenesisOptions`.
29+
30+
The topology may also list a big-ledger-peer snapshot via the optional `peerSnapshotFile` field (a file path).
31+
It seeds ledger peer selection with an initial set of big ledger peers.
32+
It is not required: in Genesis mode with ledger peers enabled, a node without one only logs a recommendation to supply it.
2833

2934
## Host networking
3035

31-
The node binds listening sockets and creates outbound connections based on `HostIPv4Addr` and `HostIPv6Addr` in `config.json`:
36+
`--host-addr` and `--host-ipv6-addr` are CLI options, not `config.json` fields:
3237

33-
```json
34-
"HostIPv4Addr": "0.0.0.0",
35-
"HostIPv6Addr": "::"
38+
```sh
39+
cardano-node run --host-addr 0.0.0.0 --host-ipv6-addr ::
3640
```
3741

38-
If the peer snapshot contains IPv6 addresses but `HostIPv6Addr` is not set, the node will fail to connect to those peers with `Network is unreachable`.
39-
On a host without IPv6 routing, omit `HostIPv6Addr` entirely — the node will skip IPv6 peers.
42+
They set the local addresses the node binds its listening sockets to.
43+
`--host-ipv6-addr` also selects the DNS lookup family: without it the node resolves only A records, so peers given as domain names never yield IPv6 addresses.
44+
45+
Neither option gates outbound connections to literal IPv6 addresses.
46+
If the peer snapshot lists a peer by its IPv6 address, the node dials it whether or not `--host-ipv6-addr` is set.
47+
On a host with no IPv6 route, that dial fails with `Network is unreachable`.
4048

41-
**Diagnostic**: if logs show repeated `Net.ConnectionManager.Remote.ConnectError` against IPv6 addresses (e.g. `[2a05:...]:3001`) while all `HandshakeSuccess` entries are IPv4, the host has no IPv6 route.
42-
Either enable IPv6 on the host and set `HostIPv6Addr`, or remove it from the config.
49+
**Diagnostic**: if logs show repeated `Net.ConnectionManager.Remote.ConnectError` against IPv6 addresses (e.g. `[2a05:...]:3001`) while all `HandshakeSuccess` entries are IPv4, the host has no IPv6 route to those peers.
50+
To stop the failures, give the host an IPv6 route or remove the IPv6 peers from the snapshot.
4351

4452
## Small testnets
4553

@@ -87,6 +95,8 @@ A Genesis sync stall is always somewhere in the feedback loop:
8795
ChainSync (per peer) → LoP → CSJ → GDD → LoE → ChainSel → DBF → ChainDB → GSM
8896
```
8997

98+
This is a linearization: LoP and CSJ run inside ChainSync, and the GSM is not a terminal sink — its state feeds back into ChainSync's LoP bucket, closing the loop.
99+
90100
The GSM has three states: `PreSyncing`, `Syncing`, `CaughtUp`.
91101

92102
### Stuck in PreSyncing
@@ -107,7 +117,7 @@ Look downstream:
107117

108118
- **LoE pinned**: `Consensus.GDD.TraceGDDEvent` shows the LoE candidate not advancing.
109119
ChainDB tip stops growing despite headers flowing.
110-
- **GDD impotent**: `TraceGDDDebug` shows multiple peers at equal density.
120+
- **GDD impotent**: `Consensus.GDD.TraceGDDEvent` with `"kind": "TraceGDDDebugInfo"` shows multiple peers at equal density.
111121
GDD is correctly refusing to act.
112122
Cause is upstream: small peer set, era/window math, checkpoint config.
113123
- **CSJ dynamo wedged**: no `Consensus.CSJ.SentJumpInstruction` for a long time.
@@ -133,7 +143,13 @@ ChainDB tip extending.
133143

134144
## Tracer configuration
135145

136-
At default severity (Notice), only GSM events, `PeerStarvedUs`, and ChainSync `Exception` are visible.
146+
The overrides below use cardano-node's new tracing system, which is always on — no separate flag enables it.
147+
(Older nodes gated it behind `UseTraceDispatcher`/`TurnOnLogging`, both generic and defaulting to on; current cardano-node has removed that switch.)
148+
149+
The trace namespaces below match mainline cardano-node; leaf names can change between node versions, so confirm them against the version you run.
150+
151+
At the default root severity (Notice), GSM events and ChainSync.Client `Exception` (severity Warning) are visible.
152+
`BlockFetch.Decision.PeerStarvedUs` is severity Info and is silenced by the default config, so it only appears once you raise `BlockFetch.Decision` to Info or Debug (below).
137153
To debug a stall, add the following to the `TraceOptions` object in `config.json`:
138154

139155
```json
@@ -147,7 +163,8 @@ To debug a stall, add the following to the `TraceOptions` object in `config.json
147163
"Net.ConnectionManager": { "severity": "Debug" }
148164
```
149165

150-
`detail: DMaximum` on `BlockFetch.Decision` is required for per-peer decline reasons in `PeersFetch` events.
166+
`detail: DMaximum` on `BlockFetch.Decision` gives the most verbose per-peer output.
167+
Per-peer decline reasons in `PeersFetch` already appear at the default detail level (any level above `DMinimal`), so `DMaximum` is not strictly required.
151168

152169
### Volume control
153170

@@ -175,4 +192,5 @@ After restart, confirm the overrides took effect:
175192
grep -E 'Consensus\.(GSM|CSJ|GDD|DevotedBlockFetch)|BlockFetch\.Decision\.(PeersFetch|PeerStarvedUs)' <logfile>
176193
```
177194

178-
Within seconds of startup, expect `Consensus.GSM.InitializedInPreSyncing` and `Consensus.CSJ.InitializedAsDynamo`.
195+
Within seconds of startup, expect `Consensus.GSM.InitializedInPreSyncing`.
196+
Once a peer registers, expect `Consensus.CSJ.InitializedAsDynamo` — CSJ runs only in Genesis mode, and this event is severity Debug, so it needs the `Consensus.CSJ` Debug override above.

0 commit comments

Comments
 (0)