Commit Graph

2019 Commits

Author SHA1 Message Date
Konstantin Akimov
291716a8b4
refactor: move common duplicated code to test_framework/governance.py 2024-08-14 15:33:53 +07:00
Konstantin Akimov
f16b998632
fix: intermittent failure in feature_governance.py by bump timeout 2024-08-14 15:22:17 +07:00
Konstantin Akimov
c3d585827f
fix: intermittent failure in feature_governance_cl by bumping timeout 2024-08-14 15:22:17 +07:00
pasta
df07c38151
Merge #6189: backport: bitcoin#16333, #21862, #22385, #22550, #22597, #22632, #22718, #22907 - fire up test chains by first block - 2/n
e4e7c440f4 fix: use proper chain instead using ActiveChain for test framework (Konstantin Akimov)
65b92fa093 Merge bitcoin/bitcoin#21862: test: Set regtest.BIP65Height = 111 to speed up tests (fanquake)
adcf095ab9 Merge bitcoin/bitcoin#22718: doc: Add missing PR 16333 release note (MarcoFalke)
101a863399 Merge bitcoin/bitcoin#16333: test: Set BIP34Height = 2 for regtest (MarcoFalke)
71af8816ef Merge bitcoin/bitcoin#22907: test: Avoid intermittent test failure in feature_csv_activation.py (merge-script)
fc25503cbc Merge bitcoin/bitcoin#22632: test: Set regtest.BIP66Height = 102 to speed up tests (W. J. van der Laan)
cbd2be8e18 Merge bitcoin/bitcoin#22597: consensus/params: simplify ValidDeployment check to avoid gcc warning (MarcoFalke)
8928146bfa Merge bitcoin/bitcoin#22550: test: improve `test_signing_with_{csv,cltv}` subtests (speed, prevent timeout) (MarcoFalke)
fb00431b7c Merge bitcoin/bitcoin#22385: refactor: Use DeploymentEnabled to hide VB deployments (MarcoFalke)

Pull request description:

  ## Issue being fixed or feature implemented
  Backports from bitcoin related to hard-fork mechanism and accelerated action

  ## What was done?
  see commits for backports.
  Also fixed an issue of using from ChainState on RegTest: should be used specified chain, not the "best chain".

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

  ## Breaking Changes
  That's a breaking changes for RegTest

  ## 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:
  PastaPastaPasta:
    utACK e4e7c440f4

