Skip to content
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

Coinstats Index #19521

Merged
merged 17 commits into from Apr 30, 2021
Merged

Coinstats Index #19521

merged 17 commits into from Apr 30, 2021

Conversation

fjahr
Copy link
Contributor

@fjahr fjahr commented Jul 14, 2020

This is part of the coinstats index project tracked in #18000

While the review of the new UTXO set hash algorithm (MuHash) takes longer recently #19328 was merged which added the possibility to run gettxoutsetinfo with a specific hash type. As the first type it added hash_type=none which skips the hashing of the UTXO set altogether. This alone did not make gettxoutsetinfo much faster but it allows the use of an index for the remaining coin statistics even before a new hashing algorithm has been added. Credit to Sjors for the idea to take this intermediate step.

Features summary:

  • Users can start their node with the option -coinstatsindex which syncs the index in the background
  • After the index is synced the user can use gettxoutsetinfo with hash_type=none or hash_type=muhash and will get the response instantly out of the index
  • The user can specify a height or block hash when calling gettxoutsetinfo to see coin statistics at a specific block height

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 15, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

if (gArgs.GetArg("-prune", 0)) {
if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX))
return InitError(_("Prune mode is incompatible with -txindex."));
if (gArgs.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX))
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
Copy link
Member

@luke-jr luke-jr Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

@fjahr fjahr Aug 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It syncs over the whole blockchain, processing every block and saving state on each. That allows users to query the stats for every block height (a nice-to-have feature). It's the standard way BaseIndex currently works, although changing that would probably only require minimal effort. Potential users who I have talked to didn't really care much about this. But I will look into it if this again since progress is slow anyway currently.

Copy link
Member

@Sjors Sjors Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a potential user, it would be nice if I can at least turn on pruning after the index is generated, but I think that's for a separate PR.

Copy link
Member

@achow101 achow101 Mar 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is necessary to disallow the coin stats index when pruning is enabled. The only reason that txindex disallows it is because txindex gets the transaction data by reading it off disk from the block files, so that is incompatible with pruning.

The coin stats index doesn't have the same problem. The only issue would be if there were a large reorg and it needed the undo data that has already been deleted. However this is an issue overall of pruned nodes so it shouldn't be a concern for the coin stats index.

@DrahtBot DrahtBot mentioned this pull request Aug 2, 2020
17 tasks
Copy link
Contributor

@PierreRochard PierreRochard left a comment

To reconcile total issuance with the spendable UTXO set, it would be helpful to sum up unspendable amounts.

src/index/coinstatsindex.cpp Show resolved Hide resolved
src/index/coinstatsindex.cpp Show resolved Hide resolved
src/index/coinstatsindex.cpp Show resolved Hide resolved
src/index/coinstatsindex.cpp Outdated Show resolved Hide resolved
struct DBVal {
uint64_t transaction_output_count;
uint64_t bogo_size;
CAmount total_amount;
Copy link
Contributor

@PierreRochard PierreRochard Aug 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the logic, total_amount is the net increase of coins due to this block?

I don't want to bloat your stats index, but I'd be interested in adding total_prevout_spent_amount, total_new_outputs_ex_coinbase_amount, and coinbase_amount to unpack total_amount.

Copy link
Contributor Author

@fjahr fjahr Aug 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the total amount of coins in the UTXO set at that block height. So it's accumulative rather than for this specific block. I added the other values in a draft commit, needs some cleanup but ready to test.

@fjahr
Copy link
Contributor Author

fjahr commented Aug 17, 2020

@PierreRochard Thanks a lot for the comments! I am happy to include these values you requested and drafted that up in a new commit (will need another day for clean-up, docs, tests etc. but it should work already). I actually had done some similar work already for my blog post and was thinking about adding some more numbers myself, just opted to keep the changeset small at the end.

The RPC now has the values for every block by passing a verbose flag true after the block indicator (example is testnet):

$ src/bitcoin-cli gettxoutsetinfo 'none' 1800003 true
{
  "height": 1800003,
  "bestblock": "00000000000005359e00fe3d069b2999baaaf4d69a34492e543f9f82047ddd01",
  "txouts": 23990594,
  "bogosize": 1799579780,
  "disk_size": 1341237413,
  "total_amount": 20940531.15125810,
  "block_info": {
    "unspendable_amount": 0.00000000,
    "total_prevout_spent_amount": 0.21428778,
    "total_new_outputs_ex_coinbase_amount": 0.21428778,
    "coinbase_amount": 0.19531250
  }
}

I just noticed when I was almost done, that I wasn't sure if you would like these requested values to be cumulative or per-block. They are per-block now but it is trivial to change that. Actually, I could even do both. And another questions: should the unspendable output values be included or excluded from the other output values. Example: src/bitcoin-cli gettxoutsetinfo 'none' 0 true shows coinbase: 50.0 although that is unspendable. Same for the total_new_outputs_ex_coinbase_amount if there is an OP_RETURN for example. Just a question of the definition.

And I saw your request for the data dump on twitter. Will look into that as a follow-up :)

