Validator operator monitoring restaking positions on laptop, network status dashboard visible, clean home office setup, afternoon light.
Protocols

Cosmovisor Setup and One-Shot Upgrade Process

A step-by-step operational guide for configuring Cosmovisor to automate binary upgrades during dYdX network halts. Covers directory structure, environment variables, and a pre-flight checklist to ensure hands-off upgrades and avoid slashing.
introduction
AUTOMATED UPGRADE OPERATIONS

Introduction

How validators configure Cosmovisor to automate dYdX chain binary upgrades during network halts, eliminating manual intervention and reducing slashing risk.

Cosmovisor is a process manager for Cosmos SDK-based chains that enables validators to perform hands-off binary upgrades during scheduled network halts. For dYdX chain operators, configuring Cosmovisor correctly is the primary defense against downtime penalties and slashing events that occur when a validator fails to switch to the correct binary at the designated upgrade height. The tool monitors the running node, detects when an upgrade proposal passes and reaches its halt height, swaps in the pre-staged binary, and restarts the node with the new version—all without operator wake-up calls.

The operational model relies on a strict directory structure where upgrade binaries are placed in named subdirectories matching the on-chain upgrade plan name. A one-shot upgrade refers to a standard Cosmovisor pattern where the binary is placed in the upgrades/<name>/bin/ directory ahead of the halt. When the chain halts, Cosmovisor executes the new binary and exits, handing control back to systemd or the configured supervisor. This pattern is distinct from the auto-download feature, which many institutional validators disable for security and auditability reasons. Operators must set environment variables—DAEMON_NAME, DAEMON_HOME, and DAEMON_ALLOW_DOWNLOAD_BINARIES—and ensure the cosmovisor binary itself is the entry point in their service definition.

A misconfigured Cosmovisor setup—incorrect binary naming, wrong directory permissions, or a missing upgrade-info.json—can cause a validator to miss the upgrade window entirely, leading to jail time and significant revenue loss. Chainscore Labs validates Cosmovisor configurations pre-upgrade, auditing directory structures, service files, and environment variables against the specific upgrade plan. For teams running institutional validators, this pre-flight review is a low-cost insurance policy against the most common cause of downtime during coordinated network upgrades.

COSMOVISOR OPERATIONS

Quick Facts

Key operational facts for configuring Cosmovisor to automate dYdX chain binary upgrades and avoid slashing during network halts.

FieldValueWhy it matters

Cosmovisor binary

Part of the Cosmos SDK tooling suite

Must be installed separately from the dydxprotocold daemon; it manages the daemon's lifecycle.

Core directory structure

DAEMON_HOME/cosmovisor/{genesis, upgrades, current}

Incorrect directory setup is the most common cause of upgrade failure. The current directory must point to the active binary.

DAEMON_NAME environment variable

dydxprotocold

Cosmovisor must know which binary to restart. An incorrect value will cause the process manager to fail silently.

DAEMON_ALLOW_DOWNLOAD_BINARIES

Recommended: false for mainnet validators

Setting to true introduces a supply-chain risk. Validators should manually build and verify binaries from the canonical dYdX repository.

UNSAFE_SKIP_BACKUP

Recommended: false

Setting to true skips the automatic backup of the data directory before an upgrade, removing a critical rollback safety net.

One-shot upgrade trigger

A governance proposal that passes and specifies an upgrade height

Cosmovisor watches for the halt at the specified height, swaps the binary, and restarts. Failure to configure correctly results in downtime and potential slashing.

Pre-flight validation

Run cosmovisor version and verify the current symlink

A simple check that prevents a validator from reaching the upgrade halt and failing to restart with the correct binary.

Post-upgrade health check

Monitor CometBFT consensus round metrics and node logs

Even with a successful binary swap, a validator can miss blocks if the new version has a performance regression or misconfiguration.

technical-context
AUTOMATED BINARY SWAP FOR NETWORK HALTS

How Cosmovisor Executes a One-Shot Upgrade

A technical walkthrough of how Cosmovisor automates the dYdX chain binary replacement at a predefined block height, enabling validators to perform hands-off upgrades and avoid consensus failures.

Cosmovisor is a process manager designed to automate the execution of on-chain software upgrade proposals for Cosmos SDK-based chains like dYdX. When a governance proposal to upgrade the network passes, it specifies a Plan containing a name and a block height at which the chain will halt. Cosmovisor monitors the running node and, upon detecting that the chain has committed the halt block, terminates the current dydxprotocold process, swaps the binary with the new version specified in the upgrade plan, and restarts the node with the new binary. This 'one-shot' upgrade mechanism is the standard method for validators to avoid downtime and potential slashing during coordinated network upgrades.

The operational logic relies on a strict directory structure and environment variables. The DAEMON_HOME directory must contain a cosmovisor/ subdirectory with genesis/bin/, upgrades/<upgrade_name>/bin/, and a current/ symlink. When Cosmovisor starts, it points the current/ symlink to the genesis/bin/ folder. Upon reaching the upgrade height, it reads the upgrade-info.json file written by the application, identifies the correct upgrades/<upgrade_name>/bin/ directory, and atomically updates the current/ symlink to point to the new binary before restarting the node. A critical pre-flight check is ensuring the new binary is placed in the correct directory and is executable well before the upgrade height is reached; failure to do so will cause the node to halt and wait indefinitely for manual intervention.

For dYdX validators, a misconfigured Cosmovisor setup during a network upgrade is a primary vector for extended downtime and slashing penalties. The process is unforgiving of path errors, permission issues, or incorrect binary naming. Chainscore Labs can validate Cosmovisor configurations, perform pre-upgrade dry-runs on testnet, and audit the operational readiness of validator infrastructure to ensure that the one-shot upgrade executes flawlessly, preventing service disruption for traders and downstream integrators.

COSMOVISOR UPGRADE IMPACT

Affected Operators and Systems

Validator Operators

Validator operators are the primary actors affected by Cosmovisor configuration. An incorrect setup—missing binaries, wrong permissions, or misconfigured environment variables—will cause a validator to miss the upgrade halt and stop signing blocks. This results in downtime slashing and potential jail time.

Pre-Upgrade Checklist:

  • Verify the DAEMON_HOME and DAEMON_NAME environment variables match the systemd service file.
  • Ensure the cosmovisor/ directory structure includes genesis/bin, upgrades/<name>/bin, and that the new binary is placed in the correct upgrade folder before the halt height.
  • Run cosmovisor version to confirm the binary is executable and the correct architecture.
  • Test the one-shot upgrade on a testnet or devnet node before mainnet activation.

Chainscore can validate your Cosmovisor directory layout, systemd unit file, and upgrade plan to prevent jail time during coordinated network halts.

implementation-impact
COSMOVISOR READINESS

Pre-Upgrade Configuration and Validation

A pre-flight checklist for validators to ensure Cosmovisor is correctly configured to automate the dYdX chain binary upgrade at the specified halt height, preventing downtime and slashing.

01

Verify Directory Structure and Permissions

Confirm the Cosmovisor directory tree is correct: $HOME/.dydxprotocol/cosmovisor/ must contain genesis/bin/dydxprotocold and upgrades/<name>/bin/dydxprotocold for the upcoming upgrade. The current symlink should point to the genesis directory. Validate that the dydxprotocold binary in the upgrade folder is executable by the cosmovisor user. A mismatch in the upgrade folder name and the plan name in the governance proposal will cause the upgrade to fail.

02

Validate Binary Version and Checksum

Do not rely solely on the file name. Run dydxprotocold version on the new binary placed in the upgrade directory to confirm it matches the official release tag. Compute the SHA256 checksum and compare it against the published checksum in the release notes. This prevents a corrupted download or a man-in-the-middle attack from causing a consensus failure at the halt height. Operators should automate this check in their deployment scripts.

03

Set DAEMON_ALLOW_DOWNLOAD_BINARIES to False

For production validators, the environment variable DAEMON_ALLOW_DOWNLOAD_BINARIES must be set to false. Setting it to true introduces a critical security and reliability risk by allowing Cosmovisor to download and execute a binary from a URL specified in the on-chain upgrade plan. An incorrect or malicious URL could halt the validator. Always provision the binary manually and validate it.

04

Configure Automatic Restart with systemd

Ensure the cosmovisor run start command is wrapped in a systemd service with Restart=on-failure and a reasonable RestartSec delay. At the upgrade halt height, Cosmovisor will stop the current binary, swap the symlink, and exit. The systemd service manager must restart the process to launch the new binary. Without this, the node will remain stopped indefinitely, causing missed blocks and potential slashing.

05

Run a Testnet Upgrade Rehearsal

The most effective validation is a full rehearsal on the dYdX public testnet. Deploy the exact same Cosmovisor configuration and systemd unit file to a testnet node. Monitor the node's behavior at the upgrade halt height: it should stop, swap the binary, and restart without manual intervention. This catches environment-specific issues like missing libraries or incorrect user permissions before they can affect mainnet operations.

COSMOVISOR OPERATIONAL RISK

Common Failure Modes and Mitigations

Pre-upgrade checklist of common misconfigurations and runtime failures that can cause a validator to miss the upgrade halt or double-sign, and the corresponding mitigation for each.

AreaFailure ModeWho is affectedAction

Directory Structure

Cosmovisor binary path does not match the expected genesis or upgrade binary location

Validators, Node Operators

Verify $DAEMON_HOME/cosmovisor/genesis/bin and /upgrades/<name>/bin paths contain the correct binary

Environment Variables

DAEMON_ALLOW_DOWNLOAD_BINARIES is set to true in a production environment

Validators, Node Operators

Set DAEMON_ALLOW_DOWNLOAD_BINARIES=false to prevent automatic download of untested binaries

Environment Variables

DAEMON_HOME is not exported or points to the wrong node home directory

Validators, Node Operators

Confirm DAEMON_HOME matches the --home flag used by the node daemon

Upgrade Plan

Upgrade info is missing, has an incorrect block height, or an invalid binary checksum

Validators, Node Operators

Query the on-chain upgrade plan and manually verify the name and expected height match the local /upgrades/ directory

Process Management

Cosmovisor is not running as a systemd service and does not restart after a reboot

Validators, Node Operators

Configure a systemd service file with Restart=on-failure and a start limit to prevent infinite restart loops

Disk Space

Insufficient disk space to store the new binary and a backup of the old binary

Validators, Node Operators

Ensure free disk space is at least 2x the size of the uncompressed binary before the upgrade height

Backup

No backup of priv_validator_state.json is taken before the upgrade halt

Validators, Node Operators

Back up the entire data/ directory, especially priv_validator_state.json, to prevent double-signing on recovery

Monitoring

No alert is configured for missed blocks or a halted node after the upgrade height

Validators, Node Operators

Set up a Prometheus alert on tendermint_consensus_height to trigger if the node stops producing blocks post-upgrade

COSMOVISOR READINESS

Pre-Upgrade Operator Checklist

A pre-flight checklist to validate that Cosmovisor is correctly configured to perform a hands-off, automated binary upgrade at the specified halt height. Completing these checks reduces the risk of missing the upgrade window and incurring downtime slashing.

Confirm that the DAEMON_HOME environment variable is set correctly and that the cosmovisor/ directory contains the required subdirectories: genesis/bin/, upgrades/<upgrade_name>/bin/, and data/. The genesis/bin/ directory must contain the current running binary (dydxprotocold). The upgrades/<upgrade_name>/bin/ directory must contain the new binary for the upcoming upgrade, and the <upgrade_name> must match the name field in the on-chain upgrade plan exactly, including case.

Why it matters: An incorrect directory name or missing binary is the most common cause of Cosmovisor upgrade failures. If Cosmovisor cannot find the new binary, the node will stall at the halt height.

Readiness signal: Running ls $DAEMON_HOME/cosmovisor/upgrades/<upgrade_name>/bin/dydxprotocold returns the new binary file with execute permissions.

Chains We Build On

Looking to build on a specific blockchain?

We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.

EVM ecosystems

  • Ethereum logo
    Ethereum
  • Arbitrum logo
    Arbitrum
  • Optimism logo
    Optimism
  • Polygon logo
    Polygon
  • Avalanche logo
    Avalanche
  • Cronos logo
    Cronos

Non-EVM ecosystems

  • Solana logo
    Solana
  • Sui logo
    Sui
  • Aptos logo
    Aptos
  • Hedera logo
    Hedera
  • Stellar logo
    Stellar
  • NEAR logo
    NEAR

Additional ecosystems

  • Polkadot logo
    Polkadot
  • Cosmos logo
    Cosmos
  • TON logo
    TON
  • Cardano logo
    Cardano
  • Algorand logo
    Algorand
  • Tempo logo
    Tempo

Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.

COSMOVISOR OPERATIONS

Frequently Asked Questions

Common operational questions about configuring, testing, and troubleshooting Cosmovisor for dYdX protocol upgrades.

Cosmovisor requires a specific directory layout to locate binaries for the current version and upcoming upgrades.

  • Base directory: $HOME/.dydxprotocol/cosmovisor
  • Genesis binary: $HOME/.dydxprotocol/cosmovisor/genesis/bin/dydxprotocold
  • Current upgrade binary: $HOME/.dydxprotocol/cosmovisor/upgrades/<upgrade-name>/bin/dydxprotocold

The current directory is a symlink managed automatically by Cosmovisor. You should never manually create or modify it.

Pre-flight check: Run cosmovisor version and verify it reports the expected Cosmovisor binary version, not the node version.

Trusted by Industry Leaders

Delivering blockchain solutions for 5+ years.

We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.

Selected Partners & Clients

ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
“I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
L
Lee Erswell
CEO, Telos Foundation
how to get started

How to get started?

If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.

01

Exploration & Strategy

Define your product goals and choose the right blockchain architecture for your use case.

02

Architecture & Design

Design the smart contracts, tokenomics, and security parameters of your system.

03

Development & Integration

Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.

04

Security & Launch

Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.

Start a build

Need a blockchain engineering team?

Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.