@@ -76,6 +76,9 @@ class LstarSpec(ForkProtocol):
7676
7777 previous : ClassVar [type [ForkProtocol ] | None ] = None
7878
79+ # Capabilities advertised by this fork.
80+ sig_scheme : ClassVar [GeneralizedXmssScheme ] = TARGET_SIGNATURE_SCHEME
81+
7982 state_class : type [State ] = State
8083 block_class : type [Block ] = Block
8184 block_body_class : type [BlockBody ] = BlockBody
@@ -797,7 +800,6 @@ def verify_signatures(
797800 self ,
798801 signed_block : SignedBlock ,
799802 validators : Validators ,
800- scheme : GeneralizedXmssScheme = TARGET_SIGNATURE_SCHEME ,
801803 ) -> bool :
802804 """
803805 Verify the merged Type-2 proof carried by a signed block.
@@ -807,19 +809,18 @@ def verify_signatures(
807809 - Each aggregated attestation in the body to its participants.
808810 - The proposer's signature over the block root.
809811
812+ The signing scheme is read from this fork's capability.
813+
810814 Args:
811815 signed_block: The signed block whose merged proof is checked.
812816 validators: Validator registry providing public keys for verification.
813- scheme: XMSS signature scheme for verification.
814817
815818 Returns:
816819 True if the merged proof is valid.
817820
818821 Raises:
819822 AssertionError: On any structural or cryptographic mismatch.
820823 """
821- _ = scheme
822-
823824 block = signed_block .block
824825 aggregated_attestations = block .body .attestations
825826
@@ -1031,19 +1032,28 @@ def on_gossip_attestation(
10311032 self ,
10321033 store : LstarStore ,
10331034 signed_attestation : SignedAttestation ,
1034- scheme : GeneralizedXmssScheme = TARGET_SIGNATURE_SCHEME ,
10351035 is_aggregator : bool = False ,
10361036 ) -> LstarStore :
10371037 """Process a signed attestation received via gossip network.
10381038
10391039 This method:
1040- 1. Verifies the XMSS signature
1040+
1041+ 1. Verifies the XMSS signature using this fork's capability
10411042 2. Stores the signature when the node is in aggregator mode
10421043
10431044 Subnet filtering happens at the p2p subscription layer — only
10441045 attestations from subscribed subnets reach this method. No
10451046 additional subnet check is needed here.
10461047
1048+ Args:
1049+ store: The current forkchoice store.
1050+ signed_attestation: The signed attestation to process.
1051+ is_aggregator: True if the node is an aggregator.
1052+
1053+ Returns:
1054+ A new store with the attestation signature recorded when in
1055+ aggregator mode, otherwise the input store unchanged.
1056+
10471057 Raises:
10481058 ValueError: If validator not found in state.
10491059 AssertionError: If signature verification fails.
@@ -1067,7 +1077,7 @@ def on_gossip_attestation(
10671077 )
10681078 public_key = key_state .validators [validator_id ].get_attestation_pubkey ()
10691079
1070- assert scheme .verify (
1080+ assert self . sig_scheme .verify (
10711081 public_key , attestation_data .slot , hash_tree_root (attestation_data ), signature
10721082 ), "Signature verification failed"
10731083
@@ -1164,16 +1174,18 @@ def on_block(
11641174 self ,
11651175 store : LstarStore ,
11661176 signed_block : SignedBlock ,
1167- scheme : GeneralizedXmssScheme = TARGET_SIGNATURE_SCHEME ,
11681177 ) -> LstarStore :
11691178 """Process a new block and update the forkchoice state.
11701179
11711180 This method integrates a block into the forkchoice store by:
1181+
11721182 1. Validating the block's parent exists
11731183 2. Computing the post-state via the state transition function
11741184 3. Processing attestations included in the block body (on-chain)
11751185 4. Updating the forkchoice head
11761186
1187+ Signatures are verified using this fork's capability.
1188+
11771189 Raises:
11781190 AssertionError: If parent block/state not found in store.
11791191 """
@@ -1200,7 +1212,7 @@ def on_block(
12001212 )
12011213
12021214 # Validate cryptographic signatures
1203- valid_signatures = self .verify_signatures (signed_block , parent_state .validators , scheme )
1215+ valid_signatures = self .verify_signatures (signed_block , parent_state .validators )
12041216
12051217 # Execute state transition function to compute post-block state
12061218 post_state = self .state_transition (parent_state , block , valid_signatures )
0 commit comments