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
Original file line number Diff line number Diff line change
Expand Up @@ -292,23 +292,6 @@ def make_fixture(self) -> Self:
scheme=LEAN_ENV_TO_SCHEMES[self.lean_env],
)

# Optionally simulate the proposer's gossip attestation.
if step.block.gossip_proposer_attestation:
proposer_index = block.proposer_index
proposer_att_data = store.produce_attestation_data(block.slot)
proposer_gossip_att = SignedAttestation(
validator_id=proposer_index,
data=proposer_att_data,
signature=key_manager.sign_attestation_data(
proposer_index, proposer_att_data
),
)
store = store.on_gossip_attestation(
proposer_gossip_att,
scheme=LEAN_ENV_TO_SCHEMES[self.lean_env],
is_aggregator=True,
)

case AttestationStep():
# Process a gossip attestation.
# Gossip attestations arrive outside of blocks.
Expand Down Expand Up @@ -435,25 +418,7 @@ def _build_block_from_spec(
aggregation_store, _ = working_store.aggregate()
merged_store = aggregation_store.accept_new_attestations()

# Two sources of attestations:
# 1. Explicit attestations from the spec (always included)
# 2. Store attestations (only if include_store_attestations is True)
available_attestations: list[Attestation]
known_block_roots: set[Bytes32] | None = None

if spec.include_store_attestations:
# Extract from merged payloads (contains both known and newly aggregated)
attestation_map = merged_store.extract_attestations_from_aggregated_payloads(
merged_store.latest_known_aggregated_payloads
)
store_attestations = [
Attestation(validator_id=vid, data=data) for vid, data in attestation_map.items()
]
available_attestations = store_attestations + attestations
known_block_roots = set(store.blocks.keys())
else:
# Use only explicit attestations from the spec
available_attestations = attestations
available_attestations = attestations

# Build the block using spec logic.
#
Expand All @@ -466,7 +431,6 @@ def _build_block_from_spec(
parent_root=parent_root,
attestations=available_attestations,
available_attestations=available_attestations,
known_block_roots=known_block_roots,
aggregated_payloads=merged_store.latest_known_aggregated_payloads,
)

Expand Down
25 changes: 0 additions & 25 deletions packages/testing/src/consensus_testing/test_types/block_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,3 @@ class BlockSpec(CamelModel):

Useful for tests that intentionally exercise slot mismatch failures.
"""

include_store_attestations: bool = False
"""
Automatically include available attestations in the block body.

When True:
- Previous proposers' attestations flow into subsequent blocks
- Gossip attestations are automatically collected
- Combined with any explicitly specified attestations

When False (default):
- Only explicitly specified attestations are included

Enables more realistic test vectors without manual specification.
"""

gossip_proposer_attestation: bool = False
"""
Simulate the proposer gossiping an attestation after block production.

In the real system, the proposer gossips an attestation at interval 1
using the attestation key, separate from the block's proposal-key
signature. This flag simulates that gossip so later blocks can
auto-collect it via include_store_attestations.
"""
Loading
Loading