Skip to content

Add Running Genesis Mode HOWTO - #2037

Closed
dnadales wants to merge 2 commits into
mainfrom
damian/genesis-howto
Closed

Add Running Genesis Mode HOWTO#2037
dnadales wants to merge 2 commits into
mainfrom
damian/genesis-howto

Conversation

@dnadales

Copy link
Copy Markdown
Member

Summary

  • Add an operational HOWTO for running Genesis-mode nodes, covering configuration, networking, small-testnet tuning, stall debugging, and tracer setup.

Motivation

The existing Genesis documentation (genesis_design.md) describes the design for implementers.
There was no documentation for people actually running, configuring, or debugging Genesis-mode nodes.

This gap became apparent while investigating sync stalls on the dijkstra and leios testnets (3 relays each).
The root cause was that MinBigLedgerPeersForTrustedState (default 5) prevents the HAA from being satisfied when the network has fewer than 5 big ledger peers — a fact not documented anywhere.
Lowering SyncTargetNumberOfActiveBigLedgerPeers alone is not sufficient; the HAA gate must also be lowered.

The new doc distills the debugging knowledge acquired during that investigation into reusable guidance.

@dnadales dnadales added no changelog skip-tests Skip building and running tests for this PR. Use for changes to documentation. labels May 11, 2026
@crocodile-dentist

Copy link
Copy Markdown
Contributor

lgtm, and indeed there is documentation on configuring and running in GenesisMode on the dev portal, in particular the note about MinBigLedgerPeersForTrustedState is mentioned.

Comment on lines +20 to +21
"UseTraceDispatcher": true,
"TurnOnLogging": true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last two are generic tracing options, rather than something Genesis related, using UseTraceDispatcher is probably not even necessary, e.g. one can run the new tracing system in a mode which traces to stdout rather than through the TraceDispatcher.

@dnadales dnadales Jul 1, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right — these are generic tracing options, not Genesis prerequisites, so they've been dropped from the required-config section.
Checking against master, the logging switch was in fact removed in 289dee332 (2026-05-18): UseTraceDispatcher and TurnOnLogging are no longer parsed and the new tracing system runs unconditionally, so nothing needs enabling.
The tracer section now just notes that and points out the switch is gone on current nodes.
Fixed in d003d27.

Comment on lines +33 to +36
```json
"HostIPv4Addr": "0.0.0.0",
"HostIPv6Addr": "::"
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never used these config options (are you sure they exist?), there are CLI options for them in the node.

@dnadales dnadales Jul 1, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — those config.json keys don't exist.
The host addresses come only from the --host-addr / --host-ipv6-addr CLI options (Cardano/Node/Parsers.hs); there's no HostIPv4Addr/HostIPv6Addr in the config parser, and SocketConfig has no FromJSON instance.
The section now uses the CLI options instead.
The IPv6 guidance was also corrected: the node dials literal IPv6 snapshot peers regardless of --host-ipv6-addr (the local address only affects socket binding and the DNS lookup family), so omitting it doesn't make the node skip them — the fix is host routing or dropping the IPv6 peers from the snapshot.
Fixed in d003d27.

dnadales added 2 commits July 1, 2026 13:27
Operational guide for running, configuring, and debugging Genesis-mode
nodes. Covers host networking (IPv4/IPv6), small-testnet peer selection
overrides (including MinBigLedgerPeersForTrustedState), sync stall
diagnosis, and tracer configuration.
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.
@dnadales
dnadales force-pushed the damian/genesis-howto branch from bb53758 to d003d27 Compare July 1, 2026 16:28
@dnadales dnadales closed this Jul 1, 2026

@jasagredo jasagredo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is in general useful and describes possible causes that would have taken me quite some time to figure out.

The only remark is that this might not belong to Consensus, but instead to the node wiki, dev portal, or some such.

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

Use Praos mode on **block-producing nodes** that connect only to trusted local relays.
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").

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure where this config is? I don't think it is in the configuration file. Perhaps in the topology?

Comment on lines +66 to +73
"MinBigLedgerPeersForTrustedState": 1,
"SyncTargetNumberOfRootPeers": 0,
"SyncTargetNumberOfKnownPeers": 1,
"SyncTargetNumberOfEstablishedPeers": 1,
"SyncTargetNumberOfActivePeers": 1,
"SyncTargetNumberOfKnownBigLedgerPeers": 1,
"SyncTargetNumberOfEstablishedBigLedgerPeers": 1,
"SyncTargetNumberOfActiveBigLedgerPeers": 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will not be top-level fields anymore after cardano-config

Comment on lines +146 to +147
The overrides below use cardano-node's new tracing system, which is always on — no separate flag enables it.
(Older nodes gated it behind `UseTraceDispatcher`/`TurnOnLogging`, both generic and defaulting to on; current cardano-node has removed that switch.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being the default, we probably can omit this info

dnadales added a commit that referenced this pull request Jul 6, 2026
## Summary

Adds a reference doc that maps the Genesis feedback loop and GSM states
to the trace events a running node emits.
It lets you locate a sync stall against the components: stuck in
PreSyncing, stuck in Syncing, bouncing, and the healthy signature.

## Context

Supersedes #2037.
That PR was an operational "how to run nodes" guide.
The configuration, tuning, and tracer setup belong on the developer
portal, which already documents Genesis configuration.
This doc keeps only the consensus-side model and links to the portal for
the fixes.

Companion developer-portal PR: cardano-foundation/developer-portal#1874,
which adds the operator-facing configuration, tuning, and tracer setup.
That PR links back to this page, so it should merge after this one is
deployed.

Trace namespaces were verified against cardano-node master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog skip-tests Skip building and running tests for this PR. Use for changes to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants