1 unstable release

0.0.1 Sep 19, 2025

#7 in #edb

Download history 114/week @ 2025-09-16 23/week @ 2025-09-23 15/week @ 2025-09-30 1/week @ 2025-10-07

153 downloads per month

AGPL-3.0

1MB
18K SLoC

EDB Engine - Advanced Ethereum smart contract debugging and analysis engine.

This crate provides the core debugging engine for EDB (Ethereum Debugger), enabling detailed analysis and debugging of smart contract execution at both opcode and source levels. The engine supports real-time expression evaluation, comprehensive snapshot management, and advanced debugging features for Ethereum smart contracts.

Key Features

🔍 Multi-Level Debugging

  • Opcode-level debugging: Step through EVM bytecode execution
  • Source-level debugging: Debug using original Solidity source code
  • Hybrid debugging: Switch seamlessly between opcode and source views

📸 Snapshot System

  • Capture execution state at any point during contract execution
  • Navigate forward/backward through execution history
  • Support for both hook-based and opcode-based snapshots

Real-time Expression Evaluation

  • Evaluate Solidity-like expressions against any execution snapshot
  • Access variables, function calls, storage, and blockchain context
  • Support for complex expressions with type casting and operations

🔗 JSON-RPC API

  • Complete debugging API for frontend integration
  • WebSocket and HTTP support for real-time debugging
  • Comprehensive error handling and protocol compliance

🛠 Advanced Analysis

  • Contract instrumentation for debugging hooks
  • Source code analysis and mapping
  • ABI resolution and type inference
  • Storage layout analysis

Core Modules

  • analysis - Source code analysis and contract instrumentation
  • core - Core engine types and execution management
  • context - Engine context and state management
  • eval - Expression evaluation system
  • inspector - EVM execution inspectors for data collection
  • instrumentation - Contract instrumentation and code generation
  • [rpc] - JSON-RPC debugging API
  • snapshot - Snapshot management and analysis
  • tweak - Runtime contract modification for debugging
  • utils - Utility functions and helpers

Quick Start

use edb_engine::{EngineContext, DebugRpcServer};
use revm::primitives::Address;

// Create engine context with debugging data
let context = EngineContext::new(db, snapshots, trace, artifacts);

// Start RPC server for debugging API
let server = DebugRpcServer::new(context);
let handle = server.start().await?;

println!("Debug server running on port {}", handle.port());

Architecture

The EDB engine follows a modular architecture:

  1. Data Collection: Inspectors collect execution data during EVM execution
  2. Snapshot Management: Captured data is organized into navigable snapshots
  3. Expression Evaluation: Real-time evaluation against snapshot data
  4. API Layer: JSON-RPC interface exposes all debugging functionality
  5. Analysis: Deep contract analysis for enhanced debugging experience

Dependencies

~102MB
~2M SLoC