. #30056

issue jdom1824 opened this issue on May 7, 2024
  1. jdom1824 commented at 4:18 PM on May 7, 2024: none

    (EDITED)

    List of implementation changes:

    • new database layout:
      • 2 leveldb's (coins/ and blktree/ subdirs), replacing blkindex.dat
      • separate directory (blocks/) with block data (in the usual format, but smaller files) and undo data
    • database keys are of the form (char,key) instead of (string,key) for reasons of compactness
    • there is no txid-to-diskpos index anymore, only blkid-to-diskpos and txid-to-unspent-outputs
      • this makes getrawtransaction only work on unspent outputs (and slower)
        • an optional txid-to-diskpos index is planned
    • some new very specialized serializers are added (compact variable-length integer, compact amount, compact txout)
    • block index does not store hashBlockNext anymore - this is reconstructed from hashBestBlock at startup
    • at startup, automatically reorg to the best block in blktree/blocks
    • new RPCs: gettxoutsetinfo and gettxout operate on the coins database
    • no more CTxIndex in-scope: instead, a global pcoinsTip (representing the coin db) and pblocktree (representing the blktree db)
      • intended to be moved to separate modules/classes, properly encapsulated
    • blktree database contains statistics about the block file (size, which blocks in it, times, heights, undo stats, ...)
    • blktree database contains flag per block that determines the degree of validation it had, to allow future headers-first mode
    • block files are pre-allocated (in batches of 16 MiB, the files grow to max 128 MIB), to reduce fragmentation
    • transaction hashes are cached, and typically never calculated more than once

    Included in the pullreq, but technically separate:

    • do -loadblock= and bootstrap.dat import in a separate thread
    • add check for strict DER encoding for signatures, and standard public keys

    Originally posted by @sipa in #1677 (comment)

    Hello, is there any formula or performance tests to choose the size of 128 MB as chunksize in blk*.data files?

  2. willcl-ark commented at 6:50 PM on May 7, 2024: member

    This issue tracker is used to track technical issues related to the Bitcoin Core code base.

    General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange or the #bitcoin IRC channel on the Libera Chat network.

    For proposed protocol changes you can post to the bitcoin-dev mailing list.

    For general bitcoin discussion you can try bitcointalk or reddit.com/r/bitcoin


    Searching for questions like this on StackExchange may directly yield answers, otherwise you can simply post your new question there.

  3. willcl-ark closed this on May 7, 2024

  4. fanquake renamed this:
    (EDITED) How was the average size of blk*.data chosen?
    .
    on May 8, 2024
  5. bitcoin locked this on May 8, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 00:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me