@benthecarman
Copy link
Contributor

benthecarman commented Aug 17, 2020

Concept ACK

Would be nice to be able to see the total_unspendable_amount up to that current block.

@jonatack
Copy link
Member

jonatack commented Aug 18, 2020

Concept ACK

src/index/coinstatsindex.cpp Outdated Show resolved Hide resolved
@PierreRochard
Copy link
Contributor

PierreRochard commented Aug 20, 2020

values to be cumulative or per-block

I find it easier to do the cumulative sum in pandas than to back in to the per-block, but the answer also depends on the performance of the underlying index for aggregate queries. If this behaves like a SQL database and we want it to be normalized, it should be per-block, but I'm not religious about it.

@fjahr
Copy link
Contributor Author

fjahr commented Aug 21, 2020

@PierreRochard Thanks for testing and further feedback. As I have written the tests today and did further cleanup I have found that I hadn't been really doing what you were looking for in the coinbase_amount. I was simply returning the block subsidy there.

I am pushing my fixes and test as a separate commit for now since you were already testing with the first version:

  • Adds total_unspendable_amount, the cumulative number as requested
  • Tests for different unspendables (except BIP30 because that is pretty hard to test)
  • Cleans up internal naming and removes some indirections that caused bugs in some scenarios (removes total_in and total_out for example)

I think the formula in block_sanity_check in the test is what should hold for each block and that is how you intended it, correct?

    assert_equal(
        block_info['total_prevout_spent_amount'] + block_subsidy,
        block_info['total_new_outputs_ex_coinbase_amount'] + block_info['coinbase_amount'] + block_info['unspendable_amount']
    )

I think the new code also fixes the BIP30 issue you discovered but I am still syncing the new version of the index with not-super-fast hardware so I will be able to check tomorrow.

@PierreRochard
Copy link
Contributor

PierreRochard commented Aug 21, 2020

Yes, perfect, that equation is exactly right. I'll just delete the coinstats index file for now but does this indexing system have versioning/migrations?

@benthecarman
Copy link
Contributor

benthecarman commented Aug 21, 2020

From testnet:

gettxoutsetinfo  none 1807942 true
{
  "height": 1807942,
  "bestblock": "00000000374715d95667998b720a60bf8241182b279c913573f5e9e3fa54ba00",
  "txouts": 24100924,
  "bogosize": 1807675952,
  "disk_size": 1318392833,
  "total_amount": 20942081.72908999,
  "total_unspendable_amount": 875.88809751,
  "block_info": {
    "unspendable_amount": 0.00000000,
    "total_prevout_spent_amount": 16798.39641164,
    "total_new_outputs_ex_coinbase_amount": 16798.36929066,
    "coinbase_amount": 0.22243348
  }
}

Looking good!

Copy link
Member

@jonatack jonatack left a comment

Code review re-ACK 5f96d7d per git range-diff 13d27b4 07201d3 5f96d7d

{
{"hash_type", RPCArg::Type::STR, RPCArg::Default{"hash_serialized_2"}, "Which UTXO set hash should be calculated. Options: 'hash_serialized_2' (the legacy algorithm), 'muhash', 'none'."},
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The block hash or height of the target height (only available with coinstatsindex)", "", {"", "string or numeric"}},
Copy link
Member

@jonatack jonatack Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit if you have to rebase, this is the only help argument of the three that doesn't end with a period.

Suggested change
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The block hash or height of the target height (only available with coinstatsindex)", "", {"", "string or numeric"}},
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::OMITTED, "The block hash or height of the target height (only available with coinstatsindex).", "", {"", "string or numeric"}},

