WeaveVM (WVM)
  • WeaveVM (WVM)
  • About WeaveVM
    • Overview
    • Network Releases Nomenclature
    • WeaveVM Alphanets
    • Key Features
    • ELI5
  • Using WeaveVM
    • Compatibility
    • Network configurations
    • WeaveVM Bundler
    • WeaveVM Bundler Gateways
    • wvm:// Data Protocol
    • WeaveVM Precompiles
    • WeaveVM-Native JSON-RPC Methods
    • Self-Hosted RPC Proxies
      • Rust Proxy
      • JavaScript Proxy
    • Code & Integrations Examples
      • ether-rs
      • ethers (etherjs)
      • Deploying an ERC20 Token
  • WeaveVM for evm chains
    • Ledger Archiver (any chain)
    • Ledger Archivers: State Reconstruction
    • DA ExEx (Reth-only)
    • Deploying OP-Stack Rollups
  • WeaveVM ExEx
    • About ExExes
    • ExEx.rs
    • WeaveVM ExExes
      • MLExEx
      • Google BigQuery ETL
      • Borsh Serializer
      • Arweave Data Uploader
      • WeaveVM DA ExEx
      • WeaveVM WeaveDrive ExEx
  • WeaveVM Arweave Data Protocols
    • WeaveVM-ExEx Data Protocol
    • WeaveVM Precompiles Data Protocol
  • DA Integrations
    • WeaveVM-EigenDA Proxy Server
    • WeaveVM - Dymension.xyz: DA client for RollAP
  • WeaveVM Stack Hacks
    • About WeaveVM Stack Hacks
    • Data Availability Hacks
  • MEM Lambda
    • About MEM
    • About MEM Lambda
    • Parallel Execution
    • MEM Lambda Sequencer
    • Contract Example: Counter
  • WeaveVM R&D
    • About R&D
    • elciao
    • ERC-7689
    • WeaveVM & VACP
  • Sunset Network Versions
    • About Sunset Network Versions
    • WeaveVM Alphanet V1
Powered by GitBook
On this page
  • Understanding the World State Trie
  • Reconstructing the World State with WeaveVM Archivers
  1. WeaveVM for evm chains

Ledger Archivers: State Reconstruction

Reconstruction an EVM network using using its wvm-archiver node instance

PreviousLedger Archiver (any chain)NextDA ExEx (Reth-only)

Last updated 2 months ago

Understanding the World State Trie

The World State Trie, also known as the Global State Trie, serves as a cornerstone data structure in Ethereum and other EVM networks. Think of it as a dynamic snapshot that captures the current state of the entire network at any given moment. This sophisticated structure maintains a crucial mapping between account addresses (both externally owned accounts and smart contracts) and their corresponding states.

Each account state in the World State Trie contains several essential pieces of information:

  • Current balance of the account

  • Transaction nonce (tracking the number of transactions sent from this account)

  • Smart contract code (for contract accounts)

  • Hash of the associated storage trie (linking to the account’s persistent storage)

This structure effectively represents the current status of all assets and relevant information on the EVM network. Each new block contains a reference to the current global state, enabling network nodes to efficiently verify information and validate transactions.

EVM Tries

The Dynamic Nature of State Management

An important distinction exists between the World State Trie database and the Account Storage Trie database. While the World State Trie database maintains immutability and reflects the network’s global state, the Account Storage Trie database remains mutable with each block. This mutability is necessary because transaction execution within each block can modify the values stored in accounts, reflecting changes in account states as the blockchain progresses.

Reconstructing the World State with WeaveVM Archivers

The core focus of this article is demonstrating how WeaveVM Archivers’ data lakes can be leveraged to reconstruct an EVM network’s World State. We’ve developed a proof-of-concept library in Rust that showcases this capability using a customized Revm wrapper. This library abstracts the complexity of state reconstruction into a simple interface that requires just 10 lines of code to implement.

Here’s how to reconstruct a network’s state using our library:

use evm_state_reconstructing::utils::core::evm_exec::StateReconstructor;  
use evm_state_reconstructing::utils::core::networks::Networks;  
use evm_state_reconstructing::utils::core::reconstruct::reconstruct_network;  
use anyhow::Error;

async fn reconstruct_state() -> Result<StateReconstructor, Error> {  
    let network: Networks = Networks::metis();  
    let state: StateReconstructor = reconstruct_network(network).await?;  
    Ok(state)  
}  

The reconstruction process follows a straightforward workflow:

  1. The library connects to the specified WeaveVM Archive network

  2. Historical ledger data is retrieved from the WeaveVM Archiver data lakes

  3. Retrieved blocks are processed through our custom minimal EVM execution machine

  4. The EVM StateManager applies the blocks sequentially, updating the state accordingly

  5. The final result is a complete reconstruction of the network’s World State

We built this PoC to showcase what’s possible when you combine permanent storage with proper EVM state handling. Whether you’re analyzing historical network states, debugging complex transactions, or building new tools for chain analysis, the groundwork is now laid.

This proof-of-concept implementation is available on GitHub:

WeaveVM State Reconstuction Flow

has evolved beyond its foundation as a decentralized archive node. This proof of concept demonstrates how our comprehensive data storage enables full EVM network state reconstruction - a capability that opens new possibilities for network analysis, debugging, and state verification.

https://github.com/weaveVM/evm-state-reconstructing
WeaveVM Archivers