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(anvil): add support for trace logging in Anvil #9895

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

zerosnacks
Copy link
Member

Motivation

Closes: #9887

Solution

Work in progress

Current output looks as follows:

Traces:
  [96345] → new <unknown>@0x5FbDB2315678afecb367f032d93F642f64180aa3
    └─ ← [Return] 481 bytes of code

...

Traces:
  [22418] 0x5FbDB2315678afecb367f032d93F642f64180aa3::d09de08a()
    ├─  storage changes:
    │   @ 0: 0 → 1
    └─ ← [Stop]

...

Traces:
  [5392] 0x5FbDB2315678afecb367f032d93F642f64180aa3::3fb5c1cb(000000000000000000000000000000000000000000000000000000000000002a)
    ├─  storage changes:
    │   @ 0: 1 → 42
    └─ ← [Stop]

It is likely possible to decode the traces to some extend using cached selectors but there is some complexity involved as all of these functions are not async.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks added T-feature Type: feature C-anvil Command: anvil labels Feb 14, 2025
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this looks good,

what we need some feedback on is when to actually print them, always or in the non success case, especially estimate could be a bit noisy because this call multiple times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-feature Type: feature
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add support for trace logging in anvil
2 participants