execution-spec-tests icon indicating copy to clipboard operation
execution-spec-tests copied to clipboard

all: Trace types

Open marioevz opened this issue 1 year ago • 3 comments

🗒️ 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: ~https://github.com/ethereum/go-ethereum/pull/29212~ ~https://github.com/ethereum/go-ethereum/pull/29248~ https://github.com/ethereum/go-ethereum/pull/29353

🔗 Related Issues

None

✅ Checklist

  • [x] All: Set appropriate labels for the changes.
  • [ ] All: Considered squashing commits to improve commit history.
  • [x] All: Added an entry to CHANGELOG.md.
  • [x] All: Considered updating the online docs in the ./docs/ directory.
  • [x] Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • [x] 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.
  • [x] Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

marioevz avatar Mar 11 '24 01:03 marioevz

Hey @marioevz the upstream geth PR is now merged. Is there any work to be done between this PR and #433?

raxhvl avatar Sep 26 '24 05:09 raxhvl

Hey @marioevz the upstream geth PR is now merged. Is there any work to be done between this PR and #433?

Hey, nothing has changed since then, a big task would be rebasing because there have been a lot of changes to the framework since this branch was last touched.

marioevz avatar Sep 26 '24 15:09 marioevz

I think this could be rebased after wait until #792 is merged.

raxhvl avatar Sep 26 '24 16:09 raxhvl