Skip to content

Transaction Trace Folding#515

Merged
praetoriansentry merged 7 commits intomainfrom
jhilliard/trace-folding
Feb 26, 2025
Merged

Transaction Trace Folding#515
praetoriansentry merged 7 commits intomainfrom
jhilliard/trace-folding

Conversation

@praetoriansentry
Copy link
Copy Markdown
Member

@praetoriansentry praetoriansentry commented Feb 21, 2025

Description

Adding a small feature to take a transaction trace and fold it for visualization with flame graphs. These are two example graph:

eg1

eg2

This how the tool works:

# First grab a trace from an RPC that supports the debug namespace
cast rpc --rpc-url http://127.0.0.1:18545 debug_traceTransaction 0x12f63f489213f5bd5b88fbfb12960b8248f61e2062a369ba41d8a3c96bb74d57 > trace.json

# Read the trace and use the `fold-trace` command and write the output 
polycli fold-trace --metric actualgas < trace.json > folded-trace.out

# Covert the folded trace into a flame graph
flamegraph.pl --title "Gas Profile for 0x7405fc5e254352350bebcadc1392bd06f158aa88e9fb01733389621a29db5f08" --width 1920 --countname gas folded-trace.out > flame.svg

@praetoriansentry praetoriansentry merged commit 69ea8c9 into main Feb 26, 2025
@praetoriansentry praetoriansentry deleted the jhilliard/trace-folding branch February 26, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants