Skip to content

Conversation

jochem-brouwer
Copy link
Member

🗒️ Description

When playing around with uv run gentest it generated a file which could not be ran directly since it imported stuff which was not the method which was being used. Keeping this as draft, because we might want to update some things for gentest:

  • The generated file was invalid and could not be ran. We should add a test for this to ensure the output runs out-of-the-box
  • The tracer works using debug_traceCall. We should change this to debug_traceTransaction, because my endpoint does not support debug_traceCall. I also think that traceCall produces incorrect results if your tx is not in index 0, because it will run the call on top of the block and not after executing the previous txs. debug_traceTransaction also supports the prestate tracer and it works out of the box.

For the change in debug_traceTransaction I have this local fix (in src/ethereum_test_rpc/rpc.py):

    def trace_call(self, tr: dict[str, str], block_number: str):
        """`debug_traceCall`: Returns pre state required for transaction."""
        return self.post_request(
            "traceTransaction",
            "<hardcoded tx hash>",
            {"tracer": "prestateTracer"},
        )

This gentest tool is extremely helpful to sandbox a tx and use it to check against clients to see if something funny is happening there! 😄 👍

CC @raxhvl, feel free to take over this PR 😄 👍

🔗 Related Issues

✅ 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/tests/static have been assigned @ported_from marker.
  • Tests: A PR with removal of converted JSON/YML blockchain tests from ethereum/tests have been opened.
  • 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.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.

@jochem-brouwer
Copy link
Member Author

I recall that this PR is a bugfix to uv run gentest and I think I used this tooling back in Berlin when we got some alerts about slow blocks related to XEN ( 😅 ). I think we can merge this once we check that this fixes a bug (once I have some time will check this and if this indeed fixes stuff will mark it as ready for review).

@danceratopz
Copy link
Member

Btw, we will need to fix these (again?) after #2209. It might still be worth fixing them in the meantime though.

@danceratopz
Copy link
Member

I just wanted to check the import fix to see if we can get this merged real quick.

But this fails even worse on main 😭 so we need to fix that first:

Also, this is a tough example, but on this branch:

uv run gentest 0x79510fa288a2d4d1bbe3794e3a079d2bcff0eb4550bc67e1ab6915b263979877 out.py

also fails mypy and ruff checks. So this all needs quite a bit of love as of right now.

@fselmo
Copy link
Collaborator

fselmo commented Oct 9, 2025

I think there are still more issues to fix with tracing and such here. The import issue does fix the first part for me but agreed here on debug_traceCall because I get a fail here right away. I think especially since this is a simple change that we can add again after The Weld™, we should probably close this, port issue #2259 over to EELS, and re-open a PR to fix this entire flow a bit more once we weld.

Any objections to this, feel free to re-open :)

@fselmo fselmo closed this Oct 9, 2025
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.

3 participants