3939
4040from lean_spec .config import LEAN_ENV
4141from lean_spec .subspecs .containers import AttestationData
42+ from lean_spec .subspecs .containers .attestation import AggregationBits
4243from lean_spec .subspecs .containers .block .types import (
4344 AggregatedAttestations ,
4445 AttestationSignatures ,
4546)
4647from lean_spec .subspecs .containers .slot import Slot
4748from lean_spec .subspecs .xmss .aggregation import (
48- AttestationSignatureKey ,
49- MultisigAggregatedSignature ,
49+ AggregatedSignatureProof ,
50+ SignatureKey ,
5051)
5152from lean_spec .subspecs .xmss .containers import KeyPair , PublicKey , Signature
5253from lean_spec .subspecs .xmss .interface import (
@@ -276,7 +277,7 @@ def sign_attestation_data(
276277 def build_attestation_signatures (
277278 self ,
278279 aggregated_attestations : AggregatedAttestations ,
279- signature_lookup : Mapping [AttestationSignatureKey , Signature ] | None = None ,
280+ signature_lookup : Mapping [SignatureKey , Signature ] | None = None ,
280281 ) -> AttestationSignatures :
281282 """
282283 Build `AttestationSignatures` for already-aggregated attestations.
@@ -286,29 +287,34 @@ def build_attestation_signatures(
286287 """
287288 lookup = signature_lookup or {}
288289
289- proof_blobs : list [MultisigAggregatedSignature ] = []
290+ proofs : list [AggregatedSignatureProof ] = []
290291 for agg in aggregated_attestations :
291292 validator_ids = agg .aggregation_bits .to_validator_indices ()
292293 message = agg .data .data_root_bytes ()
293294 epoch = agg .data .slot
294295
295296 public_keys : list [PublicKey ] = [self .get_public_key (vid ) for vid in validator_ids ]
296297 signatures : list [Signature ] = [
297- (lookup .get ((vid , message )) or self .sign_attestation_data (vid , agg .data ))
298+ (
299+ lookup .get (SignatureKey (vid , message ))
300+ or self .sign_attestation_data (vid , agg .data )
301+ )
298302 for vid in validator_ids
299303 ]
300304
301305 # If the caller supplied raw signatures and any are invalid,
302306 # aggregation should fail with exception.
303- aggregated_signature = MultisigAggregatedSignature .aggregate_signatures (
307+ participants = AggregationBits .from_validator_indices (validator_ids )
308+ proof = AggregatedSignatureProof .aggregate (
309+ participants = participants ,
304310 public_keys = public_keys ,
305311 signatures = signatures ,
306312 message = message ,
307313 epoch = epoch ,
308314 )
309- proof_blobs .append (aggregated_signature )
315+ proofs .append (proof )
310316
311- return AttestationSignatures (data = proof_blobs )
317+ return AttestationSignatures (data = proofs )
312318
313319
314320def _generate_single_keypair (
0 commit comments