Commit Graph

105 Commits

Author SHA1 Message Date
dustinface
d6c6174958
llmq|init|test: Implement DKG data recovery / quorum verification vector sync (#3964)
* llmq: Implement automated DKG recovery threads

* llmq: Implement quorum verification vector sync

* init: Validiate quorum data recovery related command line parameter

* test: Add quorum_data_request_timeout_seconds in DashTestFramework

* test: Test quorum data recovery in feature_llmq_data_recovery.py

* test: Add feature_llmq_data_recovery.py to BASE_SCRIPTS

* test: Fix quorum_data_request_expiration_timeout in wait_for_quorum_data

* test: Always test the existence of secretKeyShare in test_mn_quorum_data

With this change it also validates that "secretKeyShare" is not in `quorum_info` if its not expected to be in there. Before this was basically just not tested.

* llmq|test: Use bool as argument type for -llmq-data-recovery

* llmq: Always set nTimeLastSuccess to 0

* test: Set -llmq-data-recovery=0 in p2p_quorum_data.py

* test: Simplify test_mns

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* refactor: pass CQuorumCPtr to StartQuorumDataRecoveryThread

* test: Fix thread name in comment

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2021-02-01 17:10:19 +01:00
dustinface
21cfb4c934
llmq|rpc|test|version: Implement P2P messages QGETDATA <-> QDATA (#3953)
* version: Bump PROTOCOL_VERSION and MIN_MASTERNODE_PROTO_VERSION

* version: Introduce LLMQ_DATA_MESSAGES_VERSION for QGETDATA/QDATA support

* test: Bump MY_VERSION to 70219 (LLMQ_DATA_MESSAGES_VERSION)

* llmq: Introduce CQuorumDataRequest as wrapper for QGETDATA requests

* llmq: Implement CQuorum::{SetVerificationVector, SetSecretKeyShare}

* llmq|net|protocol: Implement QGETDATA/QDATA P2P messages

* llmq: Restrict processing QGETDATA/QDATA to masternodes only

* llmq: Implement request limiting for QGETDATA/QDATA

* llmq: Implement CQuorumManger::RequestQuorumData

* rpc: Implement "quorum getdata" as wrapper around QGETDATA

Allows to trigger sending QGETDATA messages to connected peers by RPC.

* test: Handle QGETDATA/QDATA messages in mininode

* test: Add data structures to support QGETDATA/QDATA

* test: Add some helper in test_framework.py

* test: Implement tests for QGETDATA/QDATA in p2p_quorum_data.py

* test: Add p2p_quorum_data.py to BASE_SCRIPTS

* llmq|test: Add QWATCH support for QGETDATA/QDATA

* llmq: Store CQuorumPtr in cache, not CQuorumCPtr

* llmq: Fix cache usage after recent changes

* Use uacomment to create/find specific p2ps

* No need to use network adjusted time here, GetTime should be enough

* rpc: check proTxHash

* minor tweaks

* test: Adjustments after 4e27d6513e

* llmq: Rename and improve error lambda in CQuorumManager::ProcessMessage

* llmq: Process QDATA if -watchquorums is enabled

* test: Handle qwatch messages in mininode

* test: Add test for -watchquorums support

* test: Just some empty lines

* test: Properly stop the p2p network thread at the end of the test

* rpc: Adjust "quorum getdata" parameter descriptions

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

* rpc: Fix optionality of proTxHash in "quorum getdata" command

* test: Test optionality of proTxHash for "quorum getdata" command

* test: Be more specific about imports in p2p_quorum_data.py

* llmq|rpc: Add some comments about the request.GetDataMask checks

* test: Some more empty lines

* rpc: One more parameter description

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

* test: Unify assert statements / drop parentheses for all of them

* fix typo

Signed-off-by: pasta <pasta@dashboost.org>

* adjust some line wrapping to 80 chars

Signed-off-by: pasta <pasta@dashboost.org>

* tests: Seperate out into dif atomic methods, add logging

Signed-off-by: pasta <pasta@dashboost.org>

* test: Avoid restarting masternodes, just let available requests expire

Just takes a lot time and isn't required imo.

* test: Drop redundant code/tests after separation

This was introduced in 9e224ec2f2

* test: Merge three tests

"test_mnauth_restriction", "test_invalid_messages" and "test_invalid_unexpected_qdata" with the resulting name "test_basics" because i don't feel like DKG recovery thing should be part of a test called "test_invalid_messages" and giving it an own test probably wouldn't make a lot sense because it would still depend on "test_invalid_messages". I also think there is no need for a separated "test_invalid_unexpected_qdata".

* test: Rename test_ratelimiting_banscore -> test_request_limit

* test: Apply python style

* test: Wrap all at 120 characters

Thats the default "draw annoying warnings" setting for PyCharm (and IMO a reasonable line length).

* test: Move some variables

* test: Optimize for speed

* tests: use wait_until in get_mininode_id

* test: Don't use `!=` to check for `None`

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
2021-01-28 17:33:18 -05:00
UdjinM6
48bf736525
wallet: Upgrade path for non-HD wallets to HD (#3933)
* Check mnemonic passphrase size in SetMnemonic instead of CreateWalletFromFile

* Move processing of cmd-line options and recovery via hdseed out of GenerateNewHDChain

* Implement GenerateNewHDChainEncrypted and tweak EncryptHDChain to be able to generate new encrypted HD chains in an already encrypted wallet

* rpc: Implement upgradetohd rpc

* Address review comments

* tweak rpc response

* tests: Test various non-HD to HD wallet upgrade paths

* Apply suggestions from code review

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Fix suggestions

* tests: Check upgradetohd return value

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2021-01-24 22:03:33 -05:00
dustinface
ce3bcab3ab
rpc|test: Introduce "mnauth" RPC command to override masternode authentications (#3930)
* rpc: Introduce "mnauth" RPC command to fake masternode authentications

* test: Test "mnauth" RPC command

* test: Add rpc_mnauth.py to BASE_SCRIPTS

* Update src/rpc/misc.cpp

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* Update test/functional/rpc_mnauth.py

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2021-01-24 21:50:16 -05:00
Kolby Moroz Liebl
e197f976e1
backport bitcoin#16509 and add devnet test (#3946)
* Merge #16509: test: Adapt test framework for chains other than "regtest"

faf36838bdba7393960fce6ad0c56dc1f93f5870 test: Avoid hardcoding the chain name in combine_logs (MarcoFalke)
fa8a1d7ba30040f8c74f93fc41a61276c255a6a6 test: Adapt test framework for chains other than "regtest" (MarcoFalke)
68f546635d5de2ccfedadeabc7bc79e12e5eca6a test: Fix “local variable 'e' is assigned to but never used” (Ben Woosley)

Pull request description:

  This is required for various work in progress:

  * testchains #8994
  * signet #16411
  * some of my locally written tests

  While it will be unused in the master branch as of now, it will make all of those pull requests shorter. Thus review for non-regtest tests can focus on the actual changes and not some test framework changes.

ACKs for top commit:
  jonatack:
    ACK faf36838bdba7393960fce6ad0c56dc1f93f5870, ran tests and reviewed the code.

Tree-SHA512: 35add66c12cab68f2fac8f7c7d47c604d3f24eae9336ff78f83e2c92b3dc08a25e7f4217199bac5393dd3fb72f945bba9c001d6fbb8efd298c88858075fcb3d6

* Add devnet support for tests

* test: make sure devnet can connect to each other and start

* Partial merge bitcoin/bitcoin#16681: Tests: Use self.chain instead of 'regtest' in almost all current tests, revert one TODO while at it

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: Jorge Timón <jtimon@jtimon.cc>
2021-01-22 09:58:07 -05:00
UdjinM6
f3e8401da5
rpc: Introduce verifyislock (#3906)
* Introduce `verifyislock` rpc

* Update test/functional/rpc_verifyislock.py

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2021-01-11 11:13:50 -06:00
Wladimir J. van der Laan
95cfaeea17 Merge bitcoin#12953: Deprecate accounts
cead28b [docs] Add release notes for deprecated 'account' API (John Newbery)
72c9575 [wallet] [tests] Add tests for accounts/labels APIs (John Newbery)
109e05d [wallet] [rpc] Deprecate wallet 'account' API (John Newbery)
3576ab1 [wallet] [rpc] Deprecate account RPC methods (John Newbery)
3db1ba0 [tests] Set -deprecatedrpc=accounts in tests (John Newbery)
4e671f0 [tests] Rename rpc_listtransactions.py to wallet_listtransactions.py (John Newbery)
a28b907 [wallet] [rpc] Remove duplicate entries in rpcwallet.cpp's CRPCCommand table (John Newbery)

Pull request description:

  Deprecate all accounts functionality and make it only accessible by using `-deprecatedrpc=accounts`.

  Accounts specific RPCs, account arguments, and account related results all require the `-deprecatedrpc=accunts` startup option now in order to see account things.

  Several wallet functional tests use the accounts system. Those tests are unchanged, except to start the nodes with `-deprecatedrpc=accounts`. We can slowly migrate those tests to use the 'label' API instead of the 'account' API before accounts are fully removed.

Tree-SHA512: 89f4ae2fe6de4a1422f1817b0997ae22d63ab5a1a558362ce923a3871f3e42963405d6573c69c27f1764679cdee5b51bf52202cc407f1361bfd8066d652f3f37
2020-12-22 17:53:03 +01:00
Russell Yanofsky
1914effbbb Merge bitcoin#11536: Rename account to label where appropriate
d2527bd Rename wallet_accounts.py test (Russell Yanofsky)
045eeb8 Rename account to label where appropriate (Russell Yanofsky)

Pull request description:

  Rename account to label where appropriate

  This change only updates strings and adds RPC aliases, but should simplify the implementation of address labels in #7729, by getting renaming out of the way and letting that change focus on semantics.

  The difference between accounts and labels is that labels apply only to addresses, while accounts apply to both addresses and transactions (transactions have "from" and "to" accounts). The code associating accounts with transactions is clumsy and unreliable so we would like get rid of it.

  ---

  There is a rebased version of #7729 atop this PR at https://github.com/ryanofsky/bitcoin/commits/pr/label, see #7729 (comment).

Tree-SHA512: b3f934e612922d6290f50137f8ba71ddfaea4485713c7d97e89400a8b73b09b254f9186dffa462c77f5847721f5af9852b5572ade5443d8ee95dd150b3edb7ff
2020-12-22 17:53:03 +01:00
MarcoFalke
4f77eff89c
Merge #12252: Require all tests to follow naming convention
125f4a4909 [tests] Require all tests to follow naming convention (Anthony Towns)

Pull request description:

  Based on top of #11774

Tree-SHA512: 1eb156b5a97b30c203b7b0ad3d2055b391ef825e2e57805c7745b5259a9b1caaa115768ec225452f12f354e550f83e071f9c6fee2c36698b4679191895aab8de
2020-12-15 20:21:00 -06:00
MarcoFalke
3cfe3f6db1
Merge #12720: qa: Avoiding 'file' function name from python2
0dbb32b2cb Avoiding 'file' function name from python2 with more descriptive variable naming (Jeff Rade)

Pull request description:

  @jnewbery Here is PR from review in [#12437](https://github.com/bitcoin/bitcoin/pull/12437)

Tree-SHA512: c61980f4d3170842627cd970e1f6eebaf303843dc5e95a9dcfe3ded08152be533774cb75f56a83af8452b6bcac17c0172cf20e39edf9acefb4a4c255fe893a3b
2020-12-15 17:00:05 -06:00
UdjinM6
0a8664fd33
rpc: Add masternode payments (#3863)
* rpc: Implement `masternode payments`

Returns an array of deterministic masternodes and their payments for a specific block

* tests: Add rpc_masternode.py

* Apply review suggestions

* Add amounts calculated per masternode and per block

* Tweak help string

* Update src/rpc/masternode.cpp

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* rpc: Check against vector size instead of decrementing a counter

* rpc: Use `std::vector::begin()` instead of `std::begin(std::vector)`

* Drop set_dash_dip8_activation in rpc_masternode.py

* Apply suggestions from code review

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-12-14 20:15:09 -06:00
tomthoros
5a026be52c
Consensus: DIP-0020: Dash opcode updates - OP_CAT and OP_SPLIT. (#3824)
* DIP-0020: Dash opcode updates - enable OP_CAT and OP_SPLIT (renamed from OP_SUBSTR)

* DIP-0020: Dash opcode updates - DEPLOYMENT_V17 activates dip0020 opcodes

* Add/tweak MAX_SCRIPT_ELEMENT_SIZE tests for OP_CAT and OP_SPLIT

* Check nDefaultMaxNumSize in OP_SPLIT tests

* Purify DISABLED_OPCODE tests for OP_CAT and OP_SPLIT, fix DoTest to actually preserve the DIP0020 flag

* Fix `warning: '&' within '|' [-Wbitwise-op-parentheses]`

* Rework/simplify feature_dip0020_activation.py

* DIP-0020: Remove functionally redundant tests.

* Fix file permissions for feature_dip0020_activation.py

* DIP-0020: fix typo

* Update src/test/script_tests.cpp

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* Update test/functional/feature_dip0020_activation.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* DIP-0020: improve comments

* DIP-0020: dont use negative booleans

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
2020-12-11 22:17:10 +00:00
UdjinM6
cf64339517
consenus: Implement LLMQ_100_67 quorums (#3844)
* Add LLMQ_100_67 quorums

* Re-use DEPLOYMENT_V17 bit to activate LLMQ_100_67 quorums

* Add LLMQ_TEST_NEW quorum and test its activation

* Tweak mine_quorum to work correctly with multiple quorum types

And to avoid a potentialy endless "while" loop

* llmq: Rename IsQuorumTypeEnabledAtBlock -> IsQuorumTypeEnabled

* chainparams|test: Rename llmq_test_new -> llmq_test_v17

* chainparams|consensus|llmq: Rename LLMQ_TEST_NEW -> LLMQ_TEST_V17

* Tweak few strings and the name of the test

* llmq: Make GetEnabledQuorumTypes return a vector of LLMQTypes, introduce GetLLMQParams

Signed-off-by: pasta <pasta@dashboost.org>

* Tweak minSize

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

* Exclude LLMQ_100_67 from Concentrated Recovery

* Update test/functional/feature_new_quorum_type_activation.py

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
Co-authored-by: pasta <pasta@dashboost.org>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-12-10 00:08:05 +01:00
dustinface
3a02c6d74c
rpc|governance|test: Store prepared governance objects and implement "gobject list-prepared" (#3811)
* governance: Add CGovernanceObject::ToJson()

* rpc: Save governance objects before tx commit in gobject_prepare

* rpc: Add "gobject list-prepared"

* test: Implement tests for "gobject list-prepared"

* test: Add "feature_governance_objects.py" to BASE_SCRIPTS in test_runner

* rpc: Rename parameter: limit => count

* rpc: Rephrase "Maximal" => "Maximum"

* rpc|test: Set default count of "gobject list-prepared" to 10

* rpc: Align behaviour/message or count parameter with existing commands

* rpc|test: Reverse order of "gobject list-prepared" output
2020-12-01 03:55:29 +00:00
dustinface
90f7d7ff2a
test: Implement tests for all dash related ZMQ notifications (#3804)
* test: Add more C++ representing classes in message.py

* test: Add interface_zmq_dash.py

* test: Add interface_zmq_dash.py to BASE_SCRIPTS in test_runner.py

* test: Adjust hashrecoveredsig parsing

* Force node0 to finish syncing

* Avoid `uint256_to_string(uint256_from_str())`

* Be more specific in imports

* Plural for "publisher" when makes sense

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-11-27 17:55:28 +03:00
PastaPastaPasta
e72164e719
rpc: implement whitelist for commands needed by Dash Platform (#3738)
* implement whitelist for commands needed by Dash Platform

Signed-off-by: pasta <pasta@dashboost.org>

* Add test for platform command filtering

Signed-off-by: pasta <pasta@dashboost.org>

* Use less if statements

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* make defaultPlatformUser const

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* test: Make rpc_platform_filter.py executable

* test: Refactor tests in rpc_platform_filter.py

* minor modifications to rpc_platform_filter.py

Signed-off-by: pasta <pasta@dashboost.org>

* test: Expand test cases in rpc_platform_filter.py

* rpc: Use std::map instead of std::vector for platformAllowedCommands

* rpc: Improve readability and be more specific about the reject reason

* rpc: Fix comment

* rpc|httprpc: Rename RPC_PROTECTED_COMMAND to RPC_PLATFORM_RESTRICTION

* minor modifications to server.cpp

Signed-off-by: pasta <pasta@dashboost.org>

* add help text

Signed-off-by: pasta <pasta@dashboost.org>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-11-24 02:39:50 +01:00
Wladimir J. van der Laan
79639195ee
Merge #12811: test: Make summary row bold-red if any test failed and show failed tests at end of table
ffb033a test: List any failed tests at the end of test_runner output (Anthony Towns)
f92541f test: Make summary row bold-red if any test failed (Wladimir J. van der Laan)

Pull request description:

  Make the summary row of the test runner bold red if *any* test fails. This helps visibility if something fails.
  (yesteryday I had a snafu where I missed that `feature_blocksdir.py` had failed because it's one of the earlier tests in the list, this intends to avoid that in the future)

  Before:
  ![testfailold](https://user-images.githubusercontent.com/126646/38021100-3fbaf1c6-327c-11e8-8bae-d3ba46e77408.png)

  After:
  ![testfailnew](https://user-images.githubusercontent.com/126646/38021108-43ac7ef8-327c-11e8-8566-e52bcbaf89b8.png)

  If tests pass it still looks the same:

  ![testok](https://user-images.githubusercontent.com/126646/38021115-4a8e9954-327c-11e8-8fe4-34e889384d3e.png)

Tree-SHA512: 057748c693ca1c80840e4e4cdea8aa1baf8996f03d6805975d8e3c07c4ba0087cd8fa83f891d6bf1af0bfbba88b5d46bd5d852df340d755202bd32ae6f1034b5
2020-10-14 13:27:32 -04:00
Wladimir J. van der Laan
ba32ad8620
Merge #12653: Allow to optional specify the directory for the blocks storage
a192636 -blocksdir: keep blockindex leveldb database in datadir (Jonas Schnelli)
f38e4fd QA: Add -blocksdir test (Jonas Schnelli)
386a6b6 Allow to optional specify the directory for the blocks storage (Jonas Schnelli)

Pull request description:

  Since the actual block files taking up more and more space, it may be desirable to have them stored in a different location then the data directory (use case: SSD for chainstate, etc., HD for blocks).

  This PR adds a `-blocksdir` option that allows one to keep the blockfiles and the blockindex external from the data directory (instead of creating symlinks).

  I fist had an option to keep the blockindex within the datadir, but seems to make no sense since accessing the index will (always) lead to access (r/w) the block files.

Tree-SHA512: f8b9e1a681679eac25076dc30e45e6e12d4b2d9ac4be907cbea928a75af081dbcb0f1dd3e97169ab975f73d0bd15824c00c2a34638f3b284b39017171fce2409
2020-10-14 13:26:32 -04:00
UdjinM6
ab8347e06b
Implement dynamic activation thresholds (#3692)
* Implement dynamic activation thresholds

* fix

* Revert unrelated changes

* Clarify switching to/staying in LOCKED_IN state

* Fix signal function to work correctly with num_blocks=0

* Add simplified threshold calculation and use it in tests

* Check that thresholds are decreasing, reach the min level and stay there

* Drop `;`
2020-09-12 17:33:12 +03:00
UdjinM6
d838ec0370
Implement Block Reward Reallocation (#3691)
* Implement Block Reward Reallocation

* Add integr. test

* drop unused variable

* Sep -> Oct

* Update test/functional/feature_block_reward_reallocation.py

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

* Revert to Sep for testnet and devnet

* validation: Refactor reallocation calculations

Makes it much more readable imo and avoids calculating the percentage
each time.

* test: Align reallocation calculation with c++ (GetMasternodePayment)

* test: Make feature_block_reward_allocation.py executable

* Make linter happy

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-09-10 19:23:11 +03:00
PastaPastaPasta
a566eaff30
Optimize functional tests runtime (#3630)
Signed-off-by: pasta <pasta@dashboost.org>
2020-07-28 23:51:09 +03:00
Wladimir J. van der Laan
8adbc386a5
Merge #13051: qa: Normalize executable location
fa811b0 qa: Normalize executable location (MarcoFalke)

Pull request description:

  This removes the need to override the executable locations by just reading them from the config file. Beside making the code easier to read, running individual test on Windows is now possible by default (without providing further command line arguments).

  Note: Of course, it is still possible to manually specify the location through the `BITCOIND` environment variable, e.g. `bitcoin-qt`.

Tree-SHA512: bee6d22246796242d747120ca18aaab089f73067de213c9111182561985c5912228a0b0f7f9eec025ecfdb44db031f15652f30d67c489d481c995bb3232a7ac7
2020-07-22 12:12:46 -05:00
Wladimir J. van der Laan
87cf14727a
Merge #13570: RPC: Add new "getzmqnotifications" method
161e8d40a4e4c0e701b6c8142b8dcacf2190545e RPC: Add new getzmqnotifications method. (Daniel Kraft)
caac39b0ace38aa088d88c1a5a9a9dbb4d2e893f Make ZMQ notification interface instance global. (Daniel Kraft)

Pull request description:

  This adds a new RPC method `getzmqnotifications`, which returns information about all active ZMQ notification endpoints.  This is useful for software that layers on top of bitcoind, so it can verify that ZeroMQ is enabled and also figure out where it should listen.

  See #13526.

Tree-SHA512: edce722925741c84ddbf7b3a879fc9db1907e5269d0d97138fe724035d93ee541c2118c24fa92f4197403f380d0e25c2fda5ca6c62d526792ea749cf527a99a0
2020-07-17 15:42:49 -05:00
PastaPastaPasta
b07a7b810c
Backport 11796 + 11774 (#3612)
* Merge #11796: [tests] Functional test naming convention

5fecd84 [tests] Remove redundant import in blocktools.py test (Anthony Towns)
9b20bb4 [tests] Check tests conform to naming convention (Anthony Towns)
7250b4e [tests] README.md nit fixes (Anthony Towns)
82b2712 [tests] move witness util functions to blocktools.py (John Newbery)
1e10854 [tests] [docs] update README for new test naming scheme (John Newbery)

Pull request description:

  Splitting #11774 into two parts -- this part updates the README with the proposed naming convention, and adds some checks to test_runner.py that the number of tests violating the naming convention doesn't increase too much. Idea is this part of the change should not introduce merge conflicts or require much rebasing, so reviews of the complicated bits won't become invalidated too often; while the second part will just be file renames, which will require regular rebasing and will introduce merge conflicts with pending PRs, but can be merged later, and should also be much easier to review, since it will only include relatively trivial changes.

Tree-SHA512: b96557d41714addbbfe2aed62fb5a48639eaeb1eb3aba30ac1b3a86bb3cb8d796c6247f9c414c4695c4bf54c0ec9968ac88e2f88fb62483bc1a2f89368f7fc80

* update violation count

Signed-off-by: pasta <pasta@dashboost.org>

* Merge #11774: [tests] Rename functional tests

6f881cc880 [tests] Remove EXPECTED_VIOLATION_COUNT (Anthony Towns)
3150b3fea7 [tests] Rename misc functional tests. (Anthony Towns)
81b79f2c39 [tests] Rename rpc_* functional tests. (Anthony Towns)
61b8f7f273 [tests] Rename p2p_* functional tests. (Anthony Towns)
90600bc7db [tests] Rename wallet_* functional tests. (Anthony Towns)
ca6523d0c8 [tests] Rename feature_* functional tests. (Anthony Towns)

Pull request description:

  This PR changes the functional tests to have a consistent naming scheme:

      tests for individual RPC methods are named rpc_...
      tests for interfaces (REST, ZMQ, RPC features) are named interface_...
      tests that explicitly test the p2p interface are named p2p_...
      tests for wallet features are named wallet_...
      tests for mining features are named mining_...
      tests for mempool behaviour are named mempool_...
      tests for full features that aren't wallet/mining/mempool are named feature_...

  Rationale: it's sometimes difficult for new contributors to know what's already covered by existing tests and where new tests should be added. Naming in a consistent fashion makes it easier to see what's already covered at a glance.

Tree-SHA512: 4246790552d42bbd95f6d5bdf67702b81b3b2c583ce7eaf1fe6d8e254721279b47315973c6e9ae82dad6e4c747f12188160764bf2624c0f8f3b4d39330ec8b16

* rename tests and edit associated strings to align test-suite with test name standards

Signed-off-by: pasta <pasta@dashboost.org>

* fix grammar in test/functional/test_runner.py

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>

* ci: Fix excluded test names

* rename feature_privatesend.py to rpc_privatesend.py

Signed-off-by: pasta <pasta@dashboost.org>

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-07-17 02:44:20 +03:00
Wladimir J. van der Laan
f5c91d1826 Merge #12510: test: Add rpc_bind test to default-run tests
e87fefc test: Add rpc_bind test to default-run tests (Wladimir J. van der Laan)

Pull request description:

  Skip the parts that cannot be run on the host due to lack of IPv6 support or a second interface to bind on, and warn appropriately.

  Without no strong requirements (besides being Linux only, which will skip the test) left, add this test to the default in test_runner.

  ~~(the non-IPv6 parts of the two dual-IPv4/6 tests could also be enabled, but first going to look what Travis does here to see if there wasn't another reason it was disabled)~~ done, it only makes sense for the first

Tree-SHA512: 724259b14f59dccc7e61ef071359336adb0f76a63db392b6ce6940e21c8ee0470c35374e82970681261685ef299cd70b0c1372598cea85d341f64c2c40ea28ee
2020-07-09 21:24:56 +03:00
Wladimir J. van der Laan
d1200755f1 Merge #13448: Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python
c8176b3cc7556d7bcec39a55ae4d6ba16453baaa Add linter: Make sure we explicitly open all text files using UTF-8 or ASCII encoding in Python (practicalswift)
634bd970013eca90f4b4c1f9044eec8c97ba62c2 Explicitly specify encoding when opening text files in Python code (practicalswift)

Pull request description:

  Add linter: Make sure we explicitly open all text files using UTF-8 encoding in Python.

  As requested by @laanwj in #13440.

Tree-SHA512: 1651c00fe220ceb273324abd6703aee504029b96c7ef0e3029145901762c733c9b9d24927da281394fd4681a5bff774336c04eed01fafea997bb32192c334c06
Signed-off-by: pasta <pasta@dashboost.org>

# Conflicts:
#	contrib/devtools/circular-dependencies.py
#	contrib/linearize/linearize-data.py
#	contrib/linearize/linearize-hashes.py
#	contrib/seeds/generate-seeds.py
#	contrib/verify-commits/verify-commits.py
#	test/functional/multiwallet.py
#	test/functional/notifications.py
#	test/functional/test_runner.py
#	test/util/rpcauth-test.py
2020-07-07 11:50:56 -05:00
PastaPastaPasta
b463e5780e
Change litemode to disablegovernance (#3577)
* Change litemode to disablegovernance, this makes it more clear what that flag actually does.

Signed-off-by: pasta <pasta@dashboost.org>

* more fLiteMode to fDisableGovernance

Signed-off-by: pasta <pasta@dashboost.org>

* handle -litemode being set

Signed-off-by: pasta <pasta@dashboost.org>
2020-06-29 00:00:00 +03:00
MarcoFalke
3d252a72b2 Merge #12710: Append scripts to new test_list array to fix bad assignment
b0fec8d623 Append scripts to new test_list array to fix bad assignment (Jeff Rade)

Pull request description:

  Fixes review by @MarcoFalke in PR [#12437](https://github.com/bitcoin/bitcoin/pull/12437)

  Assignment of `test_list` would point to the same array object as `BASE_SCRIPT` or `ALL_SCRIPTS` which we do not want.

Tree-SHA512: 57d6c1f4563aaffbac68e96782283799b10be687292152d70ffbbc22e7b52c11c1af0c483acb01c69fbaa99bdae01431b65a5d1d0a913d549f58dfd95d0d28d9
2020-06-17 14:29:55 -05:00
MarcoFalke
19e2de1b22 Merge #12437: [Trivial] Simplify if-else blocks and more descriptive variable naming
97bcd36811 [Trivial] Simplify if-else blocks and more descriptive variable naming (Jeff Rade)

Pull request description:

  Was looking through `test_runner.py` to start work on [#11964](https://github.com/bitcoin/bitcoin/issues/11964).  Made a few changes to make the file more readable and keep these separate from future PR.

Tree-SHA512: 7508f4ee39672d18718d8f80b61b89918eac7b4c75953682b812b73013f18ebd81adc7953f3b6c98c5c598adeb1998f5455f123b5566d1cc03631c7924b4103a
2020-06-17 14:29:55 -05:00
Pasta
b40dc8f1ec fix lint-python.sh after 11835 and 12295
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-17 14:29:55 -05:00
MarcoFalke
9e71390d39 Merge #12438: [Tests] Fix trivial typo in test_runner.py causing error
ada1af6d8f Fix typo in test_runner.py causing error (MeshCollider)

Pull request description:

  In the case that a test fails, the typo in run_tests() (introduced in #11858) will cause an error rather than printing out the combined logs, hiding the cause of the failure.

Tree-SHA512: 7d7aa406d92750320ed20610cc5f174cdc94086f630af8c0c4db2003497132e0c56d59b94312fb42ad4507904a2fa858226a4a9337450930bf206183fc35c0a0
2020-06-17 14:29:54 -05:00
Wladimir J. van der Laan
a8da932ff0 Merge #11858: qa: Prepare tests for Windows
faefd29 qa: Prepare functional tests for Windows (MarcoFalke)

Pull request description:

  * Pass `sys.executable` when calling a python script via the subprocess
    module
  * Don't remove the log file while it is still open and written to
  * Properly use os.pathsep and os.path.sep when modifying the PATH
    environment variable
  * util-tests: Use os.path.join for Windows compatibility

  Ref:  #8227

Tree-SHA512: c507a536af104b3bde4366b6634099db826532bd3e7c35d694b5883c550920643b3eab79c76703ca67e1044ed09979e855088f7324321c8d52112514e334d614
2020-06-17 14:29:54 -05:00
John Newbery
219ff3901f Partial Merge #11789 2020-06-17 14:29:54 -05:00
UdjinM6
469d6aa737
Some Dashification (#3513)
* Trivial Dashification

* Tweak getnetworkinfo and dumpwallet help text

We don't have RBF and Segwit

* CopyrightHolders should also check for missing "Dash Core" copyright
2020-06-11 11:39:04 +03:00
MarcoFalke
d6c36124c0
Merge #12227: test_runner: Readable output if create_cache.py fails
ac96e788fa test_runner: Readable output if create_cache.py fails (Russell Yanofsky)

Pull request description:

  Without this change, create_cache.py process output is shown as a byte() object
  with \n escapes in a single line that is hard to read.

Tree-SHA512: 49cd0fff037c03f558e31a1281712cc4419df6c4ed8b342057a3d54ab6b31180e1a23cb586686952d81b8add5bec07844efa8cdf16ad20f40cc903a19437fda5
2020-04-08 11:46:27 -05:00
MarcoFalke
0f937164eb Merge #11965: qa: Note on test order in test_runner
fadf60e381 qa: Note on test order in test_runner (MarcoFalke)

Pull request description:

  C.f. #11964

Tree-SHA512: 5f087965093722d9e7a3febddcc187e412bd0636a7ed2da60111668fe3bba6668110e25a38ddcccc0d0aae132611c56fa72f3f0c473fb3fb59e38be445edfcd5
2020-04-03 05:06:59 -05:00
Alexander Block
5edbeafcea Also run llmq-signing.py with spork21 enabled 2020-03-31 19:58:07 +02:00
UdjinM6
3c90da86b3
Merge pull request #3371 from PastaPastaPasta/backports-0.16-pr12
Backports 0.16 pr12
2020-03-28 00:58:08 +03:00
Alexander Block
7df624d380 Implement tests for LLMQ connection handling 2020-03-27 15:12:20 +01:00
MarcoFalke
5fc1686919
Merge #12843: [tests] Test starting bitcoind with -h and -version
63048ec73d [tests] Test starting bitcoind with -h and -version (John Newbery)

Pull request description:

  Test that starting bitcoind/bitcoin-qt with `-h` and `-version` works as expected.

  Prompted by https://github.com/bitcoin/bitcoin/pull/10762#commitcomment-28345993, which is a nullpointer dereference triggered by starting bitcoin-qt with `-h`.

  On master, this test passes when run over bitcoind, but fails when running over bitcoin-qt. I used xvfb as a virtual frame buffer to test:

  ```
  BITCOIND=/home/ubuntu/bitcoin/src/qt/bitcoin-qt xvfb-run ./feature_help.py --nocleanup
  2018-03-30T17:09:37.767000Z TestFramework (INFO): Initializing test directory /tmp/user/1000/testdi4dre13
  2018-03-30T17:09:37.767000Z TestFramework (INFO): Start bitcoin with -h for help text
  2018-03-30T17:09:37.841000Z TestFramework (ERROR): Assertion failed
  Traceback (most recent call last):
    File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 126, in main
      self.run_test()
    File "./feature_help.py", line 25, in run_test
      assert_equal(ret_code, 0)
    File "/home/ubuntu/bitcoin/test/functional/test_framework/util.py", line 39, in assert_equal
      raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
  AssertionError: not(-11 == 0)
  2018-03-30T17:09:37.842000Z TestFramework (INFO): Stopping nodes
  Traceback (most recent call last):
    File "./feature_help.py", line 42, in <module>
      HelpTest().main()
    File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 149, in main
      self.stop_nodes()
    File "/home/ubuntu/bitcoin/test/functional/test_framework/test_framework.py", line 273, in stop_nodes
      node.stop_node()
    File "/home/ubuntu/bitcoin/test/functional/test_framework/test_node.py", line 141, in stop_node
      self.stop()
    File "/home/ubuntu/bitcoin/test/functional/test_framework/test_node.py", line 87, in __getattr__
      assert self.rpc_connected and self.rpc is not None, "Error: no RPC connection"
  AssertionError: Error: no RPC connection
  ```

  Passes for bitcoind and bitcoin-qt when run on #12836.

  Longer term, we should consider running functional tests over bitcoin-qt in one of the Travis jobs.

Tree-SHA512: 0c2f40f3d5f0e78c3a1b07dbee8fd383eebab27ed0bf2a98a5b9cc66613dbd7b70e363c56163a37e02f68ae7ff7b3ae1769705d0e110ca68a00f8693315730a4
2020-03-24 11:43:10 -05:00
UdjinM6
73258b363b
Merge pull request #3354 from PastaPastaPasta/backports-0.16-pr10
Backports 0.16 pr10
2020-03-10 14:57:35 +03:00
MarcoFalke
cc2cd7291b
Merge #11970: Add test coverage for bitcoin-cli multiwallet calls
a14dbff39e Allow multiwallet.py to be used with --usecli (Russell Yanofsky)
f6ade9ce1a [tests] allow tests to be run with --usecli (John Newbery)
ff9a363ff7 TestNodeCLI batch emulation (Russell Yanofsky)
ca9085afc5 Prevent TestNodeCLI.args mixups (Russell Yanofsky)
fcfb952bca Improve TestNodeCLI output parsing (Russell Yanofsky)

Pull request description:

  Lack of test coverage was pointed out by @jnewbery in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r158133900

Tree-SHA512: 5f10e31abad11a5edab0da4e2515e39547adb6ab9e55e50427ab2eb7ec9a43d6b896b579b15863e5edc9beee7d8bf1c84d9dabd247be0760a1b9ae39e1e8ee02
2020-03-04 10:13:24 -06:00
MarcoFalke
08171fb386
Merge #11513: [trivial] [tests] A few Python3 tidy ups
f89308532 [tests] Don't subclass from object for Python 3 (John Newbery)
8f9e3627e [tests] authproxy.py: tidy up __init__() (John Newbery)
323d8f61e [tests] fix flake8 warnings in authproxy.py (John Newbery)
fc0176d01 [tests] use python3 for authproxy.py (John Newbery)

Pull request description:

  A few trivial tidyups in the test_framework:

  - the test_framework can only be run in Python3, so remove the py2/3 compatibility workarounds in authproxy.py
  - while there, do some general tidying up of the module - fix flake8 warnings, make initialization code more compact
  - All classes in Python3 are new-style. No need to explicitly inherit from `object`.

Tree-SHA512: d15c93aa4b47c1ad7d05baa7a564053cf0294932e178c95ef335380113f42e1af314978d07d3b107292a8e3496fd840535b5571a9164182feaa062a1e9ff8b73

fix up mininode.py slightly

Signed-off-by: Pasta <pasta@dashboost.org>
2020-02-29 11:51:03 -06:00
Wladimir J. van der Laan
df30971371
Merge #11883: Add configuration file/argument testing
be9a13c Add configuration/argument testing (MeshCollider)

Pull request description:

  Adds a new functional test for testing various command line and configuration file argument interactions, that aren't specific enough to other functionality to be placed in other tests.

  Currently this tests the error messages for non-existent datadir, which would have caught the bug fixed in https://github.com/bitcoin/bitcoin/pull/11829. It also tests that command line arguments override the ones in the config file.

  I plan on working on a fix for https://github.com/bitcoin/bitcoin/issues/11819 / https://github.com/bitcoin/bitcoin/issues/1044 and then expanding this test with cases for that.

Tree-SHA512: 97aea18c67d331db3ca3d0c99c79267cf012df67fddafc9fac63d392f5c3a6469aa14d93b5865c3bbe561461648d2485367978a77446483b8df53d1916f1c8e8
2020-02-27 10:36:04 -06:00
Wladimir J. van der Laan
f175a2e351
Merge #11740: Implement BIP159 NODE_NETWORK_LIMITED (pruned peers) *signaling only*
de74c62 [Doc] Update bip.md, add support for BIP 159 (Jonas Schnelli)
e054d0e [QA] Add node_network_limited test (Jonas Schnelli)
bd09416 Avoid leaking the prune height through getdata (fingerprinting countermeasure) (Jonas Schnelli)
27df193 Always set NODE_NETWORK_LIMITED bit (Jonas Schnelli)
7caba38 Add NODE_NETWORK_LIMITED flags and min block amount constants (Jonas Schnelli)

Pull request description:

  Extracted from #10387.
  Does implement BIP159, but only the signalling part. No connections are made to NODE_NETWORK_LIMITED in this PR.

  The address relay and connection work (the more complicated part) can then be separated (probably in #10387).

Tree-SHA512: e3218eb4789a9320b0f42dc10f62d30c13c49bdef00443fbe653bee22933477adcfc1cf8f6a95269324560b5721203ed41f3c5e2dd8a98ec2791f6a9d8346b1a
2020-02-27 09:41:36 -06:00
Wladimir J. van der Laan
2c7b29bac5
Merge #11466: Specify custom wallet directory with -walletdir param
c1e5d40 Make debugging test crash easier (MeshCollider)
8263f6a Create walletdir if datadir doesn't exist and fix tests (MeshCollider)
9587a9c Default walletdir is wallets/ if it exists (MeshCollider)
d987889 Add release notes for -walletdir and wallets/ dir (MeshCollider)
80c5cbc Add test for -walletdir (MeshCollider)
0530ba0 Add -walletdir parameter to specify custom wallet dir (MeshCollider)

Pull request description:

  Closes #11348

  Adds a `-walletdir` parameter which specifies a directory to use for wallets, allowing them to be stored separately from the 'main' data directory. Creates a new `wallets/` directory in datadir if this is the first time running, and defaults to using it if it exists.

  Includes tests and release notes. Things which might need to be considered more:
  - there is no 'lock' on the wallets directory, which might be needed?
  - because this uses a new wallets/ directory by default, downgrading to an earlier version won't see the wallets in that directory (not a big deal though, users can just copy them up to the main dir)
  - jnewbery suggested putting each wallet in its own directory, which is a good idea, but out of scope for this PR IMO. EDIT: this is being done in https://github.com/bitcoin/bitcoin/pull/11687
  - doc/files.md needs updating (will do soon)

  I also considered including  a cleanup by removing caching of data directory paths and instead just initialise them once on startup (c.f. #3073), but decided it wasn't super relevant here will just complicate review.

Tree-SHA512: c8ac04bfe9a810c32055f2c8b8fa0d535e56125ceb8d96f12447dd3538bf3e5ee992b60b1cd2173bf5f3fa023a9feab12c9963593bf27ed419df929bb413398d
2020-02-08 23:33:25 -06:00
Wladimir J. van der Laan
608fad56a0
Merge #11781: Add -debuglogfile option
5a7c09a test: Add tests for `-debuglogfile` with subdirs (Anthony Towns)
4158734 doc: Update release notes for `-debuglogfile` (Wladimir J. van der Laan)
2323242 test: Add test for `-debuglogfile` (Wladimir J. van der Laan)
cf5f432 Add `-debuglogfile` option (Wladimir J. van der Laan)

Pull request description:

  This patch adds an option to configure the name and/or directory of the debug log file.

  The user can specify either a relative path, in which case the path is relative to the (network specific) data directory. They can also specify an absolute path to put the log anywhere else in the file system.

  Alternative to #11741 that gets rid of the concept of a "log directory" by specifying the path for the specific kind of log, the debug log. Which happens to be the only kind of log we have at this point*, but a hypothetical new kind of log (say, an audit log) would get a new option. This has more flexibility than specifying a directory which has to contain all of them.

  \* excluding `db.log` which is internally generated by the wallet database library, but that one moves along with `-walletdir`.

Tree-SHA512: 4434d0e598dc23504e5c9e67fdbaef56db4f0fd490f9f54fd503e69d4dda9b5b69c539e1794ed841e72161b7b1dc3374d2f1193dd431b057566750e56fd8f24b
2020-01-30 07:32:32 -06:00
Wladimir J. van der Laan
21514ceb50
Merge #11486: [tests] Add uacomment tests
c5dfa90 [tests] Add uacomment tests (Cristian Mircea Messel)

Pull request description:

  Checks for setting the value, max length and reserved characters

Tree-SHA512: a62e2cf8e455a3cd3987c0855f7bfc49de47504c01263e3573366e3cbff400c5678224773d4f1e4ac684fff34d987994e490a0978c4da05ff2a4bfa972c84723
2020-01-16 09:22:46 -06:00
UdjinM6
7e85f09007
Merge pull request #3284 from PastaPastaPasta/backports-0.16-pr3
Backports 0.16 pr3
2020-01-16 14:24:11 +03:00
Alexander Block
c88a7b9e76
Merge pull request #3279 from codablock/pr_backport_11818
Backport bitcoin#11818: I accidentally [deliberately] killed it [the ComparisonTestFramework]
2020-01-14 10:17:00 +01:00