Commit Graph

25627 Commits

Author SHA1 Message Date
fanquake
d5d1a714fb
Merge bitcoin/bitcoin#24390: test: Remove suppression no longer needed with headers-only Boost.Test
81738d2881253f28b69666ada2a01ebb353f503a test: Remove suppression no longer needed with headers-only Boost.Test (Hennadii Stepanov)

Pull request description:

  It appears, that moving to [headers-only](https://github.com/bitcoin/bitcoin/pull/24301) Boost.Test makes the removed suppression unneeded even without [bumping](https://github.com/bitcoin/bitcoin/pull/24383) boost version.

ACKs for top commit:
  MarcoFalke:
    cr ACK 81738d2881253f28b69666ada2a01ebb353f503a

Tree-SHA512: e60443f79a2e38cc78fceeff5c2956d622e8a10730129f9c27c14aef59bc6fa0894b8011e6191530443bf3165f78da978bc08ad04248ddb65e2da373264afa6a
2024-03-25 11:21:49 -05:00
MarcoFalke
51630d2e5e
Merge bitcoin/bitcoin#22824: refactor: remove RecursiveMutex cs_nBlockSequenceId
0bd882b7405414b5355e69a9fdcd7a533e504b6b refactor: remove RecursiveMutex cs_nBlockSequenceId (Sebastian Falbesoner)

Pull request description:

  The RecursiveMutex `cs_nBlockSequenceId` is only used at one place in `CChainState::ReceivedBlockTransactions()` to atomically read-and-increment the nBlockSequenceId member:

  83daf47898/src/validation.cpp (L2973-L2976)

  ~~For this simple use-case, we can make the member `std::atomic` instead to achieve the same result (see https://en.cppreference.com/w/cpp/atomic/atomic/operator_arith).~~

  ~~This is related to #19303. As suggested in the issue, I first planned to change the `RecursiveMutex` to `Mutex` (still possible if the change doesn't get Concept ACKs), but using a Mutex for this simple operation seems to be overkill. Note that at the time when this mutex was introduced (PR #3370, commit 75f51f2a63) `std::atomic` were not used in the codebase yet -- according to `git log -S std::atomic` they have first appeared in 2016 (commit 7e908c7b82), probably also because the compilers didn't support them properly earlier.~~

  At this point, the cs_main lock is set, hence we can use a plain int for the member and mark it as guarded by cs_main.

ACKs for top commit:
  Zero-1729:
    ACK 0bd882b
  promag:
    Code review ACK 0bd882b7405414b5355e69a9fdcd7a533e504b6b.
  hebasto:
    ACK 0bd882b7405414b5355e69a9fdcd7a533e504b6b

Tree-SHA512: 435271ac8f877074099ddb31436665b500e555f7cab899e5c8414af299b154d1249996be500e8fdeff64e4639bcaf7386e12510b738ec6f20e415e7e35afaea9
2024-03-25 11:21:49 -05:00
Samuel Dobson
a9b1575fe8
Merge bitcoin/bitcoin#22781: wallet: fix the behavior of IsHDEnabled, return false in case of a blank hd wallet.
8733a8e84c4b2e484f6ed6159fcf5f29a360d42e the result of CWallet::IsHDEnabled() was initialized with true. (Saibato)

Pull request description:

  the result of CWallet::IsHDEnabled() was initialized with true.

  But in case of no keys or a blank hd wallet the iterator would be skipped
  and not set to false but true, since the loop would be not entered.

  That had resulted in a wrong return and subsequent false HD and watch-only
  icon display in GUi when reloading a wallet after closing.

ACKs for top commit:
  achow101:
    ACK 8733a8e84c4b2e484f6ed6159fcf5f29a360d42e
  hebasto:
    ACK 8733a8e84c4b2e484f6ed6159fcf5f29a360d42e
  theStack:
    utACK 8733a8e84c4b2e484f6ed6159fcf5f29a360d42e
  meshcollider:
    utACK 8733a8e84c4b2e484f6ed6159fcf5f29a360d42e

Tree-SHA512: 79b976594f7174d05c29fe3819037ead59aaef27498d95415ceba74d633a8e035f6b03b521000ac3370684a8cb09319d8be1a443ce2d29b3ff4089e399f6b719
2024-03-25 11:21:49 -05:00
MarcoFalke
0505229c89
Merge bitcoin/bitcoin#22327: cli: Avoid truncating -rpcwaittimeout
fa34cb80248cc39a73fc393f65c3cfc62e849556 cli: Avoid truncating -rpcwaittimeout (MarcoFalke)

Pull request description:

  `seconds` is not enough precision to "exactly" store a timestamp n seconds into the future. Improve the precision by using `microseconds`. Fixes #22325

  Also, use chrono literals.

ACKs for top commit:
  jonatack:
    ACK fa34cb80248cc39a73fc393f65c3cfc62e849556 review, debug-built, tested
  theStack:
    Tested ACK fa34cb80248cc39a73fc393f65c3cfc62e849556

Tree-SHA512: 7158da8545f9998a82bcc8636e04564efdb1e1be43b4288298c151b4df29ad47a2760259eefadd4a01db92ea18a1e017f3febc1cd8c69a4b28c86180229d8c90
2024-03-25 11:21:49 -05:00
W. J. van der Laan
1dc97c7679
Merge bitcoin/bitcoin#22149: test: Add temporary logging to debug #20975
faa94961d6e38392ba068381726ed4e033367b03 test: Add temporary logging to debug #20975 (MarcoFalke)

Pull request description:

  to be reverted after a fix

ACKs for top commit:
  laanwj:
    Code review ACK faa94961d6

Tree-SHA512: 1f3103fcf4cad0af54e26c4d257bd824b128b5f2d2b81c302e861a829fd55d6a099fa476b79b30a71fe98975ae604b9e3ff31fd48a51d442389a9bd515e60ba0
2024-03-25 11:21:48 -05:00
fanquake
44f91cbc9a
Merge #21597: test: Document race:validation_chainstatemanager_tests suppression
fab19871bad1cbe15ec2193f01152eacbf14aeb1 test: Document race:validation_chainstatemanager_tests suppression (MarcoFalke)

Pull request description:

ACKs for top commit:
  jamesob:
    ACK fab19871ba
  practicalswift:
    ACK fab19871bad1cbe15ec2193f01152eacbf14aeb1

Tree-SHA512: 3f1838b4cf11eba768ce06826cd4b57c9065669b61a5530af44216fc96535ebf37124b47a8de8f72aedf32345157a72d2208cd63214481a9cb56c063f05db5dd
2024-03-25 11:21:48 -05:00
pasta
9201529b8e
Merge #5955: refactor: simply RecursiveMutex -> Mutex
a09e260c15 refacotor: simply RecursiveMutex -> Mutex (pasta)

Pull request description:

  ## What was done?
  This PR is a simpler version of https://github.com/dashpay/dash/pull/5954; it is simply a recursiveMutex -> Mutex PR; as I think some of the scope minimization in the other PR introduced test failures (appears there are undocumented mutex dependancies)

  ## How Has This Been Tested?
  CI TBD

  ## Breaking Changes
  None

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

Tree-SHA512: 4ef5aa94ecb1a55f30b642d5e0328e2d2a0adcf2ccc2ab6489a576a420c915339be023828785c3243f019bb73ac2cd77be7dd4397e14ec874cba68999a9e54dc
2024-03-25 11:06:07 -05:00
Kittywhiskers Van Gogh
0d9046586b
merge bitcoin#21254: Avoid connecting to real network when running tests 2024-03-25 11:55:07 +00:00
Kittywhiskers Van Gogh
2f672bdb3a
merge bitcoin#20721: Move ping data to net_processing 2024-03-25 11:55:07 +00:00
Kittywhiskers Van Gogh
0d46acbfef
merge bitcoin#21165: Use mocktime in test_seed_peers 2024-03-25 11:55:07 +00:00
Kittywhiskers Van Gogh
8f40769385
merge bitcoin#19884: No delay in adding fixed seeds if -dnsseed=0 and peers.dat is empty 2024-03-25 11:55:06 +00:00
Kittywhiskers Van Gogh
446076d094
test: add missing dnsseed=0 in configuration
line added in fa31dc1bf4 (diff-e20e1f68486e5c096fdc11bca1cda063aacef524411f011d9c3497eb650c5eafR301)
2024-03-25 11:55:06 +00:00
Kittywhiskers Van Gogh
081d8db4d5
mempool: remove stray boost::optional usage 2024-03-25 11:55:06 +00:00
Kittywhiskers Van Gogh
bcd383c2d6
merge bitcoin#20724: Cleanup of -debug=net log messages 2024-03-25 11:55:05 +00:00
Kittywhiskers Van Gogh
8c63868d9b
merge bitcoin#19972: Add fuzzing harness for node eviction logic 2024-03-25 11:55:05 +00:00
Kittywhiskers Van Gogh
18f2dc0865
partial bitcoin#19829: Move block inventory state to net_processing 2024-03-25 11:55:05 +00:00
Kittywhiskers Van Gogh
ec77bd3ab4
net: move nLast{Block,TX}Time to match upstream location
Makes resolving merge conflicts easier
2024-03-25 11:55:05 +00:00
Kittywhiskers Van Gogh
f635e4a95f
merge bitcoin#20624: Remove nStartingHeight check from block relay 2024-03-25 11:55:04 +00:00
Kittywhiskers Van Gogh
9f1a3e5f18
merge bitcoin#20477: Add unit testing of node eviction logic 2024-03-25 11:55:04 +00:00
Kittywhiskers Van Gogh
2d838a627c
merge bitcoin#20146: Send post-verack handshake messages at most once 2024-03-25 11:55:04 +00:00
pasta
a09e260c15
refacotor: simply RecursiveMutex -> Mutex 2024-03-24 23:14:21 -05:00
Konstantin Akimov
adc0e4b382
fix: apply changes for .clang-format to make it matched with our code style
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-Authored-By: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2024-03-25 02:53:22 +07:00
Alessandro Rezzi
8b6c96d208 refactor: a new constant with Tx Version 2024-03-24 09:21:45 +01:00
Alessandro Rezzi
9d429f4005 refactor: drop functions from struct which supposed to be simple as possible 2024-03-24 09:21:45 +01:00
Alessandro Rezzi
b2bb097197 refactor: simplify vExtra using in wallet and add const 2024-03-24 09:21:45 +01:00
Alessandro Rezzi
d9f0e93498 refactor: use CTransaction for immutable tx in evo_assetlocks_tests 2024-03-24 09:21:45 +01:00
Alessandro Rezzi
ca0fe8c208 refactor: introduce HasExtraPayloadField() 2024-03-24 09:21:45 +01:00
Alessandro Rezzi
72d2008901 refactor: introduce IsSpecialTxVersion()
Instead of hardcoding the tx version
2024-03-24 09:21:36 +01:00
pasta
815e4f8026
masternode: protect m_{error,state} with cs 2024-03-24 07:52:07 +00:00
Kittywhiskers Van Gogh
136e445abc
refactor: pass CActiveMasternodeManager as pointer arg to LLMQContext 2024-03-24 07:37:31 +00:00
Kittywhiskers Van Gogh
5e0f77747a
refactor: pass CActiveMasternodeManager as pointer arg to CJContext
We could use std::optional<std::reference_wrapper<const CActiveMasternodeManager>>
but then we'd also have to contend with accessing the value with mn_activeman.
value().get().

We assert m_mn_activeman is present instead of fast-failing when it isn't
because of the fMasternodeMode fast-fail check. If we are in masternode
mode, m_mn_activeman should point to a valid target. If it doesn't,
something's gone wrong.
2024-03-24 07:37:31 +00:00
Kittywhiskers Van Gogh
f171c24a29
refactor: add CActiveMasternodeManager NodeContext alias, use in RPC 2024-03-24 07:37:31 +00:00
Kittywhiskers Van Gogh
44beb941cb
refactor: prefix member variable names with m_ 2024-03-24 07:37:30 +00:00
Kittywhiskers Van Gogh
73cef4f5f9
refactor: make bls{Pub}KeyOperator member variables instead of pointers
Using unique_ptr is a relic of activeMasternodeInfo, as it was accessible
independent of CActiveMasternodeManager. As it is now only accessible
if CActiveMasternodeManager is initialized, we can make it part of its
constructor and make them const.

Removes the assertion and sanity checks to see if key pair is valid.
2024-03-24 07:37:30 +00:00
Kittywhiskers Van Gogh
fbc783635a
refactor: make m_info private, get const refs (or copies) from Get*() functions
External logic should not be able to mutate the CActiveMasternodeManager
state (i.e. CActiveMasternodeInfo). Access is brokered through getter
functions.
2024-03-24 07:37:29 +00:00
Kittywhiskers Van Gogh
1b516ce4ed
refactor: use signing helper function instead of passing blsKeyOperator 2024-03-24 07:20:58 +00:00
Kittywhiskers Van Gogh
33702aca39
refactor: add helper function to decrypt messages with blsKeyOperator 2024-03-24 07:20:58 +00:00
Kittywhiskers Van Gogh
3eb931b596
refactor: add helper function to sign messages with blsKeyOperator
Avoid passing around the operator secret key if we can help it. Ask
CActiveMasternodeManager to perform the operation for you instead.
2024-03-24 07:20:58 +00:00
Kittywhiskers Van Gogh
3827355cce
refactor: move key initialization to InitKeys, define destructor 2024-03-24 07:20:57 +00:00
Kittywhiskers Van Gogh
e5295dec1f
refactor: move activeMasternodeInfo{Cs} into CActiveMasternodeManager 2024-03-24 07:20:57 +00:00
Kittywhiskers Van Gogh
b8c1f010e7
refactor: avoid accessing active masternode info if not in masternode mode
A later commit will be moving activeMasternodeInfo into activeMasternodeManager
and that is only conditionally initialized if the node is in masternode
mode, which will render access attempts outside of masternode mode invalid.
We need to adjust behaviour to account for that.
2024-03-24 07:20:41 +00:00
MarcoFalke
c326830f48
Merge bitcoin-core/gui#243: fix issue when disabling the auto-enabled blank wallet checkbox
915e34112b5a4c2ef391d7e3706603bcd6f62a2a qt: fix issue when disabling the auto-enabled blank wallet checkbox (Jarol Rodriguez)

Pull request description:

  As detailed by #151, On `master` a user can create the confusing scenario where you have a disabled `Encrypt Wallet` checkbox and a selected `Disable Private Keys` checkbox after unselecting the auto-enabled `Blank Wallet` checkbox.

  This commit makes it so that when the `Blank Wallet` checkbox is auto-selected after the user selects `Disable Private keys`, unselecting it will also unselect the `Disable Private Keys` checkbox, which in turn re-enables the `Encrypt Wallet` checkbox.

  Below are screenshots comparing the behavior of selecting `Disable Private Keys` then unselecting the `Blank Wallet` between `master` and this `PR`:

  **Master:**
  | Select `Disable Private Keys` | Unselect `Blank Wallet` |
  | ----------------------------- | ------------------------ |
  | ![Screen Shot 2021-03-09 at 7 57 14 PM](https://user-images.githubusercontent.com/23396902/110560141-77405a80-8113-11eb-9285-5acba6241dcf.png) |   ![Screen Shot 2021-03-09 at 7 57 31 PM](https://user-images.githubusercontent.com/23396902/110560159-81faef80-8113-11eb-9b37-086aa39ecb9f.png)    |

  **PR:**
  | Select `Disable Private Keys` | Unselect `Blank Wallet` |
  | ----------------------------- | ------------------------ |
  | ![Screen Shot 2021-03-09 at 7 34 12 PM](https://user-images.githubusercontent.com/23396902/110560379-e3bb5980-8113-11eb-899a-3a4c6a1bc115.png) | ![Screen Shot 2021-03-09 at 7 34 20 PM](https://user-images.githubusercontent.com/23396902/110560412-f170df00-8113-11eb-8bd0-f7fe6fc0d739.png) |

ACKs for top commit:
  hebasto:
    ACK 915e34112b5a4c2ef391d7e3706603bcd6f62a2a
  Talkless:
    ACK 915e34112b5a4c2ef391d7e3706603bcd6f62a2a

Tree-SHA512: ce6ecbc35b94a08cabf0b8a24dbdfc874d82cc8918cc8623dce8172c7fc9c75d63a13b036bae5f7ab2c090f8d020574a542285d1651600813faf5d91e2506a8d
2024-03-23 19:26:50 -05:00
fanquake
267f42fd6a
Merge #21382: build: Clean remnants of QTBUG-34748 fix
173ef8980d921c9c0e46257747ab1165965e3ced build: Small libxcb.mk improvements (Hennadii Stepanov)
5129b36573cb07d8bcbac493506c46e26d7239eb build: Clean remnants of QTBUG-34748 fix (Hennadii Stepanov)

Pull request description:

  Hope, this PR will make [transit](https://github.com/bitcoin/bitcoin/pull/21376) to Qt 5.12.10 neater.

  A fix for [QTBUG-34748](https://bugreports.qt.io/browse/QTBUG-34748) was introduced in #5915 (v0.11.0, Qt 5.2.1).

  [QTBUG-34748](https://bugreports.qt.io/browse/QTBUG-34748) was [fixed](b19b080894) in Qt 5.3.0.

  The separated [`fix-xcb-include-order.patch`](bb44d9e754/depends/patches/qt/fix-xcb-include-order.patch), provided by #5915, was dropped in #12971 while bumping Qt to 5.9.4 (5.9.6). But `libxcb.mk` remained unchanged.

  This PR reverts #5915 for `libxcb.mk` as well.

ACKs for top commit:
  practicalswift:
    cr ACK 173ef8980d921c9c0e46257747ab1165965e3ced: patch looks correct
  fanquake:
    ACK 173ef8980d921c9c0e46257747ab1165965e3ced

Tree-SHA512: 9815a7e532ff4aa08f9623ded8d5708eca1c9c73ac7a2684419a18c125da7627b44ac3191f2e7978946942c8d0580e73b1a93df624986fb2a13791a68ce1e025
2024-03-23 19:26:38 -05:00
pasta
4301ab9dfb
Merge #5773: refactor: resolve a lot of sonarlint and clang-tidy warnings in llmq code
bf57b15496 refactor: remove unneeded variable (pasta)
358ae3283d refactor: add some const (pasta)
4804aad2c9 refactor: a few more structured bindings (pasta)
ee6dc2d6ab refactor: remove some nested code blocks (pasta)
c2ac444abf refactor: create a immediately executed llamda; use some structed bindings inside of ti (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Resolve a lot of sonarlint and clang-tidy warnings. Please see individual commits

  ## What was done?

  ## How Has This Been Tested?
  `make check`

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

Top commit has no ACKs.

Tree-SHA512: 7481aaf5e5fae42fa896a9b770f41d9d3e1fa395569d2f9fffc952ec556737898283c5a4929063975852dd58fa857cd8374e78dd518983550870fd2683ad5f79
2024-03-23 14:37:45 -05:00
pasta
bf57b15496
refactor: remove unneeded variable 2024-03-23 14:37:23 -05:00
pasta
358ae3283d
refactor: add some const 2024-03-23 14:37:23 -05:00
pasta
4804aad2c9
refactor: a few more structured bindings 2024-03-23 14:37:23 -05:00
pasta
ee6dc2d6ab
refactor: remove some nested code blocks 2024-03-23 14:37:22 -05:00
pasta
c2ac444abf
refactor: create a immediately executed llamda; use some structed bindings inside of ti 2024-03-23 14:37:20 -05:00
Konstantin Akimov
0c884f9740
chore: narrow score of clang-diff-format for dash specific files only 2024-03-24 00:41:24 +07:00