Skip to main content
Full Replay allows a node to catch up on missed blocks by simply retrieving and replaying them serially. This is helpful for nodes that want all intermediary state and transactional artifacts to be generated. For example, an RPC provider would probably want this to ensure that they can respond to requests like eth_call, eth_getBalance, or eth_estimateGas for blocks that were skipped.

Context

A node that has not locally executed block forkpoint.root - delay will statesync on startup (see forkpoint startup sync). Also, nodes don’t serve blocksync requests more than statesync_threshold (600) blocks ago. Statesync is the only in-protocol way for that node to recover. This document describes an alternate way to recover a node while backfilling historical state in the event that a node has been down for longer than the blocksync provision window (600 blocks). Note that if statesync_threshold in node.toml is set to a value larger than that, blocksync will fail.
In order to recover the faulty node with complete historical state, the below procedure requires SSH access to a node that was healthy throughout the faulty node’s downtime.Let REMOTE_HOST be the healthy node that can be used for recovery.

Procedure

  1. SSH into the faulty node as monad user.
  2. Ensure statesync_threshold = 600 in node.toml
  1. Stop the monad services
  1. Run this script to copy missing blocks, then run execution up to that point. You will need to run it several times since the tip of the chain will continue advancing while this script is executing.
    1. NOTE: You will need to manually interrupt the process (Ctrl - C) once output stops.
    2. Copy this script and name it manual-sync.sh
    3. Run the script
  2. Once the first script completes in under 1 min, run this script:
    1. Copy this and name it manual-sync-step-2.sh
    2. Run the script

Check

To check that statesync has been avoided, send an eth_getBlockByNumber RPC request for blocks finalized while the node was down.