> For the complete documentation index, see [llms.txt](https://validium.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://validium.gitbook.io/docs/concepts/data-availability/recreating-l2-state-from-l1-pubdata.md).

# Recreating L2 state from L1 pubdata

***

## Prerequisites

Note: Running the L1 pubdata tool will require approximately 500GB of memory and will take a few days to complete.

This tool is written in nightly Rust. You can install Rust by following the official instructions [here](https://www.rust-lang.org/learn/get-started), and then running the following command to switch to the nightly toolchain:

```
rustup toolchain install nightly
```

Clone the [zksync-state-reconstruct](https://github.com/eqlabs/zksync-state-reconstruct) tool:

```
git clone https://github.com/eqlabs/zksync-state-reconstruct
cd zksync-state-reconstruct
```

## Usage

To start reconstructing the state, run the following command with any valid HTTP/HTTPS Ethereum JSON-RPC endpoint, for example using `https://eth.llamarpc.com`.

You can also use an Ethereum endpoint from [Alchemy,](https://www.alchemy.com/) [Infura](https://www.infura.io/) or any other endpoint provider:

```
cargo +nightly run -- reconstruct l1 --http-url https://eth.llamarpc.com
```

Here's what a successful start of the tool will look like in your terminal:

![L2 state reconstruction start](https://docs.zksync.io/_ipx/q_90/images/zk-stack/l2-state-start.png)

Here's what the tool will look like as it's running:

![L2 state reconstruction running](https://docs.zksync.io/_ipx/q_90/images/zk-stack/l2-state-running.png)

Once the tool has finished syncing, you will only be warned if the published L2 state is not the same as the reconstructed L2 state. If the tool has finished syncing and you have not received any warnings, then the L2 state has been successfully reconstructed.
