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: introduces verbosity cli option with foundry-style traces #577

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

dutterbutter
Copy link
Collaborator

@dutterbutter dutterbutter commented Feb 3, 2025

What πŸ’»

  • Introduces verbosity cli options, specifically (-vv, -vvv, -vvvv).
  • Provides foundry-style traces for user, system / precompiles.

Why βœ‹

Note: Once discussed / agree, this would ultimately remove the code from formatter.rs and simplify the debugging usage in in_memory_inner.rs which I will have to do incrementally in subsequent PRs.

Evidence πŸ“·

Include screenshots, screen recordings, or console output here demonstrating that your changes work as intended

Usage example:

# You can increase -vvv for (system), -vvvv (includes precompiles)
anvil-zksync -vv

Trace:
Screenshot 2025-02-03 at 9 26 01β€―AM

@dutterbutter dutterbutter marked this pull request as ready for review February 3, 2025 17:04
@dutterbutter dutterbutter requested a review from a team as a code owner February 3, 2025 17:04
pub fn build_call_trace_arena(
calls: &[Call],
tx_result: VmExecutionResultAndLogs,
verbosity: u8,
Copy link
Member

Choose a reason for hiding this comment

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

The fact that we pass verbosity here (and if on verbosity in another file) is a big code smell.
IMHO, this should be handled by the io abstraction only (e.g. we provide the verbosity for the line we want to print, and the shell implementation will decide whether to print it or not).

See #576 (comment) as well

@dutterbutter dutterbutter marked this pull request as draft February 4, 2025 13:48
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.

2 participants