Skip to content

fix(gentest): update imports to fix template #1751

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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.

1 participant