Bitcoin Forum
May 12, 2024, 12:28:31 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How can I rollback Bitcoin Core backwards to re-download some blocks again ?  (Read 195 times)
scott.carter.2020 (OP)
Newbie
*
Offline Offline

Activity: 24
Merit: 10


View Profile
July 14, 2020, 05:21:32 AM
 #1

If my Bitcoin Core is fully synced but I want to roll it back to re-download few blocks back, 10 blocks for example, how I can do that safely ?
1715516911
Hero Member
*
Offline Offline

Posts: 1715516911

View Profile Personal Message (Offline)

Ignore
1715516911
Reply with quote  #2

1715516911
Report to moderator
1715516911
Hero Member
*
Offline Offline

Posts: 1715516911

View Profile Personal Message (Offline)

Ignore
1715516911
Reply with quote  #2

1715516911
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715516911
Hero Member
*
Offline Offline

Posts: 1715516911

View Profile Personal Message (Offline)

Ignore
1715516911
Reply with quote  #2

1715516911
Report to moderator
1715516911
Hero Member
*
Offline Offline

Posts: 1715516911

View Profile Personal Message (Offline)

Ignore
1715516911
Reply with quote  #2

1715516911
Report to moderator
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16654


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
July 14, 2020, 06:10:07 AM
 #2

If my Bitcoin Core is fully synced but I want to roll it back to re-download few blocks back, 10 blocks for example, how I can do that safely ?
From what I've read: you should just delete the last few block files in your "blocks" directory. However, when I tried this, it triggered a full download of all blocks.

I'm curious though: why do you want this, if your client is working fine?

DaveF
Legendary
*
Offline Offline

Activity: 3472
Merit: 6271


Crypto Swap Exchange


View Profile WWW
July 14, 2020, 02:39:14 PM
Last edit: July 14, 2020, 03:24:48 PM by DaveF
 #3

EDIT: The below is bad / wrong advice, but I'm leaving it here as a monument to my stupidity :-)
Seriously, don't do it. ranochigo is correct.
But at least you now know what not to do



You can use the invalidateblock command.

You don't use the block number, you use the block hash.
So from the console if you want to invalidate block 639210 you would use
invalidateblock 0000000000000000000c7072e78db32b61a63fce2e56937167598bbaed9d653d

Then shutdown core and restart and you should pick up from there.

Obligatory, make sure you have a backup of your wallet.dat and anything else you need.

-Dave



█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4184



View Profile
July 14, 2020, 02:50:54 PM
Merited by LoyceV (6), DaveF (3)
 #4

You can use the invalidateblock command.

You don't use the block number, you use the block hash.
So from the console if you want to invalidate block 639210 you would use
invalidateblock 0000000000000000000c7072e78db32b61a63fce2e56937167598bbaed9d653d

Then shutdown core and restart and you should pick up from there.

Obligatory, make sure you have a backup of your wallet.dat and anything else you need.

-Dave



It won't work. Invalidating the block means that the client marks that block as invalid and the block prior to that will permanently be the longest chain in that client's perspective (unless someone continues to mine from 639209 again onwards). The client will not synchronize anymore after this.

I don't think it deletes the block data either? Just marking it invalid in the chainstate.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4184



View Profile
July 14, 2020, 03:14:02 PM
Merited by DaveF (3)
 #5

I don't think it deletes the block data either? Just marking it invalid in the chainstate.

Are you sure? I thought the shutdown / restart would cause it to start up again from where it thought it was.

Let me go spin up a VM and take a look. You could be correct, it's been so long since I used it I don't remember. Only used it a few times for testing.

-Dave
Yep, just tried it again on my testnet. My instance doesn't connect to the peers anymore, probably marked the other nodes as misbehaving nodes. Debug log has this:
Code:
2020-07-14T15:11:09Z ERROR: AcceptBlockHeader: block [Block hash I marked invalid] is marked invalid
.

Anyone knows how to revert this without reindex? Tongue

Nevermind, reconsiderblock did the job.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
DaveF
Legendary
*
Offline Offline

Activity: 3472
Merit: 6271


Crypto Swap Exchange


View Profile WWW
July 14, 2020, 03:19:15 PM
 #6

You are correct, sorry for the bad advice.
-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
OcTradism
Hero Member
*****
Offline Offline

Activity: 1736
Merit: 806



View Profile WWW
July 14, 2020, 04:29:51 PM
 #7

It can only happen with prune node, not full node. Re setup your prune node storage and resync your prune node. It will resync your wallets to latest blocks that fits the new storage parameter you reset.

Of course, problem might be : you must calculate or estimate as exactly as possible the total size of latest blocks you want to redownload.

Cons: you only can do this for latest blocks and can not do it aims at whatever block you want.

I don't do it in practice, it is my shower thought. I thought that total latest blocks with 50 GB for a prune node will be less than total latest blocks with 60 GB for a prune node. (change prune=x)

.
.Duelbits.
█▀▀▀▀▀











█▄▄▄▄▄
TRY OUR
  NEW  UNIQUE
GAMES!
.
..DICE...
███████████████████████████████
███▀▀                     ▀▀███
███    ▄▄▄▄         ▄▄▄▄    ███
███   ██████       ██████   ███
███   ▀████▀       ▀████▀   ███
███                         ███
███                         ███
███                         ███
███   ▄████▄       ▄████▄   ███
███   ██████       ██████   ███
███    ▀▀▀▀         ▀▀▀▀    ███
███▄▄                     ▄▄███
███████████████████████████████
.
.MINES.
███████████████████████████████
████████████████████████▄▀▄████
██████████████▀▄▄▄▀█████▄▀▄████
████████████▀ █████▄▀████ █████
██████████      █████▄▀▀▄██████
███████▀          ▀████████████
█████▀              ▀██████████
█████                ██████████
████▌                ▐█████████
█████                ██████████
██████▄            ▄███████████
████████▄▄      ▄▄█████████████
███████████████████████████████
.
.PLINKO.
███████████████████████████████
█████████▀▀▀       ▀▀▀█████████
██████▀  ▄▄███ ███      ▀██████
█████  ▄▀▀                █████
████  ▀                    ████
███                         ███
███                         ███
███                         ███
████                       ████
█████                     █████
██████▄                 ▄██████
█████████▄▄▄       ▄▄▄█████████
███████████████████████████████
10,000x
MULTIPLIER
NEARLY UP TO
.50%. REWARDS
▀▀▀▀▀█











▄▄▄▄▄█
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!