Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evm t8n: Support evm trace #566

Closed
winsvega opened this issue Feb 15, 2023 · 1 comment · Fixed by #616
Closed

evm t8n: Support evm trace #566

winsvega opened this issue Feb 15, 2023 · 1 comment · Fixed by #616

Comments

@winsvega
Copy link

the trace format as follows:

{"pc":0,"op":96,"gas":"0x59f70","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":2,"op":96,"gas":"0x59f6d","gasCost":"0x3","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":4,"op":1,"gas":"0x59f6a","gasCost":"0x3","memSize":0,"stack":["0x1","0x1"],"depth":1,"refund":0,"opName":"ADD"}
{"pc":5,"op":96,"gas":"0x59f67","gasCost":"0x3","memSize":0,"stack":["0x2"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":7,"op":85,"gas":"0x59f64","gasCost":"0x4e20","memSize":0,"stack":["0x2","0x0"],"depth":1,"refund":0,"opName":"SSTORE"}
{"pc":8,"op":0,"gas":"0x55144","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}
{"output":"","gasUsed":"0x4e2c"}

expected to be found by transaction hash at output directory.

Trace file `/dev/shm/000a91d9-c971-46ed-bf8a-777c1a6cf574/trace-0-0xeda4d6763740fbccc99cc8873ff09b8504d192e83f73bd16ccf5feb053a4e3cd.jsonl` not found!
WARNING: Transaction trace not found! (0xeda4d6763740fbccc99cc8873ff09b8504d192e83f73bd16ccf5feb053a4e3cd)
@ethereum ethereum deleted a comment Feb 20, 2023
@winsvega
Copy link
Author

geth vmtrace format:

VMTrace: (GeneralStateTests/stExample/add11, fork: Shanghai, TrInfo: d: 0, g: 0, v: 0, TrData: ` 0x..`)
Transaction number: 0, hash: 0xeda4d6763740fbccc99cc8873ff09b8504d192e83f73bd16ccf5feb053a4e3cd

{"pc":0,"op":96,"gas":"0x5c878","gasCost":"0x3","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":2,"op":96,"gas":"0x5c875","gasCost":"0x3","memSize":0,"stack":["0x1"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":4,"op":1,"gas":"0x5c872","gasCost":"0x3","memSize":0,"stack":["0x1","0x1"],"depth":1,"refund":0,"opName":"ADD"}
{"pc":5,"op":96,"gas":"0x5c86f","gasCost":"0x3","memSize":0,"stack":["0x2"],"depth":1,"refund":0,"opName":"PUSH1"}
{"pc":7,"op":85,"gas":"0x5c86c","gasCost":"0x5654","memSize":0,"stack":["0x2","0x0"],"depth":1,"refund":0,"opName":"SSTORE"}
{"pc":8,"op":0,"gas":"0x57218","gasCost":"0x0","memSize":0,"stack":[],"depth":1,"refund":0,"opName":"STOP"}
{"output":"","gasUsed":"0x5660"}

t8n is supposed to produce vmtrace files in out directory

Trace file `trace-0-0xeda4d6763740fbccc99cc8873ff09b8504d192e83f73bd16ccf5feb053a4e3cd.jsonl` not found!
WARNING: Transaction trace not found! (0xeda4d6763740fbccc99cc8873ff09b8504d192e83f73bd16ccf5feb053a4e3cd)

trace-[txIndex]-[txHash].jsonl

t8n trace options:

--trace                        (default: false)
          Output full trace logs to files <txhash>.jsonl
    --trace.memory                 (default: false)
          Enable full memory dump in traces
    --trace.nomemory               (default: true)
          Disable full memory dump in traces (deprecated)
    --trace.noreturndata           (default: true)
          Disable return data output in traces (deprecated)
    --trace.nostack                (default: false)
          Disable stack output in traces
    --trace.returndata             (default: false)
          Enable return data output in traces

the trace format must be exactly the same as of issue: ethereum/tests#249
but better to compare to the outputs produced by geth.
if we have the same trace format we can use tools to find transaction execution bugs

@rodiazet rodiazet linked a pull request Aug 7, 2023 that will close this issue
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 a pull request may close this issue.

1 participant