• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
  • License
    Apache License 2.0
  • Created about 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a collection of EVM tracing information for easy reference

Ultimate EVM Tracing Reference

Telegram Chat

This repo is a collection of trace-related information for easy reference.

A best effort is made to provide accurate information. Please submit corrections to the issue tracker.

Contents

  1. Tracers
  2. Trace Methods
  3. Node Client Support
  4. RPC Provider Support
  5. Ecosystem Tooling Support
  6. Hosted Data Platform Support
  7. Example Tracer Data

Tracers

A tracer gives a detailed view into what happened during a block or transaction.

Each tracer type provides a different set of information. There are two main categories of tracers, parity and geth. Each node client supports these tracer types to varying degrees.

To see the specific information returned by each tracer, see the schemas and data samples in the Example Tracer Data below.

tracer description parameters
parity calls1 calls in a flat list structure [ "trace" ]
parity stateDiffs2 all state changes for each tx [ "stateDiff" ]
parity vmTraces opcode-level trace [ "vmTrace" ]
geth opcodes opcode-level trace { }
geth calls1 calls in a nested structure { "tracer": "callTracer" }
geth preState2 data that was read before each tx { "tracer": "prestateTracer" }
geth stateDiffs2 all state changes for each tx { "tracer": "prestateTracer", "diffMode": true }
geth 4byte 4byte prefixes of function calls { "tracer": "4byteTracer" }
geth javascript3 custom javascript tracer functions { "tracer": "{ fault: ..., result: ... }" }

1: Geth call traces contain nearly identical information to Parity call traces. There are differences such as 1) they include precompile calls, 2) they used a nested schema instead of a list, 3) they do not include block rewards. See here for additional differences.

2: There are four types of state changes: balances, codes, nonces, and storage. State-related traces include information about all four.

3: "tracer is interpreted as a JavaScript expression that is expected to evaluate to an object which must expose the result and fault methods. There exist 4 additional methods, namely: setup, step, enter, and exit. enter and exit must be present or omitted together."

Trace Methods

RPC methods are used to obtain trace data from RPC endpoints.

Each method applies one or more tracers to a particular scope of data, such as a block, transaction, or call data.

rpc method description tracers
trace_block basic block trace parity calls
trace_transaction basic transaction trace parity calls
trace_replayBlockTransactions advanced block trace all parity tracers
trace_replayTransaction advanced transaction trace all parity tracers
trace_filter query a subset of traces all parity tracers
trace_call trace custom call_data all parity tracers
trace_callMany trace sequence of call_data all parity tracers
trace_rawTransaction parity call_data trace all parity tracers
trace_get parity indexed trace parity calls
debug_traceBlock advanced block trace all geth tracers
debug_traceTransaction basic transaction trace all geth tracers
debug_traceCall trace custom call_data all geth tracers
debug_traceBlockByNumber advanced block trace all geth tracers
debug_traceBlockByHash advanced block trace all geth tracers

Node Client Support

Node clients track the state of the chain and can perform tracing on the chain's history.

Each node client supports a different set of tracers and trace methods.

rpc method geth reth erigon besu nethermind
trace_block ❌ βœ… βœ… βœ… βœ…
trace_transaction ❌ βœ… βœ… βœ… βœ…
trace_replayBlockTransactions ❌ βœ… βœ… βœ… βœ…
trace_replayTransaction ❌ βœ… βœ… ❌ βœ…
trace_filter ❌ βœ… βœ… βœ… βœ…
trace_call ❌ βœ… βœ… βœ… βœ…
trace_callMany ❌ βœ… βœ… βœ… ❌
trace_rawTransaction ❌ βœ… βœ… βœ… βœ…
trace_get ❌ βœ… βœ… βœ… ❌
debug_traceBlock βœ… βœ… βœ… βœ… βœ…
debug_traceTransaction βœ… βœ… βœ… ❌ βœ…
debug_traceCall βœ… βœ… βœ… ❌ βœ…
debug_traceBlockByNumber βœ… βœ… βœ… ❌ βœ…
debug_traceBlockByHash βœ… βœ… βœ… βœ… βœ…

The set of traces that can be obtained for a chain is determined by the clients that support that chain:

rpc method geth reth erigon besu nethermind geth fork
ethereum βœ… βœ… βœ… βœ… βœ… ❌
goerli βœ… βœ… βœ… βœ… βœ… ❌
arbitrum ❌ ❌ ❌ ❌ ❌ βœ…
optimism ❌ βœ… ❌ ❌ ❌ βœ…
zora ❌ βœ… ❌ ❌ ❌ βœ…
base ❌ βœ… ❌ ❌ ❌ βœ…
polygon ❌ ❌ βœ… ❌ ❌ βœ…
gnosis βœ… ❌ βœ… βœ… βœ… ❌
bnb ❌ ❌ βœ…* ❌ ❌ βœ…

RPC Provider Support

RPC providers create endpoints where customers can access RPC data without having to run their own nodes.

Every node provider supports different tracers and trace methods.

rpc method infura alchemy
(pricing)
quicknode
(pricing)
llamanodes
(pricing)
chainstack
(pricing)
trace_block βœ… βœ… βœ… βœ… βœ…
trace_transaction βœ… βœ… βœ… βœ… βœ…
trace_replayBlockTransactions ❌ βœ… βœ… βœ… βœ…
trace_replayTransaction ❌ βœ… βœ… βœ… βœ…
trace_filter βœ… βœ… βœ… βœ… βœ…
trace_call βœ… βœ… βœ… βœ… βœ…
trace_callMany βœ… ❌ βœ… βœ… βœ…
trace_rawTransaction ❌ βœ… βœ… ❌ βœ…
trace_get ❌ βœ… ❌ βœ… βœ…
debug_traceBlock ❌ ❌ βœ… ❌ βœ…
debug_traceTransaction ❌ βœ… βœ… βœ… βœ…
debug_traceCall ❌ βœ… βœ… βœ… βœ…
debug_traceBlockByNumber ❌ βœ… βœ… βœ… βœ…
debug_traceBlockByHash ❌ βœ… βœ… βœ… βœ…

Ecosystem Tooling Support

Many different tools exist for obtaining and analyzing traces.

Each tool supports a different set of tracers and trace methods. The libraries in the javascript ecosystem generally do not support tracing.

πŸ“Ÿ = can use from command line
🐍 = can use as a python library
πŸ¦€ = can use as a rust library

tracer cryo
πŸ“ŸπŸπŸ¦€
ethereum
etl
πŸ“Ÿ
ethers.rs
πŸ¦€
ctc
🐍
ape
🐍
web3py
🐍
parity calls βœ… βœ… βœ… βœ… βœ… βœ…
parity stateDiffs βœ… ❌ βœ… βœ… βœ… βœ…
parity vmTraces βœ… ❌ βœ… βœ… βœ… βœ…
geth opcodes βœ… ❌ βœ… ❌ βœ… ❌
geth calls βœ… βœ… βœ… βœ… βœ… ❌
geth preState βœ… ❌ βœ… βœ… βœ… ❌
geth stateDiffs βœ… ❌ βœ… βœ… βœ… ❌
geth 4byte counts βœ… ❌ βœ… ❌ ❌ ❌
geth javascript βœ… ❌ βœ… ❌ ❌ ❌

Hosted Data Platform Support

Hosted data platforms allow customers to interact with trace data directly without running their own infrastructure.

Most platforms only support call traces.

tracer Dune Flipside Bigquery Allium
parity calls βœ… βœ… βœ… βœ…
parity stateDiffs ❌ ❌ ❌ ❌
parity vmTraces ❌ ❌ ❌ ❌
geth opcodes ❌ ❌ ❌ ❌
geth calls βœ… βœ… βœ… βœ…
geth preState ❌ ❌ ❌ ❌
geth state diffs ❌ ❌ ❌ ❌
geth 4byte counts ❌ ❌ ❌ ❌
geth javascript ❌ ❌ ❌ ❌

Example Tracer Data

