Commit Graph

23983 Commits

Author SHA1 Message Date
UdjinM6
24a4ed3f8b
fix: Update conditions and unify calculations for the number of "winners" to skip when mixing (#5532)
## Issue being fixed or feature implemented
`JoinExistingQueue` was tweaked for regtest/devnets in #4394 but we have
"skipping winners" logic in `StartNewQueue` too. We should also use
weighted count when checking "skip winners" conditions.

## What was done?
Add a helper to calculate the number and use it in both methods. Adjust
logic.

## How Has This Been Tested?
Running a local mixing node on devnet ~- no "skipping winners" in logs
anymore.~ and testnet

## 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
2023-08-16 23:39:38 -05:00
UdjinM6
9f7322b34a
feat: Add -chainlocknotify cmd-line option, update -instantsendnotify (#5522)
## Issue being fixed or feature implemented
Execute command when the best chainlock changes (`%s` in cmd is replaced
by chainlocked block hash). Same as `-blocknotify` but for chainlocks.
Let `-instantsendnotify` replace `%w` with wallet name like
`-walletnotify` does.

## What was done?

## 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
2023-08-15 11:10:21 -05:00
PastaPastaPasta
c716805f03
Merge pull request #5510 from vijaydasmp/bp22_9
backport: Merge bitcoin#20609, 20731, 20683, 20747, 20761
2023-08-08 06:33:41 -05:00
MarcoFalke
085f4dfa76 Merge #20761: fuzz: Check that NULL_DATA is unspendable
fa2630328687645fbc7dd1ea46aac32514025715 fuzz: Check that NULL_DATA is unspendable (MarcoFalke)

Pull request description:

  * Every script of type NULL_DATA must be unspendable
  * The only know types of unspendable scripts are NULL_DATA and certain NONSTANDARD scripts

ACKs for top commit:
  sipa:
    utACK fa2630328687645fbc7dd1ea46aac32514025715

Tree-SHA512: 8297fbacf32b4868b12accc1c052d352d02d96540a1fc883de9d04a3df8734116deecc33046495c9a3af6d79fec7f8d63afbfa5e401a2ca8d7c70f0f13735c0d
2023-08-08 06:33:29 -05:00
fanquake
c32857c05b Merge #20747: net processing: Remove dropmessagestest
176325a5a47befe32d480b3dc206dd0e64e04b21 [net processing] Remove dropmessagestest (John Newbery)

Pull request description:

  -dropmessagestest is a command line option that causes 1 in n received
  messages to be dropped. The Bitcoin P2P protocol is stateful and in
  general cannot handle messages being dropped. Dropped
  version/verack/ping/pong messages will cause the connection to time out
  and be torn down. Other dropped messages may also cause the peer to
  believe that the peer has stalled and tear down the connection.

  It seems difficult to uncover any actual issues with -dropmessagestest,
  and any coverage that could be generated would probably be easier to
  trigger with fuzz testing.

ACKs for top commit:
  MarcoFalke:
    cr ACK 176325a5a47befe32d480b3dc206dd0e64e04b21
  practicalswift:
    cr ACK 176325a5a47befe32d480b3dc206dd0e64e04b21
  dhruv:
    cr ACK 176325a
  amitiuttarwar:
    ACK 176325a5a47befe32d480b3dc206dd0e64e04b21

Tree-SHA512: bd582e5e8c9eb272a5d8ec01ff07c36c0033fbb84c30d1c72c87a7a6c7290021dcaf7bf549179a8b95aeb4f7243158d5593bc7fcf1ec16213782e470fe36bb89
2023-08-08 06:33:29 -05:00
Wladimir J. van der Laan
a365ed03c0 Merge #20683: test: Fix restart node race
fab46b34f4b13abbb0af276c3fb548f25ccc28bd test: Fix restart node race (MarcoFalke)

Pull request description:

  It is not allowed to start a node before it has been fully stopped. Otherwise it could lead to intermittent issues due to access issues (e.g. cookie file https://cirrus-ci.com/task/6409665024098304?command=ci#L4793)

  Fix that by waiting for the node to fully stop.

ACKs for top commit:
  laanwj:
    code review ACK fab46b34f4b13abbb0af276c3fb548f25ccc28bd

Tree-SHA512: 7605cac0573a7b04f05ff110d0131e8940d87f7baf6d698505ed16b363d4d15b1e552c5ffd1a187c8fe5639f7e265c3122734c85283275746e46bd789614fd21
2023-08-08 06:33:29 -05:00
MarcoFalke
04a0baad8d Merge #20731: rpc: Add missing description of vout in getrawtransaction help text
b23349b8804fb60c6b3d7d0e2a95927a0d1b49b9 rpc: Add missing description of vout in getrawtransaction help text (Ben Carman)

Pull request description:

  In `getrawtransaction` the vout did not have a description. I gave it the same description as the one used in `decoderawtransaction`.

ACKs for top commit:
  MarcoFalke:
    ACK b23349b8804fb60c6b3d7d0e2a95927a0d1b49b9 🏯

Tree-SHA512: 3833b97c82a46dfeb7ac825d4b2514b4b05ce54ac41f2144a8e2f2093b3411fe1d090c1e5b0c3d09200a2ea164c8d17ece12cdb43bbaeaeccc51a9da6dd7b7a3
2023-08-08 06:33:29 -05:00
MarcoFalke
48b92ec762 Merge #20609: configure: output notice that test binary is disabled by fuzzing
904d875cf5aecc337daa6a2243a803033cf4eee3 configure: output notice that test binary is disabled by fuzzing (Andrew Poelstra)

Pull request description:

  I wasted a bit of time today running a stale `test_bitcoin` and not understanding why, until I remembered that I'd ./configured my working directory with --enable-fuzz.

Top commit has no ACKs.

Tree-SHA512: 6cbe30547332114ad3fe61c67e224f5a28aac4b1b58e0acecb29cb04f5a34f792c927797aa8000449aae076435bd45acf209b7323b0b48fa971705d6ed3e6529
2023-08-08 06:33:29 -05:00
PastaPastaPasta
98b2a567ab
Merge pull request #5502 from vijaydasmp/bp22_6
backport: Merge bitcoin#20613,20617,20569,20668,20686
2023-08-08 06:26:36 -05:00
MarcoFalke
2e8800cdc1 Merge #20686: fuzz, refactor: replace CNode code with fuzz/util.h::ConsumeNode()
23d8f346896c806581189c9eb870c7833c09f5be fuzz: replace CNode code with fuzz/util.h::ConsumeNode() (Jon Atack)

Pull request description:

  Noticed this while updating the CNode fuzzing in #20210.

  - cc26fab48d76a813d798657b18ae1af08a301150 created `test/fuzz/net.cpp` in May 2020

  - 79ef8324d4c85ed16a304e98805724b8a created a CNode factory utility `test/fuzz/util.h::ConsumeNode()` in October 2020

  This PR updates `fuzz/net.cpp` from the first commit to use `ConsumeNode()` from the second commit.

ACKs for top commit:
  MarcoFalke:
    ACK 23d8f346896c806581189c9eb870c7833c09f5be

Tree-SHA512: 26f7685395b3d48fcf40dde0d479d5c2fb4e953ec9371940b19eee16bb30aee4840b081e1a918b924a9704c1bef484302ea3e8fe63819a3bba73e7eb805164f1
2023-08-08 06:26:09 -05:00
Wladimir J. van der Laan
b1e0b6c1f5 Merge #20668: doc: warn that incoming conns are unlikely when not using default ports
010eed3ce03cf4fc622a48f40fc4d589383f7a44 doc: warn that incoming conns are unlikely when not using default ports (Adam Jonas)

Pull request description:

  Closes #5150.

  This was mostly copied from #5285 by sulks, who has since quit GitHub.

  The issue has remained open for 6 years, but the extra explanation still seems useful.

ACKs for top commit:
  laanwj:
    re-ACK 010eed3ce03cf4fc622a48f40fc4d589383f7a44

Tree-SHA512: d240fb06bba41ad8898ced59356c10adefc09f3abb33e277f8e2c5980b40678f2d237f286b476451bb29d2b94032a7dee2ada3b2efe004ed1c2509e70b48e40f
2023-08-08 06:26:09 -05:00
MarcoFalke
45399b96a7 Merge #20569: test: Fix intermittent wallet_multiwallet issue with got_loading_error
fab48da908f3f81135b9163edf5011d1e5f6ef6e test: Fix intermittent wallet_multiwallet issue with got_loading_error (MarcoFalke)
fa8e15f7b75e35846b86e8627a3612e31eb22dcb test: pep8 wallet_multiwallet.py (MarcoFalke)

Pull request description:

  Failing the test after 10 iterations without a loading error is problematic because it may take 11 iterations to get a loading error.

  Fix that by running until a loading error occurs, which should happen in almost all runs within the first 10 iterations.

ACKs for top commit:
  ryanofsky:
    Code review ACK fab48da908f3f81135b9163edf5011d1e5f6ef6e. This seems like a good workaround. I think more ideally think load and unload RPCs would not have racy status reporting (suggested previously https://github.com/bitcoin/bitcoin/pull/19300#pullrequestreview-435362710 and

Tree-SHA512: 6b80b26d916276efe2a01af93bca7dbf71a3e67db9d3deb15175070719bf7d1325a1410d93e74c0316942e388faa2ba185dc9d3759c82d1c73c3c509b9997f05
2023-08-08 06:26:09 -05:00
fanquake
2111c7727b Merge #20617: p2p: Remove m_is_manual_connection from CNodeState
a33442fdc73eabd1c5596ab92954344edc9517e6 Remove m_is_manual_connection from CNodeState (Antoine Riard)

Pull request description:

  Currently, this member is only used to exclude MANUAL peers from discouragement
  in MaybePunishNodeForBlock(). Manual connections are already protected in
  MaybeDiscourageAndDisconnect(), independently from their network
  processing behaviors.

ACKs for top commit:
  MarcoFalke:
    cr ACK a33442fdc73eabd1c5596ab92954344edc9517e6
  promag:
    Code review ACK a33442fdc73eabd1c5596ab92954344edc9517e6.
  jnewbery:
    utACK a33442fdc73eabd1c5596ab92954344edc9517e6
  amitiuttarwar:
    code review ACK a33442fdc73eabd1c5596ab92954344edc9517e6

Tree-SHA512: cfe3f3dfa131373e3299002d34ae9e22ca6e1a966831bab32fcf06ff1d08f06095b4ab020cc4d267f3ec05ae23fbdc22373382ab828b999c0db11b8c842a4f0c
2023-08-08 06:26:09 -05:00
MarcoFalke
9a3abd973c Merge #20613: test: Use Popen.wait instead of RPC in assert_start_raises_init_error
fa918dd537fea775c19a590e5f9161bf51a5839b test: Use Popen.wait instead of RPC in assert_start_raises_init_error (MarcoFalke)

Pull request description:

  Using RPC (`wait_for_rpc_connection`) has several issue:

  * It polls in a loop, which might be slow
  * It tries to read the RPC cookie file, which might not be present, thus leading to intermittent issues

  Fix both by using `Popen.wait`

ACKs for top commit:
  laanwj:
    Code review ACK ~~faf7b05be9c86ee61c39e5314511fe2410128a6b~~ fa918dd537fea775c19a590e5f9161bf51a5839b
  darosior:
    ACK fa918dd537fea775c19a590e5f9161bf51a5839b

Tree-SHA512: 5368ad0d0ea2deb0af9582a42667c9290efe8f2705f37a236afc2c7908b04265ab342e2dd356a57156e99389f4a27ab6da9fa7bf9161fb7568240aa005e693b9
2023-08-08 06:26:09 -05:00
PastaPastaPasta
666fa51a7c
Merge pull request #5362 from kwvg/qt_bump
backport: merge bitcoin#22402, #23583, #23618, #17874, #21286, #23489, #23675, #24130, #23556, #23862, #24722, #24132, #24668, #25643, #25719, partial #22469, #23677 (qt backports)
2023-08-08 06:06:04 -05:00
Kittywhiskers Van Gogh
3d97c4b6a2 merge bitcoin#26057: Get rid of perl dependency 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
2e144694b8 merge bitcoin#25719: Bump Qt to 5.15.5 in depends 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
ce3521dd4d merge bitcoin#25542: Use Link Time Optimization for Qt code on Linux 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
2fde05c2ae merge bitcoin#25708: always use correct ar for win qt build 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
7e0cce3fb8 merge bitcoin#25424: Fix QMAKE_CXXFLAGS expression for mingw32 host 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
16880f12d7 partial bitcoin#24131: Fix Windows cross-compiling with Qt 5.15
excludes
- 0bbae237a8e0122b97c5c71bc85bc845e26d5b47
- 9796dcacdc3841ab6e3359bd5ca67a5f634bf176
2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
7181c721e2 merge bitcoin#23998: support OpenBSD in depends
excludes `fix_openbsd_test_lib.patch` as it's already present

```
Preprocessing boost...
patching file boost/test/impl/execution_monitor.ipp
Reversed (or previously applied) patch detected!  Assume -R? [n]
```
2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
df50931ae2 merge bitcoin#23948: add FreeBSD support to depends 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
d121666341 merge bitcoin#24668: bump Qt5 version to 5.15.3 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
b92539f437 merge bitcoin#24132: Bump minimum Qt version to 5.11.3 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
d63ec2cc9b merge bitcoin#24722: patch around qt duplicate symbol issue 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
52e0dc4919 merge bitcoin#23862: Hardcode last modified timestamp in Qt RCC 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
de72a04582 partial bitcoin#23677: Use Android NDK r23 LTS 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
3fde12f6ec merge bitcoin#23556: Fix regression in rendering on macOS Big Sur 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
0d6eec5b83 merge bitcoin#24130: Update the used Qt version 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
6e0b683366 merge bitcoin#23675: Post-pr23489 small cleanups 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
a7f90c070c merge bitcoin#23489: Qt 5.15.2 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
545387128c merge bitcoin#21286: Bump minimum Qt version to 5.9.5 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
8cd556376a trivial: rearrange patches to match upstream before upgrading Qt 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
73195bf093 merge bitcoin#17874: make linker checks more robust 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
71ab30057f partial bitcoin#22469: Add support for Android NDK r22+
excludes:
- acaac6e86a9e808244d9c69a59ab3c2d8e34cad6
2023-08-08 06:05:02 -05:00
Konstantin Akimov
93bd0c70a2
refactor: rename assetLockedAmount in CbTx to creditPoolBalance (#5526)
## Issue being fixed or feature implemented
Bad naming is noticed in https://github.com/dashpay/dash/pull/5026 by
thephez

## What was done?
Renamed `assetLockedAmount` in CbTx to `creditPoolBalance`
Renamed also some local variables and functions to make it matched also.

## How Has This Been Tested?
Run functional/unit tests - succeed
Called python's rpc binding `node.getblock(block_hash)['cbTx']`:
Got this result:
```
{'version': 3, 'height': 1556, 'merkleRootMNList': '978b2b4d1b884de62799b9eaee75c7812fea59f98f80d5ff9c963b0f0f195e14', 'merkleRootQuorums': 'bc7a34eb114f4e4bf38a11080b5d8ac41bdb36dd41e17467bae23c94ba06b013', 'bestCLHeightDiff': 0, 'bestCLSignature': '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'creditPoolBalance': Decimal('7.00141421')}
```

## Breaking Changes
Renamed `assetLockedAmount` in CbTx to `creditPoolBalance`. @shumkov be
informed


## 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
2023-08-08 05:49:31 -05:00
PastaPastaPasta
a679f8b0e5
Merge pull request #5479 from knst/bc-bp-v20-missing-9
backport: bitcoin#18160, #18454, #18487, #18524, #18532, #18546, #18551, #18561, #18563, #18587
2023-08-03 11:16:55 -05:00
MarcoFalke
2c9d41d073 Merge #18454: net: Make addr relay mockable, add test
NOTE: There is slight difference with original backport due to future changes
in bitcoin#19272, bitcoin#19763 - otherwise functional test p2p_addr_relay.py fails

fa1da3d4bfc0511a89f5b19d5a4d89e55ff7ccde test: Add basic addr relay test (MarcoFalke)
fa1793c1c44a3f75a09f9c636467b8274c541bdd net: Pass connman const when relaying address (MarcoFalke)
fa47a0b003f53708b6d5df1ed4e7f8a7c68aa3ac net: Make addr relay mockable (MarcoFalke)

Pull request description:

  As usual:

  * Switch to std::chrono time to be type-safe and mockable
  * Add basic test that relies on mocktime to add code coverage

ACKs for top commit:
  naumenkogs:
    utACK  fa1da3d
  promag:
    ACK fa1da3d4bfc0511a89f5b19d5a4d89e55ff7ccde (fabe56e44b6f683e24e37246a7a8851190947cb3 before https://github.com/bitcoin/bitcoin/pull/18454#issuecomment-607866453), fa5bf23d527a450e72c2bf13d013e5393b664ca3 was dropped since last review.

Tree-SHA512: 0552bf8fcbe375baa3cab62acd8c23b2994efa47daff818ad1116d0ffaa0b9e520dc1bca2bbc68369b25584e85e54861fe6fd0968de4f503b95439c099df9bd7

fixup - see #19272, #19763
2023-08-03 11:16:41 -05:00
MarcoFalke
5460866184 Merge #18561: test: Properly raise FailedToStartError when rpc shutdown before warmup finished
faede1b293354560317b67f0b4e6874dcac6ef41 test: Properly raise FailedToStartError when rpc shutdown before warmup finished (MarcoFalke)

Pull request description:

  Should fix issues such as https://travis-ci.org/github/bitcoin/bitcoin/jobs/671910152#L7034

Top commit has no ACKs.

Tree-SHA512: ac659f29c5ec91985c916b734e24911cbf4e2c5c4b1f1891a7e6c2d2511ec285167550fb03848eee4a7a3cbc9f8cdb0c766f4e881d9e44368c7415d007006368
2023-08-03 11:16:41 -05:00
MarcoFalke
7c5f9af0dc Merge #18563: test: Fix unregister_all_during_call cleanup
13d2a33537a403ac47a989be92109d3214375b6a Fix unregister_all_during_call cleanup (Russell Yanofsky)

Pull request description:

  Use `TestingSetup` fixture to fix `unregister_all_during_call` test not calling `UnregisterBackgroundSignalScheduler`, which could trigger an assert in `RegisterBackgroundSignalScheduler` when called in later tests

  Failure reported by fanquake https://github.com/bitcoin/bitcoin/pull/18551#issuecomment-610974251

ACKs for top commit:
  MarcoFalke:
    ACK 13d2a33537a403ac47a989be92109d3214375b6a if appveyor unit tests pass

Tree-SHA512: d2ec8ff14c54d97903af50031abfac1f38ec1c3aabc90371cfd5b79481fa69d3d77f339bfdf7d2178fd85e83402f72eda7cf4d339e5bbfa7e6e1a68836643b93
2023-08-03 11:16:41 -05:00
MarcoFalke
560e5589cb Merge #18532: rpc: Avoid initialization-order-fiasco on static CRPCCommand tables
fa1a92224dd78de817d15bcda35a8310254e1a54 rpc: Avoid initialization-order-fiasco on static CRPCCommand tables (MarcoFalke)

Pull request description:

  Currently the fiasco is only theoretical because all content of the table are compile-time constants. However, the fiasco materializes should they ever become run-time constants (e.g. #18531).

ACKs for top commit:
  promag:
    ACK fa1a92224dd78de817d15bcda35a8310254e1a54.
  practicalswift:
    ACK fa1a92224dd78de817d15bcda35a8310254e1a54 -- fiasco bad :)

Tree-SHA512: cccadb0ad56194599b74f04264d74c34fa865958580a850efc6474bbdc56f30cadce6b2e9a6ad5472ff46c3f4c793366acd8090fad409a45b25d961f2d89da19
2023-08-03 11:16:41 -05:00
MarcoFalke
2046ae1bc0 Merge #18546: Bugfix: Wallet: Safely deal with change in the address book [part 2]
7a2ecf16df938dd95d3130a46082def7a02338eb Wallet: Change IsMine check in CWallet::DelAddressBook from assert to failure (Luke Dashjr)
2952c46b923042f2de801f319e03ed5c4c4eb735 Wallet: Replace CAddressBookData.name with GetLabel() method (Luke Dashjr)
d7092c392e10889cd7a080b3d22ed6446a59b87a QA: Test that change doesn't turn into non-change when spent in an avoid-reuse wallet (Luke Dashjr)

Pull request description:

  Follow-up to #18192, not strictly necessary for 0.20

ACKs for top commit:
  MarcoFalke:
    re-ACK 7a2ecf16df, only change is adding an assert_equal in the test 🔰
  jnewbery:
    utACK 7a2ecf16df938dd95d3130a46082def7a02338eb

Tree-SHA512: e0933ee40f705b751697dc27249e1868ed4874254b174ebdd0a7150125d8c818402e66df2371718c7eeb90e67ee2317215fb260aa9b9d7b9b45ee436de2988ff
2023-08-03 11:16:41 -05:00
Wladimir J. van der Laan
363b37dfbd Merge #18487: rpc: Fix rpcRunLater race in walletpassphrase
7b8e15728d1ad058a4b7d7569fd5d5ba6806ca28 rpc: Fix rpcRunLater race in walletpassphrase (João Barbosa)

Pull request description:

  Release locks before calling `rpcRunLater`.

  Quick explanation: `rpcRunLater` leads to `event_free` which calls `event_del` which can wait for the event callback to finish if it's already running and that callback will try to lock wallet mutex - which is already locked in http thread.

  Fixes #14995 , fixes #18482. Best reviewed with whitespace changes hidden.

ACKs for top commit:
  MarcoFalke:
    ACK 7b8e15728d, only tested that this avoids the node freezing. Did not look at how libevent works or how the deadlock happens or if this breaks other stuff. 📞
  ryanofsky:
    Code review ACK 7b8e15728d1ad058a4b7d7569fd5d5ba6806ca28. Just updated comment since last review

Tree-SHA512: 17874a2fa7b0e164fb0d7ee4cb7d59650275b8c03476fb291d60af8b758495457660d3912623fb26259fefe84aeba21c0a9e0c6467982ba511f19344ed5413ab
2023-08-03 11:16:41 -05:00
MarcoFalke
76242f9d8d Merge #18551: Do not clear validationinterface entries being executed
2276339a176f83ffe8ceefb3e41ecca8601aa13b Add test for UnregisterAllValidationInterfaces bug (Russell Yanofsky)
3c61abbbc847d725f30d169278d84655571407c1 Do not clear validationinterface entries being executed (Pieter Wuille)

Pull request description:

  The previous code for MainSignalsInstance::Clear would decrement the reference
  count of every interface, including ones that were already Unregister()ed but
  still being executed.

  This fixes the issue pointed out here: https://github.com/bitcoin/bitcoin/pull/18524/files#r404395685 . It's not currently observable.

ACKs for top commit:
  jonasschnelli:
    utACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b - reviewed code and test (thanks @ryanofsky for adding the test).
  MarcoFalke:
    ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b 🎎
  ryanofsky:
    Code review ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b. No change to bugfix, just rebased and new test commit added since last review

Tree-SHA512: c1d68e7c681a45c6cadc84e407c2266bcb4b12d34264e1232a61c4eadb74b551231c5a3b1d041de39f507aef4dfa7d4589b8bfe1833f069c739c6270d2a05dbe
2023-08-03 11:16:41 -05:00
Wladimir J. van der Laan
d2bbf03c32 Merge #18524: refactor: drop boost::signals2 in validationinterface
d6815a2313158862d448733954a73520f223deb6 refactor: drop boost::signals2 in validationinterface (Russell Yanofsky)

Pull request description:

  Stop using boost::signals2 internally in validationinterface. Replace with std::list and Add/Remove/Clear/Iterate helper functions.

  Motivation for change is to reduce dependencies and avoid issues happening with boost versions before 1.59: https://github.com/bitcoin/bitcoin/issues/18517, https://github.com/bitcoin/bitcoin/pull/18471

ACKs for top commit:
  MarcoFalke:
    ACK d6815a2313158862d448733954a73520f223deb6
  laanwj:
    ACK d6815a2313158862d448733954a73520f223deb6
  hebasto:
    re-ACK d6815a2313158862d448733954a73520f223deb6
  promag:
    ACK d6815a2313158862d448733954a73520f223deb6.

Tree-SHA512: 4fc0f14a8446e8616cc142af6c3d36815f3254525d30348ba8e4d4bc74c249a5a8c9bc119bdd1be7ebd7abe0b784bc0c5551a3e156a766890cb2fdd891a95919
2023-08-03 11:16:41 -05:00
Konstantin Akimov
4f00d45e53 Merge #18587: gui: Avoid wallet tryGetBalances calls in WalletModel::pollBalanceChanged
d3a56be77a9d112cde4baef4314882170b9f228f Revert "gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged" (Russell Yanofsky)
bf0a510981ddc28c754881ca21c50ab18e5f2b59 gui: Avoid wallet tryGetBalances calls before TransactionChanged or BlockTip notifications (Russell Yanofsky)
2bc9b92ed8b7736ad67876398a0bb8287f57e9b3 Cancel wallet balance timer when shutdown requested (Russell Yanofsky)
83f69fab3a1ae97c5cff8ba1e6fd191b0fa264bb Switch transaction table to use wallet height not node height (Russell Yanofsky)

Pull request description:

  Main commit `gui: Avoid wallet tryGetBalances calls` is one-line change to `WalletModel::pollBalanceChanged` that returns early if there hasn't been a new `TransactionChanged` or `BlockTip` notification since the previous poll call. This is the same behavior that was implemented in #18160, now implemented in a simpler way.

  The other commits are a straight revert of #18160, and two tweaks to avoid relying on `WalletModel::m_client_model` lifetime which were causing travis failures with earlier versions of this PR.

  Motivation for this change is to be able to revert #18160 and cut down on unnecessary cross-process calls that happen when #18160 is combined with #10102

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).# This is a combination of 2 commits.
2023-08-03 11:16:41 -05:00
Wladimir J. van der Laan
9a84f7ef76 Merge #18160: gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged
0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37 gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged (João Barbosa)

Pull request description:

  Each 250ms the slot `WalletModel::pollBalanceChanged` is called which, at worst case, calls `Wallet::GetBalance`. This is a waste of resources since most of the time there aren't new transactions or new blocks. Fix this by early checking if cache is dirty or not.

  The actual balance computation can still hang the GUI thread but that is tracked in #16874 and should be fixed with a solution similar to #17135.

ACKs for top commit:
  hebasto:
    ACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37, I have not tested the code, but I have reviewed it and it looks OK, I agree it can be merged.
  jonasschnelli:
    utACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37
  instagibbs:
    ACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37
  ryanofsky:
    Code review ACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37, but I would prefer (not strongly) for #17905 to be merged first. This PR can be simpler if it is based on #17905, so tryGetBalances can just be left alone instead of changing into to a more complicated tryGetBalancesIfNeeded function, and then getting changed back later when we want to optimize it out.
  jonatack:
    ACK 0933a37078e based primarily on code review, despite a lot of manual testing with a large 177MB wallet.

Tree-SHA512: 18db35bf33a7577666658c8cb0b57308c8474baa5ea95bf1468cd8531a69857d8915584f6ac505874717aa6aabeb1b506ac77630f8acdb6651afab89275e38a1
2023-08-03 11:16:41 -05:00
PastaPastaPasta
0b8e501b51
Merge pull request #5501 from kwvg/assumeutxo5
backport: merge bitcoin#19521, #22047, #21796, #21767, #24133, #24921, #27988, partial #24117, #24138, #27405 (assumeutxo: part 5)
2023-08-02 10:20:01 -05:00
Kittywhiskers Van Gogh
cc9dcdd0e0 test: migrate TestChainSetup's g_txindex guardrails 2023-08-02 10:19:02 -05:00