Skip to content

Commit 51dedef

Browse files
committed
chore: Update CLAUDE.md based on last commit's refactor
1 parent 25d3c52 commit 51dedef

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

CLAUDE.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ subspecifications that the Lean Ethereum protocol relies on.
1717

1818
### Running Tests
1919
```bash
20-
uv sync --all-extras # Install dependencies
21-
uv run pytest # Run unit tests
22-
uv run fill --fork=devnet --clean # Generate test vectors
20+
uv sync --all-extras # Install dependencies
21+
uv run pytest # Run unit tests only
22+
uv run fill --fork=Devnet --clean # Generate consensus test vectors
23+
# Note: execution layer support is planned for future, infrastructure is ready
2324
```
2425

2526
### Code Quality
@@ -35,7 +36,8 @@ uv run tox # Everything (checks + tests + docs)
3536
- **Main specs**: `src/lean_spec/`
3637
- **Subspecs**: `src/lean_spec/subspecs/{subspec}/`
3738
- **Unit tests**: `tests/lean_spec/` (mirrors source structure)
38-
- **Spec tests**: `tests/spec_tests/devnet/` (generates test vectors)
39+
- **Consensus spec tests**: `tests/consensus/` (generates test vectors)
40+
- **Execution spec tests**: `tests/execution/` (future - infrastructure ready)
3941

4042
## Code Style
4143
- Line length: 100 characters, type hints everywhere
@@ -47,13 +49,17 @@ uv run tox # Everything (checks + tests + docs)
4749
**Two types of tests:**
4850

4951
1. **Unit tests** (`tests/lean_spec/`) - Standard pytest tests for implementation
50-
2. **Spec tests** (`tests/spec_tests/`) - Generate JSON test vectors via fillers
52+
2. **Spec tests** (`tests/consensus/`) - Generate JSON test vectors via fillers
53+
- *Note: `tests/execution/` infrastructure is ready for future execution layer work*
5154

5255
**Test Filling Framework:**
53-
- Pytest plugin in `packages/testing/src/consensus_testing/pytest_plugins/filler.py`
54-
- Write spec tests using `state_transition_test` or `fork_choice_test` fixtures
56+
- Layer-agnostic pytest plugin in `packages/testing/src/framework/pytest_plugins/filler.py`
57+
- Layer-specific packages: `consensus_testing` (active) and `execution_testing` (future)
58+
- Write consensus spec tests using `state_transition_test` or `fork_choice_test` fixtures
5559
- These fixtures are type aliases that create test vectors when called
56-
- Run `uv run fill --fork=devnet --clean` to generate fixtures in `fixtures/`
60+
- Run `uv run fill --fork=Devnet --clean` to generate consensus fixtures
61+
- Use `--layer=execution` flag when execution layer is implemented
62+
- Output goes to `fixtures/{layer}/{format}/{test_path}/...`
5763

5864
**Example spec test:**
5965
```python
@@ -71,13 +77,22 @@ def test_block(state_transition_test: StateTransitionTestFiller) -> None:
7177
3. `make_fixture()` executes the spec code (state transitions, fork choice steps)
7278
4. Validates output against expectations (`StateExpectation`, `StoreChecks`)
7379
5. Serializes to JSON via Pydantic's `model_dump(mode="json")`
74-
6. Writes fixtures at session end to `fixtures/{test_type}/{fork}/...`
80+
6. Writes fixtures at session end to `fixtures/{layer}/{format}/{test_path}/...`
81+
82+
**Layer-specific architecture:**
83+
- `framework/` - Shared infrastructure (base classes, pytest plugin, CLI)
84+
- `consensus_testing/` - Consensus layer fixtures, forks, builders
85+
- `execution_testing/` - Execution layer fixtures, forks, builders
86+
- Regular pytest runs (`uv run pytest`) ignore spec tests - they only run via `fill` command
7587

7688
**Serialization requirements:**
7789
- All spec types (State, Block, Uint64, etc.) must be Pydantic models
7890
- Custom types need `@field_serializer` or `model_serializer` for JSON output
7991
- SSZ types typically serialize to hex strings (e.g., `"0x1234..."`)
80-
- Fixture models inherit from `BaseConsensusFixture` (uses `CamelModel` for camelCase JSON)
92+
- Fixture models inherit from layer-specific base classes:
93+
- Consensus: `BaseConsensusFixture` (in `consensus_testing/test_fixtures/base.py`)
94+
- Execution: `BaseExecutionFixture` (in `execution_testing/test_fixtures/base.py`)
95+
- Both use `CamelModel` for camelCase JSON output
8196
- Test the serialization: `fixture.model_dump(mode="json")` must produce valid JSON
8297

8398
**Key fixture types:**

0 commit comments

Comments
 (0)