explorer icon indicating copy to clipboard operation
explorer copied to clipboard

option to not add stale blocks to database?

Open michelvankessel opened this issue 5 years ago • 4 comments

Hi.. at this moment a stale block

https://bitcoin.org/en/glossary/stale-block

is added to the database and thus counting towards the total amount an address has. These blocks have a -1 confirmation.

Is there a way to "exclude" them from the totals? or maybe even from the database? Any suggestion is welcome. I just hope that reindex is not the only way

michelvankessel avatar Apr 22 '20 09:04 michelvankessel

it is not: i've employed ZFS storage for mongo and filesystem snapshotting as a workaround. https://zfsonlinux.org/ https://docs.mongodb.com/manual/tutorial/backup-with-filesystem-snapshots/

rough & incomplete: to snapshot: call db.fsyncLock(), zfs snapshot filesystem@$(date %s), call db.fsyncUnlock() to roll back: stop iquidus, stop mongo, zfs rollback -r filesystem@timestamp, start mongo, start iquidus, node scripts/sync.js index update with some preparation a full rollback takes minutes down to seconds to complete :+1: to cleanup snapshots use zfs destroy filesystem@from%to

BloodyNora avatar Nov 15 '20 23:11 BloodyNora

@BloodyNora thanks for sharing.

We're planning (eventually) to handle this internally but it requires quite a few changes.

That's a very interesting workaround, but it would be a lot cleaner to handle this properly internally.

TheHolyRoger avatar Nov 16 '20 01:11 TheHolyRoger

i'm certainly looking forward to that day. reindex is the one painful point about iquidus.

BloodyNora avatar Nov 16 '20 08:11 BloodyNora

Also looking forward to the internal changes. Thanks for the update

michelvankessel avatar Nov 19 '20 13:11 michelvankessel