New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch chainstate db and cache to per-txout model #10195

Merged
merged 29 commits into from Jun 1, 2017

Conversation

@sipa
Member

sipa commented Apr 12, 2017

Since Bitcoin Core v0.8, we've used a per-tx model for the chainstate database and its cache. This means that the database is effectively a map from txids to the list of unspent outputs for that transaction. This PR changes that to a map from outpoints ((txid,index) pairs) to just the individual unspent output for that outpoint.

The original reason for aggregating the outputs per transaction was to save space: this way, we could avoid duplicating the txid and transaction meta across the multiple outputs. However, LevelDB internally uses an encoding that omits repeated prefix bytes in keys, and because of that, duplicating the txids is not very significant.

There are many advantages for using a per-txout model:

  • Simpler code.
  • Avoiding the CPU overhead of deserializing and serializing the unused outputs.
  • More predictable memory usage.
  • More easily adaptable to various cache flushing strategies.

Downsides:

  • Slightly larger on-disk representation, and sometimes larger in-memory representation (when there are multiple outputs for the same txid in the cache, which becomes optional).

This PR includes:

  • The main commit from #10248. We'll be dropping tx nVersion from the undo data later, so reserializing data from disk won't roundtrip anymore. This change allows us to compute the checksum based on the written data rather than the reserialized data.
  • #10249, as we'll be using some c++11 methods of std::unordered_map which aren't available in all versions of boost::unordered_map.
  • #10250, as the new tests trigger the problem fixed there.
  • A forward-compatible undo data format change (new versions can use old undo data, not the other way around).
  • Switch to a new per-txout coinsview model with related database changes.
  • Upgrade code to convert the old chainstate to a new chainstate (which is interruptible).
  • Adapted unit and functional tests (thanks to @ryanofsky for adapting the unit tests).

Tests:

  • All existing unit and functional tests pass.
  • Manually verified that continuing a reindex started with old code succeeds (even when recovering from a crash in the middle of flushing while upgrading).

Commit links:

Preparation:

  • e66dbde: Add SizeEstimate to CDBBatch
  • f54580e: error() in disconnect for disk corruption, not inconsistency
  • e484652: Introduce CHashVerifier to hash read data
  • 7e00322: Add specialization of SipHash for 256 + 32 bit data
  • d342424: Remove/ignore tx version in utxo and undo
  • c3aa0c1: Report on-disk size in gettxoutsetinfo
  • 7d991b5: Store/allow tx metadata in all undo records

Switch to COutPoint/Coin instead of uint256/CCoins:

  • 422634e: Introduce Coin, a single unspent output
  • cb2c7fd: Replace CTxInUndo with Coin
  • bd83111: Optimization: Coin&& to ApplyTxInUndo
  • 0003911: Introduce new per-txout CCoinsViewCache functions
  • f68cdfe: Switch from per-tx to per-txout CCoinsViewCache methods in some places
  • c87b957: Only pass things committed to by tx's witness hash to CScriptCheck
  • 8b3868c: Switch CScriptCheck to use Coin instead of CCoins
  • 961e483: Switch tests from ModifyCoins to AddCoin/SpendCoin
  • 05293f3: Remove ModifyCoins/ModifyNewCoins
  • 13870b5: Replace CCoins-based CTxMemPool::pruneSpent with isSpent
  • 4ec0d9e: Refactor GetUTXOStats in preparation for per-COutPoint iteration
  • 5083079: Switch CCoinsView and chainstate db from per-txid to per-txout

Cleanup:

  • ce23efa: Extend coins_tests
  • 97072d6: Remove unused CCoins methods
  • 41aa5b7: Pack Coin more tightly
  • b2af357: Reduce reserved memory space for flushing
  • 8b25d2c: Upgrade from per-tx database to per-txout
  • 580b023: [MOVEONLY] Move old CCoins class to txdb.cpp
  • 119e552: Merge CCoinsViewCache's GetOutputFor and AccessCoin
  • 73de2c1: Rename CCoinsCacheEntry::coins to coin
  • a5e02bc: Increase travis unit test timeout
  • 5898279: scripted-diff: various renames for per-utxo consistency
@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Apr 12, 2017

Member

This is awesome.

Member

gmaxwell commented Apr 12, 2017

