Registry / ai-ml / evm-trace

evm-trace

JSON →
library0.2.6pypypi✓ verified 85d ago

A Python library for Ethereum Virtual Machine transaction tracing, providing tools to decode and analyze EVM execution traces. Current version 0.2.6 (stable). Release cadence is irregular, with several patches per year.

pip install evm-trace
INSTALL
IMPORT
SIG · EVM-TRACE
E
evm-trace
ai-mlpythonv0.2.6
Install
5.9s avg
Import
778ms
Disk
60MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.6 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.792s · 59.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.9s · import 0.764s · 62MB
60MB installed
● package 60MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TraceFrame
from evm_trace import TraceFrame
CallTreeNode
from evm_trace import CallTreeNode
from evm_trace.call_trace import CallTreeNode
The correct import is from the top-level package.

Parses a raw EVM trace frame into a structured object. Replace raw_frame with actual trace data from an RPC provider.

from evm_trace import TraceFrame # Example: process a raw trace dict raw_frame = { 'pc': 0, 'op': 96, 'gas': 100000, 'gas_cost': 3, 'depth': 0, 'stack': [], 'memory': [], 'storage': {} } tf = TraceFrame.parse_obj(raw_frame) print(tf.op) # 96 (PUSH1)
Debug
Known issues
breakingv0.2.0 dropped Python 3.8 support and added Python 3.12 support.
fix
Upgrade Python to 3.9+.
affects: <0.2.0
deprecatedThe msgspec dependency was removed in v0.2.4 due to Python 3.13 incompatibility, then reintroduced in v0.2.5 for 3.13+.
fix
Use evm-trace >=0.2.5 for Python 3.13 support.
affects: 0.2.4
gotchaTraceFrame fields may contain large integers; ensure your environment handles them properly.
fix
Use Python's built-in int (unbounded) – no need for custom handling.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'CallTreeNode' from 'evm_trace.call_trace'
The CallTreeNode class is re-exported from the top-level package, not from the submodule.
fix
Use: from evm_trace import CallTreeNode
ModuleNotFoundError: No module named 'msgspec'
evm-trace version 0.2.4 removed msgspec from dependencies, but it's required for some optional functionality.
fix
Install msgspec separately: pip install msgspec, or upgrade evm-trace to >=0.2.5.
TypeError: Object of type 'TraceFrame' is not JSON serializable
Custom objects need serialization utilities.
fix
Use .dict() or .json() methods from Pydantic base model.
Upgrade
Version history
0.2.6latest on PyPI · released May 22, 2025
Audit
Dependencies
pydanticrequiredUsed for data models since v0.2.5.
eth-utilsrequiredCore Ethereum utility functions.
eth-hashrequiredKeccak256 hashing support.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
evm-trace — pip install evm-trace · libregistry