Commit Graph

2895 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
7864c21645
merge bitcoin#24895: Convert lint-includes.sh to Python 2024-11-27 04:58:22 +00:00
Kittywhiskers Van Gogh
f63bafe253
merge bitcoin#24853: Convert lint-git-commit-check.sh to Python 2024-11-27 04:58:22 +00:00
Kittywhiskers Van Gogh
d23b6614e8
merge bitcoin#24844: Convert lint-whitespace.sh to Python 2024-11-27 04:58:22 +00:00
Kittywhiskers Van Gogh
fe165168ba
merge bitcoin#24849: Convert lint-logs.sh to Python 2024-11-27 04:58:22 +00:00
Kittywhiskers Van Gogh
dbfd0b04e1
merge bitcoin#24766: convert spellchecking lint test to python 2024-11-27 04:55:47 +00:00
Kittywhiskers Van Gogh
5c23addddd
merge bitcoin#24778: Convert Python dead code linter test to Python 2024-11-27 04:55:46 +00:00
Kittywhiskers Van Gogh
829dcfb936
partial bitcoin#23462: Enable SC2046 and SC2086 shellcheck rules 2024-11-27 04:55:46 +00:00
Kittywhiskers Van Gogh
df6be0e8c0
partial bitcoin#23212: enable mypy import checking 2024-11-27 04:55:46 +00:00
Kittywhiskers Van Gogh
f77eca9256
fix: make sure that parallelized lint-all runs incl. python scripts 2024-11-27 04:55:46 +00:00
Kittywhiskers Van Gogh
e220175d0f
merge bitcoin#22861: Update test README and lint script 2024-11-27 04:55:46 +00:00
pasta
8a05f0caaa
Merge #6305: backport: Merge bitcoin#24434, 23136
379aefab10 Merge bitcoin/bitcoin#24434: Add missed word to error message (laanwj)
5187ec0b69 Merge bitcoin/bitcoin#23136: test: update fee rate assertion helper in the functional test framework (MarcoFalke)

Pull request description:

  bitcoin backports

ACKs for top commit:
  knst:
    utACK 379aefab10
  PastaPastaPasta:
    utACK 379aefab10

