Bitcoin Forum
May 02, 2024, 10:28:40 AM *
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 89 times)
LoyceV (OP)
Legendary
*
Offline Offline

Activity: 3304
Merit: 16583


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.

1714645720
Hero Member
*
Offline Offline

Posts: 1714645720

View Profile Personal Message (Offline)

Ignore
1714645720
Reply with quote  #2

1714645720
Report to moderator
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Learn Bitcoin
Hero Member
*****
Offline Offline

Activity: 518
Merit: 807


#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
*
Offline Offline

Activity: 3304
Merit: 16583


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: 686
Merit: 866



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
*
Offline Offline

Activity: 3304
Merit: 16583


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: 2954
Merit: 4165


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.

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

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

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

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

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

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











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











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