ncli_db pruneDatabase checkpointing; remove onSlotEnd lookaheadTime

This commit is contained in:
Dustin Brody 2021-03-12 18:13:26 +01:00 committed by zah
parent 6533999c82
commit 97504fdb9d
3 changed files with 3 additions and 6 deletions

View File

@ -928,12 +928,9 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
node.db.checkpoint()
let
horizonSlot = compute_start_slot_at_epoch(
node.attestationSubnets.lastCalculatedAttestationEpoch + 1) - 1
nextAttestationSlot = node.getNextAttestation(slot)
nextActionWaitTime =
saturate(fromNow(node.beaconClock, nextAttestationSlot))
horizonDistance = saturate(fromNow(node.beaconClock, horizonSlot))
info "Slot end",
slot = shortLog(slot),
@ -948,8 +945,7 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
if nextAttestationSlot == FAR_FUTURE_SLOT:
"n/a"
else:
shortLog(nextActionWaitTime),
lookaheadTime = shortLog(horizonDistance)
shortLog(nextActionWaitTime)
if nextAttestationSlot != FAR_FUTURE_SLOT:
next_action_wait.set(nextActionWaitTime.toFloatSeconds)

View File

@ -234,6 +234,7 @@ proc copyPrunedDatabase(
for signedBlock in getAncestors(db, headBlock.get):
if not dry_run:
copyDb.putBlock(signedBlock)
copyDb.checkpoint()
if verbose:
echo "copied block at slot ", signedBlock.message.slot

View File

@ -2,7 +2,7 @@
import unittest
import chronos
import ../beacon_chain/gossip_processing/[eth2_processor, gossip_to_consensus],
import ../beacon_chain/gossip_processing/gossip_to_consensus,
../beacon_chain/sync/sync_manager
type