Bitcoin Forum
May 21, 2024, 04:45:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Linux Electrum] Why is "blockchain_headers" larger than it's Size on Disk?  (Read 90 times)
LoyceV (OP)
Legendary
*
Online Online

Activity: 3318
Merit: 16673


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
August 10, 2023, 07:46:20 AM
 #1

See this image:
Image loading...
Electrum's file blockchain_headers is larger than the disk space it occupies (on a Linux system).
How can this be? Normally, files take slightly more space on disk (because of the disk block size), not less.

Learn Bitcoin
Hero Member
*****
Offline Offline

Activity: 532
Merit: 831


#SWGT CERTIK Audited


View Profile WWW
August 10, 2023, 07:48:38 AM
 #2

See this image:
Image loading...
Electrum's file blockchain_headers is larger than the disk space it occupies (on a Linux system).
How can this be? Normally, files take slightly more space on disk (because of the disk block size), not less.

Probably Compressed in some way?
This is the only thing that might make sense.
I do not see any other possible way it can take less space.

LoyceV (OP)
Legendary
*
Online Online

Activity: 3318
Merit: 16673


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
August 10, 2023, 08:05:06 AM
 #3

Probably Compressed in some way?
Nope, my file system doesn't support compression.

Zaguru12
Hero Member
*****
Offline Offline

Activity: 700
Merit: 877



View Profile
August 10, 2023, 08:24:49 AM
Merited by LoyceV (1)
 #4

Probably Compressed in some way?
Nope, my file system doesn't support compression.

The major answer to this is when there is automatic or inbuilt compression gotten from one’s operating system or again if the file in question is a sparse file

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
LoyceV (OP)
Legendary
*
Online Online

Activity: 3318
Merit: 16673


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
August 10, 2023, 08:30:25 AM
 #5

The major answer to this is when there is automatic or inbuilt compression gotten from one’s operating system
Nope.

Quote
or again if the file in question is a sparse file
That's a Microsoft link, but you may be on to something: "sparse files" exist on ETX4 too. It looks like that's what Electrum is doing, there must be a lot of empty space in the file. That brings the next question: why not just delete the empty space?

ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
August 10, 2023, 03:27:54 PM
Merited by pooya87 (4), LoyceV (4), Cricktor (1)
 #6

That's a Microsoft link, but you may be on to something: "sparse files" exist on ETX4 too. It looks like that's what Electrum is doing, there must be a lot of empty space in the file. That brings the next question: why not just delete the empty space?
It is indeed a sparse file. Electrum actually has a function that marks it as such in their util.py: https://github.com/spesmilo/electrum/blob/dfa0dd47b728d22a3b8143af4bdd1819a0997abd/electrum/util.py#L490.

A good bulk of the headers file consists of zeros, and they only need to store the headers beyond the latest checkpoint, CMIIW on this but that is how I remember it when checking out their codes. Might have to do with the way that they retrieve the headers, and thats why the zero data is necessary.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


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