BlockchainCommons / GordianServer-macOS

Tor-protected full-node GordianServer for macOS
Other
63 stars 8 forks source link

BUG: Size status showing wrong value #143

Closed ChristopherA closed 3 years ago

ChristopherA commented 3 years ago

As of latest #105 df8de5524e818b2136301df86660b81e69724067 on 2021-09-29:

GS is show size as .09 GB, but finder shows the bitcoin directory to be 998.3 MB, and the chainstate directory to be 5.51 GB.

I believe users want to know the total of these.

image
shannona commented 3 years ago

size_on_disk is supposed to be:

 "size_on_disk": xxxxxx,       (numeric) the estimated size of the block and undo files on disk

It looks like it is being accurately reported now as this:

$ ~/.gordian/BitcoinCore/bitcoin-22.0/bin/bitcoin-cli -chain=test getblockchaininfo | grep size_on_disk
  "size_on_disk": 155421032,

Now reports as 0.2gb.

However, it looks like this isn't an accurate representation of the actual blocks:

$ cd ~/Library/Application\ Support/Bitcoin/testnet3/
$ du -h -s blocks
429M    blocks
$ du -h -s chainstate
 12M    chainstate
$ ~/.gordian/BitcoinCore/bitcoin-22.0/bin/bitcoin-cli -chain=test getblockchaininfo | grep size_on_disk
  "size_on_disk": 158249603,

I don't really know what it's reporting, but it may be that we need to go out to the actual file system.

ChristopherA commented 3 years ago

GS is show size as .09 GB, but finder shows the bitcoin directory to be 998.3 MB, and the chainstate directory to be 5.51 GB.

Here is my getblockchaininfo as compared to the above actually disk space usage.

% ~/.gordian/BitcoinCore/bitcoin-22.0/bin/bitcoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 702758,
  "headers": 702758,
  "bestblockhash": "0000000000000000000dd13b37ce4c288b5b69e3348fb40d6249586aa8c4b70b",
  "difficulty": 18997641161758.95,
  "mediantime": 1632938271,
  "verificationprogress": 0.9999974785168253,
  "initialblockdownload": false,
  "chainwork": "00000000000000000000000000000000000000002224c0db19fb086c578ca0c6",
  "size_on_disk": 884059296,
  "pruned": true,
  "pruneheight": 702088,
  "automatic_pruning": true,
  "prune_target_size": 1048576000,
  "softforks": {
    "bip34": {
      "type": "buried",
      "active": true,
      "height": 227931
    },
    "bip66": {
      "type": "buried",
      "active": true,
      "height": 363725
    },
    "bip65": {
      "type": "buried",
      "active": true,
      "height": 388381
    },
    "csv": {
      "type": "buried",
      "active": true,
      "height": 419328
    },
    "segwit": {
      "type": "buried",
      "active": true,
      "height": 481824
    },
    "taproot": {
      "type": "bip9",
      "bip9": {
        "status": "locked_in",
        "start_time": 1619222400,
        "timeout": 1628640000,
        "since": 687456,
        "min_activation_height": 709632
      },
      "active": false
    }
  },
  "warnings": ""
}
ChristopherA commented 3 years ago

Maybe you should use du on the blocks and chainstate and add them?

% du -sh ~/Library/Application\ Support/Bitcoin/blocks
952M    /Users/christophera/Library/Application Support/Bitcoin/blocks

% du -sh ~/Library/Application\ Support/Bitcoin/chainstate
5.1G    /Users/christophera/Library/Application Support/Bitcoin/chainstate

% du -sh ~/Library/Application\ Support/Bitcoin
6.1G    /Users/christophera/Library/Application Support/Bitcoin
Fonta1n3 commented 3 years ago

As of latest #105 df8de55 on 2021-09-29:

GS is show size as .09 GB, but finder shows the bitcoin directory to be 998.3 MB, and the chainstate directory to be 5.51 GB.

I believe users want to know the total of these.

image

This is network specific. It does not call getblockchaininfo for each network and tally them up, it simply shows the result as per getblockhaininfo for the network you have selected.

shannona commented 3 years ago

I was seeing a discrepency before, and I'm not now:

Mac-mini:bin shannona$ ./bitcoin-cli getblockchaininfo| grep size_on_disk
  "size_on_disk": 128628826,
Mac-mini:bin shannona$ du -h ~/Library/Application\ Support/Bitcoin/blocks
8.0K    /Users/shannona/Library/Application Support/Bitcoin/blocks/index
128M    /Users/shannona/Library/Application Support/Bitcoin/blocks

So, with the understanding that size_on_disk is not necessarily the best count for actual size, I'm closing this.