Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(install): a pin alone does not start the bundled genesis (#914)
The bundled data/genesis.json declares no snapshot.manifestSha256 and
data/snapshot/ is present, so any EXPECTED_GENESIS_HASH is refused at boot.
Say that only DEMOS_ALLOW_UNPINNED_GENESIS=true, or a mounted genesis that
declares the manifest hash, starts the node, and cite genesisPin.ts:189-194
and findGenesisBlock.ts:194-201.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
  • Loading branch information
randomblocker and claude committed Nov 6, 2026
commit cac6700afb7c572ee18ad40ed5ef775dc5b6a6b2
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Leave `PG_HOST=postgres` and `TLSNOTARY_HOST=tlsnotary` exactly as shipped — t

A fresh node does **not** run as an isolated single-validator chain, and the code has no solo or single-validator mode. On an empty database the node builds block 0 from `data/genesis.json` and `data/snapshot/`. The bundled snapshot carries 35 validators and wins over the 4 listed in `genesis.json`; a freshly generated identity is in neither list. `properties.shardSize` in the bundled genesis is 10.

A node forges a block only when the committee it draws has at least `floor(2 × shardSize / 3) + 1` members online (7 for a shard size of 10) and includes the node's own identity. The three Track 1 commands with the shipped `.env` defaults do not get that far: the image sets `NODE_ENV=production` and `EXPECTED_GENESIS_HASH` and `DEMOS_ALLOW_UNPINNED_GENESIS` are empty, so the node refuses to boot with "EXPECTED_GENESIS_HASH is not set. A production node must pin the genesis it joins" before it builds block 0. Once you set a valid `EXPECTED_GENESIS_HASH` (step 3 below, "Pin the network's genesis") or, for a local network that has no published hash, `DEMOS_ALLOW_UNPINNED_GENESIS=true`, the node starts, and with no peerlist it stays at block 0: each consensus round ends with `NotInShardError` in the log ("Committee below minimum size: refusing to forge" or "We are not in the shard") and no block is produced.
A node forges a block only when the committee it draws has at least `floor(2 × shardSize / 3) + 1` members online (7 for a shard size of 10) and includes the node's own identity. The three Track 1 commands with the shipped `.env` defaults do not get that far: the image sets `NODE_ENV=production` and `EXPECTED_GENESIS_HASH` and `DEMOS_ALLOW_UNPINNED_GENESIS` are empty, so the node refuses to boot with "EXPECTED_GENESIS_HASH is not set. A production node must pin the genesis it joins" before it builds block 0. The bundled `data/genesis.json` does not declare `snapshot.manifestSha256`, and the bundled `data/snapshot/` is present, so with any `EXPECTED_GENESIS_HASH` the node still refuses to boot ("a snapshot is present but the pinned genesis does not declare snapshot.manifestSha256, so nothing binds it"). With the image's own files the node starts only with `DEMOS_ALLOW_UNPINNED_GENESIS=true` (for a local network that has no published hash). It also starts if you mount a genesis that declares `snapshot.manifestSha256` for the snapshot present and pin that genesis's hash (step 3 below, "Pin the network's genesis"). Once it starts, with no peerlist it stays at block 0: each consensus round ends with `NotInShardError` in the log ("Committee below minimum size: refusing to forge" or "We are not in the shard") and no block is produced.

Genesis rejects a `shardSize` below 3, so the smallest committee that can forge is 3 validators. The code has no setting that lets one node forge alone. There is also no documented step that adds your node's identity to the validator set of the bundled genesis. A local chain needs at least that many validators whose identities are in the genesis you start from. In the repository's local devnet, `testing/devnet/scripts/setup.sh` runs `generate-genesis.sh`, which rewrites the validator list in `testing/devnet/genesis.devnet.json` to the newly generated node identities (see [testing/devnet/README.md](testing/devnet/README.md)). The devnet genesis has a `shardSize` of 10, which gives a floor of 7, so the default 4 validators are below it (not run).

Expand All @@ -268,7 +268,7 @@ Sources for the paragraphs above:

- `data/genesis.json` (`properties.shardSize`, `validators`), `data/snapshot/manifest.json` and `data/snapshot/validators.jsonl` (35 rows), `Dockerfile:49` (`COPY data/ ./data/`)
- `src/libs/blockchain/chainGenesis.ts:103-118` (snapshot validators take precedence over the genesis list)
- `Dockerfile:266` (`NODE_ENV=production`), `docker-compose.yml:183-185` (the pin variables pass through empty), `src/libs/blockchain/routines/findGenesisBlock.ts:146-152` and `src/libs/blockchain/genesis/genesisPin.ts:56-68` (boot refused without a pin or `DEMOS_ALLOW_UNPINNED_GENESIS`)
- `Dockerfile:266` (`NODE_ENV=production`), `docker-compose.yml:183-185` (the pin variables pass through empty), `src/libs/blockchain/routines/findGenesisBlock.ts:146-152` and `src/libs/blockchain/genesis/genesisPin.ts:56-68` (boot refused without a pin or `DEMOS_ALLOW_UNPINNED_GENESIS`), `src/libs/blockchain/genesis/genesisPin.ts:189-194` and `src/libs/blockchain/routines/findGenesisBlock.ts:194-201` (a pinned genesis that does not declare `snapshot.manifestSha256` is refused while a snapshot is present)
- `src/libs/consensus/genesisShardSize.ts:20-21,50-54` (shard size must be 3 to 100)
- `src/libs/consensus/v2/quorum.ts:10-12` and `src/libs/consensus/v2/routines/getShard.ts:32-34` (committee floor)
- `src/libs/consensus/v2/types/secretaryManager.ts:263-277` (the two `NotInShardError` cases)
Expand Down