Recreating L2 state from L1 pubdata
Prerequisites
This tool is written in nightly Rust. You can install Rust by following the official instructions here, and then running the following command to switch to the nightly toolchain:
rustup toolchain install nightly
Clone the 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, Infura 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:
Here's what the tool will look like as it's running:
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.
Overview
An in-depth look at how ZKsync ensures data availability through state diffs and compresses data to optimize L1 submissions, plus tools for reconstructing L2 state from L1 public data.
Validiums
Explore the concept of Validiums as a blockchain scaling solution, examining their advantages, risks, and potential use cases, especially in privacy-focused and enterprise applications.