# Testnet Chain Sync Issue

{% hint style="info" %}
This guide will walk you through how to resolve the issue when your **Testnet** node has stopped to sync chain data at block **#336,000**.
{% endhint %}

<details>

<summary>Error logs that might have been printed</summary>

```sh
2022-10-23 01:41:12 Proposing failed: Import failed: Error at calling runtime api: Execution failed: Execution aborted due to trap: wasm trap: wasm `unreachable` instruction executed
WASM backtrace:

    0: 0x24bfd9 - <unknown>!rust_panic
    1: 0x24bfd2 - <unknown>!std::panicking::rust_panic_with_hook::hd20dbb32ccf2960c
    2: 0x24bc3d - <unknown>!std::panicking::begin_panic_handler::{{closure}}::h6f71c047f903cff6
    3: 0x24bb87 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::hbb6ee37c9cb141a4
    4: 0x24bc85 - <unknown>!rust_begin_unwind
    5: 0x1b2a32 - <unknown>!core::panicking::panic_fmt::ha6d5b6466ab38e11
    6: 0x1b2e05 - <unknown>!core::result::unwrap_failed::h7aa4a6c45486df8b
    7: 0xaa870 - <unknown>!<(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize::h93502e603e15f2d8
    8: 0x11fe6d - <unknown>!<(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize::had430e6d91ca4c07
    9: 0x41118 - <unknown>!<(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize::h58cc151aae952149
   10: 0xe7221 - <unknown>!<(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize::hedbe5eed270208e6
   11: 0x182c1c - <unknown>!frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPalletsWithSystem,COnRuntimeUpgrade>::initialize_block::h8d01681df137b3e8
   12: 0x102be8 - <unknown>!Core_initialize_block
```

</details>

## **1. Synchronization Using Snapshot (Recommended)**

{% hint style="info" %}
Currently if your node is running in full-mode (non-archive mode), instead of this step you should follow to section [#id-2.-synchronization-from-the-genesis-block](#id-2.-synchronization-from-the-genesis-block "mention")
{% endhint %}

The Bifrost Network provides snapshots of the chain data. Snapshots are updated at regular intervals. This allows node operators to spend less time on data synchronization and reduce the load on the network.

1. Follow the [link](https://github.com/bifrost-platform/bifrost-snapshots), and complete the snapshot download & export process.
2. Return to the process in the operation manual once complete.

## **2. Synchronization from the Genesis Block**

This method does not require downloading snapshots. This section works for both archive and full modes.

#### 1. Block 0 to 336115

For initial synchronization, utilize [bifrost-node 1.0.2](https://github.com/bifrost-platform/bifrost-node/releases/tag/v1.0.2) up to at least block 336115.

```bash
wget "https://github.com/bifrost-platform/bifrost-node/releases/download/v1.0.2/bifrost-node"
wget "https://github.com/bifrost-platform/bifrost-node/releases/download/v1.0.2/bifrost-testnet.json"
chmod +x bifrost-node

mv bifrost-node bifrost-testnet.json <YOUR-BASE-PATH-DIRECTORY>
cd <YOUR-BASE-PATH-DIRECTORY>

# For archive-mode
./bifrost-node --base-path ./ --chain ./bifrost-testnet.json --port 30333 --pruning archive --runtime-cache-size 128
# For full-mode (remove --pruning option)
./bifrost-node --base-path ./ --chain ./bifrost-testnet.json --port 30333 --runtime-cache-size 128
```

After start running your node, it will start to synchronize chain data from the genesis block as below. (In some cases, error logs might be displayed, but for now, those are fine to ignore)

<figure><img src="/files/EjaSDfnoYdZ5kdyhg0o8" alt=""><figcaption><p>Until the number following ‘best’ goes higher than 336115.</p></figcaption></figure>

#### 2. Block 336115 onwards

Once synchronization reaches block 336115, utilize [the latest version of bifrost-node](https://github.com/bifrost-platform/bifrost-node/releases).

```bash
# After terminate existing bifrost-node

cd <YOUR-BASE-PATH-DIRECTORY>
rm bifrost-node
wget https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-node
wget https://github.com/bifrost-platform/bifrost-node/releases/latest/download/bifrost-testnet.json
chmod +x bifrost-node

# For archive-mode (the option name for --pruning has changed to --state-pruning)
./bifrost-node --base-path ./ --chain ./bifrost-testnet.json --port 30333 --state-pruning archive --runtime-cache-size 128
# For full-mode (remove --state-pruning option)
./bifrost-node --base-path ./ --chain ./bifrost-testnet.json --port 30333 --runtime-cache-size 128
```

After restarting your node, in some cases, error logs might be displayed as before, however it is fine to ignore.

#### 3. Complete synchronization

<figure><img src="/files/jhNWBHN8sil3VnmtqGXW" alt=""><figcaption></figcaption></figure>

Synchronization is complete once “Syncing” does not appear in the log. Return to the process on the operation manual.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bifrostnetwork.com/bifrost-network/running-a-node/guide-for-operators/trouble-shooting/testnet-chain-sync-issue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
