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
This commit is contained in:
parent
67ba11cc1a
commit
74e35c464f
|
@ -326,11 +326,13 @@ proc process_operations(state: var BeaconState, body: BeaconBlockBody,
|
||||||
|
|
||||||
template for_ops_cached(operations: auto, fn: auto) =
|
template for_ops_cached(operations: auto, fn: auto) =
|
||||||
for operation in operations:
|
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) =
|
template for_ops(operations: auto, fn: auto) =
|
||||||
for operation in operations:
|
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.proposer_slashings, process_proposer_slashing)
|
||||||
for_ops_cached(body.attester_slashings, process_attester_slashing)
|
for_ops_cached(body.attester_slashings, process_attester_slashing)
|
||||||
|
|
Loading…
Reference in New Issue