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
2 changes: 1 addition & 1 deletion .claude/agents/code-tester.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ When writing tests for consensus-related code, invoke the `/consensus-testing` s

### 5. Verify
- Run `uv run pytest <test_file>` to ensure tests pass
- Run `uv run fill --clean --fork=devnet <test_file>` to ensure test fillers pass
- Run `uv run fill --clean --fork=Lstar <test_file>` to ensure test fillers pass
- Run `uv run ruff check <test_file>` for linting
- Run `uv run ruff format <test_file>` for formatting
- Fix any issues before presenting results
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/client-test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Run generated leanSpec test fixtures against a client implementation.
Generated fixtures live at `fixtures/consensus/`. Verify it contains JSON files. If empty or missing, generate them:

```bash
uv run fill --fork=devnet --clean -n auto --scheme=prod
uv run fill --fork=Lstar --clean -n auto --scheme=prod
```

Fixtures for client testing must always use `--scheme=prod` (production signatures).
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Generate test fixtures using the `fill` command:

```bash
# from `leanSpec/` (root of workspace)
uv run fill --clean --fork=devnet
uv run fill --clean --fork=Lstar
```

See the main project documentation for more details.
11 changes: 4 additions & 7 deletions packages/testing/src/framework/cli/fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@click.option(
"--fork",
required=True,
help="Fork to generate fixtures for (e.g., Devnet for consensus, Shanghai for execution)",
help="Fork to generate fixtures for (e.g., Lstar for consensus)",
)
@click.option(
"--layer",
Expand Down Expand Up @@ -62,16 +62,13 @@ def fill(

Examples:
# Generate consensus layer fixtures
fill tests/spec_tests/devnet --fork=Devnet --layer=consensus --clean -v

# Generate execution layer fixtures (future)
fill tests/spec_tests/shanghai --fork=Shanghai --layer=execution --clean -v
fill tests/consensus/devnet --fork=Lstar --layer=consensus --clean -v

# Default layer is consensus
fill tests/spec_tests/devnet --fork=Devnet --clean -v
fill tests/consensus/devnet --fork=Lstar --clean -v

# Use specific XMSS scheme (overrides LEAN_ENV env var)
fill --fork=Devnet --scheme=prod --clean -v
fill --fork=Lstar --scheme=prod --clean -v
"""
# Note: It's important to never import any leanSpec modules in this file, so the
# `LEAN_ENV` variable can be set before the config loads its value from the
Expand Down
3 changes: 1 addition & 2 deletions packages/testing/src/framework/forks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def name(cls) -> str:
"""
Return the name of the fork as it appears in test fixtures.

By default, this is the class name (e.g., "Lstar" for consensus,
"Shanghai" for execution).
By default, this is the class name (e.g., "Lstar" for consensus).
This is used in the 'network' field of generated fixtures.
"""
pass
Expand Down
6 changes: 3 additions & 3 deletions packages/testing/src/framework/pytest_plugins/filler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, output_dir: Path, fork: str, layer: str):

Args:
output_dir: Root directory for generated fixtures.
fork: The fork name (e.g., "Lstar", "Shanghai").
fork: The fork name (e.g., "Lstar").
layer: The Ethereum layer (e.g., "consensus", "execution").
"""
self.output_dir = output_dir
Expand Down Expand Up @@ -57,7 +57,7 @@ def add_fixture(

test_file = Path(test_file_path)
# Extract test path relative to tests/{layer}
# e.g., tests/consensus/devnet/... -> devnet/...
# e.g., tests/consensus/lstar/... -> lstar/...
layer = config.test_layer if hasattr(config, "test_layer") else "consensus"

try:
Expand Down Expand Up @@ -94,7 +94,7 @@ def write_fixtures(self) -> None:
test_file = Path(test_file_path)

# Extract test path relative to tests/{layer}
# e.g., tests/consensus/devnet/... -> devnet/...
# e.g., tests/consensus/lstar/... -> lstar/...
try:
relative_path = test_file.relative_to(f"tests/{self.layer}")
except ValueError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pytest
from consensus_testing import ApiEndpointTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


GENESIS_4V_AT_SLOT_3 = {"numValidators": 4, "genesisTime": 0, "anchorSlot": 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from consensus_testing import ApiEndpointTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_metrics_endpoint_scrape_contract(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Fork choice test vectors for the devnet fork.
Fork choice test vectors for the lstar fork.

This package contains spec test vectors for fork choice behavior.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from lean_spec.subspecs.ssz.hash import hash_tree_root
from lean_spec.types import Bytes32, Slot, Uint64, ValidatorIndex

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


ANCHOR_SLOT = Slot(10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from lean_spec.types import Slot, ValidatorIndex

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_block_with_duplicate_aggregated_attestation_data_rejected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest
from consensus_testing import NetworkingCodecTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_decode_failure_varint_truncated(networking_codec: NetworkingCodecTestFiller) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lean_spec.subspecs.networking.discovery.codec import MessageDecodingError

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_discv5_message_decode_rejects_empty_input(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest
from consensus_testing import NetworkingCodecTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


DEST_NODE_ID = "0x" + "11" * 32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from lean_spec.types.rlp import encode_rlp

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def _build_unsorted_enr_rlp() -> bytes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from consensus_testing import NetworkingCodecTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_enr_decode_rejects_oversize_payload(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from consensus_testing import NetworkingCodecTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_gossip_topic_network_name_matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lean_spec.subspecs.networking.gossipsub.rpc import ProtobufDecodeError

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_gossipsub_rpc_decode_rejects_unknown_wire_type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from consensus_testing import NetworkingCodecTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_reqresp_error_at_max_error_message_size(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from lean_spec.subspecs.networking.reqresp.codec import CodecError

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_reqresp_decode_rejects_empty_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from consensus_testing import NetworkingCodecTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_stream_two_success_chunks(networking_codec: NetworkingCodecTestFiller) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lean_spec.snappy.decompress import SnappyDecompressionError

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_snappy_frame_decode_rejects_empty_input(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from lean_spec.subspecs.networking.varint import VarintError

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_varint_truncated_mid_stream_rejected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from lean_spec.subspecs.koalabear.field import P

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")

WIDTH: int = 16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from lean_spec.subspecs.koalabear.field import P

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")

WIDTH: int = 24

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from lean_spec.types import BaseBitlist, Boolean

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


class SmokeBitlist8(BaseBitlist):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from lean_spec.types.exceptions import SSZSerializationError, SSZValueError

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


class DecodeBitlist8(BaseBitlist):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Uint64,
)

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


# Fixed-width bitvectors at bit- and chunk-boundary sizes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from lean_spec.forks.lstar.spec import LstarSpec
from lean_spec.types import Slot

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_process_slots_target_equal_to_state_slot_rejected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from consensus_testing import SyncTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_checkpoint_verify_rejects_empty_validator_set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from consensus_testing import SyncTestFiller

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_checkpoint_verify_advanced_slot_three(sync: SyncTestFiller) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from lean_spec.types import Slot, ValidatorIndex

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_empty_aggregation_bits_rejected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from lean_spec.types import Slot, ValidatorIndex

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_attestation_validator_index_out_of_range_rejected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from lean_spec.types import Slot

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_proposer_index_out_of_range_rejected(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from lean_spec.types import Slot, ValidatorIndex

pytestmark = pytest.mark.valid_until("Devnet")
pytestmark = pytest.mark.valid_until("Lstar")


def test_signature_group_count_mismatch_rejected(
Expand Down
Loading