Tree-SHA512: c02813179177781a0da3beaff65732e12017f0056565b897891b2c5a06fda125a4e032571a02fad9d8640728df82c117393bd78bc6d406e0a30f72587b2d7344
2024-08-14 13:18:29 +07:00
pasta
e41615572e
Merge #6211: fix: use coinstatsindex instead blockfilterindex in feature_prunning
40c0e06047 fix: use coinstatsindex instead blockfilterindex in feature_prunning (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  This is follow-up changes for backports bitcoin#15946 and bitcoin#19521

  It fixes failure:

      TestFramework (INFO): Test invalid pruning command line options
      TestFramework (ERROR): Assertion failed
      Traceback (most recent call last):
        File "dashtest/functional/test_framework/test_node.py", line 511, in assert_start_raises_init_error
          ret = self.process.wait(timeout=self.rpc_timeout)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/subprocess.py", line 1264, in wait
          return self._wait(timeout=timeout)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.11/subprocess.py", line 2038, in _wait
          raise TimeoutExpired(self.args, timeout)
      subprocess.TimeoutExpired: Command '['dashsrc/dashd', '-datadir=/tmp/dash_func_test_m8w6q7a2/node0', '-logtimemicros', '-debug', '-debugexclude=libevent', '-debugexclude=leveldb', '-mocktime=1417713337', '-uacomment=testnode0', '-logthreadnames', '-logsourcelocations', '-createwalletbackups=0', '-prune=550', '-blockfilterindex', '-mocktime=1417713337']' timed out after 120 seconds

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "dashtest/functional/test_framework/test_framework.py", line 159, in main
          self.run_test()
        File "dashtest/functional/feature_pruning.py", line 495, in run_test
          self.test_invalid_command_line_options()
        File "dashtest/functional/feature_pruning.py", line 149, in test_invalid_command_line_options
          self.nodes[0].assert_start_raises_init_error(
        File "dashtest/functional/test_framework/test_node.py", line 541, in assert_start_raises_init_error
          self._raise_assertion_error(assert_msg)
        File "dashtest/functional/test_framework/test_node.py", line 180, in _raise_assertion_error
          raise AssertionError(self._node_msg(msg))
      AssertionError: [node 0] dashd should have exited within 120s with expected error Error: Prune mode is incompatible with -blockfilterindex.
      TestFramework (INFO): Stopping nodes

  ## What was done?
  Removed `blockfilterindex` test, enabled `coinstatsindex` test.

  ## How Has This Been Tested?
  Run manually: `test/functional/feature_pruning.py`
  This test is not run by our CI

  ## 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:
  PastaPastaPasta:
    utACK 40c0e06047
  UdjinM6:
    ACK 40c0e06047

Tree-SHA512: 94005c52a39cc02be8df65898844584fb247b71abab36341c3d8b4e5018902931ed8554734f27bb5d54fae2b7867ba40f136fc089fd6f9f0e57852203a5d4011
2024-08-13 21:14:36 +07:00
Konstantin Akimov
40c0e06047
fix: use coinstatsindex instead blockfilterindex in feature_prunning
That follow-up changes for backports bitcoin#15946 and bitcoin#19521

It fixes failure:

    TestFramework (INFO): Test invalid pruning command line options
    TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "dashtest/functional/test_framework/test_node.py", line 511, in assert_start_raises_init_error
        ret = self.process.wait(timeout=self.rpc_timeout)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/subprocess.py", line 1264, in wait
        return self._wait(timeout=timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/subprocess.py", line 2038, in _wait
        raise TimeoutExpired(self.args, timeout)
    subprocess.TimeoutExpired: Command '['dashsrc/dashd', '-datadir=/tmp/dash_func_test_m8w6q7a2/node0', '-logtimemicros', '-debug', '-debugexclude=libevent', '-debugexclude=leveldb', '-mocktime=1417713337', '-uacomment=testnode0', '-logthreadnames', '-logsourcelocations', '-createwalletbackups=0', '-prune=550', '-blockfilterindex', '-mocktime=1417713337']' timed out after 120 seconds

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "dashtest/functional/test_framework/test_framework.py", line 159, in main
        self.run_test()
      File "dashtest/functional/feature_pruning.py", line 495, in run_test
        self.test_invalid_command_line_options()
      File "dashtest/functional/feature_pruning.py", line 149, in test_invalid_command_line_options
        self.nodes[0].assert_start_raises_init_error(
      File "dashtest/functional/test_framework/test_node.py", line 541, in assert_start_raises_init_error
        self._raise_assertion_error(assert_msg)
      File "dashtest/functional/test_framework/test_node.py", line 180, in _raise_assertion_error
        raise AssertionError(self._node_msg(msg))
    AssertionError: [node 0] dashd should have exited within 120s with expected error Error: Prune mode is incompatible with -blockfilterindex.
    TestFramework (INFO): Stopping nodes
2024-08-13 16:00:42 +07:00
MarcoFalke
07f4c39c44
Merge bitcoin/bitcoin#26730: test: add coverage for purpose arg in listlabels
c467cfffcebb30f829eeb8160166a6b941d97ed6 test: add coverage for `purpose` arg in `listlabels` (brunoerg)

Pull request description:

  This PR adds test coverage for `listlabels` command when specifying the `purpose` (send and receive).

  dcdfd72861/src/wallet/rpc/addresses.cpp (L698-L704)

ACKs for top commit:
  kristapsk:
    ACK c467cfffcebb30f829eeb8160166a6b941d97ed6

Tree-SHA512: 7e7143c1264692f7b22952e7c70dbe9ed3f5dcd2e3b69962a47be9f9c21b3f4a9089ca87962fbc8ff9116e7d2dbeb7f36d6a132c9ac13724a255cfe1b32373a8
2024-08-12 11:52:40 +07:00
MarcoFalke
d1b93c78b7
Merge bitcoin/bitcoin#26818: test: Fix feature_startupnotify intermittent issue
fac810bb0a524e79014882f8fc694efade35de9f test: Fix feature_startupnotify intermittent issue (MarcoFalke)

Pull request description:

  Might fix #25644

ACKs for top commit:
  aureleoules:
    ACK fac810bb0a524e79014882f8fc694efade35de9f
  brunoerg:
    ACK fac810bb0a524e79014882f8fc694efade35de9f

Tree-SHA512: 870bf65da8120b6897d02e3bb70eea018d4761396abe64c3533bbc5237e65be9f77d35f62cd5d08cf7132dd53b504bf58229c33e18833c191495ad229c84d7c2
2024-08-12 11:52:39 +07:00
MacroFake
9590929900
Merge bitcoin/bitcoin#24944: rpc: add getblockfrompeer RPCTypeCheck and invalid input test coverage
2ef5294a5bb68ceb3797d2638567a172cc21699f rpc: add RPCTypeCheck for getblockfrompeer inputs (Jon Atack)
734b9669ff7b2f5e2820993443a6f868f6b0b20a test: add getblockfrompeer coverage of invalid inputs (Jon Atack)

Pull request description:

  The new getblockfrompeer RPC lacks test coverage for invalid arguments, and its error messages are not harmonized with the existing RPCs.

  Fix all issues.

ACKs for top commit:
  brunoerg:
    ACK 2ef5294a5bb68ceb3797d2638567a172cc21699f

Tree-SHA512: 454782cf6a44fd0e05483bb152153667ef5c8021358385ddcf89724fbbbd35e187362bdff757e00c99319527bc4c0b20c7187f67241d4585d767a29787142f25
2024-08-12 11:52:38 +07:00
fanquake
65b92fa093
Merge bitcoin/bitcoin#21862: test: Set regtest.BIP65Height = 111 to speed up tests
faf7e485e901d6c72db5d969b526fa148060a003 Set regtest.BIP65Height = 111 to speed up tests (MarcoFalke)

Pull request description:

  No need to waste time by forcing creation of more than 1000 blocks to get the benefits of being able to test BIP 65. Also, reducing the height makes it more likely that (third-party) tests are conforming to BIP 65, which is enforced on mainnet for all new blocks.

ACKs for top commit:
  theStack:
    re-ACK faf7e485e901d6c72db5d969b526fa148060a003 📍
  Zero-1729:
    re-ACK faf7e485e901d6c72db5d969b526fa148060a003
  kristapsk:
    ACK faf7e485e901d6c72db5d969b526fa148060a003

Tree-SHA512: 79a8263e7233838666b9b636b496a8b9eb12398c779f9434677e1d62816732c0a7c7b3e73965be1fb0038d35e05e5a90e665bd74e9610104127dfc4ea38169bf
2024-08-12 11:45:03 +07:00
MarcoFalke
101a863399
Merge bitcoin/bitcoin#16333: test: Set BIP34Height = 2 for regtest
222290f54388270937cb6c174195717e2214ec0d test: Set BIP34Height = 2 for regtest (MarcoFalke)
fac90c55be478f0323eafa1d560ea2c56f04fb23 test: Create all blocks with version 4 or higher (MarcoFalke)

Pull request description:

  BIP34 is active on the current tip of mainnet, so all miners must obey it. It would be nice if it also was active in fresh regtest instances from the earliest time possible.

  I changed the BIP34 height to `2`, so that the block at height=1 may be used to mine a duplicate coinbase. (Needed to test mainnet behaviour)

  This pull is done in two commits:

  *  test: Create all blocks with version 4 or higher:
     Now that BIP34 is activated earlier, we need to create blocks with a higher version number. Just bump it to 4 instead of 2 to avoid having to bump it again later.

  *  test: Set BIP34Height = 2 for regtest:
     This fixes the BIP34 implementation in the tests (to match the one of the Core codebase) and updates the tests where needed

ACKs for top commit:
  ajtowns:
    ACK 222290f54388270937cb6c174195717e2214ec0d
  jonatack:
    ACK 222290f54388270937cb6c174195717e2214ec0d tested and reviewed rebased to current master 5e213822f86d
  theStack:
    Tested ACK 222290f54388270937cb6c174195717e2214ec0d

Tree-SHA512: d69c637a62a64b8e87de8c7f0b305823d8f4d115c1852514b923625dbbcf9a4854b5bb3771ff41702ebf47c4c182a4442c6d7c0b9f282c95a34b83e56a73939b
2024-08-12 11:43:36 +07:00
merge-script
71af8816ef
Merge bitcoin/bitcoin#22907: test: Avoid intermittent test failure in feature_csv_activation.py
fa676dbac87919061de9f82bce65e373e8d85bd1 test: pep-8 whitespace (MarcoFalke)
faed284eabb250a07331dfca22bb8f96a95c72ea test: Avoid intermittent test failure in feature_csv_activation.py (MarcoFalke)

Pull request description:

  Otherwise there will be disconnects if the test runs longer than the default peertimeout (60s):

  ```
   node0 2021-09-05T20:28:30.973116Z (mocktime: 2021-09-01T07:17:29Z) [net] [net.cpp:1323] [InactivityCheck] socket receive timeout: 393061s peer=0
  ```

  Fix that by skipping `InactivityCheck` via a large `-peertimeout`.

ACKs for top commit:
  fanquake:
    ACK fa676dbac87919061de9f82bce65e373e8d85bd1

Tree-SHA512: 061c0585a805aa2f8e55c4beedd4b8498a2951f33d60aa3632dda0a284db3a627d14a23dbd57e8a66c69a1612f39418e3a755c8ca97f6ae1105c0d70f0d1a801
2024-08-12 11:43:36 +07:00
W. J. van der Laan
fc25503cbc
Merge bitcoin/bitcoin#22632: test: Set regtest.BIP66Height = 102 to speed up tests
fafe896a0b870d85250927bd5374caf73d379468 test: Set regtest.BIP66Height = 102 to speed up tests (MarcoFalke)

Pull request description:

  No need to waste time by forcing creation of more than 1000 blocks to get the benefits of being able to test BIP 66. Also, reducing the height makes it more likely that (third-party) tests are conforming to BIP 66, which is enforced on mainnet for all new blocks.

ACKs for top commit:
  GeneFerneau:
    Concept + code review ACK [fafe896](fafe896a0b)
  0xB10C:
    crACK fafe896a0b870d85250927bd5374caf73d379468
  laanwj:
    ACK fafe896a0b870d85250927bd5374caf73d379468
  Zero-1729:
    tACK fafe896
  kristapsk:
    ACK fafe896a0b870d85250927bd5374caf73d379468. Full functional test suite showed few second speed incrase on my laptop (although I didn't do proper benchmarking with multiple runs, just single `time ./test/functional/test_runner.py` on current master vs this PR).
  theStack:
    Tested ACK fafe896a0b870d85250927bd5374caf73d379468
  hg333:
    tACK fafe896a0b

Tree-SHA512: 4bbee3c8587d612e74a59fde49b6439c1296f2fc27d3a7cf59a35e920f729fdd581c930290bd04def618f81412236676ddb99b4ceb4d80dfb9fd610b128a04b1
2024-08-12 11:43:32 +07:00
pasta
efe4c2d6eb
Merge #6143: backport: bitcoin#19160, #21663, #21669, #21732, #21738, #21750, #21775, #21812
f4cb0fbfe1 fix: no need to relay quorum commitment in case of block undo (Konstantin Akimov)
0431a33919 fix: follow-up changes for bitcoin#14193. (Konstantin Akimov)
86b76d19b6 Merge bitcoin/bitcoin#21812: ci: Enable D_GLIBCXX_DEBUG for multiprocess task (fanquake)
334496ea7e Merge bitcoin/bitcoin#21775: p2p: Limit m_block_inv_mutex (MarcoFalke)
23b83109ea Merge bitcoin/bitcoin#21750: net: remove unnecessary check of CNode::cs_vSend (MarcoFalke)
b34514191f Merge bitcoin/bitcoin#21738: test: Use clang-12 for ASAN, Add missing suppression (fanquake)
3411577473 Merge bitcoin/bitcoin#19160: multiprocess: Add basic spawn and IPC support (W. J. van der Laan)
970048d917 fix: missing changes from bitcoin#19267 - run multiprocess on CI (Konstantin Akimov)
f2b7ee73db fix: follow-up bitcoin#15402 - removed dead code (Konstantin Akimov)
274068cdbc fix: follow-up bitcoin/bitcoin#21732 - minor missing typo (MarcoFalke)
e9450a8b36 Merge #21669: test: Remove spurious double lock tsan suppressions by bumping to clang-12 (MarcoFalke)
ef92c3065c Merge #21663: ci: Fix macOS brew install command (W. J. van der Laan)

Pull request description:

  ## Issue being fixed or feature implemented
  Just regular backports from v22

  ## What was done?
  See commits for backports.

  Also there're 2 bugs are fixed which became visible after backporting bitcoin#21775 - both are related to possible deadlocks in net_processing

  ## How Has This Been Tested?
  Run unit and functional tests. Enabled multiprocess builds on CI

  ## 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 f4cb0fbfe1
  PastaPastaPasta:
    utACK f4cb0fbfe1

Tree-SHA512: 3204c2aa243fa4834ccf4ff4672d183cf9b35f87b857df8543572cd685729e15fca39f85b27194233e57cbc1746e36b556efab95ce20d0aa0a7d4476a9f3c6c0
2024-08-10 19:15:13 +07:00
pasta
7cc99c43c3
Merge #6188: fix: help p2p_timeouts to succeed on the my localhost
92834d1ef2 fix: help p2p_timeouts to succeed on the my localhost (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Locally on my environment the functional tests `p2p_timeouts.py` fails in 80% runs.

  Output:
  ```
      stdout:
      2024-08-08T05:02:32.216000Z TestFramework (INFO): Initializing test directory /tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0
      2024-08-08T05:02:35.079000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
              def test_function():
                  if check_connected:
                      assert self.is_connected
                  return test_function_in()
      '''
      2024-08-08T05:02:35.080000Z TestFramework (ERROR): Assertion failed
      Traceback (most recent call last):
        File "DASH/test/functional/test_framework/test_framework.py", line 159, in main
          self.run_test()
        File "DASH/test/functional/p2p_timeouts.py", line 93, in run_test
          no_verack_node.wait_for_disconnect(timeout=1)
        File "DASH/test/functional/test_framework/p2p.py", line 495, in wait_for_disconnect
          self.wait_until(test_function, timeout=timeout, check_connected=False)
        File "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 "DASH/test/functional/test_framework/util.py", line 267, in wait_until_helper
          raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
      AssertionError: Predicate ''''
              def test_function():
                  if check_connected:
                      assert self.is_connected
                  return test_function_in()
      ''' not true after 1.0 seconds
      2024-08-08T05:02:35.581000Z TestFramework (INFO): Stopping nodes
      2024-08-08T05:02:36.582000Z TestFramework (WARNING): Not cleaning up dir /tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0
      2024-08-08T05:02:36.582000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0/test_framework.log
      2024-08-08T05:02:36.582000Z TestFramework (ERROR):
      2024-08-08T05:02:36.582000Z TestFramework (ERROR): Hint: Call DASH/test/functional/combine_logs.py '/tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0' to consolidate all logs
      2024-08-08T05:02:36.582000Z TestFramework (ERROR):
      2024-08-08T05:02:36.582000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
      2024-08-08T05:02:36.582000Z TestFramework (ERROR): https://github.com/dashpay/dash/issues
      2024-08-08T05:02:36.582000Z TestFramework (ERROR):

      stderr:

      TEST            | STATUS    | DURATION

      p2p_timeouts.py | ✓ Passed  | 4 s
      p2p_timeouts.py | ✖ Failed  | 4 s
      p2p_timeouts.py | ✖ Failed  | 5 s
      p2p_timeouts.py | ✖ Failed  | 5 s
      p2p_timeouts.py | ✖ Failed  | 6 s
      p2p_timeouts.py | ✖ Failed  | 6 s
      p2p_timeouts.py | ✖ Failed  | 7 s

      ALL             | ✖ Failed  | 37 s (accumulated)
      Runtime: 7 s
  ```

  ## What was done?
  Increased a timeout to see for first disconnect event +1 second.

  ## How Has This Been Tested?
  100% succeed:
  ```
  $ test/functional/test_runner.py -j20 p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py p2p_timeouts.py

  p2p_timeouts.py | ✓ Passed  | 4 s
  p2p_timeouts.py | ✓ Passed  | 5 s
  p2p_timeouts.py | ✓ Passed  | 5 s
  p2p_timeouts.py | ✓ Passed  | 6 s
  p2p_timeouts.py | ✓ Passed  | 6 s
  p2p_timeouts.py | ✓ Passed  | 7 s
  p2p_timeouts.py | ✓ Passed  | 7 s
  p2p_timeouts.py | ✓ Passed  | 8 s
  p2p_timeouts.py | ✓ Passed  | 8 s
  p2p_timeouts.py | ✓ Passed  | 9 s
  p2p_timeouts.py | ✓ Passed  | 9 s
  p2p_timeouts.py | ✓ Passed  | 10 s
  p2p_timeouts.py | ✓ Passed  | 10 s
  p2p_timeouts.py | ✓ Passed  | 11 s
  p2p_timeouts.py | ✓ Passed  | 11 s
  p2p_timeouts.py | ✓ Passed  | 12 s
  ```

  ## 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:
    ACK 92834d1ef2
  PastaPastaPasta:
    utACK 92834d1ef2

Tree-SHA512: 598178fd97e82def16b32cbaf1f476d3416768456a7f92fb4faadc041b73147cc7be3e6760287bde22d1a3e5a5a9190124ede6da81a1722feba1e80fcc3ae4e3
2024-08-10 18:57:12 +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
c9923ca36b
partial bitcoin#25454: Avoid multiple getheaders messages in flight to the same peer
excludes:
- 99f4785cad94657dcf349d00fdd6f1d44cac9bb0
2024-08-09 17:34:41 +07:00
Kittywhiskers Van Gogh
26d477b6ae
revert: Fix duplicate initial headers sync
commits reverted:
- 753ed61fb3
2024-08-09 17:34:40 +07:00
Kittywhiskers Van Gogh
abccb2dd03
test: drop genesis block from blockheader_testnet3
bitcoin#25454 introduces a 10 point penalty for remitting more than
MAX_BLOCKS_TO_ANNOUNCE unconnected block headers. Whether they are
connected or not is determined by taking the first entry and running
its hashPrevBlock through LookupBlockIndex. This new behaviour causes a
test failure in p2p_dos_header_tree.py in Dash.

Bitcoin doesn't face a test failure with this new behaviour as the first
non-fork block in its test data is the dump for block 1 (00000000b873e7
9784647a6c82962c70d228557d24a747ea4d1b8bbe878e1206) but Dash uses block
0 (00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c),
the genesis block.

By definition of a genesis block, it has a hashPrevBlock of 0, which
cannot be looked up. This trips the penalty. This doesn't cause any
problems in the field as nobody is expected to ever broadcast the
genesis block but it does cause a test failure for us.

We need to correct that by getting rid of the genesis block from the
test data.
2024-08-09 17:34:40 +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
Kittywhiskers Van Gogh
a04290fc5c
merge bitcoin#24178: Respond to getheaders if we have sufficient chainwork 2024-08-09 17:34:39 +07:00
MarcoFalke
8928146bfa
Merge bitcoin/bitcoin#22550: test: improve test_signing_with_{csv,cltv} subtests (speed, prevent timeout)
12f094ec215aacf30e4e380c0399f80d4e45c345 test: use constants for CSV/CLTV activation heights in rpc_signrawtransaction (Sebastian Falbesoner)
746f203f1950a7df50b9a7de87a361cc7354ffb4 test: introduce `generate_to_height` helper, use in rpc_signrawtransaction (Sebastian Falbesoner)
e3237b1cd07a5099fbb0108218194eb653b6a9f3 test: check that CSV/CLTV are active in rpc_signrawtransaction (Sebastian Falbesoner)

Pull request description:

  This PR primarily aims to solve the current RPC timeout problem for test rpc_signrawtransaction.py, as described in #22542. In the course of that the test is also improved in other ways (see https://github.com/bitcoin/bitcoin/pull/22542#pullrequestreview-714297804).

  Reviewers guideline:
  * In `test_signing_with_cltv()`, a comment is fixed -- it wrongly referred to CSV, it should be CLTV.
  * As preparation, assertions are added that ensure that CSV and CLTV have been really activated after generating blocks by checking the 'softforks' output of the getblockchaininfo() RPC. Right now in master, one could remove (or decrease, like in #22542) the generate calls and the test would still pass, when it shouldn't.
  * A helper `generate_to_height()` is introduced which improves the previous way of reaching a block height in two ways:
      - instead of blindly generating TH blocks to reach target block height >= TH, the current block height CH is taken into account, and only (TH - CH) are generated in total
      - to avoid potential RPC timeouts, the block generation is split up into multiple generatetoaddress RPC calls ([as suggested by laanwj](https://github.com/bitcoin/bitcoin/pull/22542#issuecomment-886237866)); here chunks of 200 blocks have been chosen
   * The helper is used in the affected sub-tests, which should both speed-up the test (from ~18s to ~12s on my machine) and avoid potential timeouts
   * Finally, the activation constants for CSV and CLTV are used instead of using magic numbers 500 and 1500

  Open questions:
  * Any good naming alternatives for `generate_to_height()`? Not really happy with the name, happy to hear suggestions
  * Where to put the CSV and CLTV activation height constants in the test_framewor folder? I guess importing constants from other tests isn't really the desired way to go

ACKs for top commit:
  laanwj:
    Code review and tested ACK 12f094ec215aacf30e4e380c0399f80d4e45c345
  rajarshimaitra:
    reACK 12f094ec21

Tree-SHA512: 14509f6d3e5a5a05d6a30a3145bb82cd96a29d9d8a589abf1944a8bf34291cde78ce711195f52e9426588dc822b3618ec9b455e057360021ae46152bb7613516
2024-08-09 14:50:13 +07:00
Konstantin Akimov
92834d1ef2
fix: help p2p_timeouts to succeed on the my localhost
stdout:
    2024-08-08T05:02:32.216000Z TestFramework (INFO): Initializing test directory /tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0
    2024-08-08T05:02:35.079000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
            def test_function():
                if check_connected:
                    assert self.is_connected
                return test_function_in()
    '''
    2024-08-08T05:02:35.080000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "DASH/test/functional/test_framework/test_framework.py", line 159, in main
        self.run_test()
      File "DASH/test/functional/p2p_timeouts.py", line 93, in run_test
        no_verack_node.wait_for_disconnect(timeout=1)
      File "DASH/test/functional/test_framework/p2p.py", line 495, in wait_for_disconnect
        self.wait_until(test_function, timeout=timeout, check_connected=False)
      File "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 "DASH/test/functional/test_framework/util.py", line 267, in wait_until_helper
        raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
    AssertionError: Predicate ''''
            def test_function():
                if check_connected:
                    assert self.is_connected
                return test_function_in()
    ''' not true after 1.0 seconds
    2024-08-08T05:02:35.581000Z TestFramework (INFO): Stopping nodes
    2024-08-08T05:02:36.582000Z TestFramework (WARNING): Not cleaning up dir /tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0
    2024-08-08T05:02:36.582000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0/test_framework.log
    2024-08-08T05:02:36.582000Z TestFramework (ERROR):
    2024-08-08T05:02:36.582000Z TestFramework (ERROR): Hint: Call DASH/test/functional/combine_logs.py '/tmp/test_runner_∋_🏃_20240808_120217/p2p_timeouts_0' to consolidate all logs
    2024-08-08T05:02:36.582000Z TestFramework (ERROR):
    2024-08-08T05:02:36.582000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2024-08-08T05:02:36.582000Z TestFramework (ERROR): https://github.com/dashpay/dash/issues
    2024-08-08T05:02:36.582000Z TestFramework (ERROR):

    stderr:

    TEST            | STATUS    | DURATION

    p2p_timeouts.py | ✓ Passed  | 4 s
    p2p_timeouts.py | ✖ Failed  | 4 s
    p2p_timeouts.py | ✖ Failed  | 5 s
    p2p_timeouts.py | ✖ Failed  | 5 s
    p2p_timeouts.py | ✖ Failed  | 6 s
    p2p_timeouts.py | ✖ Failed  | 6 s
    p2p_timeouts.py | ✖ Failed  | 7 s

    ALL             | ✖ Failed  | 37 s (accumulated)
    Runtime: 7 s
2024-08-09 14:48:15 +07:00
pasta
5c3f1043fc
Merge #6176: test: reduce BRRHeight in regtest
38ecd6f951 test: reduce BRRHeight on regtest (Odysseas Gabrielides)

Pull request description:

  ## Issue being fixed or feature implemented
  In regtest, Block Reward Reallocation is buried at height 2500, which happens after v20 activation.

  ## What was done?
  Reduced BRRHeight in regtest from 2500 to 1000.
  The purpose of this change is to simplify regtests of Platform as well.
  Note: This change affects only regtest.

  ## How Has This Been Tested?
  tests

  ## Breaking Changes
  no, this only affects Regtest (where we make no guarantees about breaking stuff)

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] 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 _(for repository code-owners and collaborators only)_

Top commit has no ACKs.

Tree-SHA512: b5a1c2b2c2b70682f266d9d0af9e048a03417c0cb2480eb5ab5838965342b6465acd10d8dac5a0d3c5c5f59f4e36ac5b909a838bc3805c2265a83776e92b4827
2024-08-07 11:25:58 +07:00
Odysseas Gabrielides
38ecd6f951
test: reduce BRRHeight on regtest 2024-08-07 11:06:14 +07:00
pasta
87c918ac22
Merge #6138: backport: merge bitcoin#22840, #22937, #23446, #23522, #24026, #24104, #24167, #20744, partial bitcoin#23469, #24169 (replace boost::filesystem with std::filesystem)
0f239203a8 partial bitcoin#24169: Add --enable-c++20 option (Kittywhiskers Van Gogh)
a3b79267e0 merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System (Kittywhiskers Van Gogh)
be7ac493d0 merge bitcoin#24167: consistently use fsbridge:: for ifstream / ofstream (Kittywhiskers Van Gogh)
7ffea4348f merge bitcoin#24104: Make compatible with boost 1.78 (Kittywhiskers Van Gogh)
7c270e6883 merge bitcoin#24026: Block unsafe std::string fs::path conversion copy_file calls (Kittywhiskers Van Gogh)
b0d2484a0b merge bitcoin#23522: Improve fs::PathToString documentation (Kittywhiskers Van Gogh)
20d359b570 partial bitcoin#23469: Remove Boost build note from build-unix.md (Kittywhiskers Van Gogh)
193f6fde2e merge bitcoin#23446: Mention that BerkeleyDB is for legacy wallet in build-unix (Kittywhiskers Van Gogh)
ecfac10b8e merge bitcoin#22937: Forbid calling unsafe fs::path(std::string) constructor and fs::path::string() method (Kittywhiskers Van Gogh)
23fe7e2f07 chore: dashify symbols in some unit tests (Kittywhiskers Van Gogh)
28b96a071d merge bitcoin#22840: fix unoptimized libraries in depends (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Depends on https://github.com/dashpay/dash/pull/6085
  * Depends on https://github.com/dashpay/dash/pull/6137
  * Dependency for https://github.com/dashpay/dash/pull/6150

  ## Breaking Changes

  None observed.

  ## 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 **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK  0f239203a8
  PastaPastaPasta:
    utACK 0f239203a8

Tree-SHA512: 4b8f0ae55185ece27d8084a5339196b7ed993c8138f4c59a0db3e16729d4edf4a59a68a8c7309c32df57734c07182821c4878b55c253da5df763204ad7158426
2024-08-07 09:20:06 +07:00
pasta
a9979ebf73
Merge #6131: feat: make a support of Qt app to show Platform transfer Tx
21f174aff1 feat: improve query categorisation in Qt App (Konstantin Akimov)
c863473286 test: add spending asset unlock tx in functional tests (Konstantin Akimov)
1fb67ece0e feat: make a support of Qt app to show Platform Transfer transaction as a new type of transaction (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Transfers from platform have incorrectly shown amount in Dash Core wallet app.
  They also shown in Qt app as self-send that is not completely true.

  ## What was done?
  Added new type of transaction to Qt App, added a filter for its type, fixed calculation of output for tx records.
  As well added a new type of transaction `platform-transfer` in rpc output of `gettransaction` RPC

  ## How Has This Been Tested?
  Make a Platform Transfer transaction on RegTest and check it in Dash Core

  ![image](https://github.com/user-attachments/assets/16c83f09-724f-4b8b-99c8-9bb0df1428da)

  Helper to see it: export dpath=/tmp/dash_func_test_PATHPATH/ ; src/qt/dash-qt -regtest -conf=$dpath/node0/dash.conf -datadir=$dpath/node0/ -debug=0 -debuglogfile=/dev/stdout

  ## Breaking Changes
  There's new type of transaction "platform-transfer" in rpc output of `gettransaction`.

  **This PR DOES NOT change any consensus rules.**
  Breaking changes that makes withdrawal transaction immature is moved to https://github.com/dashpay/dash/pull/6128

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

Top commit has no ACKs.

Tree-SHA512: ec2a54a910f121ad30ff8e94cf17080b5b3c651872e9bc3de9ec0924ca7f7a0e526b74b05cde26aaf860e3809e67f66142112319a69c216527e5bcb1b8a2b8f6
2024-08-07 08:45:01 +07:00
Konstantin Akimov
c863473286
test: add spending asset unlock tx in functional tests 2024-08-07 08:27:33 +07:00
Kittywhiskers Van Gogh
a3b79267e0
merge bitcoin#20744: Use std::filesystem. Remove Boost Filesystem & System 2024-08-06 18:00:39 +00:00
Kittywhiskers Van Gogh
7ffea4348f
merge bitcoin#24104: Make compatible with boost 1.78 2024-08-06 18:00:38 +00:00
pasta
9b03903e94
Merge #6141: test: fix test of withdrawal for more than 1000 dash
f22ade31b9 tests: more strict test for withrawal 1000 and minor improvements (UdjinM6)
4ad18f64f5 fix: properly test hard limit of 1000 dash (Konstantin Akimov)
a2fe2b27d9 test: minor improvements for credit pool functional test (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  DIP for Credit Pool says:
  ```
  The withdrawal should not be mined if:
  * It requests more DASH than the credit pool contains
  * It requests more than 1000 DASH
  * The credit pool contains more than 1000 DASH, and the withdrawal would result in more than a 10% reduction in the credit pool over the 576-block window
  * The credit pool contains less than 1000 DASH, and the withdrawal would result in more than 100 DASH being removed from the pool over the 576-block window
  ```

  Though, current functional test for asset locks improperly test this case, because threshold for big withdrawal happens by 10%, not 1000 dash.

  ## What was done?
  Improvements for functional asset lock test to actually test a limit 1000 dash, not just 10%

  ## How Has This Been Tested?
  See changes

  ## Breaking Changes
  N/A, changes only for tests

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

ACKs for top commit:
  PastaPastaPasta:
    utACK f22ade31b9

Tree-SHA512: 2fdbfa85a3fc41683d68d1577916178ad686ccf0fba6abb22dc84a7ad69e0d44f876e371a24935c5167baa5491000662cc98cc1cd205e3817f0ffc65d2b4953d
2024-08-05 17:26:15 +07:00
pasta
28e20b31eb
Merge #6152: backport: bitcoin#20459, #20842, #21557, #21840, #21867, #21897, #21900, #21945, #22048, #22057
b73f48f3b9 Merge bitcoin/bitcoin#22057: test: use MiniWallet (P2PK mode) for feature_dersig.py (MarcoFalke)
d5a8d5e6a0 Merge bitcoin/bitcoin#22048: test: MiniWallet: introduce enum type for output mode (MarcoFalke)
f4cd20b115 Merge bitcoin/bitcoin#21945: test: add P2PK support to MiniWallet (MarcoFalke)
7be6db6dca docs: add an explanation for vsize in MiniWallet (Konstantin Akimov)
5d10b41302 Merge bitcoin/bitcoin#21840: test: Misc refactor to get rid of &foo[0] raw pointers (MarcoFalke)
7522ee9868 Merge bitcoin/bitcoin#21900: test: use MiniWallet for feature_csv_activation.py (MarcoFalke)
c6f603c26f Merge bitcoin/bitcoin#21897: rpc: adjust incorrect RPCHelpMan types (MarcoFalke)
1dffe3ab9f Merge bitcoin/bitcoin#21867: test: use MiniWallet for p2p_blocksonly.py (MarcoFalke)
81d21eea14 Merge #21557: test: small cleanup in RPCNestedTests tests (MarcoFalke)
cc169c2457 partial Merge #20842: docs: consolidate typo & url fixing (MarcoFalke)
2be1604405 Merge #20459: rpc: Fail to return undocumented return values (MarcoFalke)

Pull request description:

  ## What was done?
  Backports from v22 bitcoin.
  Mostly related to MiniWallet and RPC improvements, see commits

  ## How Has This Been Tested?
  Run unit/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 b73f48f3b9
  PastaPastaPasta:
    utACK b73f48f3b9

Tree-SHA512: 588f3a30697c0d77dadcc463aba71a00bf26eeef41b0cb8b9197799a217ebeb1d1ce7b5021ccc4576f0e9ca0e75ad840820cdc682fe8f120596788a528727a0b
2024-08-05 17:19:09 +07:00
UdjinM6
f22ade31b9
tests: more strict test for withrawal 1000 and minor improvements 2024-08-05 10:31:06 +07:00
Konstantin Akimov
4ad18f64f5
fix: properly test hard limit of 1000 dash
Now function test doesn't distint difference between 10% or 1000.
Adjust amounts to make it less than 10% but more than 1000
2024-08-05 10:31:06 +07:00
Konstantin Akimov
a2fe2b27d9
test: minor improvements for credit pool functional test 2024-08-05 10:31:00 +07:00
pasta
bf24a2bde2
Merge #6121: test: disable mocktime in p2p_eviction.py
764b3a3239 test: disable mocktime in p2p_eviction.py (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  No idea why CI has no issues but `p2p_eviction.py` fails locally after #6103 (my guess is that it's because P2PInterface can't work with mocktime properly).

  ## What was done?
  Disable mocktime in `p2p_eviction.py`

  ## How Has This Been Tested?
  Run tests locally

  ## 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
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

Top commit has no ACKs.

Tree-SHA512: a9be9032c7697ff47b2256395f0fb126deeccd9bee6f101a71a1f88e1f25b08fa039ed5eb4cd4b1b308e8136d64510a544b7019ed9147ea2e80f8cb83ff25412
2024-07-31 22:45:06 -05:00
UdjinM6
764b3a3239
test: disable mocktime in p2p_eviction.py
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
2024-07-31 22:39:52 -05:00
W. J. van der Laan
3411577473
Merge bitcoin/bitcoin#19160: multiprocess: Add basic spawn and IPC support
84934bf70e11fe4cda1cfda60113a54895d4fdd5 multiprocess: Add echoipc RPC method and test (Russell Yanofsky)
7d76cf667eff512043a28d4407cc89f58796c42b multiprocess: Add comments and documentation (Russell Yanofsky)
ddf7ecc8dfc64cf121099fb047e1ac871de94f4c multiprocess: Add bitcoin-node process spawning support (Russell Yanofsky)
10afdf0280fa93bfffb0a7665c60dc155cd84514 multiprocess: Add Ipc interface implementation (Russell Yanofsky)
745c9cebd50fea1664efef571dc1ee1bddc96102 multiprocess: Add Ipc and Init interface definitions (Russell Yanofsky)
5d62d7f6cd48bbc4e9f37ecc369f38d5e1e0036c Update libmultiprocess library (Russell Yanofsky)

Pull request description:

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).

  ---

  This PR adds basic process spawning and IPC method call support to `bitcoin-node` executables built with `--enable-multiprocess`[*].

  These changes are used in https://github.com/bitcoin/bitcoin/pull/10102 to let node, gui, and wallet functionality run in different processes, and extended in https://github.com/bitcoin/bitcoin/pull/19460 and https://github.com/bitcoin/bitcoin/pull/19461 after that to allow gui and wallet processes to be started and stopped independently and connect to the node over a socket.

  These changes can also be used to implement new functionality outside the `bitcoin-node` process like external indexes or pluggable transports (https://github.com/bitcoin/bitcoin/pull/18988). The `Ipc::spawnProcess` and `Ipc::serveProcess` methods added here are entry points for spawning a child process and serving a parent process, and being able to make bidirectional, multithreaded method calls between the processes. A simple example of this is implemented in commit "Add echoipc RPC method and test."

  Changes in this PR aside from the echo test were originally part of #10102, but have been split and moved here for easier review, and so they can be used for other applications like external plugins.

  Additional notes about this PR can be found at https://bitcoincore.reviews/19160

  [*] Note: the `--enable-multiprocess` feature is still experimental, and not enabled by default, and not yet supported on windows. More information can be found in [doc/multiprocess.md](https://github.com/bitcoin/bitcoin/blob/master/doc/multiprocess.md)

ACKs for top commit:
  fjahr:
    re-ACK 84934bf70e11fe4cda1cfda60113a54895d4fdd5
  ariard:
    ACK 84934bf. Changes since last ACK fixes the silent merge conflict about `EnsureAnyNodeContext()`. Rebuilt and checked again debug command `echoipc`.

Tree-SHA512: 52a948b5e18a26d7d7a09b83003eaae9b1ed2981978c36c959fe9a55abf70ae6a627c4ff913a3428be17400a3dace30c58b5057fa75c319662c3be98f19810c6
2024-07-27 13:04:24 +07:00
MarcoFalke
b73f48f3b9
Merge bitcoin/bitcoin#22057: test: use MiniWallet (P2PK mode) for feature_dersig.py
3e05a57297ddc9c55604a41e50a7a94d220db7ee test: use MiniWallet (P2PK mode) for feature_dersig.py (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (feature_dersig.py) to be run even with the Bitcoin Core wallet disabled. A valid DER-signature is created by using the recently introduced P2PK-Mode of the MiniWallet (#21945).

ACKs for top commit:
  MarcoFalke:
    cr ACK 3e05a57297ddc9c55604a41e50a7a94d220db7ee

Tree-SHA512: 0fb8da8ed8b47f68bcb57301eb4f0171a6c9e44539b7554626969347e5d6f80b3b9085f2cc160cd038a990f0d81b8b614846260fbed43b5f950d77f1b7aa81cf
2024-07-26 23:40:08 +07:00
MarcoFalke
d5a8d5e6a0
Merge bitcoin/bitcoin#22048: test: MiniWallet: introduce enum type for output mode
6cebac598e5e85eadd60eb1274d7f33d63ce1108 test: MiniWallet: introduce enum type for output mode (Sebastian Falbesoner)

Pull request description:

  This is a follow-up PR to #21945 which lifted the number of MiniWallet's tx output modes from 2 to 3 (by adding P2PK Support).
  Since the current way of specifying the mode on the ctor via two booleans is ugly and error-prone (see table in comment https://github.com/bitcoin/bitcoin/pull/21945#issuecomment-842526575), a new Enum type `MiniWalletMode` is introduced that can hold the following values:

  - ADDRESS_OP_TRUE
  - RAW_OP_TRUE
  - RAW_P2PK

  Also adds documentation that should guide the user on which mode is useful for what etc. with a summary table. (Can also be split up in a separate commit or shortened if that is desired, maybe it's considered to be too verbose).

ACKs for top commit:
  MarcoFalke:
    cr ACK 6cebac598e5e85eadd60eb1274d7f33d63ce1108

Tree-SHA512: cbbc10806d9d9e62829548094415e9f1a281cd247b9a9fc7f7f33b923c723aa03e7bc3024623a77fb1f7da4d73455fa8244840f746980d32acdad97ee12100da
2024-07-26 23:40:08 +07:00
MarcoFalke
f4cd20b115
Merge bitcoin/bitcoin#21945: test: add P2PK support to MiniWallet
4bea30169218e2f21e0c93a059966b41c8edd205 test: use P2PK-MiniWallet for feature_csv_activation.py (Sebastian Falbesoner)
dc7eb64e83f5b8e63f12729d5f77b1c920b136e4 test: MiniWallet: add P2PK support (Sebastian Falbesoner)

Pull request description:

  This PR adds support for creating and spending transactions with raw pubkey (P2PK) outputs to MiniWallet, [as suggested by MarcoFalke](https://github.com/bitcoin/bitcoin/pull/21900#discussion_r629524841). Using that  mode in the test `feature_csv_activation.py`, all txs submitted to the mempool follow the standard policy, i.e. `-acceptnonstdtxn=1` can be removed.

  Possible follow-ups:
  * Improve MiniWallet constructor Interface; an enum-like parameter instead of two booleans would probably be better
  * Look at other tests that could benefit from P2PK (e.g. feature_cltv.py?)
  * Check vsize also for P2PK txs (vsize varies due to signature, i.e. a range has to be asserted)

ACKs for top commit:
  laanwj:
    Code review ACK 4bea30169218e2f21e0c93a059966b41c8edd205

Tree-SHA512: 9b428e6b7cfde59a8c7955d5096cea88af1384a5f49723f00052e9884d819d952d20a5ab39bb02f9d8b6073769c44462aa265d84a33e33da33c2d21670c488a6
2024-07-26 23:40:08 +07:00
Konstantin Akimov
7be6db6dca
docs: add an explanation for vsize in MiniWallet
It's a double size because 1 byte is 2 hex character, not because it is 'segwit'
2024-07-26 23:40:08 +07:00
MarcoFalke
7522ee9868
Merge bitcoin/bitcoin#21900: test: use MiniWallet for feature_csv_activation.py
bd7f27d16dacf6f7de3b4f6bd052def41d9601be refactor: feature_csv_activation.py: move tx helper functions to methods (Sebastian Falbesoner)
2eca46b0aa0ecf4738500b53523d7013985b387d test: use MiniWallet for feature_csv_activation.py (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (feature_csv_activation.py) to be run even with the Bitcoin Core wallet disabled by using the new MiniWallet instead, as proposed in #20078.

  Short reviewers guideline:
  - Since we exclusively work with anyone-can-spend outputs here (raw scriptPubKey = OP_TRUE), signing is not needed anymore. The function `sign_transaction` and its calls are removed, after changing a tx (e.g. its scriptSig or nVersion) a simple `.rehash()` call is sufficient. Also, generating an address `self.nodeaddress` (and with that, passing it to the the various test tx creation/sending helper methods) is not needed anymore and removed.
  - The test repeatedly uses the same input for creating different txs (e.g. with different txversions 1 and 2). To let `MiniWallet` create a tx with a specific input, we have to call `.get_utxo()` before which also marks the UTXO as spent. The method is changed to also support keeping the UTXO in its internal list (`mark_as_spent=False`). With the behaviour on master, the second call to `.get_utxo()` with the same input would fail.
  - To keep the diff in the first commit short, the `miniwallet` is set as a global variable, to avoid passing it on every tx creation/spending helper. The global is eliminated in the second (refactoring) commit, where all the helpers are moved to the test class as methods. By that, we can use `self.nodes[0]` directly in the helpers and don't have to pass it again and again. I think there could still be a lot of improvements/refactoring done in the test, but that should hopefully serve as a good basis.

ACKs for top commit:
  laanwj:
    Code review ACK bd7f27d16dacf6f7de3b4f6bd052def41d9601be
  MarcoFalke:
    review ACK bd7f27d16dacf6f7de3b4f6bd052def41d9601be 🐕

Tree-SHA512: 24fb6a0f7702bae40d5271d197119827067d4b597e954d182e4c1aa5d0fa870368eb3ffed469b26713fa8ff8eb3ecc06abc80b2449cd68156d5559e7ae8a2b11
2024-07-26 13:32:54 +07:00
MarcoFalke
1dffe3ab9f
Merge bitcoin/bitcoin#21867: test: use MiniWallet for p2p_blocksonly.py
9f767e84381d678ed24e3f7f981976f9da34971e test: use MiniWallet for p2p_blocksonly.py (Sebastian Falbesoner)

Pull request description:

  This PR enables one more of the non-wallet functional tests (p2p_blocksonly.py) to be run even with the Bitcoin Core wallet disabled by using the new MiniWallet instead, as proposed in #20078.

  Note that MiniWallet creates segwit transactions by default, i.e. txid and wtxid are not identical and we have to return both from `check_p2p_tx_violation(...)`: wtxid is needed to match an expected `"received getdata for: wtx ..."` debug output, whereas the txid is needed to wait for a certain tx via `wait_for_tx(...)`.

ACKs for top commit:
  jonatack:
    ACK 9f767e84381d678ed24e3f7f981976f9da34971e tested with `--disable-wallet`

Tree-SHA512: f08001f02c3c310ccdf713af0ba17304368a36414f412749908bbe8c03ad1e902190b8768b79f3b4909855762f285e7ab1b627cc4f45c90b42bb097a43cb4318
2024-07-26 13:32:54 +07:00
MarcoFalke
cc169c2457
partial Merge #20842: docs: consolidate typo & url fixing
BACKPORT NOTICE:
missing changes in src/test/validation_tests.cpp (signet)

1112035d32ffe73a4522226c8cb2f6a5878d3ada doc: fix various typos (Ikko Ashimine)
e8640849c775efcf202dbd34736fed8d61379c49 doc: Use https URLs where possible (Sawyer Billings)

Pull request description:

  Consolidates / fixes the changes from #20762, #20836, #20810. There is no output when  `test/lint/lint-all.sh` is run.

  Closes #20807.

ACKs for top commit:
  MarcoFalke:
    ACK 1112035d32ffe73a4522226c8cb2f6a5878d3ada

Tree-SHA512: 22ca824688758281a74e5ebc6a84a358142351434e34c88c6b36045d2d241ab95fd0958565fd2060f98317e62e683323b5320cc7ec13592bf340e6922294ed78
2024-07-26 13:32:54 +07:00
MarcoFalke
5ac73929e2
Merge bitcoin/bitcoin#20583: rpc: Add missing BlockUntilSyncedToCurrentChain to wallet RPCs
fa5362a9a0c5665c1a4de51c3ce4758c93a9449e rpc: Add missing BlockUntilSyncedToCurrentChain to wallet RPCs (MarcoFalke)

Pull request description:

  Wallet RPCs that allow a rescan based on block-timestamp or block-height
  need to sync with the active chain first, because the user might assume
  the wallet is up-to-date with the latest block they got reported via a
  blockchain RPC.

ACKs for top commit:
  meshcollider:
    utACK fa5362a9a0c5665c1a4de51c3ce4758c93a9449e

Tree-SHA512: d4831f1f08f854f9a49fc969de86c438f856e41c2163c801a6ff36dc2f6299cb342b44663279c524a8b7ca9a50895db1243cd7d49bed79277ada857213f20a26
2024-07-23 23:42:45 -05:00
MarcoFalke
5e0c67cb94
Merge bitcoin/bitcoin#22113: test: minor cleanups in feature_cltv.py
7e32fde912b3924fdb27ec1f658ac11fcf160b3e test: feature_cltv.py: don't return tx copies in modification functions (Sebastian Falbesoner)
9ab2ce0a6673acc7ee0f85158fc087fce0fc7dd8 test: drop unused node parameters in feature_cltv.py (Sebastian Falbesoner)
0c2139a3f160d1d443460e4c5928109a6ab8cd11 test: fix typo in feature_cltv.py (s/ctlv/cltv/) (Sebastian Falbesoner)

Pull request description:

  This tiny PR cleans up the test `feature_cltv.py` in the following ways:
  * fixes a typo (s/ctlv/cltv/); compared to CHECKLOCKTIMEVERIFY, CHECKTIMELOCKVERIFY probably also sounds good and you [even get some search results for it](https://www.google.com/search?q=%22CHECKTIMELOCKVERIFY%22), but it's still wrong ;)
  * drops the unused "node" parameters from the tx modification functions
  * don't return a copy from the tx modification functions; it's modified in-place, hence a copy is not needed and `cltv_validate(tx, ...)` looks more natural than `tx = cltv_validate(tx, ...)`

ACKs for top commit:
  MarcoFalke:
    review ACK 7e32fde912b3924fdb27ec1f658ac11fcf160b3e 📼

Tree-SHA512: d2e6230977442f6a511d0f7c99431a44ad3a423647f4f327ce2ce8efe78bf9616c0d2093f5e3c3550f690dcb3f625ddf53227505c01ced70227425f249c25364
2024-07-23 23:41:53 -05:00
Kittywhiskers Van Gogh
04a3f65032
merge bitcoin#23721: Move restorewallet() logic to the wallet section 2024-07-23 17:45:24 +00:00
Kittywhiskers Van Gogh
847d866ff5
merge bitcoin#22738: fix failure in feature_nulldummy.py on single-core machines 2024-07-23 17:45:24 +00:00
Kittywhiskers Van Gogh
8b7ea28e80
merge bitcoin#21754: Run feature_cltv with MiniWallet
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2024-07-23 17:45:23 +00:00