ncli_db pruneDatabase checkpointing; remove onSlotEnd lookaheadTime
This commit is contained in:
parent
6533999c82
commit
97504fdb9d
|
@ -928,12 +928,9 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
|
||||||
node.db.checkpoint()
|
node.db.checkpoint()
|
||||||
|
|
||||||
let
|
let
|
||||||
horizonSlot = compute_start_slot_at_epoch(
|
|
||||||
node.attestationSubnets.lastCalculatedAttestationEpoch + 1) - 1
|
|
||||||
nextAttestationSlot = node.getNextAttestation(slot)
|
nextAttestationSlot = node.getNextAttestation(slot)
|
||||||
nextActionWaitTime =
|
nextActionWaitTime =
|
||||||
saturate(fromNow(node.beaconClock, nextAttestationSlot))
|
saturate(fromNow(node.beaconClock, nextAttestationSlot))
|
||||||
horizonDistance = saturate(fromNow(node.beaconClock, horizonSlot))
|
|
||||||
|
|
||||||
info "Slot end",
|
info "Slot end",
|
||||||
slot = shortLog(slot),
|
slot = shortLog(slot),
|
||||||
|
@ -948,8 +945,7 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
|
||||||
if nextAttestationSlot == FAR_FUTURE_SLOT:
|
if nextAttestationSlot == FAR_FUTURE_SLOT:
|
||||||
"n/a"
|
"n/a"
|
||||||
else:
|
else:
|
||||||
shortLog(nextActionWaitTime),
|
shortLog(nextActionWaitTime)
|
||||||
lookaheadTime = shortLog(horizonDistance)
|
|
||||||
|
|
||||||
if nextAttestationSlot != FAR_FUTURE_SLOT:
|
if nextAttestationSlot != FAR_FUTURE_SLOT:
|
||||||
next_action_wait.set(nextActionWaitTime.toFloatSeconds)
|
next_action_wait.set(nextActionWaitTime.toFloatSeconds)
|
||||||
|
|
|
@ -234,6 +234,7 @@ proc copyPrunedDatabase(
|
||||||
for signedBlock in getAncestors(db, headBlock.get):
|
for signedBlock in getAncestors(db, headBlock.get):
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
copyDb.putBlock(signedBlock)
|
copyDb.putBlock(signedBlock)
|
||||||
|
copyDb.checkpoint()
|
||||||
if verbose:
|
if verbose:
|
||||||
echo "copied block at slot ", signedBlock.message.slot
|
echo "copied block at slot ", signedBlock.message.slot
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import chronos
|
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
|
../beacon_chain/sync/sync_manager
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
Loading…
Reference in New Issue