@@ -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 ,
0 commit comments