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): Track 1 is refused at boot until the genesis is pinned (…
…#914)

The block 0 / NotInShardError description applied to the default Track 1
stack, but the image runs NODE_ENV=production with EXPECTED_GENESIS_HASH and
DEMOS_ALLOW_UNPINNED_GENESIS empty, so findGenesisBlock refuses to boot before
building block 0. Say that, and limit the NotInShardError description to a node
that has a valid pin or DEMOS_ALLOW_UNPINNED_GENESIS=true.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
  • Loading branch information
randomblocker and claude committed Nov 6, 2026
commit 75939f2f4df84606e40b04f5b7e83cae32d76998
3 changes: 2 additions & 1 deletion 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. A fresh stack started from the Track 1 steps therefore stays at block 0 with no peerlist: 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. 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.

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,6 +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`)
- `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