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: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.
gaiad unit. For the Cosmovisor unit, use cosmovisor in the systemctl and journalctl lines.
Find the binary that failed
-
Find the path of the running binary. The
gaiadon yourPATHcan be a different file.If the process has exited, the plain unit runs/usr/local/bin/gaiad. The Cosmovisor unit runscosmovisor/current/bin/gaiadunder the node home. -
Ask the running node for its version.
-
Set the path from step 1 and print its version and commit.
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.inactive:
Clear the halt settings
Ahalt-height at or below the next block stops the node again, even when that height has passed.
0.
Roll back one block
-
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 changepriv_validator_state.json. -
Install the correct binary. The plain unit runs
/usr/local/bin/gaiad. The Cosmovisor unit runs the file thatcurrentpoints to. Install gaiad covers verification. - Check the version and commit of the installed file against the release notes, as in Find the binary that failed.
-
Start the node and watch the log.
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 emptydata/ 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.
-
Stop the node and wait for
inactive. -
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.
-
Reset the data directory. This also resets
priv_validator_state.jsonto height 0. -
Load new data with one of these methods. Run the linked commands as the
gaiauser with--home "$NODE_HOME".-
Snapshot: download and verify an archive, then extract it into the node home.
- State sync: fetch the trust values and write the configuration, and do not start the node yet. The trust height must be above the upgrade height.
-
Snapshot: download and verify an archive, then extract it into the node home.
-
Put the signing state back. A snapshot archive can contain another node’s copy, so do this after extracting.
- If the rollback failed, install and check the correct binary now, as in steps 2 and 3 of Roll back one block.
-
Start the node.
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
catching_up is false.
On a validator, check for a jail after the node has caught up:
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.