September 18th, 2023

<aside> 💡 Note: Partners need to rehash their L2 block hashes from genesis using the below instructions & snapshots

</aside>

Requirements:

PostgreSQL pg_restore v15.4 → Important go version v1.19.13

zkevm-node v0.3.0

Prover/Executor v2.2.0

Please follow the steps below to rehash the network using snapshots:

1- Download snapshots from these links:

https://zkevm-mai.s3.eu-west-1.amazonaws.com/zkevmmainnetdbhash_1695053524_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz

https://zkevm-mai.s3.eu-west-1.amazonaws.com/zkevmmainnetdbstate_1695050997_v0.3.0-1-g375bffaf_375bffaf.sql.tar.gz

2- Review the config file from the Node (node.config.toml file) and configure the parameters to connect to the HashDB (Prover) and StateDB (Node):

[HashDB] User = "prover_user" Password = "prover_pass" Name = "prover_db" Host = "zkevm-state-db" Port = "5432" EnableLog = false MaxConns = 200

[StateDB] User = "state_user" Password = "state_password" Name = "state_db" Host = "zkevm-state-db" Port = "5432" EnableLog = false MaxConns = 200

3- Make sure that the the data dir. folders of db, statedb and hashdb are completely removed as this is mandatory and the commands will produce errors otherwise. If present, the directories can be removed by command the rm -rf datadir combined with the right path and name of the directory.

4- Download:

https://github.com/0xPolygonHermez/zkevm-node/releases/download/v0.3.0/mainnet.zip

5- Uncompress the file and run cd mainnet

6- Create the .env file with the next content. Make sure the variable ZKEVM_NODE_ETHERMAN_URL is right

ZKEVM_NETWORK = "mainnet"

# URL of a JSON RPC for mainnet
ZKEVM_NODE_ETHERMAN_URL = "https://l1_node/"

# PATH WHERE THE STATEDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_STATEDB_DATA_DIR = "./data/statedb" #Use a path that does not exist to force to create it

# PATH WHERE THE POOLDB POSTGRES CONTAINER WILL STORE PERSISTENT DATA
ZKEVM_NODE_POOLDB_DATA_DIR = "./data/pooldb"

# OPTIONAL, UNCOMENT IF YOU WANT TO DO ADVANCED CONFIG
# ZKEVM_ADVANCED_CONFIG_DIR = "/should/be/same/path/as/ZKEVM_CONFIG_DIR"

7- Inside the mainnet folder, run the next command to start the stateDB and hashDB: