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(tests): json schema verification #968

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

feat(tests): json schema verification #968

wants to merge 1 commit into from

Conversation

winsvega
Copy link
Collaborator

@winsvega winsvega commented Nov 22, 2024

🗒️ Description

Pydanticfy the json schemas so we verify the quality of generated test fixtures

This is an MVP to catch what I think is the cause of bug

src/ethereum_test_fixtures/verify_format.py:28: in verify_blockchain_fixture_json
    raise Exception(
E   Exception: Error in generated blockchain test json (tests/frontier/opcodes/test_dup.py::test_dup[fork_Frontier-evm_code_type_LEGACY-blockchain_test-DUP1])[{"type":"extra_forbidden","loc":["baseFeePerGas"],"msg":"Extra inputs are not permitted","input":"0x00","url":"https://errors.pydantic.dev/2.9/v/extra_forbidden"}]

pyspecs with evmone-t8n export extra field on all forks which should not be there. perhaps this extra field leads to wrong block init in its' t8n when we blindly feeding the env section. and to a wrong state hash in my test scenarios.

so the issue is
evmone-t8n return

"currentBaseFee": "0x0",

on all forks. and we export it to the final test. when this field is only in blockheader in exported test since London

🔗 Related Issues

#940

✅ 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: A PR with removal of converted JSON/YML 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.

@winsvega winsvega self-assigned this Nov 22, 2024
@winsvega winsvega added good first issue Good for newcomers type:test Type: Test type:feat type: Feature labels Nov 22, 2024
@winsvega winsvega changed the title json schema verification feat(tests): json schema verification Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:feat type: Feature type:test Type: Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant