Skip to content

Conversation

@jamesob
Copy link
Contributor

@jamesob jamesob commented Aug 26, 2019

This is part of the assumeutxo project:

Parent PR: #15606
Issue: #15605
Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal


In the short-term, this move-only commit will help with fuzzing (#15606 (comment)). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

Most easily reviewed with git ... --color-moved=dimmed_zebra. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

Concept ACK

@jamesob
Copy link
Contributor Author

jamesob commented Aug 26, 2019

Thanks for the quick feedback @MarcoFalke. Fixed and pushed.

@jamesob jamesob force-pushed the 2019-08-au-coinstats branch from 0afc435 to 07da7c4 Compare August 26, 2019 17:43
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

utACK 07da7c4

@DrahtBot
Copy link
Contributor

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16345 (rpc: Add getblockbyheight method by emilengler)
  • #15606 ([experimental] UTXO snapshots by jamesob)
  • #13462 (Make SER_GETHASH implicit for CHashWriter and SerializeHash by Empact)

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.

@jamesob jamesob force-pushed the 2019-08-au-coinstats branch from 07da7c4 to 4a76e68 Compare August 26, 2019 20:07
@jamesob
Copy link
Contributor Author

jamesob commented Aug 26, 2019

au.coinstast.1 -> au.coinstast.2 (change)

Pushed fixes for feedback from Marco and Russ.

@jamesob jamesob force-pushed the 2019-08-au-coinstats branch from 4a76e68 to 8f394b5 Compare August 26, 2019 20:11
Copy link

@ariard ariard left a comment

Choose a reason for hiding this comment

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

Reviewed and tested ACK 8f394b5

Copy link
Member

@Sjors Sjors left a comment

Choose a reason for hiding this comment

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

ACK 8f394b5. Happy to see more RPC code move to a seperate and reusable spot. gettxoutsetinfo still works.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Concept ACK, verified it's almost moved-only.

These procedures will later be used in the ChainstateManager to compute
statistics (particularly a content hash) for UTXO sets coming in from
snapshots.
@jamesob jamesob force-pushed the 2019-08-au-coinstats branch from 8f394b5 to 8a3b2eb Compare August 27, 2019 15:53
@jamesob
Copy link
Contributor Author

jamesob commented Aug 27, 2019

au.coinstast.3 -> au.coinstast.4 (change)

Thanks for the reviews and suggestions, everyone. I've cleaned up some of the imports and reverted the LookupBlockIndex change to restore move-onlyness.

@maflcko
Copy link
Member

maflcko commented Aug 27, 2019

ACK 8a3b2eb, checked --color-moved=dimmed-zebra

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK 8a3b2eb17572ca2131778d52cc25ec359470a90f, checked --color-moved=dimmed-zebra
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUizvwv9H7WvV2EuXemNemt9vtvZryiXhZSmOxCwxmTEj8j8lxiWvia0sqrck5dR
sb/b/Yr92kWunZgt2B2xzPnG6twcmR5gfxWGDVSYj0orCUQfqtEJXIDXgfcEHGZi
gDaPL0Kj8oCYH6Rm5RVkZ7dLcShmRj8kTJWk6oFQFfCOD0LhPCutshZdC3rYcxZQ
0ZH5AusJUM8YIiqQLOSZkc+658TxwHUV39RHFad5kbozra5kRiQwtUGBpR17jGim
SPjRnbcv3nNty3tjnlLstC+/WhKh8G+fCro+MSZnuZXqLJ33hy5gA/hy625+PGxR
/q7ItGPBO9GZpGHfB8unwFp+qgMFckKSNGiMRRt8NgzMDVVQSfE2FRvJDBMFGHN9
zMNOspTROW7uA1FmW3VCRZJwLIVYfyMBoBNT4TSN7riGuC5ejqBcPnBftPNne/pz
ME6qyyfjJ6M7ybsZIwX6QrQq/2kYwHpkR9BylefctpnbBgcfvYGM60QsUkdDm8Fq
c9EoO/St
=3F0+
-----END PGP SIGNATURE-----

Timestamp of file with hash 7a6fa2edb4e64bd8de86c3674ec9f4d48567af682d2e26d6152320c838c51897 -


#include <amount.h>
#include <coins.h>
#include <chain.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit sort :trollface:

Copy link
Member

Choose a reason for hiding this comment

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

Can be done the next time this file is touched.

@maflcko
Copy link
Member

maflcko commented Aug 27, 2019

This will be merged after one more ACK

@promag
Copy link
Contributor

promag commented Aug 27, 2019

ACK

maflcko pushed a commit that referenced this pull request Aug 27, 2019
8a3b2eb move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: #15606
  Issue: #15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  In the short-term, this move-only commit will help with fuzzing (#15606 (comment)). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

  Most easily reviewed with `git ... --color-moved=dimmed_zebra`. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

ACKs for top commit:
  MarcoFalke:
    ACK 8a3b2eb, checked --color-moved=dimmed-zebra

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74
@maflcko maflcko merged commit 8a3b2eb into bitcoin:master Aug 27, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Aug 27, 2019
8a3b2eb move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: bitcoin#15606
  Issue: bitcoin#15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  In the short-term, this move-only commit will help with fuzzing (bitcoin#15606 (comment)). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

  Most easily reviewed with `git ... --color-moved=dimmed_zebra`. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

ACKs for top commit:
  MarcoFalke:
    ACK 8a3b2eb, checked --color-moved=dimmed-zebra

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74
domob1812 added a commit to domob1812/namecoin-core that referenced this pull request Sep 2, 2019
Updated the moved code from bitcoin/bitcoin#16728
for Namecoin changes (split of UTXO amount into coin+name value).
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 20, 2020
Summary:
These procedures will later be used in the ChainstateManager to compute
statistics (particularly a content hash) for UTXO sets coming in from
snapshots.

---

This is a backport of Core [[bitcoin/bitcoin#16728 | PR16728]]

Test Plan:
  ninja check-all

Reviewers: #bitcoin_abc, Fabien, deadalnix

Reviewed By: #bitcoin_abc, Fabien, deadalnix

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6147
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Dec 1, 2020
8a3b2eb move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: bitcoin#15606
  Issue: bitcoin#15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  In the short-term, this move-only commit will help with fuzzing (bitcoin#15606 (comment)). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

  Most easily reviewed with `git ... --color-moved=dimmed_zebra`. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

ACKs for top commit:
  MarcoFalke:
    ACK 8a3b2eb, checked --color-moved=dimmed-zebra

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74
PastaPastaPasta added a commit to dashpay/dash that referenced this pull request Dec 15, 2020
* Backport Statoshi

This backports some of https://github.com/jlopp/statoshi.

Missing stuff: README.md and client name changes, segwit and fee estimation stats.

Fix RejectCodeToString

Fix copy-paste mistake s/InvalidBlockFound/InvalidChainFound/

* Merge bitcoin#16728: move-only: move coins statistics utils out of RPC

8a3b2eb move-only: move coins statistics utils out of RPC (James O'Beirne)

Pull request description:

  This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11):

  Parent PR: bitcoin#15606
  Issue: bitcoin#15605
  Specification: https://github.com/jamesob/assumeutxo-docs/tree/master/proposal

  ---

  In the short-term, this move-only commit will help with fuzzing (bitcoin#15606 (comment)). Later, these procedures will be used to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.

  Most easily reviewed with `git ... --color-moved=dimmed_zebra`. A nice follow-up would be adding unittests, which I'll do if nobody else gets around to it.

ACKs for top commit:
  MarcoFalke:
    ACK 8a3b2eb, checked --color-moved=dimmed-zebra

Tree-SHA512: a187d2f7590ad2450b8e8fa3d038c80a04fc3d903618c24222d7e3172250ce51badea35860c86101f2ba266eb4354e6efb8d7d508b353f29276e4665a1efdf74

* Fix 16728

* Modernize StatsdClient

- Reuse some functionality from netbase
- Switch from GetRand to FastRandomContext
- Drop `using namespace std` and add `// namespace statsd`

* Introduce PeriodicStats and make StatsdClient configurable via -stats<smth> (enabled/host/port/ns/period)

* Move/rename tip stats from CheckBlock to ConnectBlock

* Add new false positives to lint-format-strings.py

* Add snprintf in statsd_client to the list of known violations in lint-locale-dependence.sh

* Fix incorrect include guard

* Use bracket syntax includes

* Replace magic numbers with defaults

* Move connection stats calculation into its own function

And bail out early if stats are disabled

* assert in PeriodicStats

Co-authored-by: PastaPastaPasta <[email protected]>

Co-authored-by: MarcoFalke <[email protected]>
Co-authored-by: PastaPastaPasta <[email protected]>
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants