Commit Graph

338 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
df6be0e8c0
partial bitcoin#23212: enable mypy import checking 2024-11-27 04:55:46 +00:00
Konstantin Akimov
2026c59d3c
perf: re-order functional tests to make slowest one to run faster
On CI it is not critical, because there are only 4-8 parallel jobs,
while locally it can be 12-20 or even more
2024-10-30 00:11:53 +07:00
Konstantin Akimov
71cd68d038
feat: run rpc_quorum.py with only one type of wallet 2024-10-30 00:11:53 +07:00
Kittywhiskers Van Gogh
6a7868dba7
merge bitcoin#23443: Erlay support signaling 2024-10-27 19:38:29 +00:00
pasta
7997ad5a08
Merge #6354: backport: trivial 2024 10 23 pr6
d573e4ff86 Merge bitcoin/bitcoin#28084: doc: update windows `-fstack-clash-protection` doc (fanquake)
e3bbd1a46e Merge bitcoin-core/gui#740: Show own outputs on PSBT signing window (Hennadii Stepanov)
70cbd3f8a2 Merge bitcoin/bitcoin#28044: test: indexes, fix on error infinite loop (Ryan Ofsky)
551109105a Merge bitcoin/bitcoin#28036: test: Restore unlimited timeout in IndexWaitSynced (fanquake)
2767a13268 Merge bitcoin/bitcoin#28021: docs: fixup honggfuzz fuzz patch (fanquake)
af944b7c8d Merge bitcoin/bitcoin#28013: doc: Fix verify-binaries link in contrib README (fanquake)
79a20f96a5 Merge bitcoin/bitcoin#27929: Added static_assert to check that base_blob is using whole bytes. (fanquake)
ece625c754 Merge bitcoin/bitcoin#27914: feerate: For GetFeePerK() return nSatoshisPerK instead of round trip through GetFee (fanquake)
ba5f4c0332 Merge bitcoin/bitcoin#27906: doc: test: update TestShell instructions (fanquake)
fbc6c6e644 Merge bitcoin/bitcoin#27875: build: make sure we can overwrite config.{guess,sub} before doing so (fanquake)
e2fcd1d947 Merge bitcoin/bitcoin#27225: doc: document json rpc endpoints (fanquake)
324db8bb31 Merge bitcoin/bitcoin#27603: test: added coverage to mining_basic.py (glozow)
a21b4b16f7 Merge bitcoin/bitcoin#27802: Update .style.yapf (fanquake)
ee6b7d66f1 Merge bitcoin/bitcoin#27721: depends: remove redundant stdlib option (fanquake)
f27778abe7 Merge bitcoin/bitcoin#27561: test: Explicitly specify directory where to search tests for (fanquake)
105442f8cb Merge bitcoin/bitcoin#26422: build: Use newest `config.{guess,sub}` available (fanquake)
bef9631e99 Merge bitcoin/bitcoin#27661: doc, test: Document steps to reproduce TSan warning for `libdb` (fanquake)
277766fcef Merge bitcoin/bitcoin#27493: depends: no-longer nuke libc++abi.so* in native_clang package (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] 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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK d573e4ff86
  knst:
    utACK d573e4ff86

Tree-SHA512: c94f55888de1758457a617253ddd13013141398438a32343ee10ee170d76b7e091ef4479e96f7983cb7661ceb99984a60a668ee142a9aea52b8c5305738398cc
2024-10-25 09:58:33 -05:00
fanquake
f27778abe7
Merge bitcoin/bitcoin#27561: test: Explicitly specify directory where to search tests for
c44f3f231988dc05c4c7a8a96bc2e7b1a54da277 test: Explicitly specify directory where to search tests for (Hennadii Stepanov)

Pull request description:

  For out-of-source builds, the `test/functional/test_runner.py` is supposed to be run from the build directory which allows it to pick the `test/config.ini` file generated by the build system. Currently, it works accidently for the following reasons:
  - on POSIX systems, when running a created by Autoconf symlink to the `test/functional/test_runner.py` in the source directory, it actually has the source directory location in the `sys.path`.
  - on Windows (the `build_msvc` directory) VS project puts and copies every build artifact into the source tree (which is wrong and ugly).

  This PR makes `test/functional/test_runner.py` work from a build directory in any form (a symbolic link, a hard link, a copy) on _all_ supported platforms, which is highly desirable in the upcoming [CMake-based build system](https://github.com/bitcoin/bitcoin/pull/25797).

  For the current master branch, this PR has no behaviour change.

  Required for https://github.com/hebasto/bitcoin/pull/15.

  ---

  **Steps to reproduce the issue**

  While the issue is mostly specific to Windows and CMake builds, it is still possible to reproduce it on the current master branch.

  1. Make an out-of-source build:
  ```
  $ ./autogen.sh
  $ mkdir ../build && cd ../build
  $ ../bitcoin/configure
  $ make
  ```

  2. Note that Autoconf created a symbolic link `test/functional/test_runner.py` in the `../build` directory:
  ```
  $ ls -l test/functional/test_runner.py
  lrwxrwxrwx 1 hebasto hebasto 47 May  5 17:40 test/functional/test_runner.py -> ../../../bitcoin/test/functional/test_runner.py
  ```
  which works flawlessly.

  3. However, replacing this symbolic link with a hard link or a copy of `test/functional/test_runner.py` from the source tree will cause the following error:
  ```
  $ cp ../bitcoin/test/functional/test_runner.py test/functional/test_runner.py
  $ ls -l test/functional/test_runner.py
  $ ./test/functional/test_runner.py
  Temporary test directory at /tmp/test_runner_₿_🏃_20230505_175104
  Running Unit Tests for Test Framework Modules
  E
  ======================================================================
  ERROR: test_framework (unittest.loader._FailedTest)
  ----------------------------------------------------------------------
  ImportError: Failed to import test module: test_framework
  Traceback (most recent call last):
    File "/usr/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
      module = __import__(module_name)
  ModuleNotFoundError: No module named 'test_framework'

  ----------------------------------------------------------------------
  Ran 1 test in 0.000s

  FAILED (errors=1)
  Early exiting after failure in TestFramework unit tests
  ```

ACKs for top commit:
  stickies-v:
    re-ACK c44f3f2319
  MarcoFalke:
    lgtm ACK c44f3f231988dc05c4c7a8a96bc2e7b1a54da277 💸

Tree-SHA512: 622ff629080a55f76dd4c1dab6699de0e9f06b75da3315cd3b31b972ef4bde746458bf3e8a95e879b3c6a63be2368af70005a83f6a3c85c4f1ba5be51e91a61d
2024-10-25 09:12:00 -05:00
pasta
a67319351a
Merge #6346: backport: trivial 2024 10 23 pr2
8bf1d06599 Merge bitcoin/bitcoin#29308: doc: update `BroadcastTransaction` comment (glozow)
2a77808596 Merge bitcoin-core/gui#789: Avoid non-self-contained Windows header (Hennadii Stepanov)
da371b830d Merge bitcoin/bitcoin#28870: depends: Include `config.guess` and `config.sub` into `meta_depends` (fanquake)
2e41562d81 Merge bitcoin/bitcoin#29219: fuzz: Improve fuzzing stability for ellswift_roundtrip harness (fanquake)
b091329599 Merge bitcoin/bitcoin#29211: fuzz: fix `connman` initialization (Ava Chow)
df42d41060 Merge bitcoin/bitcoin#29200: net: create I2P sessions using both ECIES-X25519 and ElGamal encryption (fanquake)
4cdd1a8a5d Merge bitcoin/bitcoin#29172: fuzz: set `nMaxOutboundLimit` in connman target (fanquake)
97012ea522 Merge bitcoin/bitcoin#28962: doc: Rework guix docs after 1.4 release (fanquake)
c70ff5d702 Merge bitcoin/bitcoin#28844: contrib: drop GCC MAX_VERSION to 4.3.0 in symbol-check (fanquake)
e6f19e7760 Merge bitcoin/bitcoin#29068: test: Actually fail when a python unit test fails (fanquake)
75e0334866 Merge bitcoin/bitcoin#28989: test: Fix test by checking the actual exception instance (Andrew Chow)
8cd85d311f Merge bitcoin/bitcoin#28852: script, assumeutxo: Enhance validations in utxo_snapshot.sh (Ryan Ofsky)
fd2e88d6f3 Merge bitcoin/bitcoin#26077: guix: switch from `guix environment` to `guix shell` (fanquake)
02741a7706 Merge bitcoin/bitcoin#28913: coins: make sure PoolAllocator uses the correct alignment (fanquake)
dfd53dabed Merge bitcoin/bitcoin#28902: doc: Simplify guix install doc, after 1.4 release (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] 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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 8bf1d06599
  knst:
    utACK 8bf1d06599

Tree-SHA512: 506273e5a188f9ca74edf656e3cd338992192e6e97f68c89fc43e34be20fb7f211b48e4dfa8693727839a7920da8284509413c722f55774a428939c296dad517
2024-10-24 16:54:41 -05:00
pasta
ac3f0ec111
Merge #6348: backport: trivial 2024 10 23 pr4
9a79217756 Merge bitcoin/bitcoin#28227: test: check for specific bip157 disconnect reasons, add test coverage (fanquake)
a7a4603b8e Merge bitcoin-core/gui#755: Silence `-Wcast-function-type` warning (Hennadii Stepanov)
e216d0851d Merge bitcoin/bitcoin#27934: test: added coverage to estimatefee (fanquake)
34f0f56582 Merge bitcoin/bitcoin#28506: fuzz: Add missing PROVIDE_FUZZ_MAIN_FUNCTION guard to __AFL_FUZZ_INIT (fanquake)
ca0225c0fd Merge bitcoin/bitcoin#28480: fuzz: Don't use afl++ deferred forkserver mode (fanquake)
2b236ad07b Merge bitcoin/bitcoin#28460: fuzz: Use afl++ shared-memory fuzzing (fanquake)
52f036b316 Merge bitcoin/bitcoin#28427: index: coinstats reorg, fail when block cannot be reversed (fanquake)
6ad6f2f28d Merge bitcoin/bitcoin#28412: test: remove unused variables in `p2p_invalid_block` (fanquake)
43b88315e1 Merge bitcoin/bitcoin#28426: doc: s/--no-substitute/--no-substitutes in guix/INSTALL (fanquake)
1730a267ba Merge bitcoin/bitcoin#28386: test: remove fixed timeouts from feature_config_args (fanquake)
7f83db0d0c Merge bitcoin/bitcoin#28332: test: previous releases: speed up fetching sources with shallow clone (fanquake)
8490bf4b03 Merge bitcoin/bitcoin#28288: test: fix 'unknown named parameter' test in `wallet_basic` (fanquake)
8b8ff1c7d5 Merge bitcoin/bitcoin#28215: fuzz: fix a couple incorrect assertions in the `coins_view` target (fanquake)
c36f7d93fa Merge bitcoin/bitcoin#27401: tracepoints: Disables `-Wgnu-zero-variadic-macro-arguments` to compile without warnings (fanquake)
163020ef92 Merge bitcoin/bitcoin#28203: refactor: serialization simplifications (fanquake)
24e57da770 Merge bitcoin/bitcoin#28181: qa, doc: Fix comment (fanquake)
933a63e8fc Merge bitcoin/bitcoin#28145: valgrind: add suppression for bug 472219 (fanquake)
33766805eb Merge bitcoin/bitcoin#28124: fuzz: Re-enable symbolize=1 in ASAN_OPTIONS (fanquake)
621061459a Merge bitcoin/bitcoin#28099: contrib: move user32.dll from bitcoind.exe libs (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of trivial backports

  ## What was done?
  See commits

  ## How Has This Been Tested?
  built locally; large combined merge passed tests locally

  ## Breaking Changes
  Should be none

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] 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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK 9a79217756
  UdjinM6:
    utACK 9a79217756

