[Cleanup] The zerocoin garbage collector is in town once more.#2425
Merged
random-zebra merged 4 commits intoPIVX-Project:masterfrom Jul 12, 2021
Merged
Conversation
a3a8f9f to
65a2271
Compare
Author
|
Rebased, ready to go. |
…ontextualCheckZerocoinSpendNoSerialCheck
…idation to zerocoin_verify file.
65a2271 to
017ee3e
Compare
furszy
added a commit
that referenced
this pull request
Jul 28, 2021
… sporks a5a20e8 [Tests] Add check for tip != pblock in zerocoin_rejection_tests (random-zebra) f7a93cd [Refactoring] Cleanup and simplify ParseAndValidateZerocoinSpends (random-zebra) b943f2c [Refactoring] Remove zerocoin disabling check in ATMP and CheckBlock (random-zebra) f91e4df [Refactoring] Skip expensive ContainsZerocoins/HasZerocoinSpendInputs (random-zebra) dd784bb [Cleanup] Deprecate SPORK 16 (zerocoin maintenance) (random-zebra) 179662c [Cleanup] Deprecate SPORK 18 (random-zebra) f91161f [Validation] Reject under-minting blocks (random-zebra) 6c5884c [BUG] Remove double counted nValueIn for zerocoin txes (random-zebra) 78a5da8 [BUG] Remove spork-based CheckPublicCoinSpendVersion (random-zebra) 10db9bf [BUG] Fix ParseAndValidateZerocoinSpend(s) (random-zebra) Pull request description: #2425 introduced two bugs which are preventing a successful chain sync from scratch on `master`: 1. It abstracted a piece of code in `ParseAndValidateZerocoinSpend`, which is only parsing/validating a single zerocoin spend per tx, while a transaction could contain multiple spends. Fix it by returning an optional list of `CoinSpendValue`, instead of a singleton. 2. It re-introduced in the validation the (unused-at-the-time) function `CheckPublicCoinSpendVersion`, which is now failing at the first block with (version 3) public spends. As all spork-based checks, this was supposed to be skipped when `fInitialBlockDownload`. Zerocoin transactions are no longer accepted (in both nets) in the mempool, as well as inside blocks (after v5 enforcement), so we can just remove this obsolete function. The third commit fixes a very old bug: a zerocoin spend tx `nValueIn` is counted twice in ConnectBlock (first directly, after the coinspend parsing/validation, and then via `CCoinsViewCache::GetValueIn`). Then, since we are at it, we can deprecate `SPORK_16_ZEROCOIN_MAINTENANCE_MODE` and `SPORK_18_ZEROCOIN_PUBLICSPEND_V4`, which are now unused/unneeded. The last three commits are performance optimizations to avoid multiple calls to `ContainsZerocoins()`/`HasZerocoinSpendInputs()` in `ConnectBlock`, when possible. ACKs for top commit: Fuzzbawls: ACK a5a20e8 furszy: ACK a5a20e8 Tree-SHA512: 961a755fd36cb24a83d9f0382253cb6f6a94d06534104a3d3328db9047ff769a9ae83c27a4d538ce38c1d9dc25bd4da21ee4387c8ea6251b03d83f81270cd4cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Built on top of #2391.
Made the following changes:
mintpool.h/cpp.zerocoin.h/cpp.ContextualCheckZerocoinSpendandContextualCheckZerocoinSpendNoSerialCheck.zerocoin_verifyfiles.