This is awesome.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 16, 2017

Member

Rebased on top of new #10148.

Member

sipa commented Apr 16, 2017

Rebased on top of new #10148.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 19, 2017

Member

Rebased without #10148 at popular request.

Member

sipa commented Apr 19, 2017

Rebased without #10148 at popular request.

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Apr 19, 2017

Contributor

Few overrides needed probably:

+./coins.h:200:10: warning: 'BatchWrite' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
+    bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
+         ^
+./coins.h:178:18: note: overridden virtual function is here
+    virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
+                 ^
+./coins.h:201:23: warning: 'Cursor' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
+    CCoinsViewCursor *Cursor() const;
+                      ^
+./coins.h:181:31: note: overridden virtual function is here
+    virtual CCoinsViewCursor *Cursor() const;
+                              ^
+2 warnings generated.

And few initializations:

+./undo.h:70:23: note: initialize the variable 'count' to silence this warning
+        uint64_t count;
+                      ^
+                       = 0
...
+./coins.h:81:22: note: initialize the variable 'code' to silence this warning
+        uint32_t code;
+                     ^
+                      = 0
Contributor

paveljanik commented Apr 19, 2017

Few overrides needed probably:

+./coins.h:200:10: warning: 'BatchWrite' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
+    bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
+         ^
+./coins.h:178:18: note: overridden virtual function is here
+    virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
+                 ^
+./coins.h:201:23: warning: 'Cursor' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
+    CCoinsViewCursor *Cursor() const;
+                      ^
+./coins.h:181:31: note: overridden virtual function is here
+    virtual CCoinsViewCursor *Cursor() const;
+                              ^
+2 warnings generated.

And few initializations:

+./undo.h:70:23: note: initialize the variable 'count' to silence this warning
+        uint64_t count;
+                      ^
+                       = 0
...
+./coins.h:81:22: note: initialize the variable 'code' to silence this warning
+        uint32_t code;
+                     ^
+                      = 0
@TheBlueMatt

Concept ACK. Briefly looked over most of the commits except the big one, which I only briefly skimmed, but am left wondering if there's an easier way to get that +650-881 commit in. At least the first 6 commits could be merged separately (I know the first two are already in another PR), but I'm not sure thats sufficient. Anyway, will circle back around to doing a full review as other things get merged.

Show outdated Hide outdated test/functional/blockchain.py Outdated
Show outdated Hide outdated src/txdb.cpp Outdated
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 22, 2017

Member

I'm splitting the commits up more. I've pushed one update already, but I'm working splitting the big commit further.

Member

sipa commented Apr 22, 2017

I'm splitting the commits up more. I've pushed one update already, but I'm working splitting the big commit further.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 24, 2017

Member

Done. There is still one commit that does many things at once ("Switch CCoinsView and chainstate db to per-txout"), but splitting it is nontrivial. If requested, I can try splitting the database format change into a second commit, but that would require adding a bunch of conversion logic in the first commit that just gets removed in the second one. Thoughts?

Member

sipa commented Apr 24, 2017

Done. There is still one commit that does many things at once ("Switch CCoinsView and chainstate db to per-txout"), but splitting it is nontrivial. If requested, I can try splitting the database format change into a second commit, but that would require adding a bunch of conversion logic in the first commit that just gets removed in the second one. Thoughts?

Show outdated Hide outdated src/undo.h Outdated
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Apr 25, 2017

Member

