diff --git a/beacon_chain/consensus_object_pools/block_clearance.nim b/beacon_chain/consensus_object_pools/block_clearance.nim index 8aa6ea7dc8..7aeb1a9d24 100644 --- a/beacon_chain/consensus_object_pools/block_clearance.nim +++ b/beacon_chain/consensus_object_pools/block_clearance.nim @@ -514,7 +514,7 @@ proc addBackfillBlockData*( # 100%, but its not enough. if not updateState(dag, dag.clearanceState, clearanceBlock, true, cache, - dag.updateFlags): + updateFlags1): error "Unable to load clearance state for parent block, " & "database corrupt?", clearanceBlock = shortLog(clearanceBlock) return err(VerifierError.MissingParent) diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index bb3848e092..1249aba8ae 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -950,8 +950,7 @@ proc advanceSlots*( process_slots( dag.cfg, state, getStateField(state, slot) + 1, cache, info, - updateFlags). - expect("process_slots shouldn't fail when state slot is correct") + updateFlags).expect("process_slots shouldn't fail when state slot is correct") if save: dag.putState(state, stateBid) diff --git a/beacon_chain/spec/state_transition.nim b/beacon_chain/spec/state_transition.nim index 8999ea6da9..08ad858f86 100644 --- a/beacon_chain/spec/state_transition.nim +++ b/beacon_chain/spec/state_transition.nim @@ -257,8 +257,8 @@ func maybeUpgradeState*( proc process_slots*( cfg: RuntimeConfig, state: var ForkedHashedBeaconState, slot: Slot, - cache: var StateCache, info: var ForkedEpochInfo, flags: UpdateFlags -): Result[void, cstring] = + cache: var StateCache, info: var ForkedEpochInfo, flags: UpdateFlags): + Result[void, cstring] = if not (getStateField(state, slot) < slot): if slotProcessed notin flags or getStateField(state, slot) != slot: return err("process_slots: cannot rewind state to past slot")