Open
Description
Background
The ethereum/tests repository provides a canonical EVM conformance test suite, organized into categories such as:
BasicTests
BlockchainTests
TransactionTests
.
Each test case includes the minimal inputs (e.g. RLP-encoded transactions, block headers, account pre-state) and the expected outcome or post-state under each hard-fork. Client implementations simply feed these inputs into their EVM and assert that the results match the reference data.
Go-Ethereum demonstrates one approach: it pulls ethereum/tests in as a Git submodule under tests/, iterates over the generated JSON fixtures with evm test …, and compares the returned state or exceptions against the fixture expectations.
Proposal for cosmos/evm
1. Add ethereum/tests as a submodule
git submodule add https://github.com/ethereum/tests tests/ethereum
2. Write a test harness
- Recursively scan tests/ethereum/Tests/**//*.json for fixture files.
- For each fixture:
- Deserialize its txbytes, pre-state, and "result" map.
- Invoke cosmos/evm (in-process or via CLI) for each supported fork.
- Compare the returned state or exception against the fixture’s "result"[fork].
3. Explicitly skip incompatible tests
- MPT tests: skip any trie tests, since
cosmos/evm
uses IAVL, not Merkle-Patricia. - Withdrawals / Beacon-chain tests: skip EL-only tests that assume an Ethereum CL↔EL withdrawal flow.
- Mark each skip in code with a clear rationale:
t.Skip("skipping MPT test: cosmos/evm uses IAVL")
4. Integrate into CI
- Add a
go test ./tests/ethereum/...
target in ourMakefile
or CI pipeline. - Ensure skipped tests are excluded automatically.
- Publish pass/fail metrics for all executed conformance cases.
Benefits
- Immediate coverage of every EVM hard-fork scenario as soon as ethereum/tests adds or updates a fixture.
- Automated conformance checks guard against regressions in future EVM changes.
Metadata
Metadata
Assignees
Labels
No labels