A 100 block sample of data is provided for each tracer (block range 10,000,000 through 10,000,099)

tracer schema data collection command
parity calls
schema
- action_from: binary
- action_to: binary
- action_value: string
- action_gas: uint32
- action_input: binary
- action_call_type: string
- action_init: binary
- action_reward_type: string
- action_type: string
- result_gas_used: uint32
- result_output: binary
- result_code: binary
- result_address: binary
- trace_address: string
- subtraces: uint32
- transaction_index: uint32
- transaction_hash: binary
- block_number: uint32
- block_hash: binary
- error: string
- chain_id: uint64
parquet cryo traces -b 10M:+100
parity stateDiffs balances
schema
- transaction_hash: binary
- block_number: uint32
- address: binary
- from_value_string: string
- from_value_binary: binary
- from_value_f64: float64
- to_value_string: string
- to_value_binary: binary
- to_value_f64: float64
- chain_id: uint64
- transaction_index: uint32
parquet cryo balance_diffs -b 10M:+100
parity stateDiffs codes
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- address: binary
- from_value: binary
- to_value: binary
- chain_id: uint64
parquet cryo code_diffs -b 10M:+100
parity stateDiffs nonces
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- address: binary
- from_value: uint64
- to_value: uint64
- chain_id: uint64
parquet cryo nonce_diffs -b 10M:+100
parity stateDiffs storage
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- address: binary
- slot: binary
- from_value: binary
- to_value: binary
- chain_id: uint64
parquet cryo storage_diffs -b 10M:+100
parity vmTraces
schema
- block_number: uint32
- transaction_index: uint32
- pc: uint64
- cost: uint64
- used: uint64
- op: string
- chain_id: uint64
parquet cryo vm_traces -b 10M:+100
geth opcodes
schema
- block_number: uint32
- transaction_hash: binary
- transaction_index: uint32
- trace_address: string
- depth: uint64
- error: string
- gas: uint64
- gas_cost: uint64
- op: string
- pc: uint64
- refund_counter: uint64
- return_data: binary
- chain_id: uint64
parquet cryo geth_opcodes -b 10M:+100 \
--include-columns stack storage
geth calls
schema
- typ: string
- from_address: binary
- to_address: binary
- value_string: string
- value_binary: binary
- value_f64: float64
- gas_string: string
- gas_binary: binary
- gas_f64: float64
- gas_used_string: string
- gas_used_binary: binary
- gas_used_f64: float64
- input: binary
- output: binary
- error: string
- block_number: uint32
- transaction_hash: binary
- transaction_index: uint32
- trace_address: string
- chain_id: uint64
parquet cryo geth_calls -b 10M:+100
geth prestate balances
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- address: binary
- balance_binary: binary
- balance_string: string
- balance_f64: float64
- chain_id: uint64
parquet cryo balance_reads -b 10M:+100
geth prestate codes
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- contract_address: binary
- code: binary
- chain_id: uint64
parquet cryo code_reads -b 10M:+100
geth prestate nonces
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- address: binary
- nonce: uint64
- chain_id: uint64
parquet cryo nonce_reads -b 10M:+100
geth prestate storages
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- contract_address: binary
- slot: binary
- value: binary
- chain_id: uint64
parquet cryo storage_reads -b 10M:+100
geth stateDiffs balances
schema
- block_number: uint32
- transaction_index: uint64
- transaction_hash: binary
- address: binary
- from_value_f64: float64
- from_value_binary: binary
- from_value_string: string
- to_value_f64: float64
- to_value_binary: binary
- to_value_string: string
- chain_id: uint64
parquet cryo geth_balance_diffs -b 10M:+100
geth stateDiffs codes
schema
- block_number: uint32
- transaction_index: uint64
- transaction_hash: binary
- address: binary
- from_value: binary
- to_value: binary
- chain_id: uint64
parquet cryo geth_code_diffs -b 10M:+100
geth stateDiffs nonces
schema
- block_number: uint32
- transaction_index: uint64
- transaction_hash: binary
- address: binary
- from_value_f64: float64
- from_value_binary: binary
- from_value_string: string
- to_value_f64: float64
- to_value_binary: binary
- to_value_string: string
- chain_id: uint64
parquet cryo geth_nonce_diffs -b 10M:+100
geth stateDiffs storages
schema
- block_number: uint32
- transaction_index: uint64
- transaction_hash: binary
- address: binary
- slot: binary
- from_value: binary
- to_value: binary
- chain_id: uint64
parquet cryo geth_storage_diffs -b 10M:+100
geth 4byte counts
schema
- block_number: uint32
- transaction_index: uint32
- transaction_hash: binary
- signature: binary
- size: uint64
- count: uint64
- chain_id: uint64
parquet cryo 4byte_counts -b 10M:+100