Copy link
Member

@jonatack jonatack May 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in #21818

Copy link
Member

@promag promag left a comment

I think it should error when hash_or_height is set but index is not available or use_index=false otherwise the result is misleading.

Copy link
Member

@promag promag left a comment

Tested ACK 5f96d7d. Light code review ACK 5f96d7d.

Feel free to ignore nits. These and the above comment can be addressed later.

@@ -23,6 +23,7 @@ enum class CoinStatsHashType {

struct CCoinsStats
{
CoinStatsHashType m_hash_type;
Copy link
Member

@promag promag Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9c8a265

const CoinStatsHashType m_hash_type and drop constructor.

stats.nHeight = Assert(pindex)->nHeight;

if (!pindex) {
{
Copy link
Member

@promag promag Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3f166ec

Remove unnecessary block.

@@ -140,6 +140,35 @@ static int ComputeNextBlockAndDepth(const CBlockIndex* tip, const CBlockIndex* b
return blockindex == tip ? 1 : -1;
}

CBlockIndex* ParseHashOrHeight(const UniValue& param, ChainstateManager& chainman) {
Copy link
Member

@promag promag Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3f166ec

nit, can be static and move { to new line.

@fjahr
Copy link
Contributor Author

fjahr commented Apr 24, 2021

I think it should error when hash_or_height is set but index is not available or use_index=false otherwise the result is misleading.

There is already a check for that and it should error in the case you describe: https://github.com/bitcoin/bitcoin/pull/19521/files#diff-decae4be02fb8a47ab4557fe74a9cb853bdfa3ec0fa1b515c0a1e5de91f4ad0bR1168

If you found a scenario where it doesn't work, please let me know. There is at least a basic test for it here but maybe I have overlooked something: https://github.com/bitcoin/bitcoin/pull/19521/files#diff-a6434325d09a6df4b371513c837907dfc1a97cf540709def4bded9b2a17e3f49R115

@laanwj laanwj merged commit 2b45cf0 into bitcoin:master Apr 30, 2021
15 checks passed
@laanwj
Copy link
Member

laanwj commented Apr 30, 2021

Code review ACK 5f96d7d

@laanwj laanwj removed this from Blockers in High-priority for review Apr 30, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 1, 2021
domob1812 added a commit to domob1812/namecoin-core that referenced this pull request May 3, 2021
Namecoin tracks currency and name outputs separately in the UTXO stats.
For the recent merge of the coinstats index in upstream
bitcoin/bitcoin#19521, we modify the code now
to keep this separate tracking also in the new index.
domob1812 added a commit to xaya/xaya that referenced this pull request May 4, 2021
The coinstats index that was created upstream in
bitcoin/bitcoin#19521 needs some updates for
Xaya, since the genesis block reward is custom (the premine) and
spendable.
for (size_t j = 0; j < tx->vout.size(); ++j) {
const CTxOut& out{tx->vout[j]};
Coin coin{out, pindex->nHeight, tx->IsCoinBase()};
COutPoint outpoint{tx->GetHash(), static_cast<uint32_t>(j)};
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could just make j of type uint32_t to avoid the cast?

if (tx->IsCoinBase()) {
m_block_coinbase_amount += coin.out.nValue;
} else {
m_block_new_outputs_ex_coinbase_amount += coin.out.nValue;
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this called m_block...? The value is not per block, but the total, like all other CAmount members!? It might be good to call all of them m_block, or m_total, or just skip the prefix for all of them.

Copy link
Contributor Author

@fjahr fjahr May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yepp, it used to be per block, but the names were not changed when the values were changed to track totals.

m_muhash.Finalize(out);
value.second.muhash = out;

return m_db->Write(DBHeightKey(pindex->nHeight), value) && m_db->Write(DB_MUHASH, m_muhash);
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a batch to ensure an atomic operation? Otherwise you may end up with a corrupt muhash?

}
}

if (BaseIndex::Init()) {
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use early return if (!...) return false; to avoid large multi-line nesting


uint256 expected_block_hash{pindex->pprev->GetBlockHash()};
if (read_out.first != expected_block_hash) {
if (!m_db->Read(DBHashKey(expected_block_hash), read_out)) {
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstance would this recovery condition be hit? Also, shouldn't the error message mention that this condition failed as well?

Copy link
Contributor Author

@fjahr fjahr May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could happen if there is a reorg that the index has not picked up on yet, so the hash returned from the height index is not on the active chain anymore. I added a warning logging and changed the error() message to be more accurate.


uint256 expected_block_hash{pindex->pprev->GetBlockHash()};
if (read_out.first != expected_block_hash) {
if (!m_db->Read(DBHashKey(expected_block_hash), read_out)) {
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstance would this recovery condition be hit? Also, shouldn't the error message mention that this condition failed as well?

if (args.GetArg("-prune", 0)) {
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX))
return InitError(_("Prune mode is incompatible with -txindex."));
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX))
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing {} 😅

Copy link
Contributor Author

@fjahr fjahr May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully removed soon anyway with #21726 :)

self.nodes[0].submitblock(ToHex(block))
self.sync_all()

self.wait_until(lambda: not try_rpc(-32603, "Unable to read UTXO set", index_node.gettxoutsetinfo, 'muhash'))
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed? (sync_all should call syncwithvalidationinterface). Also, if it didn't, shouldn't the index RPC call syncwithvalidationinterface internally by itself, similar to how the wallet does it?

Copy link
Contributor Author

@fjahr fjahr May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, I missed the option to use the BlockUntilSynced... function from BaseIndex.

{RPCResult::Type::OBJ, "block_info", "Info on amounts in the block at this block height (only available if coinstatsindex is used)",
{
{RPCResult::Type::STR_AMOUNT, "prevout_spent", ""},
{RPCResult::Type::STR_AMOUNT, "coinbase", ""},
Copy link
Member

@MarcoFalke MarcoFalke May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string as documentation? Would be nice to explain this a bit better. Does it include unspendable outputs ...?

@fjahr
Copy link
Contributor Author

fjahr commented May 24, 2021

Thanks @MarcoFalke , all comments should be addressed in #22047 aside from the init arg brackets which should be made redundant with #21726.

laanwj added a commit that referenced this pull request Jul 28, 2021
779e638 coinstats: Add comments for new coinstatsindex values (Fabian Jahr)
5b3d4e7 Index: Improve logging in coinstatsindex (Fabian Jahr)
d4356d4 rpc: Block until synced if coinstatsindex is used in gettxoutsetinfo (Fabian Jahr)
a5f6791 rpc: Add missing gettxoutsetinfo help docs (Fabian Jahr)
01386bf Index: Return early from failed coinstatsindex init (Fabian Jahr)
1e38423 index: Use batch writing in coinstatsindex WriteBlock (Fabian Jahr)
fb65dde scripted-diff: Fix coinstats data member names (Fabian Jahr)
8ea8c92 index: Avoid unnecessary type casts in coinstatsindex (Fabian Jahr)

Pull request description:

  This is a collection of smaller follow-ups to #19521, addressing several post-merge review comments.

ACKs for top commit:
  Sjors:
    re-utACK 779e638
  jonatack:
    re-ACK 779e638 diff since last review involves doc changes only; rebased to current master and verified clean debug build/no silent conflicts, unit tests, and feature_coinstatsindex functional test
  laanwj:
    Code review ACK 779e638
  Talkless:
    re-utACK 779e638 after cosmetic changes.

Tree-SHA512: cb0d038d230c582d7fe3041c89b1e04d39971fab3739d540c609cf826754c6c513b12ded08ac92180aec7a9d7a70114ece50357bd1a902de4adaae9f30b8d699
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Mar 15, 2022
Summary:
Division of MuHash objects are very expensive and multiplication relatively cheap. The whole idea of introducing and tracking numerator and denominators seperately as a representation of the internal state was so that divisions would be rare. So using divison in the Remove method did not make any sense and was just a silly mistake which is corrected here.

This is a partial backport of [[bitcoin/bitcoin#19521 | core#19521]]
bitcoin/bitcoin@2e2648a

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11168
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
This is part of the "UTXO Set Statistics" project in Core, which aims
to make things like "checking coin supply" faster. This stuff, and
related things in coinstats.cpp, have always been broken for Elements
in the sense that we consider only explicit outputs and we ignore
assets (so everything just gets added together to get a meaningless
total). It probably wouldn't be too hard to restrict this to only
consider policyAsset, but it's out of scope for a rebase IMO.

Also, I think this situation is fine .. I don't understand the motivation
for this or why Core is merging this when they refuse to merge an address
index .. but I guess we'll see if there are users who care about this data
and who care about it being meaningful on Elements.

Also, apologies for the big diff -- there were some mechanical changes
to deal with CT amounts, but most of the changes related to the difference
in how fees are accounted for. While I'm not thrilled with this PR, its
functional test is really good! So I think what I eventually came up with
is internally consistent.
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [2/17]
bitcoin/bitcoin@9c8a265

Depends on D11589

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D11596
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [3/17]
bitcoin/bitcoin@a8a46c4

Depends on D11596

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D11597
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
Main commit
bitcoin/bitcoin@dd58a4d
>  index: Add Coinstats index
>
> The index holds the values previously calculated in coinstats.cpp  for each block, representing the state of the UTXO set at each height.

-----

bitcoin/bitcoin@57a026c
> test: Add unit test for Coinstats index

-----

bitcoin/bitcoin@8ea8c92
> index: Avoid unnecessary type casts in coinstatsindex

-----

Replace two database writes with a single atomic batch write, to avoid a risk of database corruption. See [[ bitcoin/bitcoin@dd58a4d#r634089179 | the corresponding review ]].

bitcoin/bitcoin@1e38423
> index: Use batch writing in coinstatsindex WriteBlock

-----

This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [4 & 8/17] and  [[bitcoin/bitcoin#22047 | core#22047]] [1 & 3/3]

Depends on D11597

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Subscribers: sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D11598
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [5/17]
bitcoin/bitcoin@3c914d5
partial  bitcoin/bitcoin@6a4c0c0

The functional test only checks that "-coinstatsindex" argument does not break anything. The rest of the functional test from commit 6a4c0c09ab is not yet applicable and will be added in the next commit.

This includes also minor documentation fixups from [[ bitcoin/bitcoin#21818 | core#21818]]

Depends on D11598 and D11595

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11599
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [6 & 7/17]
bitcoin/bitcoin@3f166ec
bitcoin/bitcoin@6a4c0c0 (removal of 'disk_size' and 'transactions' from the index and test the RPC on specific heights)

Notes:
 - in the source commits there is a call to `::ChainstateActive().ForceFlushStateToDisk();` added, but it is removed in a following commit in the same PR. This is obviously duplicated with the `active_chainstate.ForceFlushStateToDisk()` a few lines later, so I omitted it.
 - I added a mention about `disk_size` not being available when using the index in the doc of the RPC call. This is added later in the same PR in an unrelated commit in the source material.
 - the new `hash_or_height` RPC parameter needs to be added to the `CRPCConvertParam`table for the unit tests to pass. This is done in a later commit in the same PR in the source material

Depends on D11599

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11600
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [9 & 10/17]
bitcoin/bitcoin@ca01bb8
bitcoin/bitcoin@655d929

Depends on D11600

Test Plan: `ninja && test/functional/test_runner.py rpc_misc`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11604
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [11/17] and [[bitcoin/bitcoin#22047 | core#22047]] [2/3]
bitcoin/bitcoin@2501576
bitcoin/bitcoin@fb65dde

Depends on D11604

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11605
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [12/17]
bitcoin/bitcoin@e0938c2

Note that there are minor differences in some amounts compared to the source commit due to differences in tx fees.

Depends on D11605

Test Plan: `ninja check-functional`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11606
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [13/17]
bitcoin/bitcoin@bb7788b

Depends on D11606

Test Plan: `ninja check-functional`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11607
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [14/17]
bitcoin/bitcoin@b936239

Depends on D11607

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11608
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
… test for coinstatsindex behavior in reorgs

Summary:
This is a backport of [[bitcoin/bitcoin#19521 | core#19521]] [15 & 16/17]
bitcoin/bitcoin@90c966b
bitcoin/bitcoin@23fe504

Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
Depends on D11608

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11609
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jun 13, 2022
Summary:
This concludes backport of [[bitcoin/bitcoin#19521 | core#19521]] [17/17]
bitcoin/bitcoin@5f96d7d

Depends on D11609

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11610
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet