Docs

eth_syncing - Base RPC Method

Check the sync status of your Base node. Returns sync progress or false when fully synced — essential for node health monitoring and dApp reliability.

Returns the sync status of your Base node — either false when fully synced, or an object describing the sync progress.

Why Base? Build on Coinbase's L2 with 54% of L2 market revenue and direct access to 110M+ Coinbase users with $8B+ TVL, $0.08 gas fees, built-in Coinbase distribution, and seamless fiat rails.

When to Use This Method

eth_syncing is essential for consumer app developers, SocialFi builders, and teams seeking easy fiat onramps:

  • Node Health Checks — Verify your node is fully synced before processing transactions
  • Sync Progress Monitoring — Track how far behind your node is during initial sync or after downtime
  • Load Balancer Routing — Route requests only to fully synced nodes in multi-node setups
  • dApp Reliability — Display sync warnings to users when data may be stale

Code Examples

Common Use Cases

1. Node Health Monitor

Continuously check sync status and alert on issues:

JavaScript
async function monitorNodeHealth(provider, interval = 30000) {
  setInterval(async () => {
    const syncing = await provider.send('eth_syncing', []);

    if (syncing === false) {
      const blockNumber = await provider.getBlockNumber();
      const block = await provider.getBlock(blockNumber);
      const age = Date.now() / 1000 - block.timestamp;

      if (age > 60) {
        console.warn(`Node synced but block is ${age.toFixed(0)}s old`);
      } else {
        console.log(`Healthy — block ${blockNumber}`);
      }
    } else {
      const current = parseInt(syncing.currentBlock, 16);
      const highest = parseInt(syncing.highestBlock, 16);
      console.warn(`Syncing: ${highest - current} blocks behind`);
    }
  }, interval);
}

2. Wait for Sync Before Processing

Block application startup until the node is ready:

JavaScript
async function waitForSync(provider, pollInterval = 5000) {
  while (true) {
    const syncing = await provider.send('eth_syncing', []);

    if (syncing === false) {
      console.log('Node synced — ready to process transactions');
      return;
    }

    const current = parseInt(syncing.currentBlock, 16);
    const highest = parseInt(syncing.highestBlock, 16);
    console.log(`Waiting for sync: ${highest - current} blocks remaining...`);
    await new Promise(r => setTimeout(r, pollInterval));
  }
}

Error Handling

Error CodeDescriptionSolution
-32603Internal errorNode may be starting up — retry after delay
-32005Rate limit exceededReduce polling frequency