@@ -206,7 +206,7 @@ def _build_block_from_spec(
206206 parent_root = hash_tree_root (parent_state .latest_block_header )
207207
208208 # Build attestations from spec
209- attestations , attestation_signatures = self ._build_attestations_from_spec (
209+ attestations , signatures = self ._build_attestations_from_spec (
210210 spec , state , key_manager
211211 )
212212
@@ -230,9 +230,6 @@ def _build_block_from_spec(
230230 ),
231231 )
232232
233- # Collect all signatures: attestations first, then proposer attestation
234- signature_list = attestation_signatures .copy ()
235-
236233 # Sign proposer attestation - use valid or dummy signature based on spec
237234 if spec .valid_signature :
238235 proposer_attestation_signature = key_manager .sign_attestation (proposer_attestation )
@@ -248,14 +245,14 @@ def _build_block_from_spec(
248245 hashes = HashDigestList (data = []),
249246 )
250247
251- signature_list .append (proposer_attestation_signature )
248+ signatures .append (proposer_attestation_signature )
252249
253250 return SignedBlockWithAttestation (
254251 message = BlockWithAttestation (
255252 block = final_block ,
256253 proposer_attestation = proposer_attestation ,
257254 ),
258- signature = BlockSignatures (data = signature_list ),
255+ signature = BlockSignatures (data = signatures ),
259256 )
260257
261258 def _build_attestations_from_spec (
@@ -272,18 +269,15 @@ def _build_attestations_from_spec(
272269 attestation_signatures = []
273270
274271 for attestation_item in spec .attestations :
275- # Handle both SignedAttestation and SignedAttestationSpec
276- if isinstance (attestation_item , SignedAttestation ):
277- # Already a SignedAttestation, use it directly
278- attestations .append (attestation_item .message )
279- attestation_signatures .append (attestation_item .signature )
280- else :
281- # It's a SignedAttestationSpec, build it
272+ if isinstance (attestation_item , SignedAttestationSpec ):
282273 signed_attestation = self ._build_signed_attestation_from_spec (
283274 attestation_item , state , key_manager
284275 )
285276 attestations .append (signed_attestation .message )
286277 attestation_signatures .append (signed_attestation .signature )
278+ else :
279+ attestations .append (attestation_item .message )
280+ attestation_signatures .append (attestation_item .signature )
287281
288282 return attestations , attestation_signatures
289283
0 commit comments