Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Let's use debug_traceTransaction of ganache-cli [Feature request] #197

Open
k06a opened this issue Mar 8, 2020 · 6 comments
Open

Let's use debug_traceTransaction of ganache-cli [Feature request] #197

k06a opened this issue Mar 8, 2020 · 6 comments

Comments

@k06a
Copy link

k06a commented Mar 8, 2020

This would allow measuring every external CALL/STATICCALL/DELEGATECALL that happened inside a transaction. Related thread: trufflesuite/ganache#248

@cgewecke
Copy link
Owner

cgewecke commented Mar 8, 2020

Thanks for this suggestion @k06a!

Unfortunately there are performance drawbacks to debug_traceTransaction since there's so much data and no way to filter it as part of the request. In some cases the size of the stack causes the request to fail (see comment ganache-core 47).

I'd like to keep the gas-reporter simple / reliable and improve its execution speed via #171.

There are two other projects which might be better candidates for collecting more granular gas metrics, since they've already done all the difficult work of translating the trace into meaningful data:

@k06a
Copy link
Author

k06a commented Mar 8, 2020

@cgewecke thanks for detailed answer, what do you think about Parity Trace Module? Maybe shipping similar functionality to ganache-cli could improve eth-gas-reporter.

@cgewecke
Copy link
Owner

cgewecke commented Mar 8, 2020

what do you think about Parity Trace Module

I've never used it tbh ... do you know of an example output with subtraces? It's hard to see exactly what's going in their sample API responses.

@k06a
Copy link
Author

k06a commented Mar 8, 2020

@cgewecke
Copy link
Owner

cgewecke commented Mar 8, 2020

@k06a Oh wow, that's really cool...

I wonder if this might be easiest to use as it's own utility, for cases where a detailed analysis is helpful.

truffle run gas-trace SomeToken:transfer
// Or
buidler gas-trace SomeToken:transfer

There is a recipe for attaching to ganache-cli's vm from outside and adding whatever trace functionality you want at solidity-coverage here and here. In principle if you wanted to build a parity trace API for ganache yourself you could...

Think BuidlerEVM is going to expose a trace hook that includes gas used data soon as well - they do their own decoding. It looks like it would be straightforward to pick out the relevant data there and reformat it in way that's easy to read.

@k06a
Copy link
Author

k06a commented Mar 12, 2020

Look what I found also: https://rinkeby.etherscan.io/vmtrace?txhash=0xd68476a123e58ca838605071fbdfb570a03a3c4812da872fe85d2607f8203d40&type=gethtrace2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants