From 74e35c464f036e3141e1abe0ca2d7fc164c2212c Mon Sep 17 00:00:00 2001 From: Dustin Brody Date: Sat, 23 May 2020 19:43:05 +0200 Subject: [PATCH] halt processing if one of the operation functions fails (failed deposits due to BLS signature issues return as not-failed, so it remains consistant with that --- beacon_chain/spec/state_transition_block.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index aa838fefc..1205e1772 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -326,11 +326,13 @@ proc process_operations(state: var BeaconState, body: BeaconBlockBody, template for_ops_cached(operations: auto, fn: auto) = for operation in operations: - discard fn(state, operation, flags, stateCache) + if not fn(state, operation, flags, stateCache): + return false template for_ops(operations: auto, fn: auto) = for operation in operations: - discard fn(state, operation, flags) + if not fn(state, operation, flags): + return false for_ops_cached(body.proposer_slashings, process_proposer_slashing) for_ops_cached(body.attester_slashings, process_attester_slashing)