Bitcoin Forum
May 06, 2024, 01:28:36 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [solved] block catch up after power outage  (Read 98 times)
callmejoe (OP)
Jr. Member
*
Offline Offline

Activity: 45
Merit: 22


View Profile WWW
August 20, 2021, 01:34:20 AM
Last edit: August 21, 2021, 03:54:42 AM by callmejoe
Merited by HCP (5), vapourminer (3), ABCbits (1)
 #1

running v.0.21.0 on my raspberry pi4.  had to pull the power supply because the OS froze for some reason.  after it booted back up and i restarted bitcoin core  i noticed it was re-downloading about 200 or so blocks to get current.  i was only down for maybe 15 minutes.  does bitcoin core not save recent block history?
1715002116
Hero Member
*
Offline Offline

Posts: 1715002116

View Profile Personal Message (Offline)

Ignore
1715002116
Reply with quote  #2

1715002116
Report to moderator
1715002116
Hero Member
*
Offline Offline

Posts: 1715002116

View Profile Personal Message (Offline)

Ignore
1715002116
Reply with quote  #2

1715002116
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
August 20, 2021, 01:55:12 AM
Merited by HCP (20), Foxpup (2), vapourminer (1), ABCbits (1)
 #2

It likely wasn't re-downloading anything (unless you are saying you observed network activity). Rather it was re-applying the chainstate updates that were lost during the power loss. These chainstate updates are cached in memory before being committed to disk, so a sudden power loss will lose those updates. These updates are the effect of processing blocks - it's really just re-processing those blocks. The caching is done for performance since waiting for things to flush to disk can be a significant bottleneck in syncing.

callmejoe (OP)
Jr. Member
*
Offline Offline

Activity: 45
Merit: 22


View Profile WWW
August 20, 2021, 02:25:14 AM
 #3

It likely wasn't re-downloading anything (unless you are saying you observed network activity). Rather it was re-applying the chainstate updates that were lost during the power loss. These chainstate updates are cached in memory before being committed to disk, so a sudden power loss will lose those updates. These updates are the effect of processing blocks - it's really just re-processing those blocks. The caching is done for performance since waiting for things to flush to disk can be a significant bottleneck in syncing.

interesting. so does the cache get written to disk only when there is a proper shutdown or at some preset intervals?  maybe based on the amount RAM the system has?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
August 20, 2021, 04:19:34 AM
Merited by HCP (10), ABCbits (2), vapourminer (1)
 #4

interesting. so does the cache get written to disk only when there is a proper shutdown or at some preset intervals?  maybe based on the amount RAM the system has?
All of the above. If it's been too long since a flush, it will be flushed. If the cache is near or past its maximum (controlled by the -dbcache option, which can be dependent on available RAM), it will be flushed. And of course it's always flushed during the clean shutdown process.

kano
Legendary
*
Offline Offline

Activity: 4494
Merit: 1808


Linux since 1997 RedHat 4


View Profile
August 21, 2021, 01:36:06 AM
Merited by vapourminer (1), HCP (1)
 #5

Consider it the other way around Smiley

There are 10's of thousands of copies out there of the blockchain.
It's like running RAID1 with over 10,000 mirrors Smiley
Performance is important in core (well I'd say it's the most important thing, since I run a pool)
It's not hard to get that data back if anything goes wrong, but something going wrong should be rare not common.

The only file on your node that is critical and possibly irreplaceable is the wallet file, if you have a wallet on the node.

Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!