@@ -260,6 +260,7 @@ def import_block(
260
260
block ,
261
261
self .chaindb ,
262
262
self .config ,
263
+ is_validating_signatures = True ,
263
264
)
264
265
265
266
# Validate state roots
@@ -285,17 +286,20 @@ def process_block(
285
286
active_state : ActiveState ,
286
287
block : BaseBeaconBlock ,
287
288
chaindb : BaseBeaconChainDB ,
288
- config : BeaconConfig ) -> Tuple [BaseBeaconBlock , CrystallizedState , ActiveState ]:
289
+ config : BeaconConfig ,
290
+ is_validating_signatures : bool = True
291
+ ) -> Tuple [BaseBeaconBlock , CrystallizedState , ActiveState ]:
289
292
"""
290
293
Process ``block`` and return the new crystallized state and active state.
291
294
"""
292
295
# Process per block state changes (ActiveState)
293
- processing_active_state = cls .compute_per_block_transtion (
296
+ processing_active_state = cls .compute_per_block_transition (
294
297
crystallized_state ,
295
298
active_state ,
296
299
block ,
297
300
chaindb ,
298
301
config .CYCLE_LENGTH ,
302
+ is_validating_signatures = is_validating_signatures ,
299
303
)
300
304
301
305
# Process per cycle state changes (CrystallizedState and ActiveState)
@@ -309,12 +313,13 @@ def process_block(
309
313
return result_block , processed_crystallized_state , processed_active_state
310
314
311
315
@classmethod
312
- def compute_per_block_transtion (cls ,
313
- crystallized_state : CrystallizedState ,
314
- active_state : ActiveState ,
315
- block : BaseBeaconBlock ,
316
- chaindb : BaseBeaconChainDB ,
317
- cycle_length : int ) -> ActiveState :
316
+ def compute_per_block_transition (cls ,
317
+ crystallized_state : CrystallizedState ,
318
+ active_state : ActiveState ,
319
+ block : BaseBeaconBlock ,
320
+ chaindb : BaseBeaconChainDB ,
321
+ cycle_length : int ,
322
+ is_validating_signatures : bool = True ) -> ActiveState :
318
323
"""
319
324
Process ``block`` and return the new ActiveState.
320
325
@@ -349,6 +354,7 @@ def compute_per_block_transtion(cls,
349
354
attestation ,
350
355
chaindb ,
351
356
cycle_length ,
357
+ is_validating_signatures = is_validating_signatures ,
352
358
)
353
359
354
360
return active_state .copy (
@@ -389,6 +395,7 @@ def propose_block(
389
395
block_proposal .block ,
390
396
chaindb ,
391
397
config ,
398
+ is_validating_signatures = False ,
392
399
)
393
400
394
401
# Set state roots
@@ -405,7 +412,6 @@ def propose_block(
405
412
proposer_attestation = self .attest_proposed_block (
406
413
post_crystallized_state ,
407
414
post_active_state ,
408
- active_state ,
409
415
filled_block_proposal ,
410
416
chaindb ,
411
417
config .CYCLE_LENGTH ,
@@ -422,7 +428,6 @@ def _update_the_states(self,
422
428
def attest_proposed_block (self ,
423
429
post_crystallized_state : CrystallizedState ,
424
430
post_active_state : ActiveState ,
425
- pre_active_state : ActiveState ,
426
431
block_proposal : 'BlockProposal' ,
427
432
chaindb : BaseBeaconChainDB ,
428
433
cycle_length : int ,
@@ -461,13 +466,10 @@ def attest_proposed_block(self,
461
466
block_proposal .shard_block_hash ,
462
467
justified_slot ,
463
468
)
464
- sigs = [
465
- bls .sign (
466
- message ,
467
- private_key ,
468
- )
469
- ]
470
- aggregate_sig = bls .aggregate_sigs (sigs )
469
+ sig = bls .sign (
470
+ message ,
471
+ private_key ,
472
+ )
471
473
472
474
return self .get_attestation_record_class ()(
473
475
slot = block_proposal .block .slot_number ,
@@ -477,7 +479,7 @@ def attest_proposed_block(self,
477
479
attester_bitfield = attester_bitfield ,
478
480
justified_slot = justified_slot ,
479
481
justified_block_hash = justified_block_hash ,
480
- aggregate_sig = aggregate_sig ,
482
+ aggregate_sig = sig ,
481
483
)
482
484
483
485
#
0 commit comments