Skip to content

Commit 983bd65

Browse files
committed
fix: num validators
1 parent a3f07d1 commit 983bd65

2 files changed

Lines changed: 3 additions & 33 deletions

File tree

packages/testing/src/consensus_testing/test_fixtures/verify_signature.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ def _build_block_from_spec(
202202
proposer_index = spec.proposer_index or Uint64(int(spec.slot) % int(state.validators.count))
203203

204204
# Resolve parent root
205-
parent_root, parent_state = self._resolve_parent_root(spec, state)
205+
parent_state = state.process_slots(spec.slot)
206+
parent_root = hash_tree_root(parent_state.latest_block_header)
206207

207208
# Build attestations from spec
208209
attestations, attestation_signatures = self._build_attestations_from_spec(
@@ -257,34 +258,6 @@ def _build_block_from_spec(
257258
signature=BlockSignatures(data=signature_list),
258259
)
259260

260-
def _resolve_parent_root(
261-
self,
262-
spec: BlockSpec,
263-
state: State,
264-
) -> tuple[Bytes32, State]:
265-
"""
266-
Resolve parent root from BlockSpec.
267-
268-
For verify_signature tests, we always compute the parent root by
269-
advancing the state to the block's slot.
270-
271-
Parameters
272-
----------
273-
spec : BlockSpec
274-
The block specification.
275-
state : State
276-
The anchor state to build against.
277-
278-
Returns:
279-
-------
280-
tuple[Bytes32, State]
281-
Tuple of (parent_root, state_at_slot).
282-
"""
283-
# Advance state to the block's slot
284-
state_at_slot = state.process_slots(spec.slot)
285-
parent_root = hash_tree_root(state_at_slot.latest_block_header)
286-
return parent_root, state_at_slot
287-
288261
def _build_attestations_from_spec(
289262
self,
290263
spec: BlockSpec,

tests/consensus/devnet/verify_signature/test_valid_signatures.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ def test_proposer_signature(
3434
----------------
3535
This is the most basic signature generation test. It verifies:
3636
- XMSS key generation works
37-
- Block building produces correct structure (TODO: use the spec's block building function)
38-
- Proposer attestation is created properly
3937
- Signature aggregation includes proposer signature
40-
- Output serialization works for test vectors
4138
"""
4239
verify_signature_test(
43-
anchor_state=generate_pre_state(num_validators=1),
40+
anchor_state=generate_pre_state(num_validators=2),
4441
block=BlockSpec(
4542
slot=Slot(1),
4643
attestations=[],

0 commit comments

Comments
 (0)