Commit Graph

25465 Commits

Author SHA1 Message Date
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
Konstantin Akimov
4bc0e1f697
chore: intentionally introducing wrong formatting to bip39.cpp to trigger CI 2024-03-24 00:41:23 +07:00
Konstantin Akimov
2c74ad427d
fix: adjust wallet/bip39 accordingly linter comments 2024-03-24 00:41:23 +07:00
Konstantin Akimov
d3faa8522c
refactor: use better masks for list of files; add missing bip39.{h,cpp} 2024-03-24 00:41:23 +07:00
Konstantin Akimov
7788f1db0e
refactor: move list of non backported files o test/util/data/non-backported.txt
This files is refactored out from 'lint-cppcheck-dash' to dedicated file.
It is supposed to be used by clang formatter also in CI
2024-03-24 00:41:22 +07:00
pasta
1af51b2004
Merge #5950: refactor: RecursiveMutex -> Mutex for cs_mnauth
7cc305f1b2 refactor: RecursiveMutex -> Mutex for cs_mnauth (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Avoid using recursive mutexes where a non-recursive one does the job

  ## What was done?
  RecursiveMutex -> Mutex

  ## How Has This Been Tested?
  Built

  ## Breaking Changes
  None

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [x] I have performed a self-review of my own code
  - [ ] 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: 7c624263a1aa7aca61b12598a24fc570beca8a240ef66c5a80c86b410487a1450b3c3f31394d773c5a6041abe244708007a115f29212746d549268d376a267e1
2024-03-23 09:57:05 -05:00
MarcoFalke
1fcc5f1101
Merge #20540: test: Fix wallet_multiwallet issue on windows
fada2dfcac1c4b47ee76b877d91d515cf1d36410 test: Fix wallet_multiwallet issue on windows (MarcoFalke)

Pull request description:

  The error message on windows:

  > 2020-11-30T18:10:47.536032Z ListWalletDir: Error scanning C:\Users\user\AppData\Local\Temp\test_runner_₿_🏃_20201130_181042\wallet_multiwallet_0\node0\regtest\wallets\self_walletdat_symlink: boost::filesystem::status: The name of the file cannot be resolved by the system: "C:\Users\user\AppData\Local\Temp\test_runner_₿_🏃_20201130_181042\wallet_multiwallet_0\node0\regtest\wallets\self_walletdat_symlink\wallet.dat"

ACKs for top commit:
  promag:
    Code review ACK fada2dfcac1c4b47ee76b877d91d515cf1d36410. Although it could ignore (don't log) directories that lead to no permission error.
  fanquake:
    ACK fada2dfcac1c4b47ee76b877d91d515cf1d36410

Tree-SHA512: b475162cc3cd1574209d916605b229a79c8089714295f5e16569b71f958f0007d54dc76833938492d931387784588b11b73e3ef00f963540af42c079417f8d72
2024-03-22 11:20:57 -05:00
MarcoFalke
4afbaf2ea1
Merge #20322: test: Fix intermittent issue in wallet_listsinceblock
444412821e5349ce0e0b039d884583edb70c4399 test: Fix intermittent issue in wallet_listsinceblock (MarcoFalke)

Pull request description:

ACKs for top commit:
  Empact:
    Code Review ACK 444412821e

Tree-SHA512: 86d47b1e3c8681dd479654589c894016ac81a3c96a34c3b4a75278b2af85054ea8c6f768e518a5322a4928d82d5e99105bbce0f4fa6a7a18c40e3e0799f9ab54
2024-03-22 11:20:51 -05:00
pasta
2397209ac8
Merge #5511: backport!: Merge bitcoin#19915, 19469, 19464, 19512, 22495
a266abef75 Merge bitcoin/bitcoin#22495: p2p: refactor: tidy up `PeerManagerImpl::Misbehaving(...)` (MarcoFalke)
d7985aa36a Merge #19512: p2p: banscore updates to gui, tests, release notes (Wladimir J. van der Laan)
b9799de985 Merge #19464: net: remove -banscore configuration option (MarcoFalke)
c0c5d05419 Merge #19469: rpc: deprecate banscore field in getpeerinfo (fanquake)
02faef78c2 Merge #19915: p2p, refactor: Use Mutex type for some mutexes in CNode class (MarcoFalke)

Pull request description:

  bitcoin backports

Top commit has no ACKs.

Tree-SHA512: 7537fd2203e10f3de03e3e2df7f9c7b4fcf05387325635c352a4e9898338e979bfd46626ceee8d267ea48aded4f342bca56ff8020e71dab79f37f4b1bb7cf27c
2024-03-22 11:09:17 -05:00
MarcoFalke
a266abef75
Merge bitcoin/bitcoin#22495: p2p: refactor: tidy up PeerManagerImpl::Misbehaving(...)
8858e88c840197cdcabea07dd1380ef2aa4ece02 p2p: refactor: tidy up `PeerManagerImpl::Misbehaving(...)` (Sebastian Falbesoner)

Pull request description:

  This simple refactoring PR has the goal to improve the readability of the `Misbehaving` method by

  - introducing constant variables `score_before` and  `score_now` (to avoid repeatedly calculating the former)
  - deduplicating calls to LogPrint(), eliminates else-branch

ACKs for top commit:
  jnewbery:
    utACK 8858e88c840197cdcabea07dd1380ef2aa4ece02
  rajarshimaitra:
    tACK 8858e88c84

Tree-SHA512: 1d4dd5ac1d16ee9595edf4fa46e4960915a203641d74e6c33cffaba62ea71328834309a4451256fb45daf759f0cf6f4f199c46815afff6c89c0746e2ad4d4092
2024-03-22 11:08:11 -05:00
Wladimir J. van der Laan
d7985aa36a
Merge #19512: p2p: banscore updates to gui, tests, release notes
fa108d6a757838225179a8df942cfb6d99c98c90 test: update tests for peer discouragement (Jon Atack)
1a9f462caa63fa16d7b4415312d2032a42b3fe0b gui, doc: rm Ban Score in GUI Peers window/release notes updates (Jon Atack)

Pull request description:

  This is the third `-banscore` PR in the mini-series described in #19464. See that PR for the intention and reasoning.

  - no longer display "Ban Score" in the GUI peers window and add a release note, plus release note fixups per https://github.com/bitcoin/bitcoin/pull/19464#pullrequestreview-447452052
  - update tests (`src/test/denialofservice_tests.cpp` and `test/functional/p2p_leak.py`) from banning to discouragement and per https://github.com/bitcoin/bitcoin/pull/19464#issuecomment-658052518

ACKs for top commit:
  jnewbery:
    ACK fa108d6a757838225179a8df942cfb6d99c98c90
  laanwj:
    ACK fa108d6a757838225179a8df942cfb6d99c98c90

Tree-SHA512: 58a449b3f47b8cb5490b34e4442ee8675bfad1ce48af4e4fd5c67715b0c1a596fb8e731d42e576b4c3b64627f76e0a68cbb1da9ea9f588a5932fe119baf40d50
2024-03-22 11:08:11 -05:00
MarcoFalke
b9799de985
Merge #19464: net: remove -banscore configuration option
06059b0c2a6c2db70c87a7715f8a344a13400fa1 net: rename DEFAULT_BANSCORE_THRESHOLD to DISCOURAGEMENT_THRESHOLD (Jon Atack)
1d4024bca8086cceff7539dd8c15e0b7fe1cc5ea net: remove -banscore configuration option (Jon Atack)

Pull request description:

  per https://github.com/bitcoin/bitcoin/pull/19219#issuecomment-652684340, https://github.com/bitcoin/bitcoin/pull/19219#discussion_r443074487 and https://github.com/bitcoin/bitcoin/pull/19219#issuecomment-652699592. Edit: now split into 3 straightforward PRs:
  - net: remove -banscore configuration option (this PR)
  - rpc: deprecate banscore field in getpeerinfo (#19469, *merged*)
  - gui: no longer display banscores (TBA in the gui repo)

ACKs for top commit:
  MarcoFalke:
    review ACK 06059b0c2a6c2db70c87a7715f8a344a13400fa1 📙
  vasild:
    ACK 06059b0c

Tree-SHA512: 03fad249986e0896697033fbb8ba2cbfaae7d7603b1fb2a38b3d41db697630d238623f4d732b9098c82af249ce5a1767dd432b7ca0fec10544e23d24fbd57c50
2024-03-22 11:08:10 -05:00
fanquake
c0c5d05419
Merge #19469: rpc: deprecate banscore field in getpeerinfo
41d55d30579358c805036201664ad6a1c1d48681 doc: getpeerinfo banscore deprecation release note (Jon Atack)
dd54e3796e633cfdf6954af306afd26eadc25116 test: getpeerinfo banscore deprecation test (Jon Atack)
8c7647b3fbbab03ea84071cf3cd2d0d2bf8be255 rpc: deprecate banscore field in rpc getpeerinfo (Jon Atack)

Pull request description:

  Per https://github.com/bitcoin/bitcoin/pull/19219#discussion_r443074487 and https://github.com/bitcoin/bitcoin/pull/19219#issuecomment-652699592, this PR deprecates returning the `banscore` field in the `getpeerinfo` RPC, updates the help, adds a test, and updates the release notes. Related to #19464.

ACKs for top commit:
  fanquake:
    ACK 41d55d30579358c805036201664ad6a1c1d48681

Tree-SHA512: 8eca08332581e2fe191a2aafff6ba89ce39413f0491ed0de8b86577739f0ec430b1a8fbff2914b0f3138a229563dfcc1981c0cf5b7dd6061b5c48680a28423bc
2024-03-22 11:08:10 -05:00