Tree-SHA512: 12d18abf28e3140bbb488fe912cf8e5c18a38aebaf09caad3120dc556116f348c4bbb40131f72c89edfbf48eb980c6947dde155e58e47c783f1d5b125aa6524b
2024-10-24 15:00:31 -05:00
fanquake
24e57da770
Merge bitcoin/bitcoin#28181: qa, doc: Fix comment
ab498d913c6f9f6096c75cc43a91e7a12cfc3fb7 qa, doc: Fix comment (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up for:
  - https://github.com/bitcoin/bitcoin/pull/9956
  - https://github.com/bitcoin/bitcoin/pull/10096

ACKs for top commit:
  RandyMcMillan:
    ACK ab498d913c6f9f6096c75cc43a91e7a12cfc3fb7

Tree-SHA512: 267ae52c961ee79e172f27cb1587282ac5cf7ec929a136db6feed3de4f319a74b462befd9b99711081db8a5c30a513f72366364068700418b273a31958b31b1d
2024-10-24 11:18:38 -05:00
fanquake
6d7aa3d978
Merge bitcoin/bitcoin#29497: test: simplify test_runner.py
0831b54dfca1b9e728295fff500215da14589fc0 test: simplify test_runner.py (tdb3)

Pull request description:

  Implements the simplifications to test_runner.py proposed by sipa in PR #23995.

  Remove the num_running variable as it can be implied by the length of the jobs list.

  Remove the i variable as it can be implied by the length of the test_results list.

  Instead of counting results to determine if finished, make the queue object itself
  responsible (by looking at running jobs and jobs left).

ACKs for top commit:
  mzumsande:
    re-ACK 0831b54
  davidgumberg:
    reACK 0831b54dfc
  marcofleon:
    re-ACK 0831b54dfca1b9e728295fff500215da14589fc0

Tree-SHA512: e5473e68d49cd779b29d97635329283ae7195412cb1e92461675715ca7eedb6519a1a93ba28d40ca6f015d270f7bcd3e77cef279d9cd655155ab7805b49638f1
2024-10-24 11:16:21 -05:00
fanquake
4dce690a5e
Merge bitcoin/bitcoin#29576: Update functional test runner to return error code when no tests are found to run
33268a855883142a039a7a7b14eb1345e52809fd test: exit with code 1 when no fn tests are found (Max Edwards)

Pull request description:

  As discussed in the following PR comment: https://github.com/bitcoin/bitcoin/pull/29535#issuecomment-1979259786

  Prevents the test_runner from exiting silently with code 0 when no tests were found which has recently happened after a GHA runner update such as in this run: https://github.com/bitcoin/bitcoin/actions/runs/8131828989/job/22239779585#step:27:63

ACKs for top commit:
  TheCharlatan:
    ACK 33268a855883142a039a7a7b14eb1345e52809fd
  theStack:
    lgtm ACK 33268a855883142a039a7a7b14eb1345e52809fd

Tree-SHA512: d389e9f5e4da7ce1627fb2fad9b33baf0b04e75dbdbfc0dbf5f1e3e2b0ae1e79721476c5668476055b0f7de29723ed02c8d7e420081a555030cb784886e240fc
2024-10-24 11:16:20 -05:00
Kittywhiskers Van Gogh
4735b82979
merge bitcoin#29431: disconnection scenarios during v2 handshake 2024-10-24 14:32:05 +00:00
Kittywhiskers Van Gogh
5ee15faba0
merge bitcoin#29372: fix intermittent failure in rpc_setban.py --v2transport 2024-10-24 14:32:04 +00:00
Kittywhiskers Van Gogh
6b2a8b5988
merge bitcoin#24748: functional tests for v2 P2P encryption 2024-10-24 14:32:03 +00:00
fanquake
e6f19e7760
Merge bitcoin/bitcoin#29068: test: Actually fail when a python unit test fails
fa0534d7e47d44428d3f9dea6d2f6b8e86df22d4 test: Actually fail when a python unit test fails (MarcoFalke)

Pull request description:

  Currently python unit test failures are ignored.

  Fix this.

ACKs for top commit:
  theStack:
    ACK fa0534d7e47d44428d3f9dea6d2f6b8e86df22d4
  BrandonOdiwuor:
    ACK fa0534d7e47d44428d3f9dea6d2f6b8e86df22d4

Tree-SHA512: c136be4c8d861d966f380e04d5d14b711b90c4011101302dae1332496e493207c5c673927586ed35b02b61a0b050bf45053a31e6ff766ec52f1d054caf0985e2
2024-10-23 22:19:57 -05:00
pasta
0946eec692
Merge #6327: backport: merge bitcoin#23046, #24138, #24812, #24626, #21726, #25123, #25074, #24832, #26215, #24858, #26417, #16981 (index backports)
7d9ff96091 merge bitcoin#16981: Improve runtime performance of --reindex (Kittywhiskers Van Gogh)
e531dff5f7 merge bitcoin#26417: fix intermittent failure in feature_index_prune.py (Kittywhiskers Van Gogh)
b04b71a957 merge bitcoin#24858: incorrect blk file size calculation during reindex results in recoverable blk file corruption (Kittywhiskers Van Gogh)
9e75b99c53 merge bitcoin#26215: Improve BaseIndex::BlockUntilSyncedToCurrentChain reliability (Kittywhiskers Van Gogh)
3bd584c845 merge bitcoin#24832: Verify the block filter hash when reading the filter from disk (Kittywhiskers Van Gogh)
e507a51323 fix: avoid `mandatory-script-verify-flag-failed` crash in bench test (Kittywhiskers Van Gogh)
a86109a017 merge bitcoin#25074: During sync, commit best block after indexing (Kittywhiskers Van Gogh)
e6867a35ce merge bitcoin#25123: Fix race condition in index prune test (Kittywhiskers Van Gogh)
baf6e26eed merge bitcoin#21726: Improve Indices on pruned nodes via prune blockers (Kittywhiskers Van Gogh)
c65ec190c5 merge bitcoin#24626: disallow reindex-chainstate when pruning (Kittywhiskers Van Gogh)
bcd24a25e3 fix: push activation height for forks ahead, fix `feature_pruning.py` (Kittywhiskers Van Gogh)
10203560f5 merge bitcoin#24812: Add CHECK_NONFATAL identity function and NONFATAL_UNREACHABLE macro (Kittywhiskers Van Gogh)
1caaa85716 merge bitcoin#24138: Commit MuHash and best block together for coinstatsindex (Kittywhiskers Van Gogh)
b218f123b7 merge bitcoin#23046: Add txindex migration test (Kittywhiskers Van Gogh)
ebae59eedf fix: make sure we flush our committed best block in no-upgrade cases (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * When backporting [bitcoin#23046](https://github.com/bitcoin/bitcoin/pull/23046), it was discovered that there has been a longstanding bug in `CDeterministicMNManager::MigrateDBIfNeeded`(`2`)`()` that flagged a database taken from an older version for failing its "previous migration attempt", requiring the database to be fully rebuilt through a reindex.

    This occurred because the older database would be read pre-DIP3 in `MigrateDBIfNeeded()`, which then caused the migration logic to write the new best block ([source](3f0c2ff324/src/evo/deterministicmns.cpp (L1236-L1241))) (the legacy best block is erased before the DIP3 condition is checked, [source](3f0c2ff324/src/evo/deterministicmns.cpp (L1233))) but while it completed the transaction ([source](3f0c2ff324/src/evo/deterministicmns.cpp (L1240))), critically, it didn't write it to disk (example of writing to disk, [here](3f0c2ff324/src/evo/deterministicmns.cpp (L1288-L1292))).

    This meant that when it was read again by `MigrateDBIfNeeded2()`, it saw three things a) there is no new best block (because it didn't get written), b) there is no legacy best block (because it gets erased before the new best block is written) and c) that the chain height is greater than 1 (since this isn't a new datadir and the chain has already advanced), it concludes that it was a botched migration attempt and fails ([source](3f0c2ff324/src/evo/deterministicmns.cpp (L1337-L1343))).

    This bug affects v19 to `develop` (`3f0c2ff3` as of this writing) and prevents `feature_txindex_compatibility.py` from working as expected as it would migrate legacy databases to newer versions to test txindex migration code and get stuck at unhappy EvoDB migration logic, to allow the test to function properly when testing against the latest version of the client, this bug has been fixed as part of this PR.

  * In [bitcoin#23046](https://github.com/bitcoin/bitcoin/pull/23046), version v0.17 was used as the last version to support legacy txindex as the updated txindex format was introduced in [dash#4178](https://github.com/dashpay/dash/pull/4178) (i.e. after v0.17) and the version selected for having migration code in it (note, migration code was removed in [dash#6296](https://github.com/dashpay/dash/pull/6296), so far not included as part of any release) was v18.2.2 despite the range being v18.x to v21.x was a) due to the bug mentioned above affecting v19.x onwards and b) v18.2.2 being the latest release in the v18.x lifecycle.

    * The specific version number used for v0.17 is `170003` as the binaries corresponding to `170000` are not populated in `releases/`, which causes a CI failure ([source](https://gitlab.com/dashpay/dash/-/jobs/8073041955#L380))

  * As of `develop` (`3f0c2ff3` as of this writing), `feature_pruning.py` was broken due to changes in Core that were not adjusted for, namely:
    * The enforcement of `MAX_STANDARD_TX_SIZE` ([source](3f0c2ff324/src/policy/policy.h (L23-L24))) from DIP1 onwards ([source](3f0c2ff324/src/validation.cpp (L299-L301)))  resulting in `bad-txns-oversize` errors in blocks generated for the test as the transactions generated are ~9.5x larger than the now-enforced limit ([source](3f0c2ff324/test/functional/feature_pruning.py (L48C51-L48C57))), this is resolved by pushing the DIP1 activation height upwards to `2000` (the same activation height used for DIP3 and DIP8).
    * Change in subsidy logic in v20 ([source](3f0c2ff324/src/validation.cpp (L1073-L1082))) that results in `bad-cb-amount` errors, this is resolved by pushing the v20 activation height upwards.

    Additionally, an inopportune implicit post-`generate` sync ([source](3f0c2ff324/test/functional/feature_pruning.py (L215))) also causes the test to fail. Alongside the above, they have been resolved in this PR.

  * As of `develop` (`3f0c2ff3` as of this writing), `bench_dash` crashes when running the `AssembleBlock` benchmark. The regression was traced back to [bitcoin#21840](https://github.com/bitcoin/bitcoin/pull/21840) (5d10b41) in [dash#6152](https://github.com/dashpay/dash/pull/6152) due to the switch to `P2SH_OP_TRUE`.

    This has been resolved by reverting this particular change.

    <details>

    <summary>Pre-fix test failure:</summary>

    ```
    $ ./src/bench/bench_dash
    Warning, results might be unstable:
    * CPU governor is '' but should be 'performance'
    * Turbo is enabled, CPU frequency will fluctuate

    Recommendations
    * Use 'pyperf system tune' before benchmarking. See https://github.com/psf/pyperf

    |               ns/op |                op/s |    err% |          ins/op |         bra/op |   miss% |     total | benchmark
    |--------------------:|--------------------:|--------:|----------------:|---------------:|--------:|----------:|:----------
    |       17,647,657.00 |               56.66 |    0.1% |  231,718,349.00 |  42,246,265.00 |    0.1% |      0.20 | `AddrManAdd`
    |       42,201,861.00 |               23.70 |    0.1% |  544,366,811.00 | 102,569,244.00 |    0.0% |      0.46 | `AddrManAddThenGood`
    |          189,697.83 |            5,271.54 |    0.1% |    1,763,991.40 |     356,189.40 |    0.3% |      0.01 | `AddrManGetAddr`
    |              454.38 |        2,200,808.04 |    0.6% |        6,229.11 |       1,343.92 |    0.1% |      0.01 | `AddrManSelect`
    |        1,066,471.00 |              937.67 |   67.6% |   13,350,463.00 |   3,150,465.00 |    0.4% |      0.01 | 〰️ `AddrManSelectByNetwork` (Unstable with ~1.0 iters. Increase `minEpochIterations` to e.g. 10)
    |        1,181,774.50 |              846.19 |   49.0% |   18,358,489.50 |   4,224,642.50 |    0.0% |      0.02 | 〰️ `AddrManSelectFromAlmostEmpty` (Unstable with ~1.1 iters. Increase `minEpochIterations` to e.g. 11)
    bench_dash: bench/block_assemble.cpp:46: void AssembleBlock(benchmark::Bench &): Assertion `res.m_result_type == MempoolAcceptResult::ResultType::VALID' failed.
    [1]    2343746 IOT instruction (core dumped)  ./src/bench/bench_dash
    ```
    </details>

  ## Breaking changes

  None expected

  ## Checklist

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

ACKs for top commit:
  UdjinM6:
    utACK 7d9ff96091
  PastaPastaPasta:
    utACK 7d9ff96091

Tree-SHA512: e2f1e58abb0a0368c4f1d5e488520957e042e6207b7d2d68a15eb18662405a3cdac91c5ff8e93c8a94c0fdab9b1412bd608d055f196230506c1640439939c25d
2024-10-21 11:32:29 -05:00
Kittywhiskers Van Gogh
4e96e261e0
merge bitcoin#28805: Make existing functional tests compatible with --v2transport
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2024-10-15 15:34:12 +00:00
Kittywhiskers Van Gogh
ff92d1adae
partial bitcoin#28331: BIP324 integration
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

excludes:
- changes to `src/rpc/util.cpp`
2024-10-15 15:34:11 +00:00
Kittywhiskers Van Gogh
baf6e26eed
merge bitcoin#21726: Improve Indices on pruned nodes via prune blockers 2024-10-15 06:58:51 +00:00
Kittywhiskers Van Gogh
b218f123b7
merge bitcoin#23046: Add txindex migration test 2024-10-15 06:58:49 +00:00
Konstantin Akimov
0e55abd0f2
feat: remove feature_dip0020_activationl.py functional test and related code 2024-10-08 15:20:40 +07:00
Kittywhiskers Van Gogh
2e22fd0ba9
merge bitcoin#23289: add stress tests for initialization 2024-10-05 17:09:33 +00:00
Kittywhiskers Van Gogh
ac94de23ae
merge bitcoin#28287: add sendmsgtopeer rpc and a test for net-level deadlock situation
`random_bytes()` is introduced in bitcoin#25625 but the function def
alone doesn't warrant a full backport, so we'll only implement the
section relevant to this PR.
2024-10-02 08:31:49 +00:00
Kittywhiskers Van Gogh
473ee8ef18
merge bitcoin#24195: Fix failfast option for functional test runner 2024-09-30 09:03:28 +00:00
Kittywhiskers Van Gogh
64dd46764c
merge bitcoin#23799: Let test_runner.py start multiple jobs per timeslot 2024-09-30 09:03:28 +00:00
pasta
bd27f65601
Merge #6284: backport: bitcoin#21713, #21856, #22061, #22122, #22172, #22261, #22381, #22445, #22447
8f06ac9dfa Merge bitcoin/bitcoin#22172: doc: update tor.md, release notes with removal of tor v2 support (W. J. van der Laan)
9b22501a4d Merge bitcoin/bitcoin#22122: ci: Bump macOS image to big-sur-xcode-12.5 (MarcoFalke)
3b05a99b50 Merge bitcoin/bitcoin#22106: refactor: address ProcessNewBlock comments from #21713 (fanquake)
c8725560c9 Merge bitcoin/bitcoin#21856: doc: add OSS-Fuzz section to fuzzing.md doc (MarcoFalke)
facf685285 Merge bitcoin/bitcoin#22261: [p2p/mempool] Two small fixes to node broadcast logic (fanquake)
1430897fc4 Merge bitcoin/bitcoin#22445: fuzz: Move implementations of non-template fuzz helpers from util.h to util.cpp (MarcoFalke)
f0c62d50a5 Merge bitcoin/bitcoin#22447: test: whitelist rpc_rawtransaction peers to speed up tests (fanquake)
b609514142 Merge #22381: guix: Test security-check sanity before performing them (Carl Dong)
9ef68d1905 Merge bitcoin/bitcoin#22061: ci: Bump multiprocess memory (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Regular backports from bitcoin v22

  ## What was done?
  See commits

  ## How Has This Been Tested?
  Run unit and functional tests

  ## Breaking Changes
  N/A

  ## 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

ACKs for top commit:
  UdjinM6:
    utACK 8f06ac9dfa
  PastaPastaPasta:
    utACK 8f06ac9dfa

Tree-SHA512: f800b7ca8d357f2d02ce5cb1fc4951c2765242676c5494efd5e22e8f6d41d889e1fa2f888930f72aded75813413c6488d8a7d96baa2cf4820e3461464708658e
2024-09-27 10:47:26 -05:00
Konstantin Akimov
e2c66ae3e9
chore: deprecate a setting platform-user in favour of whitelist 2024-09-26 14:01:44 +07:00
pasta
61201b80da
Merge #6278: perf: reduced delays and syncs in functional tests to run faster
874ef8cda2 fix: mine_quorum_no_checks -> mine_quorum_less_checks: do some checks to make sure quorums are mined correctly (UdjinM6)
4f636f47b4 fix: re-order functional tests: move governance to 60+seconds category (Konstantin Akimov)
fe49f3f178 refactor: removed dead and commented code from test_framework.py (Konstantin Akimov)
cd1958c82a perf: removed sleep(6) from mine_cycle_quorum in functional tests (Konstantin Akimov)
3f17a01a83 fix: bump mocktime in simplepose when generating blocks to improve robustness (Konstantin Akimov)
132d95e651 perf: remove sleep(1) from each step of quorum creation in functional tests (Konstantin Akimov)
4c57ad1c05 chore: increase batch size from 10 to 50 for faster block generation in functional tests (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Functional tests take too long time to run.

  (PR is recreated from https://github.com/dashpay/dash/pull/6268 because CI is broken)

  ## What was done?
   - increased robustness `feature_llmq_simplepose.py` by adding missing bump for mocktime during block generations
   - removed sleep(1) from each stage of mine_quorum
   - removed sleep(6) from final stage of mine_cycled_quorum
   - size of batch for block generation in `feature_asset_locks.py` and in `activate_fork_by_name()` increased from 10 blocks to 50 blocks
   - moved governance's functional tests to "60 seconds+" category because they always the last one to wait if running more than 10 jobs at once
  Plus extra refactoring which removes dead and commented code from test_framework.py

  ## How Has This Been Tested?
  Locally, the functional tests speed up with these fixes for 15% for overall time and 20% for accumulated time
  `test/functional/test_runner.py -j20`

  Before:
  ```
  ALL                                                | ✓ Passed  | 7860 s (accumulated)
  Runtime: 481 s
  ```

  After:
  ```
  ALL                                                | ✓ Passed | 6237 s (accumulated)
  Runtime: 416 s
  ```

  ---
  CI tsan job speeds up for 5 minutes in absolute time (~5%) and 1000 seconds in accumulated time.
  ```
  ALL                                                | ✓ Passed  | 23854 s (accumulated)
  Runtime: 6249 s
  ```
  ↑ [old version](https://gitlab.com/dashpay/dash/-/jobs/7822664869) vs [new version](https://gitlab.com/dashpay/dash/-/jobs/7825461091) ↓
  ```
  ALL                                                | ✓ Passed  | 22901 s (accumulated)
  Runtime: 5962 s
  ```

  ## Breaking Changes
  N/A

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

ACKs for top commit:
  UdjinM6:
    utACK 874ef8cda2
  PastaPastaPasta:
    utACK 874ef8cda2

Tree-SHA512: 514fa2fb32abd59c90f63b68fccc8c3d3b6d16b0b6ad7459c4a348825815e7d3012177565dea1f70b8a1f28ede1a297f91361365454d1be85955e77260451cf5
2024-09-25 09:34:12 -05:00
fanquake
f0c62d50a5
Merge bitcoin/bitcoin#22447: test: whitelist rpc_rawtransaction peers to speed up tests
a3d6ec5bb567481a634638cea7ae37c355119a7b test: move rpc_rawtransaction tests to < 30s group (Jon Atack)
5a1ed96077852c739034c21d399da65db09e7714 test: whitelist rpc_rawtransaction peers to speed up tests (Jon Atack)

Pull request description:

  Speed up the somewhat slow `rpc_rawtransaction.py` test by more than 3x (from 45-55 seconds to 15 seconds on a laptop running 2 x 2.5GHz).

ACKs for top commit:
  mjdietzx:
    ACK a3d6ec5bb567481a634638cea7ae37c355119a7b
  kristapsk:
    ACK a3d6ec5bb567481a634638cea7ae37c355119a7b
  theStack:
    ACK a3d6ec5bb567481a634638cea7ae37c355119a7b 🐎
  brunoerg:
    tACK a3d6ec5bb567481a634638cea7ae37c355119a7b

Tree-SHA512: f1d105594c9b5b257a7096b631a6fa5aeb50e330a351f75c2d6ffa7dd73abdb6e1f596a78c16d204a9bac3fe506e0519f9ad96bb8477ab6424c8e18125ccb659
2024-09-25 20:58:25 +07:00
Konstantin Akimov
4f636f47b4
fix: re-order functional tests: move governance to 60+seconds category 2024-09-24 01:24:50 +07:00
Kittywhiskers Van Gogh
a36f8f2a1a
merge bitcoin#25880: Make stalling timeout adaptive during IBD
We need to disable mocktime so that the node doesn't resort to direct
fetching. We also need to delay DIP3's activation so that blocks don't
get rejected for not having a valid DIP3-compliant coinbase.
2024-09-20 12:24:22 +00:00
Kittywhiskers Van Gogh
f3b219ad0d
merge bitcoin#24358: USDT tracepoint interface tests 2024-09-04 18:46:14 +00:00
Kittywhiskers Van Gogh
87205f26b5
merge bitcoin#21327: ignore transactions while in IBD
`p2p_ibd_txrelay.py` was introduced in bitcoin#19423 but not backported
as Dash doesn't have feefilter capabilities but this backport has the
test check for additional cases which are within Dash's capabilities, so
the test has been committed in with the feefilter portions minimally
stripped out
2024-09-04 16:29:28 +00:00
fanquake
1a8268770c
Merge bitcoin/bitcoin#21800: mempool/validation: mempool ancestor/descendant limits for packages
accf3d5868460b4b14ab607fd66ac985b086fbb3 [test] mempool package ancestor/descendant limits (glozow)
2b6b26e57c24d2f0abd442c1c33098e3121572ce [test] parameterizable fee for make_chain and create_child_with_parents (glozow)
313c09f7b7beddfdb74c284720d209c81dfdb94f [test] helper function to increase transaction weight (glozow)
f8253d69d6f02850995a11eeb71fedc22e6f6575 extract/rename helper functions from rpc_packages.py (glozow)
3cd663a5d33aa7ef87994e452bced7f192d021a0 [policy] ancestor/descendant limits for packages (glozow)
c6e016aa139c8363e9b38bbc1ba0dca55700b8a7 [mempool] check ancestor/descendant limits for packages (glozow)
f551841d3ec080a2d7a7988c7b35088dff6c5830 [refactor] pass size/count instead of entry to CalculateAncestorsAndCheckLimits (glozow)
97dd1c729d2bbedf9527b914c0cc8267b8a7c21b MOVEONLY: add helper function for calculating ancestors and checking limits (glozow)
f95bbf58aaf72aab8a9c5827b1f162f3b8ac38f4 misc package validation doc improvements (glozow)

Pull request description:

  This PR implements a function to calculate mempool ancestors for a package and enforces ancestor/descendant limits on them as a whole. It reuses a portion of `CalculateMemPoolAncestors()`; there's also a small refactor to move the reused code into a generic helper function. Instead of calculating ancestors and descendants on every single transaction in the package and their ancestors, we use a "worst case" heuristic, treating every transaction in the package as each other's ancestor and descendant. This may overestimate everyone's counts, but is still pretty accurate in the our main package use cases, in which at least one of the transactions in the package is directly related to all the others (e.g. 1 parent + 1 child, multiple parents with 1 child, or chains).

  Note on Terminology: While "package" is often used to describe groups of related transactions _within_ the mempool, here, I only use package to mean the group of not-in-mempool transactions we are currently validating.

  #### Motivation

  It would be a potential DoS vector to allow submission of packages to mempool without a proper guard for mempool ancestors/descendants. In general, the purpose of mempool ancestor/descendant limits is to limit the computational complexity of dealing with families during removals and additions. We want to be able to validate multiple transactions on top of the mempool, but also avoid these scenarios:

  - We underestimate the ancestors/descendants during package validation and end up with extremely complex families in our mempool (potentially a DoS vector).
  - We expend an unreasonable amount of resources calculating everyone's ancestors and descendants during package validation.

ACKs for top commit:
  JeremyRubin:
    utACK accf3d5
  ariard:
    ACK accf3d5.

Tree-SHA512: 0d18ce4b77398fe872e0b7c2cc66d3aac2135e561b64029584339e1f4de2a6a16ebab3dd5784f376e119cbafc4d50168b28d3bd95d0b3d01158714ade2e3624d
Signed-off-by: Vijay <vijaydas.mp@gmail.com>
2024-08-29 10:01:28 +05:30
UdjinM6
1f4e1a17ed
test: add test for governance inv expiration 2024-08-22 22:03:48 +03:00
fanquake
93e7c38788
Merge bitcoin/bitcoin#24338: util: Work around libstdc++ create_directories issue
b223c3c21e89f6af76b5401413880923f7c444d6 test: Add functional test for symlinked blocks directory (laanwj)
ddb75c2e87a60ed24065bdf0c3bfabf4e058cef1 test: Add fs_tests/create_directories unit test (Hennadii Stepanov)
1f46b6e46e1454b91ff7ceb31853bc440952f8eb util: Work around libstdc++ create_directories issue (laanwj)

Pull request description:

  Work around libstdc++ issue [PR101510] with create_directories where the leaf already exists as a symlink. Fixes #24257, introduced by the switch to `std::filesystem`. It is meant to be more thorough than #24266, which worked around one instance of the problem.

  The issue was [fixed upstream](https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=124eaa50e0a34f5f89572c1aa812c50979da58fc), but unfortunately we'll have to carry a fix for it for a while.

  This introduces a function `fs::create_directories` which wraps
  `std::filesystem::create_directories`. This allows easiliy reverting the
  workaround when it is no longer necessary.

ACKs for top commit:
  jonatack:
    re-ACK b223c3c21e89f6af76b5401413880923f7c444d6 per `git range-diff df08250 67019cd b223c3c`
  hebasto:
    re-ACK b223c3c21e89f6af76b5401413880923f7c444d6
  w0xlt:
    re-ACK b223c3c
  vasild:
    ACK b223c3c21e89f6af76b5401413880923f7c444d6

Tree-SHA512: 028321717c8b10d16185c3711b35da6b05fb7aa31cee1c8c7e754e92bf5a0b02719a3785cd0f6f8bf052b3bd759f644af212320672baabc9e44e0b93ba464abc
2024-08-14 12:47:45 +07:00
Kittywhiskers Van Gogh
c92b0f57da
merge bitcoin#25720: Reduce bandwidth during initial headers sync when a block is found 2024-08-09 17:34:41 +07:00
Kittywhiskers Van Gogh
ed871d2a07
merge bitcoin#24171: Sync chain more readily from inbound peers during IBD 2024-08-09 17:34:39 +07:00
Konstantin Akimov
c72ec70fdf
feat: implement governance RPCs votealias and votemany for descriptor wallets 2024-07-05 15:37:29 +07:00
Kittywhiskers Van Gogh
c294457b52
merge bitcoin#20295: getblockfrompeer 2024-06-27 19:28:32 +00:00
Kittywhiskers Van Gogh
169dce7e50
merge bitcoin#20286: deprecate addresses and reqSigs from rpc outputs 2024-06-27 19:27:37 +00:00
pasta
4a520991db
Merge #6066: feat: support descriptor wallets for RPC protx updateregistar
c9a600e0fa fix: linkage error - message signer better to be common code rather than libconsensus (Konstantin Akimov)
8299b3b369 feat: protxregistar implementation for descriptor wallets (Konstantin Akimov)
6f45432f76 refactor: removed unused SignSpecialTxPayloadByString (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  RPC `protx updateregistar` uses forcely LegacyScriptPubKeyMan instead using CWallet's interface.
  It causes a failures such as
  ```
  test_framework.authproxy.JSONRPCException: This type of wallet does not support this command (-4)
  ```

  ## What was done?
  New method `SignSpecialTxPayloadByHash` is implemented in interface instead exporting raw private key for some address.

  See https://github.com/dashpay/dash-issues/issues/59 to track progress

  ## How Has This Been Tested?
  Functional test `feature_dip3_deterministicmns.py` to run by both ways - legacy and descriptor wallets.

  Run unit and functional tests.

  Extra test done locally:
  ```diff
  --- a/test/functional/test_framework/test_framework.py
  +++ b/test/functional/test_framework/test_framework.py
  @@ -242,10 +242,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):

           if self.options.descriptors is None:
               # Prefer BDB unless it isn't available
  -            if self.is_bdb_compiled():
  -                self.options.descriptors = False
  -            elif self.is_sqlite_compiled():
  +            if self.is_sqlite_compiled():
                   self.options.descriptors = True
  +            elif self.is_bdb_compiled():
  +                self.options.descriptors = False
  ```

  to flip flag descriptor wallets/legacy wallets for all functional tests.

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] 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

ACKs for top commit:
  PastaPastaPasta:
    utACK c9a600e0fa

Tree-SHA512: 00aea1cd9db3537b9a9dcdee096d47ea48337edeea3f52ad54aea91781678b8641ac2dd86b67f61f87e3912945bcb5361a42a3279b6c08bb8d9f096bed8fe842
2024-06-25 09:46:52 -05:00
pasta
7ca4812b18
Merge #6036: feat: skip governance checks for blocks below the best chainlock
18328279ec fix: force mnsync to skip gov obj sync on reconnection (UdjinM6)
08331bb950 fix: apply suggestions (UdjinM6)
3c3489d7a1 test: add test (UdjinM6)
41ab95dbf8 feat: skip governance checks for blocks below the best chainlock (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  A node can miss governance trigger sometimes and then it would stuck not being able to sync any further. This issue can be fixed manually by resetting sync status and reconsidering the "invalid" block. However, that's inconvenient. Also, what it does under the hood is it simply disables some parts of block validation. We could do that automagically and more precise if we would trust ChainLocks instead.

  ## What was done?
  Skip governance checks for blocks below the best known chainlock, add tests.

  ## How Has This Been Tested?
  Run tests.

  ## Breaking Changes
  n/a

  ## 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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK 18328279ec
  PastaPastaPasta:
    utACK 18328279ec

Tree-SHA512: 3cc4e2707e24b36c9f64502561667d0cb66eced7019db7941781ab1b84cfd267b3dab4684c71b059e074450ea76dc8e342744bffdd1ca1be6ccceb34b3580659
2024-06-24 11:52:39 -05:00
Konstantin Akimov
8299b3b369
feat: protxregistar implementation for descriptor wallets 2024-06-18 01:13:59 +07:00
Kittywhiskers Van Gogh
a6aa3735be
merge bitcoin#20196: fix GetListenPort() to derive the proper port
continuation of 24205d94fe from dash#5982

includes:
- 0cfc0cd32239d3c08d2121e028b297022450b320
- 7d64ea4a01920bb55bc6de0de6766712ec792a11
2024-06-12 16:37:12 +00:00
pasta
2f93ee4a53
Merge #6048: backport: merge bitcoin#19776, #20599, #22147, #22340, #20799, #25147, #20764, bitcoin-core/gui#206 (BIP152 backports)
1cbf3b9a53 merge bitcoin-core/gui#206: Display fRelayTxes and bip152_highbandwidth_{to, from} in peer details (Kittywhiskers Van Gogh)
239062192e merge bitcoin#20764: cli -netinfo peer connections dashboard updates (Kittywhiskers Van Gogh)
06a6f8444c merge bitcoin#25147: follow ups to #20799 (removing support for v1 compact blocks) (Kittywhiskers Van Gogh)
6274a571b7 merge bitcoin#20799: Only support version 2 compact blocks (Kittywhiskers Van Gogh)
f4ce573538 merge bitcoin#22340: Use legacy relaying to download blocks in blocks-only mode (Kittywhiskers Van Gogh)
73b8f84fdb merge bitcoin#22147: p2p: Protect last outbound HB compact block peer (Kittywhiskers Van Gogh)
2ce481849a merge bitcoin#20599: Tolerate sendheaders and sendcmpct messages before verack (Kittywhiskers Van Gogh)
799214b2c8 merge bitcoin#19776: expose high bandwidth mode state via getpeerinfo (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Version 2 of BIP152 high-bandwidth mode/compact blocks implements SegWit support.

    As Dash does not implement SegWit, there has never been a need to implement v2 (and therefore, have all the code necessary to support both v1 and v2, that gets removed as part of making support v2 only).

    * Despite that, the changes surrounding removing support for both versions (that in our case, do not apply as we never have supported v2) refactor the code in other ways and influence their behaviour. In the interest of upstream alignment, those changes have been backported.

  * [bitcoin#19776](https://github.com/bitcoin/bitcoin/pull/19776) doesn't seem to work on its own without successive backports, specifically [bitcoin#20799](https://github.com/bitcoin/bitcoin/pull/20799), despite the latter being a later backport.

    <details>

    <summary>19776-only p2p_compactblocks.py run (9f2c868947cc254d021e1a9bd00eb7bc80061e81)</summary>

    ```
    dash@825a14c32b73:/src/dash$ ./test/functional/p2p_compactblocks.py
    2024-06-09T12:29:09.777000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_kb2nr5oe
    2024-06-09T12:29:16.341000Z TestFramework (INFO): Testing SENDCMPCT p2p message...
    2024-06-09T12:29:31.432000Z TestFramework (INFO): Testing compactblock construction...
    2024-06-09T12:29:40.068000Z TestFramework (INFO): Testing compactblock requests...
    2024-06-09T12:29:44.597000Z TestFramework (INFO): Testing getblocktxn handler...
    2024-06-09T12:29:59.808000Z TestFramework (INFO): Testing compactblock requests/announcements not at chain tip...
    2024-06-09T12:30:03.855000Z TestFramework (INFO): Testing handling of incorrect blocktxn responses...
    2024-06-09T12:30:05.868000Z TestFramework (INFO): Testing reconstructing compact blocks from all peers...
    2024-06-09T12:30:09.389000Z TestFramework (INFO): Testing end-to-end block relay...
    2024-06-09T12:30:10.404000Z TestFramework (INFO): Testing handling of invalid compact blocks...
    2024-06-09T12:30:12.418000Z TestFramework (INFO): Testing invalid index in cmpctblock message...
    2024-06-09T12:30:14.384000Z TestFramework (INFO): Testing high-bandwidth mode states via getpeerinfo...
    2024-06-09T12:30:16.893000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/src/dash/test/functional/test_framework/test_framework.py", line 158, in main
        self.run_test()
      File "./test/functional/p2p_compactblocks.py", line 849, in run_test
        self.test_highbandwidth_mode_states_via_getpeerinfo()
      File "./test/functional/p2p_compactblocks.py", line 791, in test_highbandwidth_mode_states_via_getpeerinfo
        hb_test_node.send_and_ping(msg_block(block))
      File "/src/dash/test/functional/test_framework/p2p.py", line 579, in send_and_ping
        self.sync_with_ping(timeout=timeout)
      File "/src/dash/test/functional/test_framework/p2p.py", line 596, in sync_with_ping
        self.wait_until(test_function, timeout=timeout)
      File "/src/dash/test/functional/test_framework/p2p.py", line 487, in wait_until
        wait_until_helper(test_function, timeout=timeout, lock=p2p_lock, timeout_factor=self.timeout_factor)
      File "/src/dash/test/functional/test_framework/util.py", line 249, in wait_until_helper
        if predicate():
      File "/src/dash/test/functional/test_framework/p2p.py", line 484, in test_function
        assert self.is_connected
    AssertionError
    2024-06-09T12:30:17.396000Z TestFramework (INFO): Stopping nodes
    2024-06-09T12:30:18.400000Z TestFramework (WARNING): Not cleaning up dir /tmp/dash_func_test_kb2nr5oe
    2024-06-09T12:30:18.401000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/dash_func_test_kb2nr5oe/test_framework.log
    2024-06-09T12:30:18.401000Z TestFramework (ERROR):
    2024-06-09T12:30:18.401000Z TestFramework (ERROR): Hint: Call /src/dash/test/functional/combine_logs.py '/tmp/dash_func_test_kb2nr5oe' to consolidate all logs
    2024-06-09T12:30:18.401000Z TestFramework (ERROR):
    2024-06-09T12:30:18.401000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2024-06-09T12:30:18.402000Z TestFramework (ERROR): https://github.com/dashpay/dash/issues
    2024-06-09T12:30:18.402000Z TestFramework (ERROR):
    ```

    </details>

    <details>

    <summary>20799-incl p2p_compactblocks.py run (aa116c4f0b4753b615f9483aa03adec5ee4fd655)</summary>

    ```
    dash@825a14c32b73:/src/dash$ ./test/functional/p2p_compactblocks.py
    2024-06-09T12:34:27.169000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_7d65lmhz
    2024-06-09T12:34:32.695000Z TestFramework (INFO): Testing SENDCMPCT p2p message...
    2024-06-09T12:34:51.288000Z TestFramework (INFO): Testing compactblock construction...
    2024-06-09T12:34:55.325000Z TestFramework (INFO): Testing compactblock requests...
    2024-06-09T12:34:59.861000Z TestFramework (INFO): Testing getblocktxn handler...
    2024-06-09T12:35:07.460000Z TestFramework (INFO): Testing compactblock requests/announcements not at chain tip...
    2024-06-09T12:35:09.503000Z TestFramework (INFO): Testing handling of incorrect blocktxn responses...
    2024-06-09T12:35:11.519000Z TestFramework (INFO): Testing reconstructing compact blocks from all peers...
    2024-06-09T12:35:15.039000Z TestFramework (INFO): Testing end-to-end block relay...
    2024-06-09T12:35:16.055000Z TestFramework (INFO): Testing handling of invalid compact blocks...
    2024-06-09T12:35:17.062000Z TestFramework (INFO): Testing invalid index in cmpctblock message...
    2024-06-09T12:35:19.139000Z TestFramework (INFO): Testing high-bandwidth mode states via getpeerinfo...
    2024-06-09T12:35:22.159000Z TestFramework (INFO): Stopping nodes
    2024-06-09T12:35:23.163000Z TestFramework (INFO): Cleaning up /tmp/dash_func_test_7d65lmhz on exit
    2024-06-09T12:35:23.163000Z TestFramework (INFO): Tests successful
    ```
    </details>

  * The backport of [bitcoin-core/gui#206](https://github.com/bitcoin-core/gui/pull/206) is a continuation of 3e8ba24c87 from [dash#5964](https://github.com/dashpay/dash/pull/5964)

  * The backport of [bitcoin#20764](https://github.com/bitcoin/bitcoin/pull/20764) is a continuation of bd934c71eb from [dash#6034](https://github.com/dashpay/dash/pull/6034)

  ## Breaking changes

  * The `getpeerinfo` RPC returns two new boolean fields, `bip152_hb_to` and `bip152_hb_from`, that respectively indicate whether we selected a peer to be in compact blocks high-bandwidth mode or whether a peer selected us as a compact blocks high-bandwidth peer.

    High-bandwidth peers send new block announcements via a `cmpctblock` message rather than the usual inv/headers announcements. See BIP 152 for more details.

  * Blocks-only mode will use legacy relaying instead of BIP152 high-bandwidth mode

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] 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)_

ACKs for top commit:
  UdjinM6:
    utACK 1cbf3b9a53
  PastaPastaPasta:
    utACK 1cbf3b9a53
  knst:
    utACK 1cbf3b9a53

Tree-SHA512: 5947b622d8d57a1dc9445cd6e07d4ad690379416d0fcf04ed574269975d1beb704691a79ff081341f3c800cf11869d401f1ed90baa5449f371f9ce658f2d2e95
2024-06-11 08:42:46 -05:00
pasta
74fcd026db
Merge #6043: backport: merge bitcoin#22879, #22762, #23041, #22734, #22950, #23053, #22839, #23140, #23306, #23354, #23380 (addrman backports: part 2)
a93fec6f2d merge bitcoin#23380: Fix AddrMan::Add() return semantics and logging (Kittywhiskers Van Gogh)
d1a4b14b48 merge bitcoin#23354: Introduce new V4 format addrman (Kittywhiskers Van Gogh)
7a97aabfe0 test: restore pre-bitcoin#23306 tests to validate port distinguishment (Kittywhiskers Van Gogh)
1a050d6cb4 merge bitcoin#23306: Make AddrMan support multiple ports per IP (Kittywhiskers Van Gogh)
d56702aa0c merge bitcoin#23140: Make CAddrman::Select_ select buckets, not positions, first (Kittywhiskers Van Gogh)
19b0145379 merge bitcoin#22839: improve addrman logging (Kittywhiskers Van Gogh)
3910c68028 merge bitcoin#23053: Use public methods in addrman fuzz tests (Kittywhiskers Van Gogh)
b6ec8ab6df merge bitcoin#22950: Pimpl AddrMan to abstract implementation details (Kittywhiskers Van Gogh)
236cf36d88 merge bitcoin#22734: Avoid crash on corrupt data, Force Check after deserialize (Kittywhiskers Van Gogh)
2420ac9e53 merge bitcoin#23041: Add addrman deserialization error tests (Kittywhiskers Van Gogh)
8aefa9b93a merge bitcoin#22762: Raise InitError when peers.dat is invalid or corrupted (Kittywhiskers Van Gogh)
c9a645f814 merge bitcoin#22879: Fix format string in deserialize error (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependent on https://github.com/dashpay/dash/pull/6040.
  * Dash already introduced support for storage of address-port pairs (referred to as "port discrimination") and allowed the usage of non-default ports in P2P with [dash#2168](https://github.com/dashpay/dash/pull/2168).
    * Albeit this was only permitted for networks with `fAllowMultiplePorts` enabled (which at the time was `devnet` and as it stands currently, on every network except `mainnet`).
  * Keeping in line with the above policy (discussion on lifting such restrictions on `mainnet` is outside the scope of this PR), when backporting [bitcoin#23306](https://github.com/bitcoin/bitcoin/pull/23306), changes have been made to retain the effects of `discriminate_ports`.
    * This involves appending placing a `!m_discriminate_ports` condition to behaviour that otherwise would be _removed_ entirely.
    * Additionally, in line with upstream backports, changes have been made that render port distinguishment _enabled_ as the new default in `addrman_tests` (the old default was to keep it _disabled_, to mirror `mainnet` and pre-change upstream behaviour).
      * To ensure distinguishment _disabled_ works as expected, affected pre-backport tests were reintroduced with the `_nondiscriminate` suffix.

  ---

  I would propose at some point to rename the flag to `ignore_port`/`suppress_port` (if not remove it altogether should the `mainnet` restriction be lifted) as discriminate (or distinguish) isn't immediately clear with if address entries will be discriminated/distinguished _using_ ports (i.e. considered) or ports will be discriminated _against_ (i.e. ignored).

  ## Breaking Changes

  It's unclear if these backports result in serialization issues for older versions, as Dash Core technically supported address-port pairs since 0.12 and suppressed it on `mainnet` by setting zero-ing out the port ([source](19512988c6/src/addrman.cpp (L135-L138))), meaning even with port discrimination _disabled_, the serialization format should remain the same.

  Regardless, following upstream backports, a new version has been introduced (v4) that marks the AddrMan format incompatible with older versions of Dash Core.

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK a93fec6f2d
  PastaPastaPasta:
    utACK a93fec6f2d

Tree-SHA512: 49b35af3e4eb660249ce9a65d5a539205d852e9c728da22dc88779f6b3b15c13cf91522896a313bfe2a91889fedf3b6b2cebdea12cc2bbe865ec3b85b6a5dfa8
2024-06-10 23:35:43 -05:00
Kittywhiskers Van Gogh
f4ce573538
merge bitcoin#22340: Use legacy relaying to download blocks in blocks-only mode 2024-06-10 17:31:24 +00:00
Kittywhiskers Van Gogh
73b8f84fdb
merge bitcoin#22147: p2p: Protect last outbound HB compact block peer 2024-06-10 17:31:24 +00:00
Kittywhiskers Van Gogh
c9a645f814
merge bitcoin#22879: Fix format string in deserialize error 2024-06-10 17:15:04 +00:00