Skip to main content
This guide returns a node to the chain head after it stops with wrong Block.Header.AppHash. The error means the node computed a different state from the rest of the network. After an upgrade, the usual cause is a block executed with the wrong binary. The wrong state is already on disk, so replacing the binary is only half of the fix. The node must also undo the bad block or restore its data.

Before you begin

You have a node set up with Run gaiad as a service, and its log shows this error:
The process keeps running after this error, and RPC keeps answering at the same height. A node restarted in this state logs the same wrong Block.Header.AppHash message as Error in validation, then drops its peers. Get two values from the release notes or the upgrade announcement:
  • The version to run, and its commit if one is given.
  • The upgrade height.
Set the node home used by the commands on this page:
The commands name the plain gaiad unit. For the Cosmovisor unit, use cosmovisor in the systemctl and journalctl lines.

Find the binary that failed

  1. Find the path of the running binary. The gaiad on your PATH can be a different file.
    If the process has exited, the plain unit runs /usr/local/bin/gaiad. The Cosmovisor unit runs cosmovisor/current/bin/gaiad under the node home.
  2. Ask the running node for its version.
  3. Set the path from step 1 and print its version and commit.
Compare the output with the release notes. A different version or commit means the wrong binary ran. If the versions from steps 2 and 3 differ, the file was replaced and the node was not restarted. If the versions match the release notes, keep the log of the failure. Continue with the rollback, and report the failure as described in If the error returns.

Protect the signing key

Keep one running node per consensus key, and never replace priv_validator_state.json with an older copy. Either mistake can cause a double sign. A double sign slashes 5 percent of stake and permanently tombstones the validator.
Stop the node and wait for inactive:
With a remote signer, the signer keeps this state. Leave the signer’s state file as it is.

Clear the halt settings

A halt-height at or below the next block stops the node again, even when that height has passed.
Both values must print 0.

Roll back one block

  1. Run the rollback with the binary that failed. A newer binary may expect stores that the old state does not have.
    Success prints Rolled back state to height <height>, one below the height where the node stopped. The block stays on disk, and the node executes it again on restart. The rollback does not change priv_validator_state.json.
  2. Install the correct binary. The plain unit runs /usr/local/bin/gaiad. The Cosmovisor unit runs the file that current points to. Install gaiad covers verification.
  3. Check the version and commit of the installed file against the release notes, as in Find the binary that failed.
  4. Start the node and watch the log.
The committed state lines show a climbing height. Run the rollback once. A second run before the node starts changes nothing. On a validator, the log also shows error signing vote: step regression at height <height> round 0. The signing state blocks a second signature at the rolled-back height and round, so this is not a double sign. On mainnet the validator misses that one signature and signs from the next round or height.

If the error returns

Restore the data from a snapshot or with state sync when the rollback fails or the same error returns. Both need an empty data/ directory. State sync skips a node that already has blocks, and the same error follows. Use data from above the upgrade height. From a lower height, the node runs earlier blocks with the new binary, which can cause the same error.
  1. Stop the node and wait for inactive.
  2. Back up the signing state. Do this now, even if you have an earlier copy, because the node can sign after a restart. If the file already shows height 0, the data was reset before. In that case, skip this step and keep the backup you have.
  3. Reset the data directory. This also resets priv_validator_state.json to height 0.
  4. Load new data with one of these methods. Run the linked commands as the gaia user with --home "$NODE_HOME".
  5. Put the signing state back. A snapshot archive can contain another node’s copy, so do this after extracting.
  6. If the rollback failed, install and check the correct binary now, as in steps 2 and 3 of Roll back one block.
  7. Start the node.
With state sync, the Discovered new snapshot lines must name a height above the upgrade height. Once the node has synced, set statesync.enable back to false. If the correct binary produced the error, ask for help in the validator channels on the Interchain Discord. Include the version --long output, the abci_info response, the log of the failure, and the recovery method you used.

Verify

The version matches the release notes. The height climbs past the block that failed, and catching_up is false. On a validator, check for a jail after the node has caught up:
With a remote signer, the local key is not the validator’s key. Pass the signer’s public key or the cosmosvalcons address to signing-info instead. If the validator query shows jailed: true, wait until the jailed_until time in the signing info passes. Then follow Unjail.

Next

Upgrade a node covers the checks before the next upgrade. Monitoring covers alerts for a node that stops.