From 0796d5ec33158e529f551c82958bb2a90d0e89a1 Mon Sep 17 00:00:00 2001 From: nol4lej Date: Tue, 22 Sep 2026 09:03:34 -0300 Subject: [PATCH] feat(validator): add SYNC_MODE so a fresh validator can warp sync --- mainnet/validator/.env.example | 29 ++++++++++++++++++++++++++++ mainnet/validator/docker-compose.yml | 1 + testnet/validator/.env.example | 29 ++++++++++++++++++++++++++++ testnet/validator/docker-compose.yml | 1 + 4 files changed, 60 insertions(+) diff --git a/mainnet/validator/.env.example b/mainnet/validator/.env.example index 1415471..9f70656 100644 --- a/mainnet/validator/.env.example +++ b/mainnet/validator/.env.example @@ -13,6 +13,35 @@ VALIDATOR_NAME=Choose-Your-Validator-Name # openssl rand -hex 32 VALIDATOR_NODE_KEY= +# ─── Sync ──────────────────────────────────────────────────────────────────── + +# Empty = full sync, which is what a validator should normally run. +# +# `--sync warp` is for bootstrapping a NEW validator on an empty volume: it +# proves finality and fetches the latest state instead of replaying every +# block. Two things decide whether it does anything at all: +# +# - Once the node has finalized state on disk it is ignored, and the node +# logs "Can't use warp sync mode with a partially synced database. +# Reverting to full sync mode." So setting this on a validator that has +# already synced changes nothing — it only does something on a fresh +# volume. (A volume that exists but never got past genesis, e.g. one that +# never found peers, still warps on restart.) +# - It waits for 3 peers before it starts, so on a small --reserved-only +# network it sits idle until enough of them are up. +# +# What it costs: this node does not run --blocks-pruning archive, so the gap +# left behind is backfilled with HEADERS ONLY. It ends up with no block bodies +# before the sync point, permanently. Fine for authoring from here on, not fine +# if this node ever has to serve or replay history. +# +# Only the validator roles take this knob. The rpc and indexer-rpc nodes run +# --blocks-pruning archive, and an archive node refuses to start under warp: +# "Warp sync doesn't work for archive nodes", and the container crash-loops. +# +# SYNC_MODE=--sync warp +SYNC_MODE= + # ─── Telemetry ─────────────────────────────────────────────────────────────── # https://telemetry.orbinum.network — on by default. Publishes name, version, diff --git a/mainnet/validator/docker-compose.yml b/mainnet/validator/docker-compose.yml index a199269..6d142b5 100644 --- a/mainnet/validator/docker-compose.yml +++ b/mainnet/validator/docker-compose.yml @@ -19,6 +19,7 @@ services: --chain /chain-specs/mainnet-spec.json --name "${VALIDATOR_NAME:-Orbinum-Validator}" --base-path /data + ${SYNC_MODE} --listen-addr /ip4/0.0.0.0/tcp/${P2P_PORT:-30333} --validator --node-key ${VALIDATOR_NODE_KEY} diff --git a/testnet/validator/.env.example b/testnet/validator/.env.example index 9033e60..e662b45 100644 --- a/testnet/validator/.env.example +++ b/testnet/validator/.env.example @@ -13,6 +13,35 @@ VALIDATOR_NAME=Choose-Your-Validator-Name # openssl rand -hex 32 VALIDATOR_NODE_KEY= +# ─── Sync ──────────────────────────────────────────────────────────────────── + +# Empty = full sync, which is what a validator should normally run. +# +# `--sync warp` is for bootstrapping a NEW validator on an empty volume: it +# proves finality and fetches the latest state instead of replaying every +# block. Two things decide whether it does anything at all: +# +# - Once the node has finalized state on disk it is ignored, and the node +# logs "Can't use warp sync mode with a partially synced database. +# Reverting to full sync mode." So setting this on a validator that has +# already synced changes nothing — it only does something on a fresh +# volume. (A volume that exists but never got past genesis, e.g. one that +# never found peers, still warps on restart.) +# - It waits for 3 peers before it starts, so on a small --reserved-only +# network it sits idle until enough of them are up. +# +# What it costs: this node does not run --blocks-pruning archive, so the gap +# left behind is backfilled with HEADERS ONLY. It ends up with no block bodies +# before the sync point, permanently. Fine for authoring from here on, not fine +# if this node ever has to serve or replay history. +# +# Only the validator roles take this knob. The rpc and indexer-rpc nodes run +# --blocks-pruning archive, and an archive node refuses to start under warp: +# "Warp sync doesn't work for archive nodes", and the container crash-loops. +# +# SYNC_MODE=--sync warp +SYNC_MODE= + # ─── Telemetry ─────────────────────────────────────────────────────────────── # https://telemetry.orbinum.network — on by default. Publishes name, version, diff --git a/testnet/validator/docker-compose.yml b/testnet/validator/docker-compose.yml index aff8f9a..722df3a 100644 --- a/testnet/validator/docker-compose.yml +++ b/testnet/validator/docker-compose.yml @@ -20,6 +20,7 @@ services: --chain /chain-specs/testnet-spec.json --name "${VALIDATOR_NAME:-Orbinum-Validator}" --base-path /data + ${SYNC_MODE} --listen-addr /ip4/0.0.0.0/tcp/${P2P_PORT:-30333} --validator --node-key ${VALIDATOR_NODE_KEY}