Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@

## Adding New Subspecifications

New subspecs belong in `src/lean_spec/subspecs/`. Follow the pattern of existing subspecs like `poseidon1`:
Cryptographic subspecs live under `src/lean_spec/spec/crypto/`. Follow the pattern of an existing one like the `xmss` package:

```bash
mkdir -p src/lean_spec/subspecs/my_new_subspec
touch src/lean_spec/subspecs/my_new_subspec/__init__.py
mkdir -p tests/subspecs/my_new_subspec
mkdir -p src/lean_spec/spec/crypto/my_new_subspec
touch src/lean_spec/spec/crypto/my_new_subspec/__init__.py
mkdir -p tests/spec/crypto/my_new_subspec
```

Tests mirror the source layout one-to-one (see `tests/spec/crypto/xmss/`).

## Testing

- Write tests that mirror the source structure
Expand Down
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,18 @@ just test
```
├── src/
│ └── lean_spec/ # Main specifications
│ ├── __init__.py
│ └── subspecs/ # Sub-specifications
│ ├── poseidon1/
│ │ ├── __init__.py
│ │ ├── permutation.py
│ │ └── constants.py
│ ├── ...
│ └── ...
│ ├── cli/ # Command-line entry points
│ ├── node/ # Node implementation (chain, networking, sync, validator, ...)
│ └── spec/ # Protocol specifications
│ ├── crypto/ # Cryptographic subspecs (poseidon, koalabear, xmss, ...)
│ ├── forks/ # Fork specifications (tested via consensus vectors)
│ ├── ssz/ # SSZ serialization
│ └── observability/ # Observability spec
├── tests/ # Test suite
| ├── consensus/ # Tests for consensus
| | └── devnet/ # Tests for devnet
| | ├── fc/ # Tests for fork-choice
| | └── state_transition/ # Tests for stf
│ └── lean_spec/ # Tests for main specs
│ └── subspecs/ # Tests for subspecs
│ ├── consensus/ # Consensus test vectors
│ │ └── lstar/ # e.g. fork_choice, state_transition, ssz, ...
│ ├── spec/ # Unit tests mirroring src/lean_spec/spec/
│ └── node/ # Unit tests mirroring src/lean_spec/node/
├── docs/ # Documentation
└── pyproject.toml # Project configuration
```
Expand Down
Loading