hyperledger / hyperledger/fabric-x-evm

Integrate `BlockchainTests` from ethereum/tests

Open
#90 1 comment 0 reactions 0 assignees View on GitHub
task
Dominant language
Go
Stars
12
Forks
18
Avg merge
4d 18h
Merged PRs (30d)
23

Description

This story tracks the integration of `BlockchainTests` into fabric-x-evm. Tests should exercise the same aspects as https://github.com/ethereum/go-ethereum/blob/master/tests/block_test.go

**Blocked by #216.** The corpus this issue originally pointed at (`ethereum/tests` v17.0) is frozen and pre-Osaka; #216 migrates our conformance suite to `ethereum/execution-specs` (`tests@v20.0.1` as pinned there). This issue is retargeted to the `blockchain_tests/` directory of that same release/corpus (fetched by #235, same fixture tarball as `state_tests/`) rather than the old `ethereum/tests` layout.

## Scope: selective, not full corpus

Discussion on #216 with @arunabha003 concluded the full `blockchain_tests/` corpus isn't worth running as-is. Breakdown of the 46,832 cases in our fork allowlist (Osaka/BPO1/BPO2/Prague/Cancun):

- **39,899 (85%)** are `blockchain_test_from_state_test` — auto-generated re-encodings of the exact state tests `TestEthereumTests`/`TestExecutionSpecStateTests` already run. Same pre-state, same tx, same expected post-root. Pure duplication of `state_tests/`.
- **4,178** expect an invalid block (`expectException` on a block) — header field validation, gas-limit deltas, RLP block encoding, seal. We never validate a block header; blocks come from Fabric ordering, not from this codebase. Not applicable.
- **3,288** of the native (non-`from_state_test`) cases are multi-tx or multi-block, and they land exactly on the categories that have historically caused us trouble:
- `eip1153_tstore`/`tstorage_clear_after_tx` — transient storage must clear between txs in a block
- `eip6780_selfdestruct`/`selfdestruct`, `dynamic_create2_selfdestruct_collision` — deletion semantics that dominate trie-root failures
- `frontier/examples`/`block_intermediate_state` — intermediate state root across txs

**This last slice (~3,288 cases) is the actual scope of this issue.** The other two categories should stay out — running them either duplicates `state_tests/` for no signal or asserts block-validation behavior we deliberately don't implement.

## Blocked by #85

Exercising multi-tx/multi-block semantics correctly depends on `StateDB.GetStorageRoot` being properly wired to the storage trie (#85), which is currently a stub. Don't start this until #85 lands.

## Non-goals

- Do not add block header / RLP / consensus validation. Fabric owns ordering; this codebase doesn't and shouldn't re-derive it.
- Do not run the `*_from_state_test` subset — it's redundant with `TestExecutionSpecStateTests`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Wait for #85, which is required for multi-transaction and multi-block semantics. Start with the blockchain_tests/ corpus and the existing TestEthereumTests and TestExecutionSpecStateTests runs; focus on the listed transient-storage, selfdestruct, intermediate-state, and multi-transaction cases. Done means the selected native blockchain tests run without adding the excluded from_state_test or block-validation subsets.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.