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): state the devnet node limit and a forging setup; limit…
… the pin refusal to non-empty pins

The devnet generator and compose file stop at 5 nodes, below the floor of 7
for shardSize 10, so describe the shardSize override test-tx-status-e2e.sh
uses. An empty pin skips the snapshot-binding check (genesisPin.ts:186), so
the refusal applies to any non-empty pin.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
  • Loading branch information
randomblocker and claude committed Nov 7, 2026
commit ef443cbc71919b9cb25f4b709f1e9ae91f4d4cea
7 changes: 5 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,19 @@ Genesis rejects a `shardSize` below 3, so the smallest committee that can forge

That edited genesis only applies when `testing/devnet/docker-compose.fixture.yml` is used as an overlay: it mounts `genesis.devnet.json` over `/app/data/genesis.json` and `./empty-snapshot`, a directory with no `manifest.json`, over `/app/data/snapshot/`. With no snapshot the node takes the balances path, and `ensureValidatorSeed` seeds the genesis validators at boot, while the chain is still at block 0. A snapshot whose `validators.jsonl` has rows owns the validator set, so the genesis list applies only when the snapshot has no validator rows. Without the overlay, the image's baked genesis and the 35-validator snapshot are used, and the snapshot validators win. The devnet compose file runs the nodes with `NODE_ENV=development`, so the pin requirement above does not apply there.

`NODE_COUNT` cannot reach the floor of 7: `generate-genesis.sh` rejects node 6, and Compose defines at most five nodes (`node-5` is in the `rehearsal` profile). To get a devnet that forges, run `setup.sh`, then lower `properties.shardSize` to the validator count in a copy of `genesis.devnet.json` and mount the copy over `/app/data/genesis.json` with one more compose file, listed after the fixture file. `testing/devnet/scripts/test-tx-status-e2e.sh` does this with `jq '.properties.shardSize = (.validators | length)'`. Four validators with a `shardSize` of 4 have a floor of 3. For `NODE_COUNT=5`, add `--profile rehearsal` and mount the copy on `node-5` too.

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/genesis/restoreGenesisState.ts:86-96` and `src/libs/blockchain/routines/ensureValidatorSeed.ts:107-151` (snapshot validators take precedence over the genesis list; the genesis list is the fallback at block 0)
- `src/libs/blockchain/genesis/genesisFile.ts:12-16` and `src/libs/blockchain/genesis/loadSnapshot.ts:170-176` (`DEMOS_GENESIS_FILE`, `DEMOS_SNAPSHOT_DIR`), `src/libs/blockchain/genesis/loadSnapshot.ts:444-452` (no snapshot directory or no `manifest.json` means no snapshot)
- `Dockerfile:266` (`NODE_ENV=production`), `docker-compose.yml:192-194` (the pin variables pass through empty), `src/libs/blockchain/routines/findGenesisBlock.ts:155-163` 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:199-204` and `src/libs/blockchain/routines/findGenesisBlock.ts:217-227` (a pinned genesis that does not declare `snapshot.manifestSha256` is refused while a snapshot is present, before block 0 is written)
- `Dockerfile:266` (`NODE_ENV=production`), `docker-compose.yml:192-194` (the pin variables pass through empty), `src/libs/blockchain/routines/findGenesisBlock.ts:155-163` 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:186,199-204` (an empty pin returns before this refusal) and `src/libs/blockchain/routines/findGenesisBlock.ts:217-227` (a pinned genesis that does not declare `snapshot.manifestSha256` is refused while a snapshot is present, before block 0 is written)
- `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:267-281` (the two `NotInShardError` cases)
- `testing/devnet/scripts/generate-genesis.sh:1-10,27`, `testing/devnet/scripts/setup.sh:24`, `testing/devnet/genesis.devnet.json` (`properties.shardSize`), `testing/devnet/docker-compose.fixture.yml:9-13,27-28`, `testing/devnet/docker-compose.yml:62` (`NODE_ENV=development`), `testing/devnet/quorum-drills/README.md:131` (the `floor` drill)
- `testing/devnet/scripts/generate-genesis.sh:30-39,45-54` (node index 6 is rejected), `testing/devnet/docker-compose.yml:221-222` (`node-5`, `rehearsal` profile; no `node-6`), `testing/devnet/scripts/test-tx-status-e2e.sh:44,75-89` (the `rehearsal` profile, the `shardSize` copy and the override file)

To participate in the actual Demos testnet/mainnet, you must do **three things** before the node's first start:

Expand Down Expand Up @@ -329,7 +332,7 @@ EXPECTED_GENESIS_BLOCK_HASH=<published block 0 hash>

`scripts/genesis-hash.ts --genesis <file>` prints both values for a genesis file; the block 0 hash is the one labelled "genesis block hash". What each hash covers, and where mainnet's are published, is in [docs/mainnet/genesis-hash.md](docs/mainnet/genesis-hash.md).

While a snapshot is present, a pin is accepted only for a genesis that declares `snapshot.manifestSha256` for it, as the mainnet genesis template does. The genesis bundled in the image declares none and the bundled snapshot is present, so with the bundled files a node with an empty database refuses to boot whatever value `EXPECTED_GENESIS_HASH` has (this snapshot check runs only when block 0 is built, so a database that already holds block 0 is not refused for it); see the paragraphs at the top of this section.
While a snapshot is present, a pin is accepted only for a genesis that declares `snapshot.manifestSha256` for it, as the mainnet genesis template does. The genesis bundled in the image declares none and the bundled snapshot is present, so with the bundled files a node with an empty database refuses to boot with any non-empty pin (an empty pin skips this check; this snapshot check runs only when block 0 is built, so a database that already holds block 0 is not refused for it); see the paragraphs at the top of this section.

A validator never leaves these set in `.env`: `DEMOS_ALLOW_UNPINNED_GENESIS`, and the one-start switches `DEMOS_GENERATE_IDENTITY`, `DEMOS_IDENTITY_TAKEOVER`, `DEMOS_SIGNING_RECORD_REBIND` and `DEMOS_ACCEPT_FORK_SCHEDULE_DIGEST`. Each of the last four is for the single start that needs it (see [docs/runbooks/validator-key.md](docs/runbooks/validator-key.md) and below); remove it once the node runs. `./scripts/node-doctor --production` fails while any of them is set.

Expand Down