(just a test to get ultraprune tested by PullTester) #1937

pull sipa wants to merge 32 commits into bitcoin:master from sipa:ultraprune_coinhash changing 177 files +29651 −1442
  1. sipa commented at 2:14 PM on October 20, 2012: member

    No description provided.

  2. Check for canonical public keys and signatures
    Only enabled inside tests for now.
    58bc86e37f
  3. Merge branch 'canonical' 3e4eec8cb6
  4. Merge branch 'threadimport' cc3e1f021e
  5. Import LevelDB 1.5, it will be used for the transaction database. 398e837e8d
  6. Leveldb Windows port by Edouard Alligand, adapted for MingW by me. d7b9500eed
  7. Disable libsnappy detection in LevelDB 70407bad80
  8. Backport Win32 LevelDB env from C++0x to C++
    Since the gitian mingw compiler doesn't support C++0x yet.
    d6efe12b1a
  9. Makefile integration of LevelDB 4031122ffc
  10. LevelDB glue
    Database-independent glue for supporting LevelDB databases.
    
    Based on code from earlier commits by Mike Hearn in his leveldb
    branch.
    2b44e4b66b
  11. Compact serialization for variable-length integers
    Variable-length integers: bytes are a MSB base-128 encoding of the number.
    The high bit in each byte signifies whether another digit follows. To make
    the encoding is one-to-one, one is subtracted from all but the last digit.
    Thus, the byte sequence a[] with length len, where all but the last byte
    has bit 128 set, encodes the number:
    
      (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1))
    
    Properties:
    * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes)
    * Every integer has exactly one encoding
    * Encoding does not depend on size of original integer type
    396427bbd6
  12. Compact serialization for scripts
    Special serializers for script which detect common cases and encode
    them much more efficiently. 3 special cases are defined:
    * Pay to pubkey hash (encoded as 21 bytes)
    * Pay to script hash (encoded as 21 bytes)
    * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes)
    
    Other scripts up to 121 bytes require 1 byte + script length. Above
    that, scripts up to 16505 bytes require 2 bytes + script length.
    df00016186
  13. Compact serialization for amounts
    Special serializer/deserializer for amount values. It is optimized for
    values which have few non-zero digits in decimal representation. Most
    amounts currently in the txout set take only 1 or 2 bytes to
    represent.
    ac9073c93e
  14. Add CCoins: pruned list of transaction outputs
    The CCoins class represents a pruned set of transaction outputs from
    a given transaction. It only retains information about its height in
    the block chain, whether it was a coinbase transaction, and its
    unspent outputs (script + amount).
    
    It has a custom serializer that has very low redundancy.
    ca487b5d68
  15. Add CTxUndo: transaction undo information
    The CTxUndo class encapsulates data necessary to undo the effects of
    a transaction on the txout set, namely the previous outputs consumed
    by it (script + amount), and potentially transaction meta-data when
    it is spent entirely.
    39ddb97ca5
  16. One file per block
    Refactor of the block storage code, which now stores one file per block.
    This will allow easier pruning, as blocks can be removed individually.
    d213076d14
  17. Preliminary undo file creation
    Create files (one per block) with undo information for the transactions
    in it.
    4415a7f1f5
  18. Multiple blocks per file
    Change the block storage layer again, this time with multiple files
    per block, but tracked by txindex.dat database entries. The file
    format is exactly the same as the earlier blk00001.dat, but with
    smaller files (128 MiB for now).
    
    The database entries track how many bytes each block file already
    uses, how many blocks are in it, which range of heights is present
    and which range of dates.
    ab5a65f0c0
  19. Pre-allocate block and undo files in chunks
    Introduce a AllocateFileRange() function in util, which wipes or
    at least allocates a given range of a file. It can be overriden
    by more efficient OS-dependent versions if necessary.
    
    Block and undo files are now allocated in chunks of 16 and 1 MiB,
    respectively.
    2da7336714
  20. Ultraprune
    This switches bitcoin's transaction/block verification logic to use a
    "coin database", which contains all unredeemed transaction output scripts,
    amounts and heights.
    
    The name ultraprune comes from the fact that instead of a full transaction
    index, we only (need to) keep an index with unspent outputs. For now, the
    blocks themselves are kept as usual, although they are only necessary for
    serving, rescanning and reorganizing.
    
    The basic datastructures are CCoins (representing the coins of a single
    transaction), and CCoinsView (representing a state of the coins database).
    There are several implementations for CCoinsView. A dummy, one backed by
    the coins database (coins.dat), one backed by the memory pool, and one
    that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock,
    DisconnectBlock, ... now operate on a generic CCoinsView.
    
    The block switching logic now builds a single cached CCoinsView with
    changes to be committed to the database before any changes are made.
    This means no uncommitted changes are ever read from the database, and
    should ease the transition to another database layer which does not
    support transactions (but does support atomic writes), like LevelDB.
    
    For the getrawtransaction() RPC call, access to a txid-to-disk index
    would be preferable. As this index is not necessary or even useful
    for any other part of the implementation, it is not provided. Instead,
    getrawtransaction() uses the coin database to find the block height,
    and then scans that block to find the requested transaction. This is
    slow, but should suffice for debug purposes.
    60dc5e8860
  21. Batch block connection during IBD
    During the initial block download (or -loadblock), delay connection
    of new blocks a bit, and perform them in a single action. This reduces
    the load on the database engine, as subsequent blocks often update an
    earlier block's transaction already.
    69a9db3639
  22. Transaction hash caching
    Use CBlock's vMerkleTree to cache transaction hashes, and pass them
    along as argument in more function calls. During initial block download,
    this results in every transaction's hash to be only computed once.
    e84145a0c6
  23. Direct CCoins references
    To prevent excessive copying of CCoins in and out of the CCoinsView
    implementations, introduce a GetCoins() function in CCoinsViewCache
    with returns a direct reference. The block validation and connection
    logic is updated to require caching CCoinsViews, and exploits the
    GetCoins() function heavily.
    b6ac21afb5
  24. Automatically reorganize at startup to best known block
    Given that the block tree database (chain.dat) and the active chain
    database (coins.dat) are entirely separate now, it becomes legal to
    swap one with another instance without affecting the other.
    
    This commit introduces a check in the startup code that detects the
    presence of a better chain in chain.dat that has not been activated
    yet, and does so efficiently (in batch, while reusing the blk???.dat
    files).
    d59389e76e
  25. Prepare database format for multi-stage block processing
    This commit adds a status field and a transaction counter to the block
    indexes.
    e961d7dac9
  26. Use singleton block tree database instance b73ff755b9
  27. Flush and sync block data afdf33b64d
  28. LevelDB block and coin databases
    Split off CBlockTreeDB and CCoinsViewDB into txdb-*.{cpp,h} files,
    implemented by either LevelDB or BDB.
    
    Based on code from earlier commits by Mike Hearn in his leveldb
    branch.
    6871a20ea5
  29. Add LevelDB MemEnv support
    Support LevelDB memory-backed environments, and use them in unit tests.
    3569b3a474
  30. Add gettxout and gettxoutsetinfo RPCs 4a8ca807be
  31. Remove BDB block database support b343492bfa
  32. SetHash framework 1b93546674
  33. Add gettxoutsethash RPC f625f941c1
  34. sipa closed this on Oct 20, 2012

  35. KolbyML referenced this in commit 3bf6248633 on Dec 5, 2020
  36. DrahtBot locked this on Sep 8, 2021
Contributors

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-04-19 09:16 UTC

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