Tree-SHA512: c61e295f9543878fa7a56dcb42cebb740cf1d38ae870f8ec78bbbb0dd643713e6415d6bd14bbdaeba61a2be8eaa8c4648edc76754b6f32cc89845af9ed8ca994
2024-11-26 11:29:51 -06:00
pasta
1155ff2ccf
Merge #6399: backport: merge bitcoin#23235, #23104, #24770, #24830, #24464, #24757, #25202, #25217, #25292, #25614, partial bitcoin#22766 (logging backports)
1621696a6f log: restore `LogPrintLevel` messages from prior backports (Kittywhiskers Van Gogh)
52a1263989 merge bitcoin#25614: Severity-based logging, step 2 (Kittywhiskers Van Gogh)
21470fdeb3 merge bitcoin#25292: Add LogPrintLevel to lint-format-strings, drop LogPrint-vs-LogPrintf section in dev notes (Kittywhiskers Van Gogh)
026409e4ff merge bitcoin#25217: update lint-logs.py to detect LogPrintLevel, mention WalletLogPrintf (Kittywhiskers Van Gogh)
b046e091c9 merge bitcoin#25202: Use severity-based logging for leveldb/libevent messages, reverse LogPrintLevel order (Kittywhiskers Van Gogh)
7697b73257 revert dash#2794: Disable logging of libevent debug messages (Kittywhiskers Van Gogh)
ff6304f5f3 merge bitcoin#24757: add `DEBUG_LOCKCONTENTION` to `--enable-debug` and CI (Kittywhiskers Van Gogh)
88592f30a3 merge bitcoin#24464: Add severity level to logs (Kittywhiskers Van Gogh)
d3e837ad22 merge bitcoin#24830: Allow -proxy="" setting values (Kittywhiskers Van Gogh)
0e01d5b5f3 partial bitcoin#22766: Clarify and disable unused ArgsManager flags (Kittywhiskers Van Gogh)
a9cfbd1048 fix: don't use non-existent `PrintLockContention` in `SharedEnter` (Kittywhiskers Van Gogh)
f331cbe8c8 merge bitcoin#24770: Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive (Kittywhiskers Van Gogh)
d9cc2ea178 merge bitcoin#23104: Avoid breaking single log lines over multiple lines in the log file (Kittywhiskers Van Gogh)
479ae82ecc merge bitcoin#23235: Reduce unnecessary default logging (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * This pull request's primary purpose is to restore `LogPrintLevel`s from backports in [dash#6333](https://github.com/dashpay/dash/pull/6333) that were changed to `LogPrint`s as they were backported before `LogPrintLevel` was backported.
  * ~~`clang-format` suggestions for `LogPrintLevel` have to be ignored in order to prevent the linter from tripping due to a "missing newline" ([build](https://gitlab.com/dashpay/dash/-/jobs/8398818860#L54)).~~ Resolved by applying diff ([source](https://github.com/dashpay/dash/pull/6399#issuecomment-2488992710)).
  * `SharedLock` was introduced in [dash#5961](https://github.com/dashpay/dash/pull/5961) and `PrintLockContention` was removed in [dash#6046](https://github.com/dashpay/dash/pull/6046) but the changes in the latter were not extended to the former. This has been corrected as part of this pull request.

  ## Breaking Changes

  None expected.

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

Top commit has no ACKs.

Tree-SHA512: f2d0ef8ce5cb1091c714a2169e89deb33fa71ff174ce4e6147b3ad421f57a84183d2a9e76736c0b064b2cc70fb3f2e545c42b8562cf36fdce18c3fb61307c364
2024-11-26 11:15:23 -06:00
MarcoFalke
5187ec0b69
Merge bitcoin/bitcoin#23136: test: update fee rate assertion helper in the functional test framework
b658d7d5c5339739dc19bf961d84186469a818d5 test: update assert_fee_amount() in test_framework/util.py (Jon Atack)

Pull request description:

  Follow-up to 42e1b5d979 (#12486).
  - update call to `round()` with our utility function `satoshi_round()` to avoid intermittent test failures
  - rename `fee_per_kB` to `feerate_BTC_kvB` for precision
  - store division result in `feerate_BTC_vB`

  Possibly resolves #19418.

ACKs for top commit:
  meshcollider:
    utACK b658d7d5c5339739dc19bf961d84186469a818d5

Tree-SHA512: f124ded98c913f98782dc047a85a05d3fdf5f0585041fa81129be562138f6261ec1bd9ee2af89729028277e75b591b0a7ad50244016c2b2fa935c6e400523183
2024-11-24 20:31:54 +05:30
Kittywhiskers Van Gogh
52a1263989
merge bitcoin#25614: Severity-based logging, step 2 2024-11-24 08:59:00 +00:00
Kittywhiskers Van Gogh
21470fdeb3
merge bitcoin#25292: Add LogPrintLevel to lint-format-strings, drop LogPrint-vs-LogPrintf section in dev notes 2024-11-24 08:58:59 +00:00
Kittywhiskers Van Gogh
026409e4ff
merge bitcoin#25217: update lint-logs.py to detect LogPrintLevel, mention WalletLogPrintf 2024-11-24 08:58:59 +00:00
Kittywhiskers Van Gogh
d3e837ad22
merge bitcoin#24830: Allow -proxy="" setting values 2024-11-24 08:58:59 +00:00
pasta
f526937790
Merge #6415: refactor: use self.wait_until in all the dash specific "wait_until_x" logic in order to actually apply the timeout scaling settings
3ba602672c refactor: use self.wait_until in all the dash specific "wait_until_x" logic in order to actually apply the timeout scaling settings (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Currently we use the raw helper, but that means that timeout scaling isn't applying.. I think this may be a cause of a lot of the functional test failures that we see in tsan / ubsan.

  ## What was done?

  ## How Has This Been Tested?
  hasn't; wait for CI

  ## Breaking Changes

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

ACKs for top commit:
  knst:
    utACK 3ba602672c
  UdjinM6:
    utACK 3ba602672c

Tree-SHA512: 935498f4b296b1abcac8be686cce396b61b654ef62da46de9a23a0f24ad31254f4938a581a6a4e2533576db0e0120861fd690bd9019e893b30990f21d1e48168
2024-11-22 15:57:01 -06:00
pasta
3ba602672c
refactor: use self.wait_until in all the dash specific "wait_until_x" logic in order to actually apply the timeout scaling settings 2024-11-22 12:34:34 -06:00
Konstantin Akimov
a34caecdff
refactor: replace infinite loop with break to while in forcemninfo 2024-11-22 01:32:27 +07:00
Konstantin Akimov
4ec385d020
refactor: simplify loop of node connection in test_framework 2024-11-22 01:32:27 +07:00
Konstantin Akimov
fa4ba4d169
refactor: moved functions do_connect, remove_masternode closer to theirs usages 2024-11-22 01:32:27 +07:00
pasta
8a14482190
Merge #6407: fix: dataraces
5078baea2b fix(test): wait for chainlock before mining a block we expect to include said chainlock (pasta)
f39c1e6f4c fix: guard m_can_tx_relay behind m_tx_relay_mutex; make it private; add additional annotations (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  See each commit; fixes two bugs, both discovered while running feature_llmq_chainlocks.py with tsan / debug.

  one a datarace in net_processing.cpp and the other in the test I was using to ensure this fix was correct, feature_llmq_chainlocks

  ## What was done?
  ### net_processing.cpp
  You can see the datarace here: https://gist.github.com/PastaPastaPasta/c966a9f805758b34524085e3d52ea7f8

  We simply guard it with an existing mutex that is always locked in close proximity.

  ### feature_llmq_chainlocks.py
  Most of the time, while generating the cycle quorum, there is sufficient time to generate a chainlock; however, this is racey, and I've observed locally where the block gets generated before a chainlock is present and as such `test_coinbase_best_cl` fails. We should instead wait for the chainlock first, and then mine the block. This was we can ensure the mined block will include that chainlock.

  This was observed locally maybe 1/10 times or so

  ## How Has This Been Tested?
  ran feature_llmq_chainlocks.py ~40 times locally with tsan / debug

  ## 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
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  kwvg:
    utACK 5078baea2b
  knst:
    utACK 5078baea2b
  UdjinM6:
    utACK 5078baea2b

Tree-SHA512: b346fc60809df72d0161f625073dce7062bd2641d35e4f80160fac9afeec63707de552e2856940ac2604875908ae3b98a225d352de36bfbfc6ee3fbe1e1538ff
2024-11-20 22:09:02 -06:00
pasta
8a86fd898e
Merge #6416: refactor: drop unused parameter mninfos_valid in test framework mine_ cycle_quorum
0072318421 refactor: drop unused parameter mninfos_valid in test framework mine_cycle_quorum (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This param is unused

  ## What was done?
  Removed

  ## How Has This Been Tested?
  see ci

  ## Breaking Changes

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

ACKs for top commit:
  knst:
    utACK 0072318421
  UdjinM6:
    utACK 0072318421

Tree-SHA512: e66e2b23b95b98e843fdb1d58419ba0798e8ba4115ef6c52e2e4681b04ea3e43efe73cee0ac96758560914567f822d107169ca0d6212210e07cc81b317a3e2eb
2024-11-20 11:34:21 -06:00
Kittywhiskers Van Gogh
f331cbe8c8
merge bitcoin#24770: Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive 2024-11-20 17:26:33 +00:00
pasta
0072318421
refactor: drop unused parameter mninfos_valid in test framework mine_cycle_quorum 2024-11-19 23:10:21 -06:00
Konstantin Akimov
0c0d91e491
fix: functional test feature_llmq_chainlocks.py should activate MN_RR instead v20 2024-11-20 03:20:50 +07:00
Konstantin Akimov
af93e877f2
refactor: removed pre-MN_RR logic of validation of CL
The fork MN_RR is active awhile on testnet and mainnet and no more need legacy check
2024-11-20 03:20:50 +07:00
pasta
5078baea2b
fix(test): wait for chainlock before mining a block we expect to include said chainlock
Most of the time, while generating the cycle quorum, there is sufficient time to generate a chainlock; however, this is racey, and I've observed locally where the block gets generated before a chainlock is present and as such `test_coinbase_best_cl` fails. We should instead wait for the chainlock first, and then mine the block. This was we can ensure the mined block will include that chainlock.

This was observed locally maybe 1/10 times or so
2024-11-19 10:39:22 -06:00
Kittywhiskers Van Gogh
479ae82ecc
merge bitcoin#23235: Reduce unnecessary default logging 2024-11-18 10:45:27 +00:00
MarcoFalke
3383b79049
Merge bitcoin/bitcoin#24312: addrman: Log too low compat value
fa097d074bc1afcc2a52976796bb618f7c6a68b3 addrman: Log too low compat value (MarcoFalke)

Pull request description:

  Before this patch, when writing a negative `lowest_compatible` value, it would be read as a positive value. For example `-32` will be read as `224`. There is generally nothing wrong with that. Though, similarly there shouldn't be anything wrong with refusing to read a negative value. I find the code after this patch more logical than before. Also, this allows dropping a file-wide sanitizer suppression.

  In practice none of this should ever happen. Bitcoin Core would never write a negative `lowest_compatible` in normal operation, unless the file storage is later corrupted by external influence.

ACKs for top commit:
  mzumsande:
    re-ACK fa097d074bc1afcc2a52976796bb618f7c6a68b3

Tree-SHA512: 9aae7b8fe666f52f667f149667025e0160cef1a793cc4d392e36608f65c2bee8096da429235118f40a3368f327aabe30f3732ae78c5874648ea6f423f2687b65
2024-11-17 17:49:40 -06:00
UdjinM6
efc8c99139
refactor: Introduce get_chain_conf_names 2024-11-02 00:19:07 +03:00
UdjinM6
519966efff
refactor: Refactor CCbTx python class to match c++ declaration 2024-11-02 00:19:06 +03:00
pasta
88a8e7a077
Merge #6374: test: optimize feature asset locks test
2d05df04fd refactor: use irange (pasta)
4cc3ee6286 test: update feature_asset_locks.py to reflect changes (pasta)
bfe1d2768d refactor: activate DEPLOYMENT_WITHDRAWALS sooner on regtest (pasta)
c8342e1b55 refactor: pull LimitBlocksToTrace into CChainParams (reduce regtest to 100) (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Minimize number of blocks needed to be mined in asset locks test

  Based on CI test goes from about 270s -> 213s

  ## What was done?
  Reduce number of blocks needed by reducing hard fork activation points

  ## How Has This Been Tested?
  Ran test locally, built

  ## Breaking Changes
  Breaking for regtests, nothing else.

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

ACKs for top commit:
  knst:
    utACK 2d05df04fd
  UdjinM6:
    utACK 2d05df04fd

Tree-SHA512: b52ec2570912ccb578b14baa4ef5c6e69454db7d83e7476c4451bca62b0c57e4c961e4bfafc9e5b0b4eebd6226840ac00505d3787316d7bdaeb64cb66b08fb30
2024-10-29 19:38:46 -05:00
pasta
4cc3ee6286
test: update feature_asset_locks.py to reflect changes
This results in test time locally going from ~4 minutes to ~3 minutes
2024-10-29 12:57:35 -05:00
Konstantin Akimov
2026c59d3c
perf: re-order functional tests to make slowest one to run faster
On CI it is not critical, because there are only 4-8 parallel jobs,
while locally it can be 12-20 or even more
2024-10-30 00:11:53 +07:00
Konstantin Akimov
d35ce1e5d9
fix: uncomment sethdseed to follow-up for #6017 and bitcoin#12560 2024-10-30 00:11:53 +07:00
Konstantin Akimov
71cd68d038
feat: run rpc_quorum.py with only one type of wallet 2024-10-30 00:11:53 +07:00
Konstantin Akimov
80c5481c3e
fix: use unique port for interface_zmq_dash.py - follow-up for bitcoin/bitcoin#26805 2024-10-30 00:11:53 +07:00
Konstantin Akimov
237460c533
fix: initialization of CMerkleBlock() due to misusage of default argument to follow-up bitcoin#30552 2024-10-30 00:11:53 +07:00
pasta
79ced62d6f
Merge #6369: feat: increased withdrawal limits to flat 2000 from v22
e43ca6243a feat: replace assert to error in p2p code of Asset Lock (Konstantin Akimov)
c97f5f5ca5 feat: update some asserts related to CreditPool in consensus code to exceptions (Konstantin Akimov)
877aa08144 feat: generate less blocks in feature_asset_locks.py to make it faster (Konstantin Akimov)
a51ade5cc9 style: apply clang-format (Konstantin Akimov)
ef6190e434 docs: add release notes for withdrawal changes in v22 (Konstantin Akimov)
5b0a2f56cd fix: string in credit pool logs 'previous' is renamed to recently unlocked (Konstantin Akimov)
31ca8a497a feat: update limit of withdrawals to flat 2000 starting from v22 (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Limit 1000 seems a bit small at the moment, while limit 2000 is still safe enough.

  ## What was done?
  Withdrawals limits in pre-v22 are:
   - if credit pool is more than 10k -> limit withdrawals to 1k
   - if credit pool is between 100 dash and 10000 dash -> let to withdraw 10%.
   - if 10% of credit pool is less than 100 dash -> no limits, let to withdraw everything.

  The fork `withdrawals` introduces higher limit:
   - 2000 dash per last 576 blocks. That's all.

  ## How Has This Been Tested?
  Updated functional test `feature_asset_locks.py`

  ## Breaking Changes
  Limits of withdrawals are increased to 2000 dash. It changes consensus rules.

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

Tree-SHA512: 77fc27b6b38105cc311ee5ea78d66edfe854600ad6fb9422c0d302dac436e9aa1dcdc394a36ccb980d42de98091c1596e01be260b3a940df4e6309842fd89065
2024-10-28 12:30:05 -05:00
Konstantin Akimov
877aa08144
feat: generate less blocks in feature_asset_locks.py to make it faster 2024-10-28 21:47:46 +07:00
Konstantin Akimov
31ca8a497a
feat: update limit of withdrawals to flat 2000 starting from v22 2024-10-28 16:08:16 +07:00
Kittywhiskers Van Gogh
38a16a24d7
merge bitcoin#26359: Erlay support signaling follow-ups 2024-10-27 19:38:30 +00:00
Kittywhiskers Van Gogh
b55a6f794b
merge bitcoin#26448: fix intermittent failure in p2p_sendtxrcncl.py 2024-10-27 19:38:30 +00:00
Kittywhiskers Van Gogh
36be978fc9
merge bitcoin#26396: Avoid SetTxRelay for feeler connections
continuation of dash#6365

includes:
- fa24239a (changes to `p2p_sendtxrcncl.py`)
2024-10-27 19:38:30 +00:00
Kittywhiskers Van Gogh
62dc9cb17b
merge bitcoin#26381: Fix intermittent issue in p2p_sendtxrcncl.py 2024-10-27 19:38:30 +00:00
Kittywhiskers Van Gogh
6a7868dba7
merge bitcoin#23443: Erlay support signaling 2024-10-27 19:38:29 +00:00
pasta
25c3355053
Merge #6365: backport: merge bitcoin#22778, #25156, #26497, #27213, #28189, #28155, #28895, partial bitcoin#26396 (networking backports: part 9)
09504bdd1f merge bitcoin#28895: do not make automatic outbound connections to addnode peers (Kittywhiskers Van Gogh)
6cf206ca0e merge bitcoin#28155: improves addnode / m_added_nodes logic (Kittywhiskers Van Gogh)
11d654af19 merge bitcoin#28189: diversify network outbounds release note (Kittywhiskers Van Gogh)
5dc52b3b6f merge bitcoin#27213: Diversify automatic outbound connections with respect to networks (Kittywhiskers Van Gogh)
291305b4d2 merge bitcoin#26497: Make ConsumeNetAddr always produce valid onion addresses (Kittywhiskers Van Gogh)
6a37934af4 partial bitcoin#26396: Avoid SetTxRelay for feeler connections (Kittywhiskers Van Gogh)
221a78ea84 merge bitcoin#25156: Introduce PeerManagerImpl::RejectIncomingTxs (Kittywhiskers Van Gogh)
cc694c2e5b merge bitcoin#22778: Reduce resource usage for inbound block-relay-only connections (Kittywhiskers Van Gogh)
6e6de54e5e net: use `Peer::m_can_relay_tx` when we mean `m_tx_relay != nullptr` (Kittywhiskers Van Gogh)
77526d2129 net: rename `Peer::m_block_relay_only` to `Peer::m_can_tx_relay` (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependency for https://github.com/dashpay/dash/pull/6333
  * When backporting [bitcoin#22778](https://github.com/bitcoin/bitcoin/pull/22778), the `m_tx_inventory_known_filter.insert()` call in  `queueAndMaybePushInv()` had to be moved out as `EXCLUSIVE_LOCKS_REQUIRED` does not seem to work with lambda parameters list (though it does work with capture list, [source](4b5e39290c/src/net_processing.cpp (L5781))), see error below

    <details>

    <summary>Compiler error:</summary>

    ```
    net_processing.cpp:5895:21: note: found near match 'tx_relay->m_tx_inventory_mutex'
    net_processing.cpp:5955:21: error: calling function 'operator()' requires holding mutex 'queueAndMaybePushInv.m_tx_inventory_mutex' exclusively [-Werror,-Wthread-safety-precise]
                        queueAndMaybePushInv(tx_relay, CInv(nInvType, hash));
                        ^
    net_processing.cpp:5955:21: note: found near match 'tx_relay->m_tx_inventory_mutex'
    net_processing.cpp:5977:17: error: calling function 'operator()' requires holding mutex 'queueAndMaybePushInv.m_tx_inventory_mutex' exclusively [-Werror,-Wthread-safety-precise]
                    queueAndMaybePushInv(inv_relay, inv);
                    ^
    ```

    </details>

    * Attempting to remove the `EXCLUSIVE_LOCKS_REQUIRED` or the `AssertLockHeld` are not options due to stricter thread sanitization checks being applied since [dash#6319](https://github.com/dashpay/dash/pull/6319) (and in general, removing annotations being inadvisable regardless)

    * We cannot simply lock `peer->GetInvRelay()->m_tx_inventory_mutex` as a) the caller already has a copy of the relay pointer (which means that `m_tx_relay_mutex` was already held) that b) they used to lock `m_tx_inventory_mutex` (which we were already asserting) so c) we cannot simply re-lock `m_tx_inventory_mutex` as it's already already held, just through a less circuitous path.

      * The reason locking is mentioned instead of asserting is that the compiler treats `peer->GetInvRelay()->m_tx_inventory_mutex` and `tx_relay->m_tx_inventory_mutex` as separate locks (despite being different ways of accessing the same thing) and would complain similarly to the error above if attempting to assert the former while holding the latter.

  * As `m_tx_relay` is always initialized for Dash, to mimic the behaviour _expected_ upstream, in [bitcoin#22778](https://github.com/bitcoin/bitcoin/pull/22778), `SetTxRelay()` will _allow_ `GetTxRelay()` to return `m_can_tx_relay` (while Dash code that demands unconditional access can use `GetInvRelay()` instead) with the lack of `SetTxRelay()` resulting in `GetTxRelay()` feigning the absence of `m_can_tx_relay`.

    This allows us to retain the same style of checks used upstream instead of using proxies like `!CNode::IsBlockOnlyConn()` to determined if we _should_ use `m_tx_relay`.

  * Speaking of proxies, being a block-only connection is now no longer the only reason not to relay transactions

    In preparation for [bitcoin#26396](https://github.com/bitcoin/bitcoin/pull/26396), proxy usage of `!CNode::IsBlockOnlyConn()` and `!Peer::m_block_relay_only` was replaced with the more explicit `Peer::m_can_tx_relay` before being used to gate the result of `GetTxRelay()`, to help it mimic upstream semantics.

  ## Breaking Changes

  None expected

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

Tree-SHA512: f4f36f12f749b697dd4ad5521ed15f862c93ed4492a047759554aa80a3ce00dbd1bdc0242f7a4468f41f25925d5b79c8ab774d8489317437b1983f0a1277eecb
2024-10-27 14:19:30 -05:00
pasta
565f2db930
Merge #6362: backport: trivial 2024 10 25 pr1
b6544791b4 Merge bitcoin/bitcoin#30705: test: Avoid intermittent block download timeout in p2p_ibd_stalling (merge-script)
745a819683 Merge bitcoin/bitcoin#30690: devtools, utxo-snapshot: Fix block height out of range in script (Ava Chow)
01b570e9e2 Merge bitcoin/bitcoin#29999: guix: fix suggested fake date for openssl-1.1.1l (Ava Chow)
432f352719 Merge bitcoin/bitcoin#30580: doc: Add note about distro's `g++-mingw-w64-x86-64-posix` version (merge-script)
1bd090e7fb Merge bitcoin/bitcoin#30597: doc: Drop no longer needed workaround for WSL (merge-script)
8a12237745 Merge bitcoin/bitcoin#30630: doc: Update ccache website link (merge-script)
f66547f84e Merge bitcoin/bitcoin#30588: depends: fix ZMQ CMake getcachesize check (merge-script)
ddaec964c0 Merge bitcoin/bitcoin#30565: depends: Fix `zeromq` build on OpenBSD (merge-script)
e4e5605ef8 Merge bitcoin/bitcoin#30552: test: fix constructor of msg_tx (merge-script)
df3c2392ca Merge bitcoin/bitcoin#26950: cleanse: switch to SecureZeroMemory for Windows cross-compile (merge-script)
57945ce337 Merge bitcoin/bitcoin#30506: depends: Cleanup postprocess commands after switching to CMake (merge-script)
e016ffada1 Merge bitcoin/bitcoin#29878: depends: build expat with CMake (merge-script)
62dcd43b58 Merge bitcoin/bitcoin#29880: depends: build FreeType with CMake (merge-script)
745addf6a7 Merge bitcoin/bitcoin#30245: net: Allow -proxy=[::1] on nodes with IPV6 lo only (Ava Chow)
4e144be0dd Merge bitcoin-core/gui#795: Keep focus on "Hide" while ModalOverlay is visible (Hennadii Stepanov)
69c04b2c48 Merge bitcoin/bitcoin#30372: util: Use SteadyClock in RandAddSeedPerfmon (merge-script)
ebed8af1d0 Merge bitcoin/bitcoin#30336: depends: update doc in Qt pwd patch (merge-script)
9793fb1a87 Merge bitcoin/bitcoin#30340: test: Added coverage to Block not found error using gettxoutsetinfo (Ava Chow)
479cb8bcb8 Merge bitcoin/bitcoin#30312: contrib: add R(UN)PATH check to ELF symbol-check (merge-script)
ca83773854 Merge bitcoin/bitcoin#30283: upnp: fix build with miniupnpc 2.2.8 (merge-script)
63e139d11b Merge bitcoin/bitcoin#30185: guix: show `*_FLAGS` variables in pre-build output (merge-script)
3be0d3e5cd Merge bitcoin/bitcoin#30097: crypto: disable asan for sha256_sse4 with clang and -O0 (merge-script)
3070c3e388 Merge bitcoin/bitcoin#30078: depends: set AR & RANLIB for CMake (merge-script)

Pull request description:

  ## Issue being fixed or feature implemented
  Trivial backports

  ## What was done?

  ## How Has This Been Tested?
  built locally

  ## Breaking Changes

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

ACKs for top commit:
  UdjinM6:
    utACK b6544791b4
  kwvg:
    utACK b6544791b4

Tree-SHA512: 10b5af4e92c83fa9d6764b20bf066bba8e4c600402966fd5c1d6dad07b0549d8a42151a33f21e2f8263336c12a810a6f3fc2828d90bc98153e09c165d9e5b043
2024-10-27 14:15:08 -05:00