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

feat(traces): use TraceWriter, delegating the formatting of the print trace to revm-inspectors #8224

Merged
merged 33 commits into from
Jul 5, 2024

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Jun 21, 2024

Motivation

Closes paradigmxyz/revm-inspectors#14

Related PR: paradigmxyz/revm-inspectors#151

Solution

  • Mutates the arena traces to populate new decoded fields in the CallTrace
  • Brings back decoder.decode (now extend_trace)
  • Delegates all formatting of the print to revm-inspectors

Cargo.toml Outdated Show resolved Hide resolved
crates/evm/traces/src/decoder/mod.rs Outdated Show resolved Hide resolved
crates/forge/bin/cmd/test/mod.rs Outdated Show resolved Hide resolved
mattsse pushed a commit to paradigmxyz/revm-inspectors that referenced this pull request Jun 27, 2024
Closes: #14

- Add `nodes_mut` for mutability of nodes, required for populating added
CallTrace fields
- Adds `decoded.label`, `decoded.return_data`, `decoded.call_data`,
wrapped in the `DecodedCallTrace` container type.
- Wraps the raw `LogData` in a `CallLog` to accompany it with additional
decoded data fields: `decoded.name`, `decoded.params`, wrapped in the
`DecodedCallLog` container type.

`decoded.contract_name` has not been added as a field as it is only used
in Foundry's gas report, not in the current trace render.

It is likely that some stylistic updates will be followed up relatively
quickly

Related PR: foundry-rs/foundry#8224

---------

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Cargo.toml Outdated Show resolved Hide resolved
@zerosnacks
Copy link
Member Author

Marking as ready for review, pending revm-inspectors release as blocker for merging

@zerosnacks zerosnacks marked this pull request as ready for review June 28, 2024 16:09
crates/evm/traces/src/decoder/mod.rs Outdated Show resolved Hide resolved
crates/forge/bin/cmd/test/mod.rs Outdated Show resolved Hide resolved
crates/script/src/execute.rs Outdated Show resolved Hide resolved
crates/script/src/execute.rs Outdated Show resolved Hide resolved
crates/forge/tests/it/config.rs Outdated Show resolved Hide resolved
into Outdated Show resolved Hide resolved
@DaniPopes DaniPopes enabled auto-merge (squash) July 4, 2024 17:30
@DaniPopes DaniPopes merged commit 09306b3 into master Jul 5, 2024
21 checks passed
@DaniPopes DaniPopes deleted the zerosnacks/trace-printer-revm-inspectors branch July 5, 2024 05:55
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.

Upstream trace pretty-printer from Foundry
3 participants