Commit Graph

31 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
7d3c3b4b64
merge bitcoin#22788: Use generate* from TestFramework 2024-10-04 19:01:00 +00:00
Konstantin Akimov
8639298e16
refactor: drop fast_dip3_enforcement=True from functional tests.
It also change dip3params default from 30:50 to 2:2
De facto, that always equals True, so, there's no meaning to have it
2024-09-26 14:17:05 +07:00
Konstantin Akimov
593c6cff14
feat: instant activation dip-0008 on regtest on first block 2024-08-15 11:26:06 +07:00
MarcoFalke
57b6fe7327
Merge bitcoin/bitcoin#22257: test: refactor: various (de)serialization helpers cleanups/improvements
bdb8b9a347e68f80a2e8d44ce5590a2e8214b6bb test: doc: improve doc for `from_hex` helper (mention `to_hex` alternative) (Sebastian Falbesoner)
191405420815d49ab50184513717a303fc2744d6 scripted-diff: test: rename `FromHex` to `from_hex` (Sebastian Falbesoner)
a79396fe5f8f81c78cf84117a87074c6ff6c9d95 test: remove `ToHex` helper, use .serialize().hex() instead (Sebastian Falbesoner)
2ce7b47958c4a10ba20dc86c011d71cda4b070a5 test: introduce `tx_from_hex` helper for tx deserialization (Sebastian Falbesoner)

Pull request description:

  There are still many functional tests that perform conversions from a hex-string to a message object (deserialization) manually. This PR identifies all those instances and replaces them with a newly introduced helper `tx_from_hex`.

  Instances were found via
  * `git grep "deserialize.*BytesIO"`

  and some of them manually, when it were not one-liners.

  Further, the helper `ToHex` was removed and simply replaced by `.serialize().hex()`, since now both variants are in use (sometimes even within the same test) and using the helper doesn't really have an advantage in readability. (see discussion https://github.com/bitcoin/bitcoin/pull/22257#discussion_r652404782)

ACKs for top commit:
  MarcoFalke:
    review re-ACK bdb8b9a347e68f80a2e8d44ce5590a2e8214b6bb 😁

Tree-SHA512: e25d7dc85918de1d6755a5cea65471b07a743204c20ad1c2f71ff07ef48cc1b9ad3fe5f515c1efaba2b2e3d89384e7980380c5d81895f9826e2046808cd3266e
2024-03-22 10:29:15 -05:00
Konstantin Akimov
2f788aa76d
fix: change port to use for zmq in interface_zmq_dash.py
It resolves a conflict with interface_zmq.py and intermittent failure
2024-03-18 16:01:41 +07:00
Konstantin Akimov
097a8e7196
non-scripted-diff: bump copyright year to 2023
that's a result of:
contrib/devtools/copyright_header.py update ./

it is not scripted diff, because it works differentlly on my localhost and in CI:
CI doesn't want to use git commit date which is mocked to 30th Dec of 2023
2024-02-24 11:05:37 -06:00
Konstantin Akimov
f34889dcf4
Merge #19760: test: Remove confusing mininode terminology
d5800da5199527a366024bc80cad7fcca17d5c4a [test] Remove final references to mininode (John Newbery)
5e8df3312e47a73e747ee892face55ed9ababeea test: resort imports (John Newbery)
85165d4332b0f72d30e0c584b476249b542338e6 scripted-diff: Rename mininode to p2p (John Newbery)
9e2897d020b114a10c860f90c5405be029afddba scripted-diff: Rename mininode_lock to p2p_lock (John Newbery)

Pull request description:

  New contributors are often confused by the terminology in the test framework, and what the difference between a _node_ and a _peer_ is. To summarize:

  - a 'node' is a bitcoind instance. This is the thing whose behavior is being tested. Each bitcoind node is managed by a python `TestNode` object which is used to start/stop the node, manage the node's data directory, read state about the node (eg process status, log file), and interact with the node over different interfaces.
  - one of the interfaces that we can use to interact with the node is the p2p interface. Each connection to a node using this interface is managed by a python `P2PInterface` or derived object (which is owned by the `TestNode` object). We can open zero, one or many p2p connections to each bitcoind node. The node sees these connections as 'peers'.

  For historic reasons, the word 'mininode' has been used to refer to those p2p interface objects that we use to connect to the bitcoind node (the code was originally taken from the 'mini-node' branch of https://github.com/jgarzik/pynode/tree/mini-node). However that name has proved to be confusing for new contributors, so rename the remaining references.

ACKs for top commit:
  amitiuttarwar:
    ACK d5800da519
  MarcoFalke:
    ACK d5800da5199527a366024bc80cad7fcca17d5c4a 🚞
Tree-SHA512: 2c46c2ac3c4278b6e3c647cfd8108428a41e80788fc4f0e386e5b0c47675bc687d94779496c09a3e5ea1319617295be10c422adeeff2d2bd68378e00e0eeb5de
2024-01-20 00:07:10 +07:00
Odysseas Gabrielides
112564974d
refactor: deprecate non-deterministic IS support (#5553)
## Issue being fixed or feature implemented
Non-deterministic IS locks aren't used anymore since v18 dip24.
We should drop that support to make code simpler.

## What was done?
Dropped non-deterministic IS code, `evo_instantsend_tests` and
`feature_llmq_is_migration.py` (don't need it anymore), adjusted func
tests.

## How Has This Been Tested?
all tests, synced Testnet

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: Konstantin Akimov <545784+knst@users.noreply.github.com>
2023-11-20 10:17:04 -06:00
Konstantin Akimov
750f627a90
fix: improved reliability of functional tests that activates dip24 (#5313)
## Issue being fixed or feature implemented
Functional tests in CI and locally often fails without a good reason
(pretty randomly)

## What was done?
It was re-implemented `get_recovered_sig` and updated `create_raw_tx`
for better selection/change output.

## How Has This Been Tested?
Run functional times with bug amount of parrallel jobs:
```
test/functional/test_runner.py -j 20 feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py  feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py feature_llmq_is_cl_conflicts.py
```
Without these changes usually 2-3 instance fails.
With these changes all failures happened only for `p2p_addrv2_relay.py`
and `mempool_unbroadcast.py`. Beside feature_llmq_is_conflicts.py
improved stability of `interface_zmq_dash.py` also.

## Breaking Changes
No breaking changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-05-06 21:36:45 -05:00
Odysseas Gabrielides
78d057dd7a
feat!: BLS scheme upgrade (#5021)
Tracking issue is:
[(https://github.com/dashpay/dash/issues/5001)](https://github.com/dashpay/dash/issues/5001)

Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
2022-12-29 23:45:31 -06:00
Kittywhiskers Van Gogh
82938bdfb9 trivial: relocate MSG_* constants from mininode to messages 2022-09-24 08:51:04 +05:30
Kittywhiskers Van Gogh
282b02e6b2
rpc: split spork manipulation logic to distinct "sporkupdate" call (#4885)
* rpc: split spork manipulation logic to distinct "sporkupdate" call

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

* docs: add release notes for dash#4885

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-18 19:52:45 +03:00
PastaPastaPasta
d64b7229cd
chore: bump copyrights (#4873)
* chore: bump copyright in configure.ac

* chore: bump copyright via copyright_header.py

ran command `python3 contrib/devtools/copyright_header.py update .`
2022-06-08 02:36:46 +03:00
UdjinM6
ba4a7b1d07
tests: make inv replies in interface_zmq_dash.py stricter, fix a bug (#4813)
* only reply to the correct inv type in on_getdata

* send_tx should send invs with the right type

the bug was introduced in 3852
2022-04-27 17:16:52 +03:00
UdjinM6
7fc9ced96d
tests: various fixes/cleanups (#4797)
* tests: move `move_to_next_cycle` to `DashTestFramework`

* tests: set correct defaults for `mine_cycle_quorum`

* tests: use correct quorum type in `create_islock`

* tests: fix `rpc_verifyislock.py`

* tests: fix `feature_llmq_is_cl_conflicts.py`

* tests: isolate zmq subscribers in `interface_zmq_dash.py`

this lets us call `test_*_publishers()` in any order and any number of times

* tests: check zmq for both deterministic and non-deterministic islocks
2022-04-25 22:12:04 +03:00
thephez
dcc00ac8e9
test: skip test properly if zmq missing (#4684) 2022-02-12 04:33:46 +07:00
gabriel-bjg
b4d001a602
instantsend: deterministic lock using the same msg hash as islock (#4381)
When receiving an islock, propagate it as islock.
When creating/receiving and isdlock, propagate it as isdlock to peers which support it and as islock to peers which don't.
Functional tests to cover both islock and isdlock scenarios.
2021-10-05 20:42:34 +03:00
Wladimir J. van der Laan
71b4cf307b Merge #14180: qa: Run all tests even if wallet is not compiled
fac95398366f644911b58f1605e6bc37fb76782d qa: Run all tests even if wallet is not compiled (MarcoFalke)
faa669cbcd1fc799517b523b0f850e01b11bf40a qa: Premine to deterministic address with -disablewallet (MarcoFalke)

Pull request description:

  Currently the test_runner would exit if the wallet was not compiled into the Bitcoin Core executable. However, a lot of the tests run without the wallet just fine and there is no need to globally require the wallet to run the tests.

Tree-SHA512: 63177260aa29126fd20f0be217a82b10b62288ab846f96f1cbcc3bd2c52702437703475d91eae3f8d821a3149fc62b725a4c5b2a7b3657b67ffcbc81532a03bb
2021-09-21 17:24:56 -04:00
Dzutte
39933ecd8a
Merge bitcoin#14060: ZMQ: add options to configure outbound message high water mark, aka SNDHWM (#4360)
* Merge #14060: ZMQ: add options to configure outbound message high water mark, aka SNDHWM

a4edb168b635b6f5c36324e44961cd42cf9bbbaa ZMQ: add options to configure outbound message high water mark, aka SNDHWM (mruddy)

Pull request description:

  ZMQ: add options to configure outbound message high water mark, aka SNDHWM

  This is my attempt at https://github.com/bitcoin/bitcoin/pull/13315

Tree-SHA512: a4cc3bcf179776899261a97c8c4f31f35d1d8950fd71a09a79c5c064879b38e600b26824c89c4091d941502ed5b0255390882f7d44baf9e6dc49d685a86e8edb

* High watermark settings for Dash-specific messages

Signed-off-by: Dzutte <dzutte.tomsk@gmail.com>

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
2021-09-08 12:39:06 -04:00
Kittywhiskers Van Gogh
0b13db2ac5 merge #14954: Require python 3.5 2021-08-31 11:16:12 +05:30
MarcoFalke
e1497f67b2
Merge #13916: qa: wait_for_verack by default
fa5587fe71 qa: wait_for_verack by default (MarcoFalke)

Pull request description:

  This removes the need to do so manually every time a connection is added.

Tree-SHA512: a46c92cb4df41e30778b42b9fd3dcbd8d2d82aa7503d1213cb1c1165034f648d8caee01c292e2d87d05b0f71696996eef5be8a753f35ab49e5f66b0e3bf29f21
2021-07-06 20:29:31 +03:00
Wladimir J. van der Laan
c02337e1b0
Merge #13517: qa: Remove need to handle the network thread in tests
fa87da2f172ae2e6dc15e9ed156a3564a8ecfbdd qa: Avoid start/stop of the network thread mid-test (MarcoFalke)

Pull request description:

  This simplifies test writing by removing the need to handle the network thread in tests. E.g. start thread, join thread, restart thread mid-test, adding p2p connections at the "right" time, ...

Tree-SHA512: 533642f12fef5496f1933855edcdab1a7ed901d088d34911749cd0f9e044c8a6cb1f89985ac3a7f41a512943663e4e270a61978f6f072143ae050cd102d4eab8
2021-07-02 12:59:26 +03:00
PastaPastaPasta
c5b919d084
Update copyright (#4115)
* run: `python3 contrib/devtools/copyright_header.py update .`

* bump copyright year
2021-04-20 22:33:02 +03:00
UdjinM6
95e8492f31
llmq: Implement Intra-Quorum Relay connections for qrecsig-s (#4020)
* llmq: Implement Intra-Quorum Relay connections for qrecsig-s

Avoid relaying recsigs to non-masternodes.

* test: Simplify loop

* test: Assert connections are equal to llmq_size instead of static number

* test: Drop redundant brackets

* test: Fix typo

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2021-03-14 22:49:38 -04:00
UdjinM6
687aece098
Harden DIP0008 activation (#3889)
* Harden DIP0008 activation

* Update src/llmq/quorums_instantsend.cpp

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

* Update test/functional/test_framework/test_framework.py

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

Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-12-28 12:21:01 +01:00
xdustinface
724e8aed19
More of bitcoin#13645 in interface_zmq_dash.py 2020-12-18 12:55:45 -06:00
UdjinM6
b95cf017c3
tests: Enable InstantSend and ChainLocks by default (#3853)
* tests: Enable ChainLocks by default

* tests: Enable InstantSend (including filtering) by default
2020-12-12 00:57:39 -06:00
UdjinM6
88d54054f9
zmq: Send islock notifications for txes received after their islocks were received (#3852)
* Send islock notifications for txes received after their islocks were received

Also drop UpdateWalletTransaction - its name makes no sense and it's only used once.

* tests: early islocks should trigger notifications once a corresponding tx is received

* Tweak tests

- fail if an unexpected islock is received
- drop unused variable

* llmq: Drop `c_str()` in two log statements

* test: Move create_islock to DashTestFramework in test_framework.py

Just because it's used the same way in two files

* test: Simplify send tx in zmq test

* format

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-12-09 19:52:11 +00:00
UdjinM6
adee9504a6
tests: Fix a couple of rare mnsync issues (#3847)
* tests: Bump mocktime in smaller intervals while (not) signaling

This is needed to avoid triggering `CMasternodeSync::Reset()`.

* tests: force faucet node to finish mnsync in prepare_datadirs

* test: Drop redundant force_finish_mnsync in interface_zmq_dash.py

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-12-05 23:39:38 +00:00
PastaPastaPasta
a70ea0cafd
tests: adjust some comments in interface_zmq_dash.py (#3839)
Signed-off-by: pasta <pasta@dashboost.org>
2020-11-30 17:01:31 +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