Kroma MPT Migration Guide
This is a guide on how to transition from ZK Trie to MPT and zkEVM to zkVM
Node Migration
Starting from the KromaMPT hard fork block, MPT (Merkle Patricia Trie) will replace ZK Trie. All node operators must migrate the entire state data to MPT. The migration process will occur automatically upon upgrading the node to the latest version, as long as it is done before the KromaMPT hard fork block.
For Validator Node Operators:
You must complete the upgrade and migration process before the KromaMPT hard fork. Nodes that fail to complete the migration will submit incorrect outputs after the hard fork and may lose staked assets due to challenges.
For Nodes Not Meeting Minimum Requirements or Skipping Migration:
Refer to the migration deactivation option. Alternatively, you can set up a new node using the snapshot provided after the KromaMPT hard fork block.
Minimum Requirements
To ensure smooth migration during the KromaMPT hard fork, the following minimum specifications are recommended:
Processor: 4+ cores CPU
A CPU with 4 or more cores is recommended as block production and state data migration occur simultaneously.
Memory: 16GB+
At least 16GB of memory is required due to high memory usage during the state data migration to MPT.
Storage: 1TB+ SSD
Prepare a high-speed SSD of 1TB or more, as the database size will increase after migration.
Note: These are minimum recommended specifications. Higher specs will result in faster migration.
Guide for Full Node Operators
Using kroma-up (Recommended)
Upgrade to kroma-up v2.1.0+geth.v0.6.0
Update the kroma-up repository to v2.1.0+geth.v0.6.0 (use git pull or clone the repository and git checkout v2.1.0+geth.v0.6.0).
Follow the Guide
Refer to the guide provided in the repository for detailed steps.
For more information on node operation using kroma-up, check here.
Using Docker Images
Update Docker Images
Download the latest images from Docker Hub:
kromanetwork/geth:v0.6.0
kromanetwork/node:v2.1.0
Restart the Node
Restart the node using the updated images.
Modify rollup.json
Edit the rollup.json file to add the "kroma_mpt_time" field under "ecotone_time".
Mainnet Example:
Sepolia Example:
If you are unsure how to edit, refer to the respective JSON files:
Mainnet: mainnet/rollup.json
Sepolia: sepolia/rollup.json
Guide for Validator Node Operators
After the KromaMPT hard fork, Kroma will transition from the zkEVM Fault Proof system to the zkVM Fault Proof system. Validators using challenger mode will require additional configurations.
Environment Variable Changes
Some environment variable names have been updated. Check these in kroma-up/envs/{network}/validator.env.
Before
After
VALIDATOR_CHALLENGER_POLL_INTERVAL
VALIDATOR_CHALLENGE_POLL_INTERVAL
VALIDATOR_FETCHING_PROOF_TIMEOUT
VALIDATOR_CHALLENGER_ZKEVM_NETWORK_TIMEOUT
VALIDATOR_PROVER_RPC
VALIDATOR_CHALLENGER_ZKEVM_PROVER_RPC
Settings for zkVM Proofs
When challenger mode is enabled, you must set the following RPC values in the .env file:
KROMA_VALIDATOR__ZKVM_PROVER_PROXY_RPC
KROMA_VALIDATOR__ZKVM_WITNESS_GENERATOR_RPC
Example:
Optional: Historical RPC Settings
If querying past state data (blocks prior to the KromaMPT hard fork) is needed, configure Historical RPC endpoints.
Using kroma-up:
Edit .env to add:
Direct Node Operations:
Add the flag --rollup.historicalrpc="<RPC Endpoint>" when running Geth:
Note: Nodes without Historical RPC cannot submit outputs containing blocks prior to the KromaMPT hard fork.
Migration Deactivation Option
If the node does not meet the minimum specs or migration is unnecessary (e.g., for Historical RPC-only nodes), migration can be deactivated.
Using kroma-up:
Set the following in .env:
Direct Node Operations:
Add the flag --kroma.migration.disable=true.
Caution: Nodes with migration disabled will stop syncing blocks after the KromaMPT hard fork.
Block Sync for Disabled Nodes
Nodes with disabled migration must use snapshots available after the KromaMPT hard fork to set up a new node. Note that these nodes cannot generate blocks during the transition period.
Snapshots will be updated within:
Sepolia: Up to 2 hours post-hard fork.
Mainnet: TBD.
Regular snapshots will also be available daily at 00:00 UTC.
Hard Fork Schedule
Kroma Mainnet: TBD
Kroma Sepolia: Jan 17th 2024, 05:00 UTC
Steps to Configure a Historical RPC Node
Complete Steps 1-4 for a Full Node Setup
Follow the Full Node setup process, excluding Step 5: Start a Full Node.
Edit the .env File
Open the .env file with a text editor and modify the following values:
Update IMAGE_TAG__KROMA_GETH and IMAGE_TAG__KROMA_NODE to the specified versions.
If these are already set to the versions below, proceed to the next step.
Disable MPT Migration
Locate the KROMA_GETH__DISABLE_MPT_MIGRATION field in the .env file and set its value to true.
Start the Historical RPC Node
Perform Step 5: Start a Full Node to run the Historical RPC node.
Key Notes for Historical RPC Nodes
Historical RPC nodes have MPT migration disabled by default and will not sync to the latest blocks after the KromaMPT hard fork.
To minimize unnecessary resource usage, it is recommended to stop the kroma-node service.
Command to stop the service:
Prover Migration
From the KromaMPT hard fork, Kroma’s state tree will transition from ZKTrie to MPT (Merkle Patricia Trie). Kroma employs zk proofs during the challenge process to correct invalid L2 outputs submitted to L1. Before the KromaMPT hard fork, the zkEVM Prover generated zk proofs for Kroma using ZKTrie. Post-hard fork, zk proofs will be generated using the zkVM Prover, which supports Kroma’s MPT-based state.
To achieve this, two components are required:
Witness Generator: Provides the input (witness) required to generate SP1 proofs.
Prover Proxy: Sends the witness and the target guest program to the SP1 prover network to obtain the proof.
This guide outlines the steps to upgrade the Challenger component for the KromaMPT hard fork.
Minimum Requirements
Witness Generator
Processor: 4+ cores CPU
Memory: 4GB+
Storage: 100GB+ (SSD or HDD)
Prover Proxy
Processor: 2+ cores CPU
Memory: 2GB+
Storage: 50GB+ (SSD or HDD)
Environment Variable Configuration
Witness Generator
Ensure the following configurations are included in the .env file:
L1_RPC and L2_RPC must have the debug API enabled.
If running the witness generator before the MPT time, ensure ROLLUP_CONFIG_FROM_FILE is set to true. Check the MPT time for each network.
MAX_BATCH_POST_DELAY_MIN represents the maximum batch interval for the batcher. This varies by network:
KromaHolsky: 20
KromaSepolia: 20
KromaMainnet: 20
Note: The relationship between MAX_BATCH_POST_DELAY_MIN and BATCHER_MAX_CHANNEL_DURATION is: MAX_BATCH_POST_DELAY_MIN = BATCHER_MAX_CHANNEL_DURATION * 12 / 60.
Set SKIP_SIMULATION to true to enable self-verification of the generated witness. If your system has fewer than 8 CPU cores, it is recommended to set it to false.
Prover Proxy
Include the following configuration in the .env file:
Please note that the SP1 API Key is now only provided who are whitelisted. Succinct team will make it publicly accessible within a few weeks.
Using Docker Images
Download Docker Images
Obtain the latest or specified versions of the images from Docker Hub:
zkp/witness-gen:v1
zkp/prover-proxy:v1
Run Docker Containers
Witness Generator:
Prover Proxy:
Using Source Code
For source code setup, refer to the README.md file in the kroma-sp1-prover repository.
With this guide, you can prepare the Witness Generator and Prover Proxy components to ensure proper zkVM-based zk proof generation for the KromaMPT hard fork.
Last updated