Commit Graph

2893 Commits

Author SHA1 Message Date
pasta
f6edb8a85c
Merge #6430: feat: dynamically register MN in functional tests without IS
37fbdee1d9 feat: do not mine extra quorum in feature_dip3_v19.py (Konstantin Akimov)
70ba007f1a feat: do not mine extra quorum in feature_llmq_evo.py (Konstantin Akimov)
129385d349 feat: remove regular masternodes from feature_asset_locks tests (Konstantin Akimov)
8ea45bbf69 fix: make helper get_merkle_root works with no masternodes (Konstantin Akimov)
7e0c2ca5a5 fix: make dynamic masternode register even without is-quorum (Konstantin Akimov)

Pull request description:

  This PR has important fixes to implement "single-node quorum" feature.

  ## Issue being fixed or feature implemented
  Without IS-quorum you can not dynamically add a new MN or Evo node.
  For evo nodes adding it dynamically is the only way.

  ## What was done?
  Fixed a function that dynamically adds a masternode without Instant Send quorums; use it in a functional test feature_asset_locks.py

  As side effect it improves performance of functional tests which do not wait more IS lock significantly; for feature_asset_locks.py it gave ~20 seconds per run.

  ## How Has This Been Tested?
  See updates in `feature_asset_locks.py`, `feature_llmq_evo.py`, `feature_dip3_v19.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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 37fbdee1d9
  PastaPastaPasta:
    utACK 37fbdee1d9

Tree-SHA512: 2da036ccd9842946f20450606621108fa8cd8fae31927ac2d1fc5f02bf9c2f6955a67e23ef76141a02299510c8cbf206fcd4947b0ec41b776fe80f70947afc14
2024-12-01 22:46:42 -06:00
pasta
c2b83dc80e
Merge #6309: backport: Merge bitcoin#24237, 23631, 24609
e237301b76 Merge bitcoin/bitcoin#24609: Clarify -maxtimeadjustment that only outbound peers influence timedata (MarcoFalke)
e101fd8e3b Merge bitcoin/bitcoin#23631: p2p: Don't use timestamps from inbound peers for Adjusted Time (Vijay)
abfa8c0bd4 Merge bitcoin/bitcoin#24237: test: Avoid testing negative block heights (MarcoFalke)

Pull request description:

  bitcoin backports

ACKs for top commit:
  UdjinM6:
    utACK e237301b76

Tree-SHA512: 5ecb1c3504a92a2b84962809aa349e5b102455984748a65bee8f2fb6c39e1ba85c6a0063780030f73806546017efffca21959de6d96ba65b4a2db9416d8fd6ed
2024-12-01 22:35:08 -06:00
MarcoFalke
abfa8c0bd4
Merge bitcoin/bitcoin#24237: test: Avoid testing negative block heights
fad81548fa03861c244397201d6b6e6cbf883c38 test: Avoid testing negative block heights (MarcoFalke)

Pull request description:

  A negative chain height is only used to denote an empty chain, not the height of any block.

  So stop testing that and remove a suppression.

ACKs for top commit:
  brunoerg:
    crACK fad81548fa03861c244397201d6b6e6cbf883c38

Tree-SHA512: 0f9e91617dfb6ceda99831e6cf4b4bf0d951054957c159b1a05a178ab6090798fae7368edefe12800da24585bcdf7299ec3534f4d3bbf5ce6a6eca74dd3bb766
2024-11-27 11:57:53 +05:30
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
Konstantin Akimov
37fbdee1d9
feat: do not mine extra quorum in feature_dip3_v19.py 2024-11-26 20:08:50 +07:00
Konstantin Akimov
70ba007f1a
feat: do not mine extra quorum in feature_llmq_evo.py 2024-11-26 20:03:16 +07:00
Konstantin Akimov
129385d349
feat: remove regular masternodes from feature_asset_locks tests 2024-11-26 19:33:21 +07:00
Konstantin Akimov
8ea45bbf69
fix: make helper get_merkle_root works with no masternodes 2024-11-26 19:33:21 +07:00
Konstantin Akimov
7e0c2ca5a5
fix: make dynamic masternode register even without is-quorum
replace wait-IS to bump time in test_framework
2024-11-26 19:33:21 +07: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
pasta
f211bb9289
Merge #6363: backport: trivial 2024 10 25 pr2
700b8c5ac5 Merge bitcoin/bitcoin#29658: Bugfix: GUI: Help messages already have a trailing newline, so don't add an extra one (merge-script)
a0cd305a7c Merge bitcoin/bitcoin#29948: test: add missing comparison of node1's mempool in MempoolPackagesTest (Ava Chow)
f1907ea997 Merge bitcoin/bitcoin#29984: net: Replace ifname check with IFF_LOOPBACK in Discover (merge-script)
daa6eeed5f Merge bitcoin/bitcoin#29960: depends: pass verbose through to cmake based makefiles (merge-script)
61a5832a6a Merge bitcoin/bitcoin#29907: test: Fix `test/streams_tests.cpp` compilation on SunOS / illumos (merge-script)
23f25a94fa Merge bitcoin/bitcoin#29872: test: Add missing Assert(mock_time_in >= 0s) to SetMockTime (merge-script)
a7daee71da Merge bitcoin/bitcoin#29689: lint: scripted-diff verification also requires GNU grep (Ava Chow)
3df1ca102b Merge bitcoin/bitcoin#29953: doc: Bash is needed in gen_id and is not installed on FreeBSD by default (merge-script)
b53b85409f Merge bitcoin/bitcoin#29850: net: Decrease nMaxIPs when learning from DNS seeds (Ava Chow)
c4a147cfea Merge bitcoin/bitcoin#28340: security: restrict abis in bitcoind.service (Ryan Ofsky)
acfdf9e438 Merge bitcoin/bitcoin#28373: doc: Add example of mixing private and public keys in descriptors (Ava Chow)
51bc8bdcd6 Merge bitcoin/bitcoin#29859: build: Fix false positive `CHECK_ATOMIC` test (merge-script)
bb4102c590 Merge bitcoin/bitcoin#29893: test: fix intermittent failure in p2p_compactblocks_hb.py (glozow)
4ecb76104e Merge bitcoin/bitcoin#29786: Drop Windows Socket dependency for `randomenv.cpp` (fanquake)
1a8e805aab Merge bitcoin/bitcoin#29498: test: Update --tmpdir doc string to say directory must not exist (fanquake)
81ca71c266 Merge bitcoin/bitcoin#29781: depends: add new LLVM debug macro (fanquake)
5ce92ca9ea Merge bitcoin/bitcoin#29527: depends: add -g to DEBUG=1 flags (fanquake)

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 700b8c5ac5 but pls confirm Guix is happy now before merging
  kwvg:
    utACK 700b8c5ac5

Tree-SHA512: 9722979c4f0589cb02bfeaf39373713372a4aa1c8c5a55aa5b4d33388f73ef19231de3963b80ffaad25fbe0db90a133de5080baac691daed41b86a762b867b2d
2024-10-26 19:21:50 -05:00
merge-script
b6544791b4
Merge bitcoin/bitcoin#30705: test: Avoid intermittent block download timeout in p2p_ibd_stalling
fa5b58ea01fac1adb6336b8b6b5217193295c695 test: Avoid intermittent block download timeout in p2p_ibd_stalling (MarcoFalke)

Pull request description:

  Fixes #30704

  The goal of the test is to check the stalling timeout, not the block download timeout.

  On extremely slow hardware (for example qemu virtual hardware), downloading the 1023 blocks may take longer than the block download timeout.

  Fix it by pinning the time using mocktime, and only advance it when testing the stalling timeout.

ACKs for top commit:
  tdb3:
    CR ACK fa5b58ea01fac1adb6336b8b6b5217193295c695
  brunoerg:
    utACK fa5b58ea01fac1adb6336b8b6b5217193295c695

Tree-SHA512: 9a9221f264bea52be5e9fe81fd319f5a6970cd315cc5e9f5e2e049c5d84619b19b9f6f075cda8d34565c2d6c17a88fb57e195c66c271e40f73119a77caecb6d7
2024-10-26 19:14:08 -05:00