neo icon indicating copy to clipboard operation
neo copied to clipboard

add ledger debugger plugin

Open Jim8y opened this issue 11 months ago • 0 comments

Neo.Plugins.LedgerDebugger

Overview

The Neo.Plugins.LedgerDebugger plugin is a specialized tool for Neo blockchain developers and node operators that captures blockchain state during execution for later replay without requiring full blockchain synchronization.

Features

  • Lightweight State Capture: Records minimal information required to reconstruct blockchain state
  • Content-Addressable Storage: Implements efficient deduplication of blockchain data
  • Storage Optimization: Values ≤32 bytes are stored directly, while larger values are stored by hash reference
  • Block Replay: Enables replaying blockchain execution without full synchronization
  • Debugging Support: Provides detailed state information for debugging smart contract applications

Technical Design

The LedgerDebugger uses several key components:

  1. BlockReadSetStorage: Stores the read sets for each block in a highly optimized format
  2. Content-Addressable Storage: Deduplicates identical data across multiple blocks
  3. Read Set Capturing: Records which storage items were read during execution
  4. Efficient Serialization: Minimizes storage footprint while maintaining data integrity

Usage

Once installed, the plugin automatically captures the necessary data during blockchain execution. This data can then be used to:

  1. Replay specific blocks without syncing the full chain
  2. Debug smart contract execution by examining state at specific blocks
  3. Analyze transaction effects on chain state
  4. Create lightweight testing environments with real blockchain data

Configuration Options

  • Path: Directory where the read set data will be stored
  • StoreProvider: The type of storage to use (MemoryStore, RocksDBStore, etc.)
  • MaxReadSetsToKeep: Controls how many block read sets to maintain in storage

Jim8y avatar May 03 '25 06:05 Jim8y