forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #2360: [Tests] Resurrect feature_block and kill the p2p compari…
…son test framework 48e5d54 [Tests][Refactoring] Remove 'magic bytes' in p2p_invalid_* tests (random-zebra) fcda6cc [QA][Cleanup] Retire the Comparison Test Framework (random-zebra) 3633e42 [Tests] Fix and resurrect feature_block.py (random-zebra) 77645bf [BUG][Tests] Add on_getblocks to P2PDataStore interface (random-zebra) 030517b [Refactoring] pass next block height to IncrementExtraNonce (random-zebra) 0f0c97c [BUG] Fix block with invalid PoW in zerocoin_rejection_tests (random-zebra) b19bee9 [Refactoring][BUG] Never change chain-params after setup in unit tests (random-zebra) 810a880 [Tests] Update PIVX specific constants bits/block-size/block-version (random-zebra) d0777a7 [Refactoring] Add fPowNoRetargeting consensus param + fix regtest diff (random-zebra) 93fcc2e [Params] Fix regtest coinbase - mine it with lower diff (random-zebra) 4cf7222 [Tests] Refactor wallet_sapling_transactions_validations_tests (random-zebra) 44a1c44 [Refactor] Option to mine mempool txes in TestChainSetup::CreateBlock (random-zebra) 0b670c8 [BUG] Properly recompute coinbase and sapling root hash in CreateBlock (random-zebra) f5f72ca [Trivial] Update some state logs (tx oversize and inputs missing/spent) (random-zebra) 9d552f9 [Refactor][Tests] Do not change chain when not needed (random-zebra) bd6e591 [Refactoring] remove SaplingActive check in GUI/RPC (random-zebra) b2410ae [BUG] Fix assertion in error in assert_debug_log (random-zebra) Pull request description: Follow-up to #2346. The original goal here was to remove the `ComparisonTestFramework`, following bitcoin#11818. But, before doing that, had to update the old `feature_block` test, which was still using the framework, even though the test was disabled. This is one of the most important functional tests, as it checks all block-related consensus rules, so, just keeping it disabled was not an option. Aside from being very long (1200+ lines), the test was taking ages to mine any single block. This is because it relies on `next_block` doing the actual proof of work (`CBlock::solve`), given the regtest nBits (difficulty is fixed on regtest). Now, since all networks (mainnet/testnet/regtest) share the same genesis block, the regtest difficulty was way higher than it should have been. We never had issues with this, because we are bailing out early in `CheckProofOfWork`, essentially not performing any proof of work check on regtest. So, in order to fix `feature_block.py`, there were two options: either modify `next_block` to keep a fixed nonce, or update the regtest chain parameters, creating a new genesis block with low-diff nBits, and actually checking the proof of work. I chose the latter. This triggered the need to refactor some unit-tests that were changing chain params (from `MAIN` to `REGTEST`) without reloading the genesis block in the block index (which wasn't needed before, because, as explained, all networks had the same genesis). After this PR, the chain is set only inside the test fixtures, and is never changed inside the single test cases (so there is no need to reload the chain index during execution). ACKs for top commit: furszy: ACK 48e5d54 . Fuzzbawls: ACK 48e5d54 Tree-SHA512: 213cad1be7eade941ec5be59fc0b8753eeb11aef55ae74052f59b6c668c4b8ab87efe77221545bdbb2d7b5beeb34b6123005ed2964def6673080cc809c508145
- Loading branch information
Showing
39 changed files
with
961 additions
and
1,607 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.