-
Notifications
You must be signed in to change notification settings - Fork 40
feat(tests): Initial implementation for generating client test vectors #76
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
57e6bfb
feat: first pass at filling test vectors
fselmo 4a655a6
Add more _info to test vectors
fselmo aec1d1d
Add proper fork support
fselmo 617ce82
fix: updates to parametrize fork for tests
fselmo 8f6b1de
chore: move framework tests into appropriate parent
fselmo 0349371
fix: fork system hierarchy
fselmo 2623baa
fix: hex serialization issues for test vectors
fselmo 0bb7c6a
refactor: Refactor fillers; design fork_choice_test; remove genesis t…
fselmo e1a078e
refactor: some fork choice logic to help advance chain with blocks
fselmo b8e41d6
fix: cleanups from comments on PR #76
fselmo 899a9a3
Add missing STF test post checks + confirm state validation works
fselmo 8c75a9b
chore: Update CLAUDE.md; make more succinct to reduce context
fselmo 13f232a
chore: Add official Python 3.14 support to lean-spec-tests
fselmo bd7a148
refactor: rename package + generalize framework + use consensus scope
fselmo 5209b20
chore: Update CLAUDE.md based on last commit's refactor
fselmo fd8e8ef
fix: reconcile differences with main after rebase + cleanup impl
fselmo 81090ef
chore: add simple fill-devnet-tests run to CI for sanity checks
fselmo 457a1da
fix: updates from comments on #76
fselmo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Lean Ethereum Specification Testing Framework | ||
|
|
||
| Testing framework for generating and running Lean Ethereum specification tests. | ||
|
|
||
| This package provides tools for generating consensus test fixtures, including: | ||
| - Pytest plugins for fixture generation | ||
| - Base fixture types and serialization | ||
| - CLI tools for test management | ||
|
|
||
| ## Installation | ||
|
|
||
| This package is part of the lean-spec workspace and is automatically installed when you | ||
| sync the parent project with `--all-packages`. | ||
|
|
||
| ```bash | ||
| # from `leanSpec/` (root of workspace) | ||
| uv sync --all-packages | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| Generate test fixtures using the `fill` command: | ||
|
|
||
| ```bash | ||
| # from `leanSpec/` (root of workspace) | ||
| uv run fill --clean --fork=devnet | ||
| ``` | ||
|
|
||
| See the main project documentation for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=77.0.3", "wheel"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "lean-ethereum-testing" | ||
| version = "0.0.1" | ||
| description = "Lean Ethereum client test generation and runner framework" | ||
| readme = "README.md" | ||
| authors = [ | ||
| { name = "Ethereum Foundation", email = "thomas.coratger@ethereum.org" }, | ||
| ] | ||
| keywords = ["ethereum", "testing", "consensus", "lean"] | ||
| classifiers = [ | ||
| "License :: OSI Approved :: MIT License", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| ] | ||
| requires-python = ">=3.12" | ||
| dependencies = [ | ||
| "lean-spec", | ||
| "pydantic>=2.12.0,<3", | ||
| "pytest>=8.3.3,<9", | ||
| "click>=8.1.0,<9", | ||
| ] | ||
|
|
||
| license = {text = "MIT"} | ||
|
|
||
| [project.optional-dependencies] | ||
| test = ["pytest-cov>=6.0.0,<7"] | ||
| lint = ["ruff>=0.11.8,<1", "mypy>=1.15.0,<1.16"] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/leanEthereum/lean-spec" | ||
| Source = "https://github.com/leanEthereum/lean-spec" | ||
| Issues = "https://github.com/leanEthereum/lean-spec/issues" | ||
|
|
||
| [project.scripts] | ||
| fill = "framework.cli.fill:fill" | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
|
|
||
| [tool.uv.sources] | ||
| lean-spec = { workspace = true } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| """Test tools for generating and consuming leanSpec consensus test vectors.""" | ||
|
|
||
| from typing import Type | ||
|
|
||
| from framework.base_types import CamelModel | ||
|
|
||
| from . import forks | ||
| from .block_spec import BlockSpec | ||
| from .genesis import generate_pre_state | ||
| from .test_fixtures import ( | ||
| BaseConsensusFixture, | ||
| ForkChoiceTest, | ||
| StateTransitionTest, | ||
| ) | ||
| from .test_types import ( | ||
| AttestationStep, | ||
| BaseForkChoiceStep, | ||
| BlockStep, | ||
| ForkChoiceStep, | ||
| StateExpectation, | ||
| StoreChecks, | ||
| TickStep, | ||
| ) | ||
|
|
||
| StateTransitionTestFiller = Type[StateTransitionTest] | ||
| ForkChoiceTestFiller = Type[ForkChoiceTest] | ||
|
|
||
| __all__ = [ | ||
| # Public API | ||
| "BlockSpec", | ||
| "forks", | ||
| "generate_pre_state", | ||
| # Base types | ||
| "CamelModel", | ||
| # Fixture classes | ||
| "BaseConsensusFixture", | ||
| "StateTransitionTest", | ||
| "ForkChoiceTest", | ||
| # Test types | ||
| "BaseForkChoiceStep", | ||
| "TickStep", | ||
| "BlockStep", | ||
| "AttestationStep", | ||
| "ForkChoiceStep", | ||
| "StateExpectation", | ||
| "StoreChecks", | ||
| # Type aliases for test function signatures | ||
| "StateTransitionTestFiller", | ||
| "ForkChoiceTestFiller", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.