neo
neo copied to clipboard
add ledger debugger plugin
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:
- BlockReadSetStorage: Stores the read sets for each block in a highly optimized format
- Content-Addressable Storage: Deduplicates identical data across multiple blocks
- Read Set Capturing: Records which storage items were read during execution
- 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:
- Replay specific blocks without syncing the full chain
- Debug smart contract execution by examining state at specific blocks
- Analyze transaction effects on chain state
- 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