Skip to content

Commit

Permalink
REVM tracing and gas reports (#867)
Browse files Browse the repository at this point in the history
* feat: very simple traces

* feat: creation traces

* feat: setup and revert traces

* fix: fix lib addresses

* refactor: simplify tracer inspector

* fix: fill traces in correct order

* build: bump revm

* fix: get code for newly created contracts

* refactor: unify log extraction logic

* feat: trace logs

* refactor: unify labels and names

* refactor: return string from trace

Instead of passing in an empty string we then pass
around inside the trace display logic, we just return
strings where appropriate.

* refactor: remove identified contracts

* refactor: remove unused vars

* refactor: simplify `construct_func_call`

* refactor: name special characters in traces

* refactor: rework all display logic

* feat: first pass identify/decode for traces

* refactor: move tracing to own module

* refactor: simplify `test`

* feat: traces for fuzz tests

* fix: make fuzz revert reasons less verbose

* feat: port gas reports

* refactor: small readability nits

* feat: run fuzz *and* unit tests in parallel

Previously we would run each test contract in parallel,
but within each `ContractRunner` we would run unit tests
first (in parallel) and then fuzz tests (in parallel).

* refactor: move colouring logic to its own function

* fix: test contract identification

We now include three kinds of traces that are used for
identification of contracts:

- Deployment traces: these are the initial deployments
  of the test contract and libraries
- Setup traces: these are traces of calls to the `setUp`
  function
- Execution traces: these are the traces of calls to
  the test contract itself

* fix: mark setup trace as a setup trace

* fix: get correct nonce in tracer

* fix: log extraction outside of current memory

* chore: clean up complex types

* chore: remove outdated comment

* fix: make tests compile

* fix: add missing test filter function

* feat: display full address in traces

* fix: color "new" keyword in traces

* fix: filter out `console.log` calls from traces

* chore: remove unnecessary comment

* feat: add gas cost to creation traces

* fix: properly decode outputs

* refactor: destructure `TestSetup` in test funcs

* fix: ignore address for func output decoding

* fix: fix expect emit

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: brockelmore <brockelmore@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 13, 2022
1 parent c43f8f1 commit 2ab9081
Show file tree
Hide file tree
Showing 21 changed files with 1,674 additions and 582 deletions.
100 changes: 97 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ab9081

Please sign in to comment.