More Repositories

1

reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
Rust
3,910
star
2

artemis

A simple, modular, and fast framework for writing MEV bots in Rust.
Rust
2,292
star
3

cryo

cryo is the easiest way to extract blockchain data to parquet, csv, json, or python dataframes
Rust
1,137
star
4

rivet

Developer Wallet & DevTools for Anvil
TypeScript
833
star
5

flux

Graph-based LLM power tool for exploring many completions in parallel.
TypeScript
773
star
6

paradigm-ctf-2021

Official repository for Paradigm CTF 2021
Solidity
488
star
7

flood

flood is a load testing tool for benchmarking EVM nodes over RPC
Python
316
star
8

paradigm-ctf-2022

Rust
296
star
9

paradigm-data-portal

a collection of open source crypto datasets for researchers and tool builders
Python
288
star
10

revmc

JIT and AOT compiler for the Ethereum Virtual Machine, built on Revm.
Rust
202
star
11

mev-share-rs

Rust client library for Flashbots MEV-share
Rust
177
star
12

zk-eth-rng

Secure randomness for Ethereum's execution layer via SNARKs and RANDAO.
Solidity
172
star
13

pyrevm

Python wrapper around https://github.com/bluealloy/revm/ using PyO3
Rust
167
star
14

mesc

MESC is a specification for how crypto tools configure their RPC endpoints
Rust
167
star
15

etop

like htop for Ethereum and other EVM chains
Rust
143
star
16

jitevm

convert evm bytecode to native machine code and go vroom - just an experiment, probably broken, reach out to [email protected] to contribute / productionize.
Rust
141
star
17

spice

Simple client for extracting data from the Dune Analytics API
Python
131
star
18

tbl

tbl is a swiss army knife for parquet read and write operations
Rust
112
star
19

reth-exex-examples

Collection of ExEx examples built on Reth
Rust
100
star
20

paradigm-ctf-infrastructure

Public infra related to hosting Paradigm CTF
Solidity
98
star
21

sinker

Synchronize Postgres to Elasticsearch
Python
63
star
22

local_reth

Run Reth+Prometheus+Grafana locally via docker-compose
Dockerfile
60
star
23

paradigm-ctf-2023

Solidity
59
star
24

stress4844

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844blobs.
Rust
55
star
25

fig

Guidelines & best practices for developing Frames: https://www.figma.com/community/file/1367670879509913267/frame-interface-guidelines
52
star
26

paradigm-ctf-2022-teaser

https://rinkeby.etherscan.io/address/0xffb9205c84d0b209c215212a3cdfc50bf1cfb0e0#code
Solidity
40
star
27

op-rs

Rust
37
star
28

how-to-raise-the-gas-limit

Data & code accompanying Paradigm's How to Raise the Gas Limit post.
Jupyter Notebook
33
star
29

foundry-alphanet

Foundry tools for interfacing with Reth Alphanet's bleeding-edge EVM extensions.
Shell
29
star
30

humanizooor

16
star
31

phishing-list

A rapidly-updated list of live phishing domains for consumption by the eth-phishing-detect module
16
star
32

state_growth

Python
15
star
33

homebrew-brew

A homebrew tap
Ruby
12
star
34

.github

7
star
35

evm-inspectors

EVM Execution Hooks.
2
star
36

crypto_colors

Python
1
star