Skip to content

Conversation

@d-xo
Copy link
Collaborator

@d-xo d-xo commented Sep 22, 2025

Description

adds a cli option to exec that outputs a geth compatible jsonl trace.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

adds a cli option to exec that outputs a geth compatible jsonl trace.
Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have lately been pretty bad at doing PRs, so I think you need @blishko to review. But I am actually liking it a lot. It is BTW possible to add tests to CLI stuff like this, via clitest.hs, it's something to consider, though it may be a little convoluted with this one.

Comment on lines 44 to +48
$ export ETH_RPC_URL=https://mainnet.infura.io/v3/YOUR_API_KEY_HERE
$ export TXHASH=0xd2235b9554e51e8ff5b3de62039d5ab6e591164b593d892e42b2ffe0e3e4e426
hevm exec --caller $(seth tx $TXHASH from) --address $(seth tx $TXHASH to) \
--calldata $(seth tx $TXHASH input) --rpc $ETH_RPC_URL \
--block $(($(seth tx $TXHASH blockNumber)-1)) --gas $(seth tx $TXHASH gas)
hevm exec --caller $(cast tx $TXHASH from) --address $(cast tx $TXHASH to) \
--calldata $(cast tx $TXHASH input) --rpc $ETH_RPC_URL \
--block $(($(cast tx $TXHASH blockNumber)-1)) --gas $(cast tx $TXHASH gas)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is nice!

Comment on lines +39 to +45
{ pc :: Int
, op :: Int
, gas :: Data.Word.Word64
, memSize :: Data.Word.Word64
, depth :: Int
, stack :: [W256]
, error :: Maybe String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, yes :) I think at the time we didn't have the . notation? So it was more useful. Much better this way!

Copy link
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@blishko blishko merged commit 1bfd838 into main Sep 24, 2025
25 of 28 checks passed
@blishko blishko deleted the expose-json-trace branch September 24, 2025 11:03
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.

4 participants