From 7da16f49086fc21ce10766eb0cc00decc9d0fd81 Mon Sep 17 00:00:00 2001 From: tersec Date: Fri, 15 Jan 2021 05:23:54 +0000 Subject: [PATCH] only checkpoint every four slots (#2236) * only checkpoint every four slots * only checkpoint every 16 slots * every 8 slots * every 4 slots; 8 seems probably okay, but be a bit conservative --- beacon_chain/nimbus_beacon_node.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index f56b17e2f..69cc5e9fc 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -626,7 +626,8 @@ proc onSlotEnd(node: BeaconNode, slot, nextSlot: Slot) = # Checkpoint the database to clear the WAL file and make sure changes in # the database are synced with the filesystem. - node.db.checkpoint() + if slot mod 4 == 0: + node.db.checkpoint() info "Slot end", slot = shortLog(slot),