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

all: Trace types #474

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

all: Trace types #474

wants to merge 24 commits into from

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Mar 11, 2024

🗒️ Description

  • Adds typing to trace results from the evm command using pydantic.
  • Adds a context sensitive trace printer (class TraceableException) which selects relevant traces from the full EVM trace:
    E.g. in this case, the test failed because it expected a certain storage value at address 0x0000000000000000000000000000000000000100, so the trace printer detected the call frame returned from the address with an error and printed this line and a few previous lines:
            ...
            EVMTraceLine(
                pc=46,
                op=85,
                op_name='SSTORE',
                gas=18934,
                gas_cost=20000,
                mem_size=0,
                stack=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 3],
                depth=1,
                refund=0,
                context_address='0x0000000000000000000000000000000000000100'
            ),
            EVMCallFrameExit(from_address='0x0000000000000000000000000000000000000100', output=b'', gas_used=79000, error='out of gas')
        ],
        description='Exit frame from address 0x0000000000000000000000000000000000000100 with error'
  • Uses rich library to better print the relevant trace information when a test runs into an error.

Requires: ethereum/go-ethereum#29212 ethereum/go-ethereum#29248 ethereum/go-ethereum#29353

🔗 Related Issues

None

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@marioevz marioevz added scope:tools Scope: ethereum_test_tools package type:refactor Type: Refactor type:feat type: Feature labels Mar 13, 2024
@marioevz marioevz marked this pull request as ready for review March 13, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:tools Scope: ethereum_test_tools package type:feat type: Feature type:refactor Type: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants