@@ -65,8 +65,8 @@ def test_withholding_attack(spec, state):
6565 signed_attack_block = signed_blocks [- 1 ]
6666 for signed_block in signed_blocks [:- 1 ]:
6767 current_root = signed_block .message .hash_tree_root ()
68- state = yield from tick_and_add_block (spec , store , signed_block , test_steps )
69- state = payload_state_transition (spec , store , signed_block .message )
68+ yield from tick_and_add_block (spec , store , signed_block , test_steps )
69+ payload_state_transition (spec , store , signed_block .message )
7070 check_head_against_root (spec , store , current_root )
7171 head_root = signed_blocks [- 2 ].message .hash_tree_root ()
7272 check_head_against_root (spec , store , head_root )
@@ -79,10 +79,12 @@ def test_withholding_attack(spec, state):
7979 assert spec .compute_epoch_at_slot (state .slot ) == 5
8080 assert state .current_justified_checkpoint .epoch == 3
8181 # Create two blocks in the honest chain with full attestations, and add to the store
82+ honest_state = state .copy ()
8283 for _ in range (2 ):
83- signed_block = state_transition_with_full_block (spec , state , True , False )
84+ print ("Trying slot" , honest_state .slot )
85+ signed_block = state_transition_with_full_block (spec , honest_state , True , False )
8486 yield from tick_and_add_block (spec , store , signed_block , test_steps )
85- payload_state_transition (spec , store , signed_block .message )
87+ honest_state = payload_state_transition (spec , store , signed_block .message ). copy ( )
8688 # Create final block in the honest chain that includes the justifying attestations from the attack block
8789 honest_block = build_empty_block_for_next_slot (spec , state )
8890 honest_block .body .attestations = signed_attack_block .message .body .attestations
0 commit comments