Commit Graph

18282 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
eb4f01f931
merge bitcoin#26584: include local ("unreachable") peers in -netinfo table 2024-09-20 12:24:22 +00:00
Kittywhiskers Van Gogh
10dc874136
merge bitcoin#26982: bitcoin#25880 fixups 2024-09-20 12:24:22 +00:00
Kittywhiskers Van Gogh
a36f8f2a1a
merge bitcoin#25880: Make stalling timeout adaptive during IBD
We need to disable mocktime so that the node doesn't resort to direct
fetching. We also need to delay DIP3's activation so that blocks don't
get rejected for not having a valid DIP3-compliant coinbase.
2024-09-20 12:24:22 +00:00
UdjinM6
ad35c1ab2f
apply suggestions 2024-09-18 18:26:22 +03:00
UdjinM6
600dcf3dda
refactor: make clang-format happy 2024-09-18 18:26:22 +03:00
UdjinM6
da9b8e038b
feat: Split quorum contribution db out of evodb 2024-09-18 18:26:19 +03:00
Konstantin Akimov
8286bdf611
fix: assert in signing_shares - amount of members can match with amount of attempts
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2024-09-18 18:57:35 +07:00
Kittywhiskers Van Gogh
3a1743fc7f
trivial: avoid unneeded copy when iterating through mapDenomCount
Caught by Clang 14 with `--enable-werror`
2024-09-18 07:38:49 +00:00
Kittywhiskers Van Gogh
cba650953a
test: simplify pow_test's get_next_work block index construction
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
2024-09-18 07:38:48 +00:00
pasta
d754799580
Merge #6270: fix: remove mn_rr fork usage from functional test of EHF
056d869571 refactor: use testdummy in feature_mnehf functional test, removed useless checks (Konstantin Akimov)
0351469bb5 refactor: removed duplicated meaningless condition from Check mnhftx (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Using mn_rr in feature_mnehf.py is a blocker for burying mn_rr fork.

  ## What was done?
  Removed useless conditions, uses testdummy fork instead mn_rr in ehf functional test.

  ## How Has This Been Tested?
  Run it `test/functional/feature_mnehf.py`

  ## Breaking Changes
  N/A

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

ACKs for top commit:
  UdjinM6:
    utACK 056d869571
  PastaPastaPasta:
    utACK 056d869571

Tree-SHA512: aa016dc21fee3afdb5a4172e757cdd0b92867c23eb5241287f641d3c97d363ab1c46eba06423481ecc7ba05f6c0010b65eadfe77d4a1fd6074706cc6f3a71309
2024-09-16 21:44:08 -05:00
pasta
ca4b9eaad1
Merge #6255: backport: merge bitcoin#24531, #25500, #25814, #25962, #26888, #27264, #27257, #27324, #27374, #27467, #27411, partial bitcoin#25472 (networking backports: part 8)
8320e0ca8e merge bitcoin#27411: Restrict self-advertisements with privacy networks to avoid fingerprinting (Kittywhiskers Van Gogh)
1376289b11 merge bitcoin#27467: skip netgroup diversity follow-up (Kittywhiskers Van Gogh)
a52b3a3bf0 merge bitcoin#27374: skip netgroup diversity of new connections for tor/i2p/cjdns (Kittywhiskers Van Gogh)
ab11e0f998 merge bitcoin#27324: bitcoin#27257 follow-ups (Kittywhiskers Van Gogh)
9023dd25af merge bitcoin#27257: End friendship of CNode, CConnman and ConnmanTestMsg (Kittywhiskers Van Gogh)
3465df2689 merge bitcoin#27264: Improve diversification of new connections (Kittywhiskers Van Gogh)
d3f5b3881b merge bitcoin#26888: simplify the call to vProcessMsg.splice() (Kittywhiskers Van Gogh)
d9e56f3e78 merge bitcoin#25962: Add CNodeOptions and increase constness (Kittywhiskers Van Gogh)
79e67fd96a merge bitcoin#25814: simplify GetLocalAddress() (Kittywhiskers Van Gogh)
6d4945418a partial bitcoin#25472: Increase MS Visual Studio minimum version (Kittywhiskers Van Gogh)
54bb3a438f merge bitcoin#25500: Move inbound eviction logic to its own translation unit (Kittywhiskers Van Gogh)
b50febc0f0 merge bitcoin#24531: Use designated initializers (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependent on https://github.com/dashpay/dash/pull/6254
  * When backporting [bitcoin#27411](https://github.com/bitcoin/bitcoin/pull/27411), the `CNetAddr*` variant of `GetLocal()` was not removed (upstream it was replaced by the `CNode&` variant with additional checks that rely on fields in `CNode`) as `CActiveMasternodeManager` relies on `GetLocal()` to detect a valid external address.
    * While it can also rely on other nodes to determine that, removing code that tests against a well-known public address would increase the number of reported failures esp. if the checks are run _before_ the node has a chance to connect to any peers.

  ## 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:
  UdjinM6:
    utACK 8320e0ca8e
  PastaPastaPasta:
    utACK 8320e0ca8e

Tree-SHA512: 1d02bc33c8d62c392960d4dd044edf3de08515a5e8c8794d95cd95e9654da91b20e7290436cf9c79b0ea8dbd42b27dcc61c8eb17e573902574d7b281b8874584
2024-09-16 12:01:08 -05:00
W. J. van der Laan
78b06a4dd2
Merge bitcoin/bitcoin#23591: refactor: Use underlying type of isminetype for isminefilter
fa2c991ec93bc72d276f0dcd747b3e57c246139b refactor: Use underlying type of isminetype for isminefilter (MarcoFalke)

Pull request description:

  This does not change behavior, but it would be good for code clarity and to avoid `-Wimplicit-int-conversion` compiler warnings to use the an int of the same width for both `isminetype` and `isminefilter`.

ACKs for top commit:
  laanwj:
    Code review ACK fa2c991ec93bc72d276f0dcd747b3e57c246139b
  shaavan:
    crACK fa2c991ec93bc72d276f0dcd747b3e57c246139b
  promag:
    Code review ACK fa2c991ec93bc72d276f0dcd747b3e57c246139b.

Tree-SHA512: b3e255de7c9b1dea272bc8cb9386b339fe701f18580e03e997c270cac6453088ca2032e26e39f536d66cd1b6fda3e96bdbdc6e960879030e635338d0916277e6
2024-09-14 20:23:47 +05:30
Kittywhiskers Van Gogh
8320e0ca8e
merge bitcoin#27411: Restrict self-advertisements with privacy networks to avoid fingerprinting
The old `GetLocal()` has been moved to `masternode/node.cpp` due to its
use in determining a node's external address. We don't want the old
variant to be used otherwise so we'll move it out of `net.{cpp,h}` for
good measure.

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2024-09-13 17:04:45 +00:00
Kittywhiskers Van Gogh
925870d7d0
merge bitcoin#27015: bitcoin#26847 fixups (AddrMan totals) 2024-09-13 16:57:54 +00:00
Kittywhiskers Van Gogh
dacf859218
refactor: make pdsNotificationInterface a unique_ptr, rename 2024-09-13 13:06:22 +00:00
Konstantin Akimov
0351469bb5
refactor: removed duplicated meaningless condition from Check mnhftx 2024-09-13 15:51:58 +07:00
Kittywhiskers Van Gogh
1376289b11
merge bitcoin#27467: skip netgroup diversity follow-up 2024-09-13 08:14:34 +00:00
Kittywhiskers Van Gogh
a52b3a3bf0
merge bitcoin#27374: skip netgroup diversity of new connections for tor/i2p/cjdns 2024-09-13 08:14:33 +00:00
Kittywhiskers Van Gogh
ab11e0f998
merge bitcoin#27324: bitcoin#27257 follow-ups 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
9023dd25af
merge bitcoin#27257: End friendship of CNode, CConnman and ConnmanTestMsg 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
3465df2689
merge bitcoin#27264: Improve diversification of new connections 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
d3f5b3881b
merge bitcoin#26888: simplify the call to vProcessMsg.splice() 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
d9e56f3e78
merge bitcoin#25962: Add CNodeOptions and increase constness 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
79e67fd96a
merge bitcoin#25814: simplify GetLocalAddress() 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
6d4945418a
partial bitcoin#25472: Increase MS Visual Studio minimum version
contains:
- 630c1711 (excl. changes to mempool as they haven't been backported
  yet)
2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
54bb3a438f
merge bitcoin#25500: Move inbound eviction logic to its own translation unit 2024-09-12 14:42:57 +00:00
Kittywhiskers Van Gogh
b50febc0f0
merge bitcoin#24531: Use designated initializers 2024-09-12 14:42:56 +00:00
fanquake
71689fe6dc
(partial) Merge bitcoin/bitcoin#22981: doc: Fix incorrect C++ named args
fac49470ca36ff944a613f4358386bf8e0967427 doc: Fix incorrect C++ named args (MarcoFalke)

Pull request description:

  Incorrect named args are source of bugs, like #22979.

  Fix that by correcting them and adjust the format, so that clang-tidy can check it.

ACKs for top commit:
  fanquake:
    ACK fac49470ca36ff944a613f4358386bf8e0967427 - `run-clang-tidy` works for me now.

Tree-SHA512: 2694e17a1586394baf30bbc479a913e4bad361221e8470b8739caf30aacea736befc73820f3fe56f6207d9f5d969323278d43a647f58c3497e8e44cad79f8934
2024-09-12 18:57:30 +05:30
MarcoFalke
2b71a9b030
Merge bitcoin/bitcoin#23755: rpc: Quote user supplied strings in error messages
fa24a3df8796cbf4eeb35d950a4c848d605e5b22 rpc: Quote user supplied strings in error messages (MarcoFalke)

Pull request description:

  I can't see a downside doing this and this fixes a fuzzing crash

  Background:

  This is a follow-up to commit 926fc2a0d4ff64cf2ff8e1dfa64eca2ebd24e090, which introduced the "starts_with-hack". Maybe an alternative to the hack would be to assign a unique error code to internal bugs? However, I think this can be done in an separate pull request and the changes here make sense even on their own.

ACKs for top commit:
  fanquake:
    ACK fa24a3df8796cbf4eeb35d950a4c848d605e5b22 - to fix the fuzzers.

Tree-SHA512: d998626406a64396a037a6d1fce22fce3dadb7567c2f9638e450ebe8fb8ae77d134e15dd02555326732208f698d77b0028bc62be9ceee9c43282b61fe95fccbd
2024-09-12 18:57:19 +05:30
Hennadii Stepanov
5a441b38de
(partial) Merge bitcoin-core/gui#409: Fix window title of wallet loading window
01bff8f0494ba1c02c087b7186c892785f326fd9 qt: Fix WalletControllerActivity progress dialog title (Shashwat)

Pull request description:

  Throughout the GUI, the title of the window, tells about the purpose of the window. This was not true for the title of wallet loading wallet.
  This PR fixes this issue by renaming the wallet loading window title to 'Open Wallet'

  Changes introduced in this PR (Runned Bitcoin-GUI on signet network)

  |Master|PR|
  |---|---|
  |![Screenshot from 2021-08-24 00-02-18](https://user-images.githubusercontent.com/85434418/130500309-2f0af2c9-55f0-4609-a92b-3156800fa92e.png)|![Screenshot from 2021-09-07 18-19-10](https://user-images.githubusercontent.com/85434418/132351394-1ee4a36c-3ba9-4d1a-a8f3-f17804fb856a.png)|

ACKs for top commit:
  jarolrod:
    ACK 01bff8f
  hebasto:
    ACK 01bff8f0494ba1c02c087b7186c892785f326fd9, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: cd21c40752eb1c0afb5ec61b8a40e900bc3aa05749963f7957ece6024e4957f5bb37e0eb4f95aac488f5e08aea51fe13b023b05d8302a08c88dcc6790410ba64
2024-09-12 18:57:20 +05:30
W. J. van der Laan
49c87e93a6
Merge bitcoin/bitcoin#23142: Return false on corrupt tx rather than asserting
0ab4c3b27265401c59e40adc494041927dc9dbe3 Return false on corrupt tx rather than asserting (Samuel Dobson)

Pull request description:

  Takes up #19793

  Rather than asserting, we log an error and return CORRUPT so that the user is informed. This type of error isn't critical so it isn't worth `assert`ing.

ACKs for top commit:
  achow101:
    ACK 0ab4c3b27265401c59e40adc494041927dc9dbe3
  laanwj:
    Code review ACK 0ab4c3b27265401c59e40adc494041927dc9dbe3
  ryanofsky:
    Code review ACK 0ab4c3b27265401c59e40adc494041927dc9dbe3. There may be room for more improvements later like better error messages or easier recovery options, but changing from an assert to an error seems like a clear improvement, and this seems to avoid all the pitfalls of the last PR that tried this.

Tree-SHA512: 4a1a412e7c473d176c4e09123b85f390a6b0ea195e78d28ebd50b13814b7852f8225a172511a2efb6affb555b11bd4e667c19eb8c78b060c5444b62f0fae5f7a
2024-09-12 18:57:19 +05:30
Kittywhiskers Van Gogh
e544d3c741
fmt: apply clang-format-diff.py suggestions, satisfy linter
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2024-09-12 06:36:44 +00:00
Kittywhiskers Van Gogh
7da74ffcd5
merge bitcoin#28341: Use HashWriter over legacy CHashWriter 2024-09-11 18:34:07 +00:00
Kittywhiskers Van Gogh
7d149c97be
merge bitcoin#27745: select addresses by network follow-up 2024-09-11 18:34:07 +00:00
Kittywhiskers Van Gogh
1d82994383
merge bitcoin#26261: cleanup LookupIntern, Lookup and LookupHost 2024-09-11 18:34:06 +00:00
Kittywhiskers Van Gogh
231ff82c2e
merge bitcoin#27214: Enable selecting addresses by network 2024-09-11 16:18:47 +00:00
Kittywhiskers Van Gogh
e82559516c
merge bitcoin#25619: avoid overriding non-virtual ToString() in CService and use better naming 2024-09-11 16:18:46 +00:00
Kittywhiskers Van Gogh
2e9b48a910
merge bitcoin#26847: track AddrMan totals by network and table, improve precision of adding fixed seeds 2024-09-11 16:18:46 +00:00
Kittywhiskers Van Gogh
79a550ec15
merge bitcoin#26040: comment "add only reachable addresses to addrman" 2024-09-11 16:18:46 +00:00
Kittywhiskers Van Gogh
1adb635ec6
merge bitcoin#25678: skip querying dns seeds if -onlynet disables IPv4 and IPv6 2024-09-11 16:18:46 +00:00
Kittywhiskers Van Gogh
2d99be0aea
partial bitcoin#25331: Add HashWriter without ser-type and ser-version
includes:
- faa5425629d35708326b255570c51139aef0c8c4
2024-09-11 16:18:46 +00:00
pasta
96685be685
Merge #5167: refactor(stats): modernize statsd::StatsdClient, make global unique_ptr
cc998abec1 fmt: apply `clang-format-diff.py` suggestions (Kittywhiskers Van Gogh)
0401c581eb stats: `const`-ify variables and arguments (Kittywhiskers Van Gogh)
9f96723774 stats: stop using error codes, switch over to `bool` (Kittywhiskers Van Gogh)
1a81979c1e stats: initialize socket after we have a valid socket address (Kittywhiskers Van Gogh)
dbbfc8d766 stats: use `Socks` wrapper, use `CService` to generate our `sockaddr` (Kittywhiskers Van Gogh)
2def905044 stats: move init logic into constructor (Kittywhiskers Van Gogh)
4bc727cd6c stats: clean up randomization code, move `FastRandomContext` inward (Kittywhiskers Van Gogh)
840241eefd stats: cleanup error logging, improve code sanity (Kittywhiskers Van Gogh)
85890ddb13 docs: add copyright notice to source file, update notice in header (Kittywhiskers Van Gogh)
a9d1b1494d stats: move `_StatsdClientData` variables into `StatsdClient` (Kittywhiskers Van Gogh)
30c30c1397 stats: fetch all arguments needed when constructing `g_stats_client` (Kittywhiskers Van Gogh)
5133d88415 stats: s/statsClient/g_stats_client/g (Kittywhiskers Van Gogh)
f81951dd00 stats: make `statsClient` a `std::unique_ptr`, denote as global variable (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  Support for transmitting stats to a Statsd server has been courtesy of Statoshi ([repo](https://github.com/jlopp/statoshi)), implemented Dec, 2020 by [dash#2515](https://github.com/dashpay/dash/pull/2515) but since then, it hasn't gotten much attention aside from benefiting from codebase-wide changes and the occasional compiler appeasement. This pull request aims to give our statistics code some TLC.

  Changes include:

  * Limiting initialization to solely during construction and moving the responsibility of fetching arguments outside of `statsd::StatsdClient`.
  * Using the RAII `Socks` wrapper as early as possible (we still need to construct a raw socket ourselves but this is done in the initializer and control is moved to the wrapper and everywhere else, the wrapper is used)
  * Utilizing existing networking code to generate the socket address
    * This lets us trivially allow IPv6 connections as the responsibility to construct it safely is moved to `CService`.
  * Using `std::string` and our string manipulation capabilities (replacing `snprintf` with `strprintf`), replacing platform-specific types (replacing `short` with `uint16_t`).

  ## 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 **(note: N/A)**
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  PastaPastaPasta:
    utACK [cc998ab](cc998abec1)
  UdjinM6:
    utACK cc998abec1

Tree-SHA512: 433c92160d6ac7ebb8582ada3cbb65ead7913618266b773619a528c90dfe0e286aafa46dc3b0bca62f246938e5948a732080e2cddba942d3627f007ca6efcc1f
2024-09-11 11:17:52 -05:00
Kittywhiskers Van Gogh
cc998abec1
fmt: apply clang-format-diff.py suggestions 2024-09-11 15:02:10 +00:00
pasta
6019a8708f
Merge #6260: backport: merge bitcoin#20018, #22141, #22221, #22653, #23054, #23398, #23175, #22362, #23769, #23936, #24238, #24331 (auxiliary backports: part 15)
6c7335e002 merge bitcoin#24331: Revert back `MoveFileExW` call for MinGW-w64 (Kittywhiskers Van Gogh)
15e794bdd8 merge bitcoin#24238: use arc4random on OpenBSD (Kittywhiskers Van Gogh)
e039aecbdc merge bitcoin#23936: Add and use EnsureArgsman helper (Kittywhiskers Van Gogh)
b4bfacfd24 merge bitcoin#23769: Disallow copies of CChain (Kittywhiskers Van Gogh)
5b66688160 merge bitcoin#22362: Drop only invalid entries when reading banlist.json (Kittywhiskers Van Gogh)
109c963f6a merge bitcoin#23175: Add CJDNS network to -addrinfo and -netinfo (Kittywhiskers Van Gogh)
d57c96ea37 merge bitcoin#23398: add return message to savemempool RPC (Kittywhiskers Van Gogh)
22e59fb464 merge bitcoin#23054: Use C++11 member initializer in CTxMemPoolEntry (Kittywhiskers Van Gogh)
d158063b6d merge bitcoin#22653: Rename JoinErrors and re-use it (Kittywhiskers Van Gogh)
e24324d266 merge bitcoin#22221: Pass block reference instead of pointer to PeerManagerImpl::BlockRequested (Kittywhiskers Van Gogh)
68657efc03 merge bitcoin#22141: net processing: Remove hash and fValidatedHeaders from QueuedBlock (Kittywhiskers Van Gogh)
c0e6792e27 merge bitcoin#20018: ProcessAddrFetch(-seednode) is unnecessary if -connect is specified (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * When backporting [bitcoin#23054](https://github.com/bitcoin/bitcoin/pull/23054), `sigOpCount` and `nSigOpCountWithAncestors` were switched from `unsigned int` to `int64_t`. This change was done to prevent integer narrowing when accepting the `int64_t` taken from the constructor.

    This isn't a problem upstream as the same changes were as part of [bitcoin#8149](https://github.com/bitcoin/bitcoin/pull/8149/files#diff-8a2230436880b65a205db9299ab2e4e4adb1d4069146791b5db566f3fb752adaL90-L107), which was omitted but the type changes remain valid as sigop count cannot be a negative number.

  ## 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:
  PastaPastaPasta:
    utACK 6c7335e002
  UdjinM6:
    utACK 6c7335e002

Tree-SHA512: 29cae42dd82235305d3558562bae346170e742ce0b65897e396b331294b39cad0dd831fa9a09b34780a67844e55292e5b4e784cf544a894cc3f8897afe617ca1
2024-09-11 09:53:26 -05:00
Kittywhiskers Van Gogh
0401c581eb
stats: const-ify variables and arguments
We cannot convert `DEFAULT_STATSD*` to `std::string_view`s as they're
being used as default arguments and `GetArgs` expects `std::string`s
2024-09-11 14:37:58 +00:00
Kittywhiskers Van Gogh
9f96723774
stats: stop using error codes, switch over to bool 2024-09-11 14:34:53 +00:00
Kittywhiskers Van Gogh
1a81979c1e
stats: initialize socket after we have a valid socket address
As creating the socket is now the last step, we don't need
`m_init` anymore. We can just see if a socket is successfully
constructed and take that as our validity indicator.

We'll also move it out of the inner `send` function so we can bail out
before we bother with all the string processing and manipulation.
2024-09-11 14:34:20 +00:00
Kittywhiskers Van Gogh
dbbfc8d766
stats: use Socks wrapper, use CService to generate our sockaddr 2024-09-11 14:34:20 +00:00
Kittywhiskers Van Gogh
2def905044
stats: move init logic into constructor
Also, add log messages to inform us if we're skipping initialization or
it has successfully been initialized.
2024-09-11 14:34:19 +00:00
Kittywhiskers Van Gogh
4bc727cd6c
stats: clean up randomization code, move FastRandomContext inward
We can skip the computationally expensive dice-roll if our sample rate
is zero as that means we should never send it. Also get rid of the
`FastRandomContext::operator()` that isn't used anywhere else in the
codebase.
2024-09-11 14:34:19 +00:00
Kittywhiskers Van Gogh
840241eefd
stats: cleanup error logging, improve code sanity
- Use `uint16_t` instead of `short`, `int64_t` instead of `size_t`
- Get rid of the `errmsg` buffer and use `LogPrintf` to report errors
- Use `strprintf` instead of `snprintf`
- Rephrase networking error logs to allow inclusion of error strings
2024-09-11 14:33:55 +00:00
pasta
4d312b5456
Merge #6252: test: Improve tests robustness
0c5179462e test: rework feature_governance_cl.py (UdjinM6)
11ac0819da feat: bump_mocktime also bumps schedulers now (UdjinM6)
1937f503fe feat: regtest-only: do not auto-reset mnsync after 1h (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  1. The original idea behind forced reset was to help desktop clients which go into sleep/hibernation mode from time to time to sync with no issues once they are online again. For regtest however it doesn't do anything good and only causes issues.
  2. We rely on schedulers a lot, bumping them should let nodes behave more like on a real network.
  3. Forcing mnsync to skip governance votes doesn't always work as we'd expect cause we don't control connection creation. To make it more deterministic create a proposal that should get into one superblock only. This way both the proposal and the trigger will expire/be deleted after another superblock meaning we can be 100% sure the isolated node never gets any of them and can only sync thanks to chainlock.

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

ACKs for top commit:
  knst:
    utACK 0c5179462e

Tree-SHA512: 9a40eeaba880f3f27f86736e92afa19a4ecb2a2d157bc42b65dd9da0d4109c9cd1d83a5abdf1ec16be2f8a8b31821fb700a7f0d2265c094fd4fdff7f18bc6ec7
2024-09-11 08:19:02 -05:00
UdjinM6
a6bbaacfaa
fix: GetHeadersLimit is used for getheaders(2) and headers(2), refactor it to accept compressed instead of msg_type 2024-09-10 12:57:55 -05:00
MarcoFalke
3c51f3ab1e
Merge bitcoin/bitcoin#23064: fuzz: Fix memory leak in system fuzz target
aaaa37abbab69fe1fdc2d332bbaf6ecce0c5cc00 fuzz: Fix memory leak in system fuzz target (MarcoFalke)

Pull request description:

  Might fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36906

  To test:

  ```
  $ FUZZ=system valgrind --tool=massif ./src/test/fuzz/fuzz ../btc_qa_assets/fuzz_seed_corpus/system/
  ^C
  $ massif-visualizer ./massif.out.952024
  ```

ACKs for top commit:
  practicalswift:
    cr ACK aaaa37abbab69fe1fdc2d332bbaf6ecce0c5cc00

Tree-SHA512: 6aa47ea12ec76133ae326ed41c31414d7a418abe1f28b05f698e9bb5439bbe26b814c4827999b15b77b47608dbc71c9b35789d0b84e25f56928381d06d6460e5
2024-09-10 21:06:38 +05:30
pasta
07876b2c4a
use MAX_HEADERS_UNCOMPRESSED_RESULT not MAX_HEADERS_UNCOMPRESSED_RESULTS ; use MAX_HEADERS_UNCOMPRESSED_RESULT in RPC to avoid breaking changes 2024-09-10 10:25:05 -05:00
pasta
b137280df4
change to _COMPRESSED or _UNCOMPRESSED 2024-09-10 10:25:05 -05:00
UdjinM6
303bc7af99
fix: increase it for headers2 only 2024-09-10 10:25:03 -05:00
Kittywhiskers Van Gogh
e23410ffdd
trivial: rename MAX_HEADERS_RESULTS_NEW to MAX_HEADERS_RESULTS
We can reduce the diff by keeping the name `MAX_HEADERS_RESULTS` for
`MAX_HEADERS_RESULTS_NEW` as `MAX_HEADERS_RESULTS_OLD` is only
referenced once (in `GetHeadersLimit()`)
2024-09-10 10:23:54 -05:00
Kittywhiskers Van Gogh
bcf0320691
trivial: move the headers limit determination to GetHeadersLimit() 2024-09-10 10:23:53 -05:00
pasta
993c7c0f90
feat: increase the number of block headers able to be downloaded at once to 8000 in protocol version 70234 2024-09-10 10:23:36 -05:00
pasta
1464e69058
Merge #6148: feat: broadcast dsq messages using the inventory system
57fb0874ef feat: broadcast dsq messages using the inventory system (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  DSQ messages are 142 bytes.

  Previously, assuming a relatively highly connected masternode hosting 100 connection, each round of coinjoin will result in 14.2KB (100*142) of inbound and outbound traffic each.

  ## What was done?
  Now, using the inventory system, a message will first use 36 bytes per peer (sending and receiving), plus the size of a `getdata` message and the actual message itself. As a result, bandwidth usage for 1 round of mixing would be closer to 36 * 100 + 142 (dsq) + 36 (getdata) = ~3.8KB, a reduction of around ~73%

  ## How Has This Been Tested?
  Has not been; @UdjinM6 especially please review well :)

  ## Breaking Changes
  Does introduce a new protocol version, but in a backwards compatible way. I don't think this would need to be delayed to v22 for any reason.

  ## 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: 3dc39a339cba29d8cf207cec76ecace5ad0e11d1892ca0f65f9253a2b1d90313da21c6c178c2476756c5566ece0fab777006cd609b7984df906a9206c25d921d
2024-09-10 10:20:59 -05:00
pasta
57fb0874ef
feat: broadcast dsq messages using the inventory system
DSQ messages are 142 bytes.

Previously, assuming a relatively highly connected masternode hosting 100 connection, each round of coinjoin will result in 14.2KB (100*142) of inbound and outbound traffic each.

Now, using the inventory system, a message will first use 36 bytes per peer (sending and receiving), plus the size of a `getdata` message and the actual message itself. As a result, bandwidth usage for 1 round of mixing would be closer to 36 * 100 + 142 (dsq) + 36 (getdata) = ~3.8KB, a reduction of around ~73%
2024-09-10 09:23:22 -05:00
UdjinM6
1937f503fe
feat: regtest-only: do not auto-reset mnsync after 1h 2024-09-10 17:05:11 +03:00
pasta
6d426515a5
Merge #6225: feat: bury v20 fork - fire up test chains by first block - 4/n
23812555b1 fix: possible deadlock during calculation of signals for historical blocks during re-index (Konstantin Akimov)
1087489fd4 feat: bury v20 deployment (Konstantin Akimov)
64cedb30bd feat: actually test something EHF unit tests (Konstantin Akimov)
762a808b8c chore: drop irrelevant bip9 code from feature_llmq_rotation.py (Konstantin Akimov)
7735631aad fix: remove v20 from test feature_llmq_evo as far as mn_rr used (Konstantin Akimov)
ca83b26815 fix: crash in CreditPool: it meant to check that DIP0003 is activated (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  V20 is activated on mainnet: time to bury it!

  https://github.com/dashpay/dash/issues/6186

  ## What was done?
  Hard-fork v20 is buried and it requires to implement multiple fixes, simplifications, refactoring:
   - some tests for EHF moved from functional tests to unit tests
   - fixed crash in Credit Pool if DIP3 is not activated yet
   - added a requirement for v20 activation for `CMNHFManager::GetSignalsStage`
   - removed useless code from functional test feature_llmq_rotation
   - renamed variables "v20" to "mn_rr" in feature_llmq_evo.py so far as actually used fork is mn_rr

  ## How Has This Been Tested?
  Some unit and functional tests to succeed.

  Done reindex  (just in case):

      src/qt/dash-qt -reindex  -assumevalid=0
      src/qt/dash-qt -reindex  -assumevalid=0 -testnet

  ## Breaking Changes
  N/A

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

ACKs for top commit:
  UdjinM6:
    ACK 23812555b1
  PastaPastaPasta:
    utACK 23812555b1

Tree-SHA512: eec35745baa695f3f286d39b6a61fa0a9f34820b13d1dd4cfbd1efe707850283892c39bf7fe49c49c812e0c02465d64df11480b3f12aa7f21b59a71eeae7260e
2024-09-10 08:50:23 -05:00
Kittywhiskers Van Gogh
6c7335e002
merge bitcoin#24331: Revert back MoveFileExW call for MinGW-w64 2024-09-08 16:29:03 +00:00
Kittywhiskers Van Gogh
15e794bdd8
merge bitcoin#24238: use arc4random on OpenBSD 2024-09-08 16:24:37 +00:00
Kittywhiskers Van Gogh
e039aecbdc
merge bitcoin#23936: Add and use EnsureArgsman helper 2024-09-08 16:24:37 +00:00
Kittywhiskers Van Gogh
b4bfacfd24
merge bitcoin#23769: Disallow copies of CChain 2024-09-08 16:24:36 +00:00
Kittywhiskers Van Gogh
5b66688160
merge bitcoin#22362: Drop only invalid entries when reading banlist.json 2024-09-08 16:24:36 +00:00
Kittywhiskers Van Gogh
109c963f6a
merge bitcoin#23175: Add CJDNS network to -addrinfo and -netinfo 2024-09-08 16:24:36 +00:00
Kittywhiskers Van Gogh
d57c96ea37
merge bitcoin#23398: add return message to savemempool RPC 2024-09-08 16:24:36 +00:00
Kittywhiskers Van Gogh
22e59fb464
merge bitcoin#23054: Use C++11 member initializer in CTxMemPoolEntry 2024-09-08 16:24:36 +00:00
Kittywhiskers Van Gogh
d158063b6d
merge bitcoin#22653: Rename JoinErrors and re-use it 2024-09-08 15:35:22 +00:00
Kittywhiskers Van Gogh
e24324d266
merge bitcoin#22221: Pass block reference instead of pointer to PeerManagerImpl::BlockRequested 2024-09-08 15:35:22 +00:00
Kittywhiskers Van Gogh
68657efc03
merge bitcoin#22141: net processing: Remove hash and fValidatedHeaders from QueuedBlock 2024-09-08 15:35:21 +00:00
Kittywhiskers Van Gogh
c0e6792e27
merge bitcoin#20018: ProcessAddrFetch(-seednode) is unnecessary if -connect is specified 2024-09-08 15:35:20 +00:00
Kittywhiskers Van Gogh
85890ddb13
docs: add copyright notice to source file, update notice in header 2024-09-06 19:08:19 +00:00
Kittywhiskers Van Gogh
a9d1b1494d
stats: move _StatsdClientData variables into StatsdClient
There doesn't seem to be a benefit to keeping these values in a separate
struct.
2024-09-06 19:08:19 +00:00
Kittywhiskers Van Gogh
30c30c1397
stats: fetch all arguments needed when constructing g_stats_client
There's little sense in passing a ref to `ArgsManager` just to set a few
values because we'll be `const`-ing them in an upcoming commit.
Arguments supplied are expected to last the lifetime of the program's
instance and there's little reason to keep re-fetching those values.
2024-09-06 19:08:19 +00:00
Kittywhiskers Van Gogh
5133d88415
stats: s/statsClient/g_stats_client/g 2024-09-06 19:08:19 +00:00
Kittywhiskers Van Gogh
f81951dd00
stats: make statsClient a std::unique_ptr, denote as global variable
This step is needed so we can simplify construction in an upcoming
commit
2024-09-06 19:08:19 +00:00
pasta
f222f798ab
Merge #6155: fix: avoid voting for the same trigger multiple times
e92aad7cff test: make sure MNs don't vote twice even when they are allowed to (UdjinM6)
3d75390e4e fix: correct conditions for YES voting (UdjinM6)
ec1392c6de chore: make clang-format and linter happy (UdjinM6)
a6320865c4 fix: avoid voting for the same trigger multiple times (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We just had a sb voting period and I noticed that the network is way too spammy and produces too many votes (10x+ the expected numbers). It turns out that relying on `ProcessVoteAndRelay` on mainnet is not enough because rate-check expires too soon and MNs are able to vote again and again. On testnet it was never an issue because the voting period there is really short.

  ## What was done?
  Check known votes to make sure we never voted earlier.

  ## How Has This Been Tested?
  Run tests, run a MN on mainnet and check logs.

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

ACKs for top commit:
  PastaPastaPasta:
    utACK e92aad7cff

Tree-SHA512: 142e23d3a19fa9527fa5257eb790e558d3507a7a857f17c6e02fd58eeb5643fcfb48d824d227e0ea7cd3dae6a6d7d871b3af88b13077f5af074ed1911e42bb28
2024-09-05 12:49:44 -05:00
pasta
93e62f3e78
Merge #6232: backport: merge bitcoin#22006, #22955, #23375, #23302, #22902, #23724, #26944, #23907, #24358, #25360, #25794, #26945, #27458, #28110 (userspace static defined tracing)
0a7a234bd3 merge bitcoin#28110: correct Fedora systemtap dep (Kittywhiskers Van Gogh)
c92eb67c40 merge bitcoin#27458: Detect USDT the same way how it is used in the code (Kittywhiskers Van Gogh)
f4a53ba8ce merge bitcoin#26945: systemtap 4.8 (Kittywhiskers Van Gogh)
88696129f3 merge bitcoin#25794: don't rely on block_connected USDT event order in tests (Kittywhiskers Van Gogh)
457bbd3f8b merge bitcoin#25360: SystemTap 4.7 (RISC-V support) (Kittywhiskers Van Gogh)
f3b219ad0d merge bitcoin#24358: USDT tracepoint interface tests (Kittywhiskers Van Gogh)
5b10a5a2fd merge bitcoin#23907: utxocache tracepoints follow up (Kittywhiskers Van Gogh)
c3d7e3a192 merge bitcoin#26944: fix systemtap download URL (Kittywhiskers Van Gogh)
264e02fcc7 merge bitcoin#23724: add systemtap's sys/sdt.h as depends for GUIX builds with USDT tracepoints (Kittywhiskers Van Gogh)
6cc596b99a merge bitcoin#22902: utxocache tracepoints (Kittywhiskers Van Gogh)
644a47ef9a merge bitcoin#23302: drop GetHash().ToString() argument from the `validation:block_connected` tracepoint (Kittywhiskers Van Gogh)
bfdc9ad364 merge bitcoin#23375: more deterministic coin selection for coinbase UTXOs (oldest first) (Kittywhiskers Van Gogh)
5718716cd2 merge bitcoin#22955: Rename fBlocksOnly, Add test (Kittywhiskers Van Gogh)
cacc31213b merge bitcoin#22006: first tracepoints and documentation on User-Space, Statically Defined Tracing (USDT) (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * In [bitcoin#22955](https://github.com/bitcoin/bitcoin/pull/22955), `fBlocksOnly` has not been renamed to `reject_tx_invs` as Dash uses the inventory system beyond relaying transaction data with the block-relay-only blocklist have a greater set of prohibited messages. This renders the new name misleading but coining a new name may be a source of confusion, making retaining the legacy name desirable.

    * Additionally, because the word "transaction" isn't hardcoded into the log message (instead opting to use `CInv::GetCommand()`'s output instead, which for transactions, are "tx"), the expected log message in `p2p_blocksonly.py` has been adjusted accordingly.

  * [bitcoin#24358](https://github.com/bitcoin/bitcoin/pull/24358) depends on [bitcoin#22955](https://github.com/bitcoin/bitcoin/pull/22955) and [bitcoin#23375](https://github.com/bitcoin/bitcoin/pull/23375) in order to work as without the latter backport, `interface_usdt_utxocache.py` will return the following error

    <details>

    <summary>Test run:</summary>

    ```
    debian@debian:~/dash$ sudo ./test/functional/interface_usdt_utxocache.py
    [sudo] password for debian:
    2024-08-26T17:08:05.234000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_n5rb0xy4
    2024-08-26T17:08:07.023000Z TestFramework (INFO): testing the utxocache:uncache tracepoint API
    2024-08-26T17:08:07.026000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/home/debian/dash/test/functional/test_framework/test_framework.py", line 160, in main
        self.run_test()
      File "/home/debian/dash/./test/functional/interface_usdt_utxocache.py", line 149, in run_test
        self.test_uncache()
      File "/home/debian/dash/./test/functional/interface_usdt_utxocache.py", line 172, in test_uncache
        invalid_tx = self.wallet.create_self_transfer(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/debian/dash/test/functional/test_framework/wallet.py", line 166, in create_self_transfer
        assert_equal(mempool_valid, tx_info['allowed'])
      File "/home/debian/dash/test/functional/test_framework/util.py", line 51, in assert_equal
        raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
    AssertionError: not(True == False)
    2024-08-26T17:08:07.533000Z TestFramework (INFO): Stopping nodes
    2024-08-26T17:08:08.535000Z TestFramework (WARNING): Not cleaning up dir /tmp/dash_func_test_n5rb0xy4
    2024-08-26T17:08:08.535000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/dash_func_test_n5rb0xy4/test_framework.log
    2024-08-26T17:08:08.535000Z TestFramework (ERROR):
    2024-08-26T17:08:08.535000Z TestFramework (ERROR): Hint: Call /home/debian/dash/test/functional/combine_logs.py '/tmp/dash_func_test_n5rb0xy4' to consolidate all logs
    2024-08-26T17:08:08.536000Z TestFramework (ERROR):
    2024-08-26T17:08:08.536000Z 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-26T17:08:08.536000Z TestFramework (ERROR): https://github.com/dashpay/dash/issues
    2024-08-26T17:08:08.536000Z TestFramework (ERROR):
    ```

    </details>

    with the underlying error that has been alluded to in d2c4904

    ```
    {'txid': '44b58b10e69321dacf00724f1893c9ecb50fc1f89ed7c70a6c0b3c08f7dc750f', 'allowed': False, 'reject-reason': 'bad-txns-premature-spend-of-coinbase'}
    ```

  * In [bitcoin#24358](https://github.com/bitcoin/bitcoin/pull/24358), all `interface_usdt_*.py` tests needed minor syntax changes to account for how we invoke certain RPCs. `interface_usdt_utxocache.py` required tweaking with the blocks needed to be eligible for pruning (`450` vs. `350` upstream) and stop the node explicitly to account for the governance validation warning .

    This is important as the placement assumes that `test_flush()` is the last test, should this change, the node may need to be manually started before continuing on with the tests after.

  * Some `TRACE*` entries may not exactly match the backports they come from because the variables or functions they access may have been amended by a backport done _after_ the backport that introduce the trace entry.

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

ACKs for top commit:
  UdjinM6:
    utACK 0a7a234bd3
  PastaPastaPasta:
    utACK [0a7a234](0a7a234bd3)

Tree-SHA512: 8df11392dd8d152c18d55ac70a446d1eec336bdf1a984cbf41c3202c353358180e05ba4b7182ec2962ea09eefa41d1dc3cd383d358f9b3dec57ce8b67c6e6afd
2024-09-05 12:13:17 -05:00
pasta
b38c4d3c1b
Merge #6229: fix: creditOutputs in AssetLock tx json output should be an array of objects, not debug strings
9876c2d78b docs: add partial release notes (UdjinM6)
b330318db7 refactor: drop circular dependency (UdjinM6)
e54fe42ce8 refactor: use `key_to_p2pkh_script` in more places (UdjinM6)
3ed6246889 test: check `creditOutputs` format (UdjinM6)
ba0e64505b fix: `creditOutputs` in AssetLock tx json output should be an array of objects, not debug strings (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Txout-s in `creditOutputs` for AssetLock txes should be shown the way txout-s are shown in other places. We should not be using debug strings there.

  Example: `getrawtransaction 50757f651f335e22c5a810bd05c1e5aac0d95b132f6454e2a72683f88e3983f3 1`

  develop:
  ```
    "assetLockTx": {
      "version": 1,
      "creditOutputs": [
        "CTxOut(nValue=0.01000000, scriptPubKey=76a914cdfca4ae1cf2333056659a2c)"
      ]
    },
  ```
  This PR:
  ```
    "assetLockTx": {
      "version": 1,
      "creditOutputs": [
        {
          "value": 0.01000000,
          "valueSat": 1000000,
          "scriptPubKey": {
            "asm": "OP_DUP OP_HASH160 cdfca4ae1cf2333056659a2c8dc656f36d228402 OP_EQUALVERIFY OP_CHECKSIG",
            "hex": "76a914cdfca4ae1cf2333056659a2c8dc656f36d22840288ac",
            "address": "yf6c2VSpWGXUgmjQSHRpfEcTPsbqN4oL4c",
            "type": "pubkeyhash"
          }
        }
      ]
    },
  ```
  kudos to @coolaj86 for finding the issue

  ## What was done?
  Change `CAssetLockPayload::ToJson()` output to be closer to [`TxToUniv()`](https://github.com/dashpay/dash/blob/develop/src/core_write.cpp#L262-L272)

  NOTE: `refactor: use key_to_p2pkh_script in more places` commit is a bit unrelated but I decided to add it anyway to make it easier to follow assetlock creation vs getrawtransaction rpc check.

  ## How Has This Been Tested?
  Try example above, run tests

  ## Breaking Changes
  RPC output is different for AssetLock txes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 9876c2d78b

Tree-SHA512: 158c98ac9e4979bb29c4f54cb1b71806f22aaec92218d92cd2b2e9b9f74df721563e7a6c5f517ea358ac74659fa79f51d1b683002a1cdceb1b8ee80f8fd79375
2024-09-05 09:38:29 -05:00
Kittywhiskers Van Gogh
5b10a5a2fd
merge bitcoin#23907: utxocache tracepoints follow up 2024-09-04 18:46:14 +00:00
Kittywhiskers Van Gogh
6cc596b99a
merge bitcoin#22902: utxocache tracepoints 2024-09-04 18:46:13 +00:00
Kittywhiskers Van Gogh
644a47ef9a
merge bitcoin#23302: drop GetHash().ToString() argument from the validation:block_connected tracepoint 2024-09-04 18:46:13 +00:00
Kittywhiskers Van Gogh
cacc31213b
merge bitcoin#22006: first tracepoints and documentation on User-Space, Statically Defined Tracing (USDT) 2024-09-04 18:46:13 +00:00
pasta
18625ae559
Merge #6243: backport: merge bitcoin#22226, #22831, #23084, #22872, #23477, #23492, #23713, #23780, #23826, #23373, #24201, #24665, #22910, partial bitcoin#23025 (addrman backports: part 3)
f032119456 merge bitcoin#22910: Encapsulate asmap in NetGroupManager (Kittywhiskers Van Gogh)
8020bfa8c1 merge bitcoin#24665: document clang tidy named args (Kittywhiskers Van Gogh)
40a22e457a merge bitcoin#24201: Avoid InitError when downgrading peers.dat (Kittywhiskers Van Gogh)
cdcaf2278c merge bitcoin#23373: Parse command line arguments from unit and fuzz tests, make addrman consistency check ratio easier to change (Kittywhiskers Van Gogh)
b30f0fa441 test: remove `connman` local from `BasicTestingSetup` (Kittywhiskers Van Gogh)
df43565464 merge bitcoin#23826: Make AddrMan unit tests use public interface, extend coverage (Kittywhiskers Van Gogh)
c14a54089f merge bitcoin#23780: update `addrman_tests.cpp` to use output from `AddrMan::Good()` (Kittywhiskers Van Gogh)
8b2db6bce4 merge bitcoin#23713: refactor addrman_tried_collisions test to directly check for collisions (Kittywhiskers Van Gogh)
5b5dd39f45 merge bitcoin#23492: tidy up addrman unit tests (Kittywhiskers Van Gogh)
aba0ebd400 merge bitcoin#23477: tidy up unit tests (Kittywhiskers Van Gogh)
cdc8321c4d merge bitcoin#22872: improve checkaddrman logging with duration in milliseconds (Kittywhiskers Van Gogh)
8d22fe9945 merge bitcoin#23084: avoid non-determinism in asmap-addrman test (Kittywhiskers Van Gogh)
ba4696718e partial bitcoin#23025: update nanobench add `-min_time` (Kittywhiskers Van Gogh)
c28b05c5ca merge bitcoin#22831: add addpeeraddress "tried", test addrman checks on restart with asmap (Kittywhiskers Van Gogh)
c4fe6085c8 merge bitcoin#22226: add unittest core dump instructions (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * In [bitcoin#22831](https://github.com/bitcoin/bitcoin/pull/22831), when restarting the node in `rpc_net.py`'s `test_addpeeraddress()`, existing commands need to be appended to `extra_args` to ensure they're retained when the node is restarted (default behavior is to overwrite the argument list with `extra_args`) to prevent the test from hanging and then failing due to missing fast DIP3 activation params from the arguments list.

    Missing arguments result in a block database sanity check failure on restart due to `bad-qc-premature` arising from the activation height being higher than the height of a block with a quorum commitment.

  * `NodeContext` was moved from `TestingSetup` to `BasicTestingSetup` in [bitcoin#18571](https://github.com/bitcoin/bitcoin/pull/18571) ([dash#4844](https://github.com/dashpay/dash/pull/4844)) but `connman` as a `BasicTestingSetup` variable still stuck around (despite `NodeContext`'s presence making this unnecessary).

    To prepare for [bitcoin#22910](https://github.com/bitcoin/bitcoin/pull/22910), the remnant variable has been replaced with `m_node.connman` and adjustments have been made to that effect.

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

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

Tree-SHA512: b29c292ecda54cda8301ea804b433f80476a1cdbb72bd48740cc9b2e885a4ff52350e5e42f112426856282bd6d961f0e37f1b23020c52f07238413070bbc504a
2024-09-04 12:44:49 -05:00
Kittywhiskers Van Gogh
76a458e5f9
fmt: apply formatting suggestions from clang-format-diff.py 2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
63962ec475
merge bitcoin#28165: transport abstraction 2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
c6b9186e69
merge bitcoin#25325: Add pool based memory resource 2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
8c986d6b08
partial bitcoin#27981: Fix potential network stalling bug
To allow for the removal of a node from `vReceivableNodes`, the
collection of node pointers have been made into an `std::set`.

Marking as partial as it should be revisited when bitcoin#24356 is
backported.
2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
13f6dc1b27
merge bitcoin#26844: Pass MSG_MORE flag when sending non-final network messages 2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
caaa0fda01
net: use std::deque for vSendMsg instead of std::list
The change was introduced as an optimization in 027a852a (dash#3398) but
prevents the backport of bitcoin#26844 due to the inability to engage in
binary expressions with iterators of `std::list`.
2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
2ecba6ba5f
partial bitcoin#26036: add NetEventsInterface::g_msgproc_mutex
This backport excludes annotations for members introduced in
bitcoin#25717 as it hasn't been backported yet.
2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
f6c943922f
merge bitcoin#24543: Move remaining globals into PeerManagerImpl 2024-09-04 16:29:29 +00:00
Kittywhiskers Van Gogh
dbe41ea141
refactor: move object request logic to PeerManagerImpl
Preparation for backporting bitcoin#24543, which makes `State()` internal
to `PeerManagerImpl`.
2024-09-04 16:29:29 +00:00
Kittywhiskers Van Gogh
112c4e0a16
merge bitcoin#24021: Rename and move PoissonNextSend functions 2024-09-04 16:29:29 +00:00
Kittywhiskers Van Gogh
6d690ede82
merge bitcoin#23970: Remove pointless and confusing shift in RelayAddress 2024-09-04 16:29:29 +00:00