Rebased and reset the author timestamps (so that GitHub shows them in logical order, $@#!*).

Member

sipa commented Apr 25, 2017

Rebased and reset the author timestamps (so that GitHub shows them in logical order, $@#!*).

@laanwj laanwj added this to Blockers in High-priority for review Apr 27, 2017

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa May 3, 2017

Member

Rebased.

Member

sipa commented May 3, 2017

Rebased.

@ryanofsky

utACK 493f03f. This is a really nice change, and seems complete and ready to go as far as I could tell. I left a lot of comments and possible suggestions in my review, but they're all very minor, so feel free ignore anything not of interest.

Show outdated Hide outdated src/validation.cpp Outdated
Show outdated Hide outdated src/validation.cpp Outdated
Show outdated Hide outdated src/hash.h Outdated
Show outdated Hide outdated src/rpc/blockchain.cpp Outdated
Show outdated Hide outdated src/rpc/blockchain.cpp Outdated
Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/net_processing.cpp Outdated
ss << *(const CScriptBase*)(&output.second.out.scriptPubKey);
ss << VARINT(output.second.out.nValue);
stats.nTransactionOutputs++;
stats.nTotalAmount += output.second.out.nValue;

This comment has been minimized.

@ryanofsky

ryanofsky May 3, 2017

Contributor

In commit "Refactor GetUTXOStats in preparation for per-COutPoint iteration":

This stats.ntotalamount value seems to get overwritten in line 815. Probably that line should be removed.

@ryanofsky

ryanofsky May 3, 2017

Contributor

In commit "Refactor GetUTXOStats in preparation for per-COutPoint iteration":

This stats.ntotalamount value seems to get overwritten in line 815. Probably that line should be removed.

Show outdated Hide outdated src/rpc/rawtransaction.cpp Outdated
Show outdated Hide outdated src/txmempool.cpp Outdated
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa May 4, 2017

Member

Updated and addressed many of @ryanofsky's review comments. I'll respond only individually to the ones I'm not addressing.

Member

sipa commented May 4, 2017

Updated and addressed many of @ryanofsky's review comments. I'll respond only individually to the ones I'm not addressing.

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa May 5, 2017

Member

Here is a graph of the speed and memory usage of a -reindex-chainstate until the default assumevalid point, with infinity -dbcache, on a 2.2GHz dual-cpu 28-core 56-threads machine with 256GiB RAM. Note that the x axis is progress (so proportional to the number of transactions).

reindex

Member

sipa commented May 5, 2017

Here is a graph of the speed and memory usage of a -reindex-chainstate until the default assumevalid point, with infinity -dbcache, on a 2.2GHz dual-cpu 28-core 56-threads machine with 256GiB RAM. Note that the x axis is progress (so proportional to the number of transactions).

reindex

@jnewbery

I've reviewed up to 4f09ae5 "Introduce new per-txout CCoinsViewCache functions" and have a few nits. I'll finish reviewing next week.

Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/undo.h Outdated
Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/coins.h Outdated
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa May 6, 2017

Member

Same machine, but flushing at 1300 MiB:
reindex-1300

Member

sipa commented May 6, 2017

Same machine, but flushing at 1300 MiB:
reindex-1300

Show outdated Hide outdated src/coins.cpp Outdated
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa May 10, 2017

Member

I've pushed a few more changes (rewriting the commits, but not a rebase), renaming some of the classes and variables to be more consistent.

For any further changes I'll create fixup commits in order to not hurt review.

Member

sipa commented May 10, 2017

I've pushed a few more changes (rewriting the commits, but not a rebase), renaming some of the classes and variables to be more consistent.

For any further changes I'll create fixup commits in order to not hurt review.

@ryanofsky

This comment has been minimized.

Show comment
Hide comment
@ryanofsky

ryanofsky May 10, 2017

Contributor

utACK 37b2735. Thanks for implementing so many review suggestions. Removing coins->Clear() from ApplyTxInUndo in an earlier commit, renaming CCoin to Coin, changing stats.nSerializedSize were the only significant changes since my last review that I don't remember seeing suggested, and these all look good.

Contributor

ryanofsky commented May 10, 2017

utACK 37b2735. Thanks for implementing so many review suggestions. Removing coins->Clear() from ApplyTxInUndo in an earlier commit, renaming CCoin to Coin, changing stats.nSerializedSize were the only significant changes since my last review that I don't remember seeing suggested, and these all look good.

@sdaftuar

I've spent a bunch of time code reviewing today; got up to 21791e4.

Posting my current set of comments now; will pick review up again on Monday.

Show outdated Hide outdated src/undo.h Outdated
Show outdated Hide outdated src/coins.cpp Outdated
Show outdated Hide outdated src/txmempool.h Outdated
Show outdated Hide outdated src/rpc/blockchain.cpp Outdated
Show outdated Hide outdated src/rpc/rawtransaction.cpp Outdated
Show outdated Hide outdated src/txmempool.cpp Outdated
@TheBlueMatt

Got through a big chunk, but still a bunch to review.

Show outdated Hide outdated src/undo.h Outdated
Show outdated Hide outdated src/undo.h Outdated
Show outdated Hide outdated src/validation.cpp Outdated
Show outdated Hide outdated src/validation.cpp Outdated
Show outdated Hide outdated src/coins.cpp Outdated
Show outdated Hide outdated src/coins.h Outdated
Show outdated Hide outdated src/init.cpp Outdated
Show outdated Hide outdated src/net_processing.cpp Outdated
Show outdated Hide outdated src/rpc/blockchain.cpp Outdated
Show outdated Hide outdated src/txdb.h Outdated
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa May 13, 2017

Member

Squashed history with fixups. Original history:

  • 83367a9 Add SizeEstimate to CDBBatch
  • ac6910b error() in disconnect for disk corruption, not inconsistency
  • f7beab2 Introduce CHashVerifier to hash read data
  • e3d9ac3 Add specialization of SipHash for 256 + 32 bit data
  • 5be8c48 Remove/ignore tx version in utxo and undo
  • ec8c261 Store/allow tx metadata in all undo records
  • ac70d1f Introduce Coin, a single unspent output
  • 50a8df0 Replace CTxInUndo with Coin
  • c3ce6c9 Optimization: Coin&& to ApplyTxInUndo
  • 777f4c6 Introduce new per-txout CCoinsViewCache functions
  • 8df47a3 Switch from per-tx to per-txout CCoinsViewCache methods in some places
  • 5466816 Switch CScriptCheck to use Coin instead of CCoins
  • ce86045 Switch tests from ModifyCoins to AddCoin/SpendCoin
  • b514426 Remove ModifyCoins/ModifyNewCoins
  • 593a632 Replace CCoins-based CTxMemPool::pruneSpent with isSpent
  • deb42bb Refactor GetUTXOStats in preparation for per-COutPoint iteration
  • 21791e4 Switch CCoinsView and chainstate db from per-txid to per-txout
  • 6fd519e Remove unused CCoins methods
  • 575ffb3 Pack Coin more tightly
  • f2cd835 Reduce reserved memory space for flushing
  • b951db2 Upgrade from per-tx database to per-txout
  • 229b89c [MOVEONLY] Move old CCoins class to txdb.cpp
  • fdab87c Merge CCoinsViewCache's GetOutputFor and AccessCoin
  • 37b2735 Rename CCoinsCacheEntry::coins to coin
  • e581f28 f Replace CTxInUndo with Coin: initialize count variale
  • 69f14c4 f Introduce new per-txout CCoinsViewCache functions: add comment explaining fCoinbase
  • 71ccd9d f Switch CCoinsView and chainstate db from per-txid to per-txout: fix txmempool comment
  • fdfafc5 f Remove/ignore tx version in utxo and undo: remove ill-defined bytes_serialized
  • 9da167e Report on-disk size in gettxoutsetinfo
  • 3e04e32 f Switch CCoinsView and chainstate db from per-txid to per-txout: re-add sanity check in gettxoutproof
  • c898541 f Switch CCoinsView and chainstate db from per-txid to per-txout: CTxMempool::TrimToSize should not use per-txid logic for pvNoRemainingSpends
  • b69f3bc f Replace CTxInUndo with Coin: split TxInUndoSerializer off from deserializer
  • 544c34b f Replace CTxInUndo with Coin: don't hardcode max outputs per block
  • bf4dadb f error() in disconnect for disk corruption, not inconsistency: correct type in extern ApplyTxInUndo in coins_tests.cpp
  • 6ac7ea3 f Optimization: Coin&& to ApplyTxInUndo: Comment that all of txundo.prevout was moved
  • 369afe4 f Introduce new per-txout CCoinsViewCache functions: do not compute CTxOut() size in loop
  • dc2bb20 f Introduce new per-txout CCoinsViewCache functions: Add comment explaining AddCoins potential_overwrite assumptions
  • 5611b76 f Switch from per-tx to per-txout CCoinsViewCache methods in some places: remove redundant nHeight < 1000000000 logic
  • 51c7c42 f Switch CCoinsView and chainstate db from per-txid to per-txout: add overrides
  • b5621d6 f Switch CCoinsView and chainstate db from per-txid to per-txout: still try COutPoint(hash, 0) in AlreadyHave
  • ea2a5b9 Only pass things committed to by tx's witness hash to CScriptCheck
Member

sipa commented May 13, 2017

Squashed history with fixups. Original history:

  • 83367a9 Add SizeEstimate to CDBBatch
  • ac6910b error() in disconnect for disk corruption, not inconsistency
  • f7beab2 Introduce CHashVerifier to hash read data
  • e3d9ac3 Add specialization of SipHash for 256 + 32 bit data
  • 5be8c48 Remove/ignore tx version in utxo and undo
  • ec8c261 Store/allow tx metadata in all undo records
  • ac70d1f Introduce Coin, a single unspent output
  • 50a8df0 Replace CTxInUndo with Coin
  • c3ce6c9 Optimization: Coin&& to ApplyTxInUndo
  • 777f4c6 Introduce new per-txout CCoinsViewCache functions
  • 8df47a3 Switch from per-tx to per-txout CCoinsViewCache methods in some places
  • 5466816 Switch CScriptCheck to use Coin instead of CCoins
  • ce86045 Switch tests from ModifyCoins to AddCoin/SpendCoin
  • b514426 Remove ModifyCoins/ModifyNewCoins
  • 593a632 Replace CCoins-based CTxMemPool::pruneSpent with isSpent
  • deb42bb Refactor GetUTXOStats in preparation for per-COutPoint iteration
  • 21791e4 Switch CCoinsView and chainstate db from per-txid to per-txout
  • 6fd519e Remove unused CCoins methods
  • 575ffb3 Pack Coin more tightly
  • f2cd835 Reduce reserved memory space for flushing
  • b951db2 Upgrade from per-tx database to per-txout
  • 229b89c [MOVEONLY] Move old CCoins class to txdb.cpp
  • fdab87c Merge CCoinsViewCache's GetOutputFor and AccessCoin
  • 37b2735 Rename CCoinsCacheEntry::coins to coin
  • e581f28 f Replace CTxInUndo with Coin: initialize count variale
  • 69f14c4 f Introduce new per-txout CCoinsViewCache functions: add comment explaining fCoinbase
  • 71ccd9d f Switch CCoinsView and chainstate db from per-txid to per-txout: fix txmempool comment
  • fdfafc5 f Remove/ignore tx version in utxo and undo: remove ill-defined bytes_serialized
  • 9da167e Report on-disk size in gettxoutsetinfo
  • 3e04e32 f Switch CCoinsView and chainstate db from per-txid to per-txout: re-add sanity check in gettxoutproof
  • c898541 f Switch CCoinsView and chainstate db from per-txid to per-txout: CTxMempool::TrimToSize should not use per-txid logic for pvNoRemainingSpends
  • b69f3bc f Replace CTxInUndo with Coin: split TxInUndoSerializer off from deserializer
  • 544c34b f Replace CTxInUndo with Coin: don't hardcode max outputs per block
  • bf4dadb f error() in disconnect for disk corruption, not inconsistency: correct type in extern ApplyTxInUndo in coins_tests.cpp
  • 6ac7ea3 f Optimization: Coin&& to ApplyTxInUndo: Comment that all of txundo.prevout was moved
  • 369afe4 f Introduce new per-txout CCoinsViewCache functions: do not compute CTxOut() size in loop
  • dc2bb20 f Introduce new per-txout CCoinsViewCache functions: Add comment explaining AddCoins potential_overwrite assumptions
  • 5611b76 f Switch from per-tx to per-txout CCoinsViewCache methods in some places: remove redundant nHeight < 1000000000 logic
  • 51c7c42 f Switch CCoinsView and chainstate db from per-txid to per-txout: add overrides
  • b5621d6 f Switch CCoinsView and chainstate db from per-txid to per-txout: still try COutPoint(hash, 0) in AlreadyHave
  • ea2a5b9 Only pass things committed to by tx's witness hash to CScriptCheck
@@ -878,8 +891,8 @@ UniValue gettxoutsetinfo(const JSONRPCRequest& request)
" \"bestblock\": \"hex\", (string) the best block hash hex\n"
" \"transactions\": n, (numeric) The number of transactions\n"
" \"txouts\": n, (numeric) The number of output transactions\n"
" \"bytes_serialized\": n, (numeric) The serialized size\n"
" \"hash_serialized\": \"hash\", (string) The serialized hash\n"

This comment has been minimized.

@laanwj

laanwj May 15, 2017

Member

doc: hash_serialized_2

@laanwj

laanwj May 15, 2017

Member

doc: hash_serialized_2

This comment has been minimized.

@jnewbery

jnewbery May 30, 2017

Member

the name should be updated to hash_serialized_2. The description should also be updated to say that hash_serialized_2 will not be compatible with hash_serialized from clients <0.15.0.

@jnewbery

jnewbery May 30, 2017

Member

the name should be updated to hash_serialized_2. The description should also be updated to say that hash_serialized_2 will not be compatible with hash_serialized from clients <0.15.0.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj May 15, 2017

Member

I've been testing this on a slow system: on an ARM (i.MX6), USB2 external harddisk, the database upgrade took about 50 minutes:

2017-05-15 10:27:45 Upgrading database...
2017-05-15 11:20:25 LoadBlockIndexDB: last block file = 869

Not necessarily in this pull, but some kind of progress feedback like for rescans / reindexes would be indispensable. Users might assume that the client has crashed after no log messages for such a long time.

Member

laanwj commented May 15, 2017

I've been testing this on a slow system: on an ARM (i.MX6), USB2 external harddisk, the database upgrade took about 50 minutes:

2017-05-15 10:27:45 Upgrading database...
2017-05-15 11:20:25 LoadBlockIndexDB: last block file = 869

Not necessarily in this pull, but some kind of progress feedback like for rescans / reindexes would be indispensable. Users might assume that the client has crashed after no log messages for such a long time.

@morcos

posthumous utACK (very untested)

nice work.
i left my couple of nits anyway.
I can open a PR to address the output lookups in ATMP and for any of the others that are worth addressing.

Show outdated Hide outdated src/coins.cpp Outdated
COutPoint out(hash, o);
Coin coin;
view.SpendCoin(out, &coin);
if (tx.vout[o] != coin.out) {

This comment has been minimized.

@morcos

morcos Jun 7, 2017

Member

Do we want to check that coin.nHeight == pindex->nHeight ?
Not sure if it matters, but that used to get checked...

@morcos

morcos Jun 7, 2017

Member

Do we want to check that coin.nHeight == pindex->nHeight ?
Not sure if it matters, but that used to get checked...

//! This may (but cannot always) return true for fully spent transactions
virtual bool HaveCoins(const uint256 &txid) const;
//! Just check whether we have data for a given outpoint.
//! This may (but cannot always) return true for spent outputs.

This comment has been minimized.

@morcos

morcos Jun 7, 2017

Member

This comment is incorrect I believe? It will never return true (nor should it) for a spent output

@morcos

morcos Jun 7, 2017

Member

This comment is incorrect I believe? It will never return true (nor should it) for a spent output

Show outdated Hide outdated src/validation.cpp Outdated
static constexpr int MAX_BLOCK_COINSDB_USAGE = 200 * DB_PEAK_USAGE_FACTOR;
//! Always periodic flush if less than this much space still available.
static constexpr int MIN_BLOCK_COINSDB_USAGE = 50 * DB_PEAK_USAGE_FACTOR;
static constexpr int MAX_BLOCK_COINSDB_USAGE = 10 * DB_PEAK_USAGE_FACTOR;

This comment has been minimized.

@morcos

morcos Jun 7, 2017

Member

maybe this should be 30?
sdaftuar said he saw 17 in only a week of testing

@morcos

morcos Jun 7, 2017

Member

maybe this should be 30?
sdaftuar said he saw 17 in only a week of testing

This comment has been minimized.

@sdaftuar

sdaftuar Jun 7, 2017

Member

17 was incorrect; I mistakenly reported the cache delta between blocks (which includes the effect of transactions on the cache) as the per-block cache delta.

@sdaftuar

sdaftuar Jun 7, 2017

Member

17 was incorrect; I mistakenly reported the cache delta between blocks (which includes the effect of transactions on the cache) as the per-block cache delta.

@sipa sipa deleted the sipa:pertxoutcache branch Jun 23, 2017

@jnewbery jnewbery referenced this pull request Jul 31, 2017

Closed

TODO for release notes 0.15.0 #9889

12 of 12 tasks complete

MarcoFalke added a commit that referenced this pull request Aug 11, 2017

Merge #11029: [RPC] trivial: gettxout no longer shows version of tx
8627946 [RPC] trivial: gettxout no longer shows version of tx (Felix Weis)

Pull request description:

  Since the switch to a per-txout chainstate db in #10195, the tx version information is no longer stored. Updated `gettxout` rpc help text accordingly.

Tree-SHA512: 3d7f42ef0f649056ece98bf22a1e972d1876324733adc81fa31bc2cd160550c5b6cb8682209fb8e8dbc56a8139ed5f5f0e740945f709039e69d52997ddbca7b8
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action)
{
READWRITE(nTxVer);
uint32_t nTxVerDummy = 0;
READWRITE(nTxVerDummy);

This comment has been minimized.

@Earlz

Earlz Sep 11, 2017

Contributor

What is the point of this? Just to keep the database backwards compatible?

@Earlz

Earlz Sep 11, 2017

Contributor

What is the point of this? Just to keep the database backwards compatible?

codablock added a commit to codablock/dash that referenced this pull request Sep 27, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 12, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 26, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 26, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 30, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 31, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 31, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

codablock added a commit to codablock/dash that referenced this pull request Oct 31, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3

UdjinM6 added a commit to UdjinM6/dash that referenced this pull request Nov 8, 2017

Merge bitcoin#10195: Switch chainstate db and cache to per-txout model
5898279 scripted-diff: various renames for per-utxo consistency (Pieter Wuille)
a5e02bc Increase travis unit test timeout (Pieter Wuille)
73de2c1 Rename CCoinsCacheEntry::coins to coin (Pieter Wuille)
119e552 Merge CCoinsViewCache's GetOutputFor and AccessCoin (Pieter Wuille)
580b023 [MOVEONLY] Move old CCoins class to txdb.cpp (Pieter Wuille)
8b25d2c Upgrade from per-tx database to per-txout (Pieter Wuille)
b2af357 Reduce reserved memory space for flushing (Pieter Wuille)
41aa5b7 Pack Coin more tightly (Pieter Wuille)
97072d6 Remove unused CCoins methods (Pieter Wuille)
ce23efa Extend coins_tests (Pieter Wuille)
5083079 Switch CCoinsView and chainstate db from per-txid to per-txout (Pieter Wuille)
4ec0d9e Refactor GetUTXOStats in preparation for per-COutPoint iteration (Pieter Wuille)
13870b5 Replace CCoins-based CTxMemPool::pruneSpent with isSpent (Pieter Wuille)
05293f3 Remove ModifyCoins/ModifyNewCoins (Pieter Wuille)
961e483 Switch tests from ModifyCoins to AddCoin/SpendCoin (Pieter Wuille)
8b3868c Switch CScriptCheck to use Coin instead of CCoins (Pieter Wuille)
c87b957 Only pass things committed to by tx's witness hash to CScriptCheck (Matt Corallo)
f68cdfe Switch from per-tx to per-txout CCoinsViewCache methods in some places (Pieter Wuille)
0003911 Introduce new per-txout CCoinsViewCache functions (Pieter Wuille)
bd83111 Optimization: Coin&& to ApplyTxInUndo (Pieter Wuille)
cb2c7fd Replace CTxInUndo with Coin (Pieter Wuille)
422634e Introduce Coin, a single unspent output (Pieter Wuille)
7d991b5 Store/allow tx metadata in all undo records (Pieter Wuille)
c3aa0c1 Report on-disk size in gettxoutsetinfo (Pieter Wuille)
d342424 Remove/ignore tx version in utxo and undo (Pieter Wuille)
7e00322 Add specialization of SipHash for 256 + 32 bit data (Pieter Wuille)
e484652 Introduce CHashVerifier to hash read data (Pieter Wuille)
f54580e error() in disconnect for disk corruption, not inconsistency (Pieter Wuille)
e66dbde Add SizeEstimate to CDBBatch (Pieter Wuille)

Tree-SHA512: ce1fb1e40c77d38915cd02189fab7a8b125c7f44d425c85579d872c3bede3a437760997907c99d7b3017ced1c2de54b2ac7223d99d83a6658fe5ef61edef1de3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment