Commit Graph

25934 Commits

Author SHA1 Message Date
Vijay
e0d9dc18a8
scripted-diff: Merge #21836: Replace three dots with ellipsis in the UI string
-BEGIN VERIFY SCRIPT-
sed -i -E -e 's/\.\.\."\)(\.|,|\)| )/…"\)\1/' -- $(git ls-files -- 'src' ':(exclude)src/qt/dashstrings.cpp' ':(exclude)src/immer/')
sed -i -e 's/\.\.\.\\"/…\\"/' src/qt/sendcoinsdialog.cpp
sed -i -e 's|\.\.\.</string>|…</string>|' src/qt/forms/*.ui
sed -i -e 's|\.\.\.)</string>|…)</string>|' src/qt/forms/sendcoinsdialog.ui
-END VERIFY SCRIPT-
2024-05-19 11:16:42 -05:00
W. J. van der Laan
7bd0262aa2
Merge bitcoin/bitcoin#21753: doc: add -addrinfo to tor docs
65f30e4c21e94b775853392b7e0de5c7fd3de488 doc: add -addrinfo troubleshooting section to tor.md (Jon Atack)

Pull request description:

  Follow-up to #21595.

ACKs for top commit:
  jarolrod:
    ACK 65f30e4c21e94b775853392b7e0de5c7fd3de488
  practicalswift:
    ACK 65f30e4c21e94b775853392b7e0de5c7fd3de488
  0xB10C:
    ACK 65f30e4c21e94b775853392b7e0de5c7fd3de488
  theStack:
    ACK 65f30e4c21e94b775853392b7e0de5c7fd3de488

Tree-SHA512: d17fa007106b8f877d2632c99273c663a24f025febe52faec9b197c561df808fd6a92bb27992ccbf5c3cc0d82058a8c4b82a2f1b99325f0ddfdac5ef703ac7d7
2024-05-19 11:16:41 -05:00
W. J. van der Laan
6350b0cd86
Merge bitcoin/bitcoin#21710: doc: update helps for addnode rpc and -addnode/-maxconnections config options
b4fcbcfb49461b96bc72fb64d6152de7c5ce00de doc: update -maxconnections config option help (Jon Atack)
79685a8992ad302833b506cc6d03aab1cc127de0 doc: update -addnode config option help (Jon Atack)
2896c6c4cc6d382d8369c037e274c08dd8e32c69 doc: update addnode rpc help (Jon Atack)

Pull request description:

  Since #9319 proposed by Gregory Maxwell and released in v0.14, peers manually added through the `-addnode` config option or using the `addnode` RPC have their own separate limit of 8 connections that does not compete with other inbound or outbound connection usage and is not subject to the limitation imposed by the `-maxconnections` option.

  This PR updates the `-addnode` and `-maxconnections` config options and the `addnode` RPC help docs with this information.

  `-addnode` config option help
  ```
  $ bitcoind -h | grep -A5 addnode=
    -addnode=<ip>
         Add a node to connect to and attempt to keep the connection open (see
         the addnode RPC help for more info). This option can be specified
         multiple times to add multiple nodes; connections are limited to
         8 at a time and are counted separately from the -maxconnections
         limit.

  $ bitcoind -h | grep -A3 maxconnections=
    -maxconnections=<n>
         Maintain at most <n> connections to peers (default: 125). This limit
         does not apply to connections manually added via -addnode or the
         addnode RPC, which have a separate limit of 8.
  ```

  `addnode` rpc help
  ```
  $ bitcoin-cli help addnode
  addnode "node" "command"

  Attempts to add or remove a node from the addnode list.
  Or try a connection to a node once.
  Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be
  full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).
  Addnode connections are limited to 8 at a time and are counted separately from the -maxconnections limit.
  ```

ACKs for top commit:
  prayank23:
    ACK b4fcbcfb49
  jarolrod:
    ACK b4fcbcfb49461b96bc72fb64d6152de7c5ce00de

Tree-SHA512: b6d69baa6cbf6d53f91bac5b39b549d49db6c95f92ea1bdd3588a6432794a25ac2c8b3c89e2c72bb9097e61f2717c8b5ecc404745d5992b88e523db03200898f
2024-05-19 11:16:41 -05:00
pasta
b114e2e82d
Merge #6015: backport: Merge bitcoin#22043, 22169, 22135
f951dddef5 Merge bitcoin/bitcoin#22135: CRegTestParams: Use `args` instead of `gArgs`. (MarcoFalke)
d613458bf4 Merge bitcoin/bitcoin#22169: p2p, rpc, fuzz: various tiny follow-ups (fanquake)
72d51a75e5 Merge bitcoin/bitcoin#22043: rpc, test: addpeeraddress test coverage, code simplify/constness (MarcoFalke)

Pull request description:

  bitcoin backports

Top commit has no ACKs.

Tree-SHA512: 9cd5ae1683fe1f54230e14fcd1c4e34c1ef83885d6a03a11781fafca973fc8f39743185680aaed67c01d537c2ece5f8a8b71f7c26a09557858ae4812cd9e94de
2024-05-19 11:13:54 -05:00
MarcoFalke
f951dddef5
Merge bitcoin/bitcoin#22135: CRegTestParams: Use args instead of gArgs.
5f23531926e1a9cf13bd69c09a7a8f638df1c32b CRegTestParams: Use `args` instead of `gArgs`. (Kiminuo)

Pull request description:

  This PR is a very minor follow-up to #13311.

  I believe that `gArgs` was just overlooked at the modified line.

ACKs for top commit:
  MarcoFalke:
    cr ACK 5f23531926e1a9cf13bd69c09a7a8f638df1c32b

Tree-SHA512: f4e4ed6b23fca60e88825b502f20a1341ee2e4429bc8a2a7e419057adb643abda11be2061fe7ee076931657736e629aff88fd2c33737c84c330dc9d64f368c30
2024-05-19 11:13:42 -05:00
fanquake
d613458bf4
Merge bitcoin/bitcoin#22169: p2p, rpc, fuzz: various tiny follow-ups
c274574458e5921be4d1f3e86e6bba72a7cd3e65 p2p, rpc, fuzz: various tiny follow-ups (Jon Atack)

Pull request description:

  - p2p: pass `Span` by value per https://github.com/bitcoin/bitcoin/pull/22143#issuecomment-853953438 as a follow-up to 8be56f0f8ecc54744
  - rpc: remove duplicate `CAddress` constructor per https://github.com/bitcoin/bitcoin/pull/22043#discussion_r638535703
  - fuzz: rename 3 fuzz targets changed in eba9a94b9f56be2fda623e77f19b960425ea1eb5 back to their original names per https://github.com/bitcoin-core/qa-assets/pull/63#issuecomment-855281865

ACKs for top commit:
  MarcoFalke:
    cr ACK c274574458e5921be4d1f3e86e6bba72a7cd3e65
  practicalswift:
    cr ACK c274574458e5921be4d1f3e86e6bba72a7cd3e65: patch looks correct
  jarolrod:
    ACK  c274574458e5921be4d1f3e86e6bba72a7cd3e65

Tree-SHA512: 3672b210d30b3a91f3a6455005e4d3cb1f89621820c417c645d24b06e53459440122a1f75758e0e04c3d04eff9d6f88ef62865216aa3e42301c6df783f7c0b4a
2024-05-19 11:13:42 -05:00
MarcoFalke
72d51a75e5
Merge bitcoin/bitcoin#22043: rpc, test: addpeeraddress test coverage, code simplify/constness
b36e0cd1b9d361ac6f9777c09328a13e9ee923be rpc: simplify addpeeraddress and improve code constness (Jon Atack)
6b1926cf1eac1ad1850599d2753dd22bc21fd327 test: addpeeraddress functional test coverage (Jon Atack)

Pull request description:

  - Add functional test coverage for rpc addpeeraddress
  - Simplify addpeeraddress and improve code constness

ACKs for top commit:
  klementtan:
    ACK [`b36e0cd`](b36e0cd1b9)
  MarcoFalke:
    review ACK b36e0cd1b9d361ac6f9777c09328a13e9ee923be 💭

Tree-SHA512: 01773fb70f23db5abf46806bb27804e48feff27272b2e6582bd5b886e9715088eb2d84755106bce2ad6f88e21582f7f071a30a89d5b17286d899c3dd8553b4fc
2024-05-19 11:13:42 -05:00
pasta
2cad51b509
Merge #6016: backport: Merge bitcoin#22214, 22120, 21745
3b5dc9e5aa Merge bitcoin/bitcoin#21745: refactor: Add missing includes in pubkey.cpp/pubkey.h (W. J. van der Laan)
1ee01c801e Merge bitcoin/bitcoin#22120: test: p2p_invalid_block: Check that a block rejected due to too-new tim… (MarcoFalke)
bf72bea014 Merge bitcoin/bitcoin#22214: refactor: Rearrange fillPSBT arguments (fanquake)

Pull request description:

  bitcoin backport

Top commit has no ACKs.

Tree-SHA512: 5b4ab7e898c8e0c3f465acc084f3c2136c8c8523d5cc813f042df8591967acff17a380a4173b7c6da63f6dca76773d8ad9811d68d290f3ddd198eaa6481bbacb
2024-05-19 11:12:06 -05:00
W. J. van der Laan
3b5dc9e5aa
Merge bitcoin/bitcoin#21745: refactor: Add missing includes in pubkey.cpp/pubkey.h
71c824ed6cf70b39ca09e8b3962f452f69523af0 cleaned up and added missing "include" statements for pubkey.cpp and pubkey.h (William Bright)

Pull request description:

  #### Problem:
  Many symbols in the files were undefined and causing issues when I was working on building independent sections of the codebase. The hidden imports from the "secp256k1" library was a particular pain point.

  The other standard and missing includes are following best practices and will help with refactoring, build process and others.

  #### Changes:
  Clean up and declared imports/include for `pubkey.cpp` and `pubkey.h`

ACKs for top commit:
  jnewbery:
    utACK 71c824ed6c
  laanwj:
    Code review ACK 71c824ed6cf70b39ca09e8b3962f452f69523af0

Tree-SHA512: bce605cfde24d8e3be82a596cabab7a8577fec0aef7c5e6f7a56603357046d8e8dea11ac8e3dbe79600550291be7784e35c7a55ebf40b46525b8949e4bedae96
2024-05-19 11:11:35 -05:00
MarcoFalke
1ee01c801e
Merge bitcoin/bitcoin#22120: test: p2p_invalid_block: Check that a block rejected due to too-new tim…
754e802274e9373ad7e1dccb710acf74ded6e7fb test: check rejected future block later accepted (Luke Dashjr)

Pull request description:

  (Luke) was unsure if the code sufficiently avoided caching a
  time-too-new rejection, so wrote this test to check it.  It looks like
  despite only exempting BLOCK_MUTATED, it is still okay because header
  failures never cache block invalidity.  This test will help ensure that
  if this ever changes, BLOCK_TIME_FUTURE gets excluded at the same time.

  This PR re-opens https://github.com/bitcoin/bitcoin/pull/17872 which went stale and addresses the nits raised by reviewers there.

ACKs for top commit:
  MarcoFalke:
    review ACK 754e802274e9373ad7e1dccb710acf74ded6e7fb

Tree-SHA512: a2bbc8fffb523cf2831e1ecb05f20868e30106a38cc2e369e4973fa549cca06675a668df16f76c49cc4ce3a22925404255e5c53c4232d63ba1b9fca878509aa0
2024-05-19 11:11:34 -05:00
fanquake
bf72bea014
Merge bitcoin/bitcoin#22214: refactor: Rearrange fillPSBT arguments
f47e8028391fbcf44fe1dbf3539f42e4185590fd Rearrange fillPSBT arguments (Russell Yanofsky)

Pull request description:

  Move fillPSBT inout argument before output-only arguments. This is a nice thing to do to keep the interface style [consistent](https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs). But motivation is to work around a current limitation of the libmultiprocess code generator (which figures out order of inout parameters by looking at input list, but more ideally would use the output list).

  ---

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). The commit was first part of larger PR #10102.

ACKs for top commit:
  achow101:
    ACK f47e8028391fbcf44fe1dbf3539f42e4185590fd
  theStack:
    Code-review ACK f47e8028391fbcf44fe1dbf3539f42e4185590fd

Tree-SHA512: 1787af3031ff7ed6b519f3b93054d8b257af96a3380a476a6dab0f759329039ecc5d624b785c5c2d14d594fc852dd81c626880c775c691ec9c79b7b3dbcfb257
2024-05-19 11:11:30 -05:00
pasta
1fc62c81a0
Merge #6020: backport: bitcoin#21053, #22082, #22118, #22292, #22308, #22334, #22358, #22388, bitcoin-core/gui#271, #311
0bed7b4702 Merge bitcoin/bitcoin#22292: bench, doc: benchmarking updates and fixups (fanquake)
c95df68637 Merge bitcoin/bitcoin#22388: ci: use Ubuntu 20.04 as the default Docker container (MarcoFalke)
c586ca5b56 Merge bitcoin/bitcoin#22334: wallet: do not spam about non-existent spk managers (fanquake)
62f9394374 Merge bitcoin/bitcoin#22308: wallet: Add missing BlockUntilSyncedToCurrentChain (MarcoFalke)
240d8efb82 Merge bitcoin/bitcoin#22358: Remove unused wallet pointer from wallet signals (fanquake)
9a1500ab47 Merge bitcoin/bitcoin#22118: test: check anchors.dat when node starts for the first time (MarcoFalke)
262c8b6f44 Merge bitcoin/bitcoin#22082: test: update nanobench from release 4.0.0 to 4.3.4 (MarcoFalke)
3d2cea667b Merge bitcoin-core/gui#311: Peers Window rename 'Peer id' to 'Peer' (Hennadii Stepanov)
dc498be3be Merge bitcoin-core/gui#271: Don't clear console prompt when font resizing (W. J. van der Laan)
1ed2d2d891 Merge #21053: rpc, test: document {previous,next}blockhash as optional (MarcoFalke)

Pull request description:

  ## Issue being fixed or feature implemented
  Regular backports from bitcoin v22

  ## What was done?
   - bitcoin/bitcoin#21053
   - bitcoin-core/gui#271
   - bitcoin-core/gui#311
   - bitcoin/bitcoin#22082
   - bitcoin/bitcoin#22118
   - bitcoin/bitcoin#22358
   - bitcoin/bitcoin#22308
   - bitcoin/bitcoin#22334
   - bitcoin/bitcoin#22388
   - bitcoin/bitcoin#22292

  ## How Has This Been Tested?
  Run unit/functional 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
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  PastaPastaPasta:
    utACK 0bed7b4702

Tree-SHA512: 8354297857516ddf94b242f2e50e1a28d999e613da2a7eb90c603e1fee7212e46d6e8a20ad42aa2945b48137e98fc7f589c9c77469c71cc01d032a33fa6da517
2024-05-18 21:08:06 -05:00
pasta
644f00fcd0
Merge #6021: backport: (scripted-diff) Merge bitcoin-core/gui#523:, 23044, 22423, 22520
38649da984 Merge bitcoin/bitcoin#22520: test: improve rpc_blockchain.py tests and assert on time and mediantime (MarcoFalke)
61f9d96f38 Merge bitcoin/bitcoin#22423: test: wallet_listtransactions improvements (speedup, cleanup, logging) (MarcoFalke)
0959f0fe52 Merge bitcoin/bitcoin#23044: refactor: Remove unused validation includes (merge-script)
ea678b5a04 scripted-diff: Merge bitcoin-core/gui#523: scripted-diff: Rename functions to drop mention of boost (Vijay)

Pull request description:

  bitcoin backports

Top commit has no ACKs.

Tree-SHA512: 5903bbe51d03a2e91e4e69481f3cbef228b97b5d8ac9f1d1350d7fb0b66a4c1f31bd3dd665011c6dbded4e85dc426befc6f2f00fac525dc3687d2630de4c854b
2024-05-18 17:54:40 -05:00
MarcoFalke
38649da984
Merge bitcoin/bitcoin#22520: test: improve rpc_blockchain.py tests and assert on time and mediantime
ef5e9304cd407adab1563f24215da1b582274c20 test: update logging and docstring in rpc_blockchain.py (Jon Atack)
d548dc71e4849f638fccaea6be86ac4fa5304f01 test: replace magic values by constants in rpc_blockchain.py (Jon Atack)
78c361086fc0bf27612e8142bd33e05e37a36af6 test: assert on mediantime in getblockheader and getblockchaininfo (Jon Atack)
0a9129c588ab016eb0453b40a0cae918ca4aa6a2 test: assert on the value of getblockchaininfo#time (Jon Atack)

Pull request description:

  Follow-up to #22407 improving test coverage per https://github.com/bitcoin/bitcoin/pull/22407#pullrequestreview-702077013.

ACKs for top commit:
  tryphe:
    untested ACK ef5e9304cd407adab1563f24215da1b582274c20

Tree-SHA512: f746d56f430331bc6a2ea7ecd27b21b06275927966aacf1f1127d8d5fdfd930583cabe72e23df3adb2e005da904fc05dc573b8e5eaa2f86e0e193b89a17a5734
2024-05-18 17:54:16 -05:00
MarcoFalke
61f9d96f38
Merge bitcoin/bitcoin#22423: test: wallet_listtransactions improvements (speedup, cleanup, logging)
a006d7d73019b8cf4d68626c019c3d69729dda69 test: add logging to wallet_listtransactions (Sebastian Falbesoner)
47915b118720c6e2b2ec9f599f25848041b42b99 test: remove unneeded/redundant code in wallet_listtransactions (Sebastian Falbesoner)
fb6c6a7938cb7c4808ad88d23bfc2b7408407b12 test: speedup wallet_listtransactions by whitelisting peers (immediate tx relay) (Sebastian Falbesoner)

Pull request description:

  This PR improves the test `wallet_listtransactions.py` in three ways:
  * speeds up runtime by a factor of 2-3x by using the good ol' immediate tx relay trick (`-whitelist=noban@127.0.0.1`)
  * removes unneeded/redundant code
  * adds log messages, mostly by turning comments into `self.log.info(...)` calls

ACKs for top commit:
  jonatack:
    ACK a006d7d73019b8cf4d68626c019c3d69729dda69
  kristapsk:
    ACK a006d7d73019b8cf4d68626c019c3d69729dda69

Tree-SHA512: a91a19f5ebc4d05f0b96c5419683c4c57ac0ef44b64eeb8dd550bd72296fd3a2857a3ba83f755fe4b0b3bd06439973f226070b5d0ce2dee58344dae78cb50290
2024-05-18 17:54:16 -05:00
merge-script
0959f0fe52
Merge bitcoin/bitcoin#23044: refactor: Remove unused validation includes
fa45a1338adb127d69aee982920e29519bc1fed6 refactor: Remove unused validation includes (MarcoFalke)

Pull request description:

  Unused includes will cause needless recompilation when headers are changed. Also, they pretend there are dependencies that don't exist.

  Fix both by removing them.

ACKs for top commit:
  laanwj:
    Code review ACK fa45a1338adb127d69aee982920e29519bc1fed6
  theStack:
    ACK fa45a1338adb127d69aee982920e29519bc1fed6 ♻️

Tree-SHA512: 69190fd09184b75bce34ce3f315a1817e09ea32779f9ddc2d4790c89b0887b6cebd88aba66fa054c43c9183fc66202a556d982dd7034fc389a75802d8aaac83a
2024-05-18 17:54:16 -05:00
Vijay
ea678b5a04
scripted-diff: Merge bitcoin-core/gui#523: scripted-diff: Rename functions to drop mention of boost
-BEGIN VERIFY SCRIPT-
FILES=$(git ls-files src/qt)
sed -i 's/boostPathToQString/PathToQString/g' -- $FILES
sed -i 's/qstringToBoostPath/QStringToPath/g' -- $FILES
-END VERIFY SCRIPT-
2024-05-18 17:54:15 -05:00
pasta
8b7f9c895a
Merge #6027: fix: actually use -socketevents
113b3feddc fix: actually use `-socketevents` (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  #6007 follow-up

  ## What was done?

  ## How Has This Been Tested?
  check `socketevents` in `getnetworkinfo` response

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

ACKs for top commit:
  kwvg:
    ACK 113b3feddc
  PastaPastaPasta:
    utACK 113b3feddc

Tree-SHA512: 50dcbdfe1f34e42e71078b585cfed2cd6b07f5f08c8296c7205367043e42e676c2eca47fa5193fdb9071eef202b01ba6e44ae2e3affb59a4e94196ecb6eb4350
2024-05-18 17:52:44 -05:00
pasta
95c3532611
Merge #6023: backport: bitcoin#21740, #21873, #24762, #25015 - new linter for filenames and permissions
e0ad143e08 chore: dashify file list exception for liner (Konstantin Akimov)
98a2dad78c fix: wrong permission for various files accordingly new linter (Konstantin Akimov)
c8c58a1810 Merge bitcoin/bitcoin#25015: test: Use permissions from git in lint-files.py (MacroFake)
f226e8dc1f Merge bitcoin/bitcoin#24762: lint: Start to use py lint scripts (MarcoFalke)
85013e99d6 Merge bitcoin/bitcoin#21873: test: minor fixes & improvements for files linter test (MarcoFalke)
dce79f5c8e Merge bitcoin/bitcoin#21740: test: add new python linter to check file names and permissions (W. J. van der Laan)

Pull request description:

  ## Issue being fixed or feature implemented
  Backports from bitcoin v22+ for a new linter for filenames and file permissions

  ## What was done?
  backports:
   - bitcoin/bitcoin#21740
   - bitcoin/bitcoin#21873
   - bitcoin/bitcoin#24762
   - bitcoin/bitcoin#25015

  ## How Has This Been Tested?
  Run new linter: `test/lint/lint-files.py`

  ## 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
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  PastaPastaPasta:
    utACK e0ad143e08

Tree-SHA512: e0ccc1655628fb34a40875b8da28145d44c94868efd9934457568afbe9b75db3954fef80870119476d7bdc9c3424a9b222ede6e47333ea432e1ef63f2218e938
2024-05-17 14:37:23 -05:00
UdjinM6
113b3feddc
fix: actually use -socketevents
6007 follow-up
2024-05-17 19:31:26 +03:00
Konstantin Akimov
e0ad143e08
chore: dashify file list exception for liner 2024-05-16 02:10:16 +07:00
Konstantin Akimov
98a2dad78c
fix: wrong permission for various files accordingly new linter 2024-05-16 02:09:48 +07:00
MacroFake
c8c58a1810
Merge bitcoin/bitcoin#25015: test: Use permissions from git in lint-files.py
908fb7e2ec37fe68675d38dbfee4df9f861bb2b5 test: Use permissions from git in `lint-files.py` (laanwj)
48d2e80a7479a44b0ab09e87542c8cb7a8f72223 test: Don't use shell=True in `lint-files.py` (laanwj)

Pull request description:

  Improvements to the `lint-files.py` script:

  - Avoid use of `shell=True`.
  - Check the permissions in git's metadata instead of in the filesystem. This stops the umask or filesystem from interfering. It's also more efficient as it only needs a single call to `git ls-files`.

  (what triggered this change was `File "..." contains a shebang line, but has the file permission 775 instead of the expected executable permission 755.` errors running the script locally).

ACKs for top commit:
  vincenzopalazzo:
    re-tACK 908fb7e2ec

Tree-SHA512: 2eaf868c55a9c3508b12658a5b3ac429963fd0551e645332d0ac54be56fefccee95115e4667386df24b46b545593cb0d0bf8c6cecab73f9cb19d37ddf704c614
2024-05-16 02:09:38 +07:00
MarcoFalke
f226e8dc1f
Merge bitcoin/bitcoin#24762: lint: Start to use py lint scripts
fae211c0ae0dd90876a3390eb21449b7b0bb45c4 lint: Start to use py lint scripts (MarcoFalke)
fa82e890e7950fe5ba6d4fa88fcd922cc929dc47 Move lint script and data file to avoid lint- prefix (MarcoFalke)

Pull request description:

ACKs for top commit:
  fjahr:
    tACK fae211c0ae0dd90876a3390eb21449b7b0bb45c4

Tree-SHA512: f8272a1bab9efb8203cac121710baae68f01f79e520ad71ff15aa516d19763d61c088b411b019de105a6a30e7ee3c274814d59963f6ac22ba1084560fb601f45
2024-05-16 02:09:38 +07:00
MarcoFalke
85013e99d6
Merge bitcoin/bitcoin#21873: test: minor fixes & improvements for files linter test
2227fc4e6203064b14e99bcf453601bd263a0196 test: minor fixes & improvements for files linter test (windsok)

Pull request description:

  Couple of minor fixes & improvements for files linter test added in #21740

  - Use a context manager when opening files, so that files are closed are we are done with them

  - Use the `-z` flag when shelling out to `git ls-files` so that we can catch newlines and other weird control characters in filenames.

  From the `git ls-files` manpage:
  ```
  -z \0 line termination on output and do not quote filenames. See OUTPUT below for more information.

  Without the -z option, pathnames with "unusual" characters are quoted as explained for the configuration variable
  core.quotePath (see git-config(1)). Using -z the filename is output verbatim and the line is terminated by a NUL byte.
  ```

ACKs for top commit:
  MarcoFalke:
    cr ACK 2227fc4e6203064b14e99bcf453601bd263a0196
  practicalswift:
    cr ACK 2227fc4e6203064b14e99bcf453601bd263a0196: patch looks correct

Tree-SHA512: af059a805f4a7614162de85dea856052a45ab531895cb0431087e7fc9e037513fa7501bb5eb2fe43238adf5f09e77712ebdbb15b1486983359ad3661a3da0c60
2024-05-16 02:09:38 +07:00
W. J. van der Laan
dce79f5c8e
Merge bitcoin/bitcoin#21740: test: add new python linter to check file names and permissions
46b025e00df40724175735eb5606ac73067cb3b8 test: add new python linter to check file names and permissions (windsok)
6f6bb3ebc7cb8e17a5dfc8ef55aa2d3f2dc6bdea test: fix file permissions on various scripts (windsok)

Pull request description:

  Adds a new python linter test which tests for correct filenames and file permissions in the repository.

  Replaces the existing tests in the `test/lint/lint-filenames.sh` and `test/lint/lint-shebang.sh` linter tests, as well as adding some new and increased testing. This increased coverage is intended to catch issues such as in #21728 and https://github.com/bitcoin/bitcoin/pull/16807/files#r345547050

  Summary of tests:
  * Checks every file in the repository against an allowed regexp to make sure only lowercase or uppercase alphanumerics (a-zA-Z0-9), underscores (_), hyphens (-), at (@) and dots (.) are used in repository filenames.

  * Checks only source files (*.cpp, *.h, *.py, *.sh) against a stricter allowed regexp to make sure only lowercase alphanumerics (a-z0-9), underscores (_), hyphens (-) and dots (.) are used in source code filenames. Additionally there is an exception regexp for directories or files which are excepted from matching this regexp (This should replicate the existing `test/lint/lint-filenames.sh` test)

  * Checks all files in the repository match an allowed executable or non-executable file permission octal. Additionally checks that for executable files, the file contains a shebang line.

  * Checks that for executable `.py` and `.sh` files, the shebang line used matches an allowable list of shebangs (This should replicate the existing `test/lint/lint-shebang.sh` test)

  * Checks every file that contains a shebang line to ensure it has an executable permission

  Additionally updates the permissions on various files to comply with the new tests.

  Fixes #21729

ACKs for top commit:
  practicalswift:
    cr re-ACK 46b025e00df40724175735eb5606ac73067cb3b8: patch still looks correct
  kiminuo:
    code review ACK 46b025e00df40724175735eb5606ac73067cb3b8 if `contrib/gitian-descriptors/assign_DISTNAME` permission change is deemed OK.
  laanwj:
    Code review ACK 46b025e00df40724175735eb5606ac73067cb3b8

Tree-SHA512: 1c8201a2cee0d9cbce15652b68cec9a6458a8b493fcd5392f98560aca0b1a12e668baab65a47100f116f626dadc3f591deb47f7368468c6a46c6c712c2533455
2024-05-16 02:09:37 +07:00
fanquake
0bed7b4702
Merge bitcoin/bitcoin#22292: bench, doc: benchmarking updates and fixups
d8513fe41102dcbfc05235f3b95e33eb1878f880 doc: update doc/benchmarking.md (Jon Atack)
84e2d5b78181d08b258c77f9c9c4e1bb7fdaa451 bench: bench_bitcoin.cpp help fixups (Jon Atack)
10f4ce20783cbbcb0c0997c605452d9e60827e6d bench: bench.h fixes and improvements (Jon Atack)

Pull request description:

  Fixups and updates I noticed while writing benchmarks for #22284.

ACKs for top commit:
  za-kk:
    ACK d8513fe41102dcbfc05235f3b95e33eb1878f880
  theStack:
    ACK d8513fe41102dcbfc05235f3b95e33eb1878f880 🚤

Tree-SHA512: d494956b5d6a3329e98e8b6f4405a10613b8fce51a04bbf4493d8b3497b8d5b177c1a9a3eeb828796eb4edb92b0ace769595151e223671c0dc8f09bcf631ebb5
2024-05-15 03:03:18 +07:00
MarcoFalke
c95df68637
Merge bitcoin/bitcoin#22388: ci: use Ubuntu 20.04 as the default Docker container
7fc1e14ce60d4e0533c7ccc65a9b24052d7a608f ci: use Ubuntu 20.04 as the default Docker container (fanquake)

Pull request description:

  All but 2 of the Ubuntu CIs (native qt5 & nowallet) are already using 20.04 or 21.04.

ACKs for top commit:
  MarcoFalke:
    cr ACK 7fc1e14ce60d4e0533c7ccc65a9b24052d7a608f

Tree-SHA512: f35d79a87af6c6955695b5e627884f94aed19bafaed4657d03ef4db66cf47cae5311464bb39961570140325652941283b9d88dff862776e8becfff9130162917
2024-05-15 03:03:18 +07:00
fanquake
c586ca5b56
Merge bitcoin/bitcoin#22334: wallet: do not spam about non-existent spk managers
6084d2caed9b2c70c0f19898c33ecb141fe603c8 wallet: do not spam about non-existent spk managers (S3RK)

Pull request description:

  Avoid spam in logs during `loadwallet`, `listdescriptors` and probably other commands as well.

  **`loadwallet` Before:**
  ```
  2021-06-24T06:31:45Z init message: Loading wallet…
  2021-06-24T06:31:45Z [desc] Wallet File Version = 169900
  2021-06-24T06:31:45Z [desc] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] Wallet completed loading in             197ms
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] setKeyPool.size() = 0
  2021-06-24T06:31:45Z [desc] mapWallet.size() = 0
  2021-06-24T06:31:45Z [desc] m_address_book.size() = 0
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] External scriptPubKey Manager for output type 2 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 0 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 1 does not exist
  2021-06-24T06:31:45Z [desc] Internal scriptPubKey Manager for output type 2 does not exist
  {
    "name": "desc",
    "warning": ""
  }
  ```

  **After:**
  ```
  2021-06-24T06:26:58Z init message: Loading wallet…
  2021-06-24T06:26:58Z [desc] Wallet File Version = 169900
  2021-06-24T06:26:58Z [desc] Keys: 0 plaintext, 0 encrypted, 0 w/ metadata, 0 total. Unknown wallet records: 0
  2021-06-24T06:26:58Z [desc] Wallet completed loading in             158ms
  2021-06-24T06:26:58Z [desc] setKeyPool.size() = 0
  2021-06-24T06:26:58Z [desc] mapWallet.size() = 0
  2021-06-24T06:26:58Z [desc] m_address_book.size() = 0
  {
    "name": "desc",
    "warning": ""
  }
  ```

ACKs for top commit:
  achow101:
    ACK 6084d2caed9b2c70c0f19898c33ecb141fe603c8

Tree-SHA512: c7d7345c3182a575db088fd731b7f6e428c42e4f3f2e10d5adb50bf74a2defe88768e65ebb91a08590be48cf766a5697e36fafa73f68ffe45e76a60600f072e2
2024-05-15 03:03:18 +07:00
MarcoFalke
62f9394374
Merge bitcoin/bitcoin#22308: wallet: Add missing BlockUntilSyncedToCurrentChain
fa27baa9c8a13239625e5a7b6c472d236fe5b9fa Revert "test: Add temporary logging to debug #20975" (MarcoFalke)
fadb55085a02c9e355617bcb5f84b6335e4f8c9d wallet: Add missing BlockUntilSyncedToCurrentChain (MarcoFalke)

Pull request description:

  Fixes #20975

  Also replace the wallet pointer by a reference

ACKs for top commit:
  achow101:
    ACK fa27baa9c8a13239625e5a7b6c472d236fe5b9fa

Tree-SHA512: 79047a30998104a12c2ff84a8e3cc5207151410bbe92b74cfedbe1c1aca3ffa5909391607fc597f3a3cf0725fa827528a4c57edaeacc8360536b1965e166be6a
2024-05-15 03:03:17 +07:00
fanquake
240d8efb82
Merge bitcoin/bitcoin#22358: Remove unused wallet pointer from wallet signals
8888cf45f5e45b38cb830f9c94cafbf622e1fe5f Remove unused wallet pointer from NotifyAddressBookChanged (MarcoFalke)
faf36403038afb3df3ddd963bd6c352d3eff4da8 Remove unused wallet pointer from NotifyTransactionChanged signal (MarcoFalke)

Pull request description:

  The signals are members of the wallet, so passing the pointer would be redundant even if it was used.

  Also, fix `with` -> `without`, which was forgotten in commit ca4cf5cff6.

ACKs for top commit:
  jonatack:
    Code review ACK 8888cf45f5e45b38cb830f9c94cafbf622e1fe5f also verified with/without lock cs_wallet status for each of the two functions and debian clang 11 debug build clean
  promag:
    Code review ACK 8888cf45f5e45b38cb830f9c94cafbf622e1fe5f.
  theStack:
    Code review ACK 8888cf45f5e45b38cb830f9c94cafbf622e1fe5f

Tree-SHA512: e3b80931ce9bcb05213619f5435ac7c21d3c7848643950a70db610902bd1803c92bb75e501d46b0e519bc576901f160e088e8882c4f1adce892a80df565f897b
2024-05-15 03:03:17 +07:00
MarcoFalke
9a1500ab47
Merge bitcoin/bitcoin#22118: test: check anchors.dat when node starts for the first time
ef99d03c2bbb6b5fa5ff3d3d3cb9c5da7d471133 test: check anchors.dat when node starts for the first time (bruno)

Pull request description:

  See https://github.com/bitcoin/bitcoin/pull/21338#discussion_r598406712, https://github.com/bitcoin/bitcoin/pull/21338#discussion_r598406187, https://github.com/bitcoin/bitcoin/pull/21338#discussion_r598405613.

ACKs for top commit:
  laanwj:
    Code review ACK ef99d03c2bbb6b5fa5ff3d3d3cb9c5da7d471133

Tree-SHA512: 505f1f34fbc0c72a92968883be0f1c5f169a4ba3aa8a56e1ce8bc5e514f49e3a17ce51fd40be0073dc4bc06eaeda36dfe90ace843c181170e34643226afd78ef
2024-05-15 03:03:17 +07:00
MarcoFalke
262c8b6f44
Merge bitcoin/bitcoin#22082: test: update nanobench from release 4.0.0 to 4.3.4
44d05d0a69c14ed295b0a7f6c8ec4379d44155e4 test: remove sanitizer suppression for nanobench (Martin Ankerl)
e3c866e3ca85f841671a828712e6207e24d0d996 test: update nanobench from release 4.0.0 to 4.3.4 (Martin Ankerl)

Pull request description:

  This updates the third-party library nanobench with the latest release. It contains mostly minor bugfixes, a new pyperf output format, ability to suppress warnings with environment variable `NANOBENCH_SUPPRESS_WARNINGS`. Full changelog:

  v4.0.2
  * Changed `doNotOptimizeAway` to what google benchmark is doing. The old code did not work on some machines.
  * fix: display correct "total" value
  * minor Documentation updates

  v4.1.0
  * Updated link to new pyperf home
  * Adds ability to configure console output time unit
  *  Add support for environment variable `NANOBENCH_SUPPRESS_WARNINGS`
  * Nanobench is now usable with CMake's FetchContent (see documentation: https://nanobench.ankerl.com/tutorial.html#cmake-integration)

  v4.2.0
  * Ability to store and later compare results added, through `pyperf`.
  * See https://nanobench.ankerl.com/tutorial.html#pyperf-python-pyperf-module-output
  * Added lots of build targets to travis, similar to bitcoin's build.
  * Some minor API & documentation improvements

  v4.3.0
  * `ankerl::nanobench::Rng` can now return the state with `std::vector<uint64_t> Rng::state()`, and this can also be used to initialize the Rng.

  v4.3.1
  * Minor cmake improvements when integrationg as a third-party library: add alias `nanobench::nanobench`, default to C++17

  v4.3.2
  * Fixed a MSVC 2015 build problem
  * updates license to 2021.
  * build should now work with very old linux headers
  * Also disable UBSAN (bitcoin needed to add a suppression)

  v4.3.3
  * Do not use locale-dependent `std::to_string`

  v4.3.4
  * Add missing sanitizer suppression to `rotl`

ACKs for top commit:
  MarcoFalke:
    review ACK 44d05d0a69c14ed295b0a7f6c8ec4379d44155e4

Tree-SHA512: 3291c85057720cfc84a44bfaa305a7d0df4dc35779169d20de73d32e40d4cdbf3f005bf343f79710eca517441de2459e8118c195c5f5136f99d1f50ebd5dfd08
2024-05-15 03:03:16 +07:00
Hennadii Stepanov
3d2cea667b
Merge bitcoin-core/gui#311: Peers Window rename 'Peer id' to 'Peer'
657b33ef2de77acd1061cdf4d1d64d0e086d75df qt: add translator comments for peers table columns (Jarol Rodriguez)
73a91c63ec72e62ef76fbc857baff14b099a1358 gui: rename "Peer Id" to "Peer" in tab column and details area (Jon Atack)

Pull request description:

  Picking up https://github.com/bitcoin-core/gui/pull/290

  **Original PR Description:**
  - renames the peers tab column header from `Peer Id` to `Peer` to allow resizing the column more tightly (this will be particularly useful after #256) and does the same for the peer details area.

  While here, we also add Qt translator comments for the Peer Table columns.

  | Master        | PR               |
  | ----------- | ----------- |
  | ![Screen Shot 2021-05-03 at 1 23 05 AM](https://user-images.githubusercontent.com/23396902/116843818-20a14b00-abaf-11eb-913e-ddff11cda5cd.png) | ![Screen Shot 2021-05-05 at 4 08 45 AM](https://user-images.githubusercontent.com/23396902/117112825-a2cc7380-ad57-11eb-939b-1aceb4214ad1.png) |

ACKs for top commit:
  jonatack:
    utACK 657b33ef2de77acd1061cdf4d1d64d0e086d75df
  hebasto:
    re-ACK 657b33ef2de77acd1061cdf4d1d64d0e086d75df

Tree-SHA512: f50116f7ca8719cadf1f95f45e3594b3b92bde9c43eb954f3e963ed10629dd9406efdb5e96aa1f750a926e24a96321d824ed3780bd9cd748774e0b85fd0c9535
2024-05-15 03:03:16 +07:00
W. J. van der Laan
dc498be3be
Merge bitcoin-core/gui#271: Don't clear console prompt when font resizing
7962e0dde8bbd0fa3dd702e2224774f1edaadcb6 qt: Do not clear console prompt when font resizing (Hennadii Stepanov)
d2cc3390054616c73f72a59f864700f6de14067b qt, refactor: Drop redundant history cleaning in RPC console (Hennadii Stepanov)
4f0ae472e22990ad9e734faea4adacef8df449bb qt: Untie irrelevant signal-slot parameters (Hennadii Stepanov)

Pull request description:

  On master, a console resize event will clear the prompt. To fix this, we store the content of the prompt and re-set it upon a resize. This preserves the prompt text throughout resizes. The text will still clear when you click the clear button, as it should.

  **Master**

  | Before Resize      | After Resize |
  | ----------------- | ------------ |
  |  ![master-beforeresize](https://user-images.githubusercontent.com/23396902/113553721-2a428d80-95c6-11eb-971b-bb77151bc6d5.png)  |  ![master-afterresize](https://user-images.githubusercontent.com/23396902/113553769-3d555d80-95c6-11eb-9cdb-9ad1fd7208a9.png) |

  **PR**
  | Before Resize      | After Resize |
  | ----------------- | ------------ |
  | ![pr-beforeresize](https://user-images.githubusercontent.com/23396902/113553885-6f66bf80-95c6-11eb-8317-0975f1ebd444.png) | ![pr-afterresize](https://user-images.githubusercontent.com/23396902/113553906-75f53700-95c6-11eb-9a32-b64d8aba98e5.png) |

  Closes #269

ACKs for top commit:
  laanwj:
    Code review ACK 7962e0dde8bbd0fa3dd702e2224774f1edaadcb6
  hebasto:
    ACK 7962e0dde8bbd0fa3dd702e2224774f1edaadcb6
  Talkless:
    tACK 7962e0dde8bbd0fa3dd702e2224774f1edaadcb6, tested on Debian Sid with Qt 5.15.2

Tree-SHA512: a6f19d3f80e2e47725cff5d6e15862b6cb793a65dfcaded15f23bba051088cd3317f068f93290c9b09d0a90f5fcac1c5a4610cc417cc5961ba6d005fe5049ab0
2024-05-15 03:03:16 +07:00
MarcoFalke
1ed2d2d891
Merge #21053: rpc, test: document {previous,next}blockhash as optional
ba7e17e073f833eccd4c7c111ae9058c3f123371 rpc, test: document {previous,next}blockhash as optional (Sebastian Falbesoner)

Pull request description:

  This PR updates the result help of the following RPCs w.r.t. the `previousblockhash` and `nextblockhash` fields:
  - getblockheader
  - getblock

  Also adds trivial tests on genesis block (should not contain "previousblockhash") and best block (should not contain "nextblockhash").

Top commit has no ACKs.

Tree-SHA512: ef42c5c773fc436e1b4a67be14e2532e800e1e30e45e54a57431c6abb714d2c069c70d40ea4012d549293b823a1973b3f569484b3273679683b28ed40abf46bb
2024-05-15 03:02:45 +07:00
pasta
3b0323a683
Merge #6007: refactor: move {epoll, kqueue} (de)init logic and wakeup pipes logic out of CConnman and into EdgeTriggeredEvents and WakeupPipes
bd8b5d4007 net: add more details to log information in ETE and `WakeupPipes` (Kittywhiskers Van Gogh)
ec99294976 net: restrict access `EdgeTriggerEvents` members (Kittywhiskers Van Gogh)
f24520a3a2 net: log `close` failures in `EdgeTriggerEvents` and `WakeupPipe` (Kittywhiskers Van Gogh)
b8c3b480eb refactor: introduce `WakeupPipe`, move wakeup select pipe logic there (Kittywhiskers Van Gogh)
ed7d976c3e refactor: move wakeup pipe (de)registration to ETE (Kittywhiskers Van Gogh)
f50c710028 refactor: move `CConnman::`(`Un`)`registerEvents` to ETE (Kittywhiskers Van Gogh)
3a9f386138 refactor: move `SOCKET` addition/removal from interest list to ETE (Kittywhiskers Van Gogh)
212df0677f refactor: introduce `EdgeTriggeredEvents`, move {epoll, kqueue} fd there (Kittywhiskers Van Gogh)
3b11ef9b89 refactor: move `CConnman::SocketEventsMode` to `util/sock.h` (Kittywhiskers Van Gogh)

Pull request description:

  ## Motivation

  `CConnman` is an entity that contains a lot of platform-specific implementation logic, both inherited from upstream and added upon by Dash (support for edge-triggered socket events modes like `epoll` on Linux and `kqueue` on FreeBSD/Darwin).

  Bitcoin has since moved to strip down `CConnman` by moving peer-related logic to the `Peer` struct in `net_processing` (portions of which are backported in #5982 and friends, tracking efforts from https://github.com/bitcoin/bitcoin/issues/19398) and moving socket-related logic to `Sock` (portions of which are aimed to be backported in #6004, tracking efforts from https://github.com/bitcoin/bitcoin/pull/21878).

  Due to the direction being taken and the difference in how edge-triggered events modes operate (utilizing interest lists and events instead of iterating over each socket) in comparison to level-triggered modes (which are inherited from upstream), it would be reasonable to therefore, isolate Dash-specific code into its own entities and minimize the information `CConnman` has about its internal workings.

  One of the visible benefits of this approach is comparing `develop` (as of this writing, d44b0d5dcb) and this pull request for interactions between wakeup pipes logic and {`epoll`, `kqueue`} logic.

  This is what construction looks like:

  d44b0d5dcb/src/net.cpp (L3358-L3397)

  But, if we segment wakeup pipes logic (that work on any platform with POSIX APIs and excludes Windows) and {`epoll`, `kqueue`} logic (calling them `EdgeTriggeredEvents` instead), construction looks different:

  907a351517/src/util/wpipe.cpp (L12-L38)

  Now wakeup pipes logic doesn't need to know what socket events mode is being used nor are the implementation aspects of (de)registering it its concern, that is now `EdgeTriggeredEvents` problem.

  ## Additional Information

  * This pull request will need testing on macOS (FreeBSD isn't a tier-one target) to ensure that lack of breakage in `kqueue`-specific logic.

  ## Breaking Changes

  * Dependency for https://github.com/dashpay/dash/pull/6018
  * More logging has been introduced and existing log messages have been made more exhaustive. If there is parsing that relies on a particular template, they will have to be updated.
  * If `EdgeTriggeredEvents` or `WakeupPipes` fail to initialize or are incorrectly initialized and not destroyed immediately, any further attempts at calling any of its functions will result in an `assert`-induced crash. Earlier behavior may have allowed for silent failure but segmentation of logic from `CConnman` means the newly created instances must only exist if the circumstances needed for it to initialize correctly are present.

    This is to ensure that `CConnman` doesn't have to concern itself with internal workings of either entities.

  ## 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 **(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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK bd8b5d4007

Tree-SHA512: 8f793d4b4f2d8091e05bb9cc108013e924bbfbf19081290d9c0dfd91b0f2c80652ccf853f1596562942b4433509149c526e111396937988db605707ae1fe7366
2024-05-14 11:31:14 -05:00
Kittywhiskers Van Gogh
bd8b5d4007
net: add more details to log information in ETE and WakeupPipes 2024-05-14 17:23:15 +00:00
Kittywhiskers Van Gogh
ec99294976
net: restrict access EdgeTriggerEvents members
- File descriptor creation and destruction are handled within ETE, no
  reason to expose read-write access to it.
- (Un)registerPipe should only be used within WakeupPipe, remove from
  public view.
2024-05-14 17:23:15 +00:00
Kittywhiskers Van Gogh
f24520a3a2
net: log close failures in EdgeTriggerEvents and WakeupPipe 2024-05-14 17:23:15 +00:00
Kittywhiskers Van Gogh
b8c3b480eb
refactor: introduce WakeupPipe, move wakeup select pipe logic there 2024-05-14 17:23:15 +00:00
Kittywhiskers Van Gogh
ed7d976c3e
refactor: move wakeup pipe (de)registration to ETE 2024-05-14 17:23:15 +00:00
Kittywhiskers Van Gogh
f50c710028
refactor: move CConnman::(Un)registerEvents to ETE 2024-05-14 17:23:14 +00:00
Kittywhiskers Van Gogh
3a9f386138
refactor: move SOCKET addition/removal from interest list to ETE
Additionally, log errors if removal from interest list fails (which is
possible if it was already removed or socket is invalid).
2024-05-14 17:23:14 +00:00
Kittywhiskers Van Gogh
212df0677f
refactor: introduce EdgeTriggeredEvents, move {epoll, kqueue} fd there 2024-05-14 17:23:14 +00:00
Kittywhiskers Van Gogh
3b11ef9b89
refactor: move CConnman::SocketEventsMode to util/sock.h 2024-05-14 17:23:14 +00:00
pasta
146be9f0d8
Merge #6003: feat: support rpc protx-register for descriptor wallets - part VI
a33dcb3283 fix: CheckWalletOwnsScript/CheckWalletOwnsKey to use wallet instead of SPK (Konstantin Akimov)
b2ede8bfee feat: update list of tests that still doesn't support descriptor wallets (Konstantin Akimov)
838d06f2fd feat: enable descriptor wallets for more tests (Konstantin Akimov)
5ab108c982 feat: implementation of RPC 'protx register' for descriptor wallets (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Many rpc such as `protx register` uses forcely LegacyScriptPubKeyMan instead using CWallet's interface.
  It causes a failures such as
  ```
  test_framework.authproxy.JSONRPCException: This type of wallet does not support this command (-4)
  ```
  for all functional tests that uses Masternodes/evo nodes.

  See https://github.com/dashpay/dash-issues/issues/59 to track progress

  ## What was done?
  Some direct usages of LegacyScriptPubKeyMan refactored to use CWallet's functionality.
  There are still 4 functional tests that doesn't work for descriptor wallets:
   - feature_dip3_deterministicmns.py (no rpc `protx updateregistar`)
   - feature_governance.py: no rpc for `governance votemany` and `governance votealias`
   - interface_zmq_dash.py (see governance)

  That's part I of changes, other changes are not PR-ready yet, WIP.

  ## How Has This Been Tested?
  Firstly, the flag `--legacy-wallets` are removed for many functional tests.
  Secondly, the flag `--descriptors` is inverted in default value:
  ```
  diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
  index 585a6a74d6..9ad5fd1daa 100755
  --- a/test/functional/test_framework/test_framework.py
  +++ b/test/functional/test_framework/test_framework.py
  @@ -242,10 +242,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):

           if self.options.descriptors is None:
               # Prefer BDB unless it isn't available
  -            if self.is_bdb_compiled():
  -                self.options.descriptors = False
  -            elif self.is_sqlite_compiled():
  +            if self.is_sqlite_compiled():
                   self.options.descriptors = True
  +            elif self.is_bdb_compiled():
  +                self.options.descriptors = False
               else:
                   # If neither are compiled, tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
                   # It still needs to exist and be None in order for tests to work however.
  ```

  ## Breaking Changes
  N/A, descriptor wallets have not been publicly released yet

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

Tree-SHA512: 24e22ac91e30a3804d1ac9af864eb9d073208bbb6d1f3326c7f0438f3ccce2b553aa46450989e48cb5c6e0d838ff1c88c6522f195e7aa2bd89342710f3ecef77
2024-05-14 09:17:00 -05:00
pasta
806fc73494
Merge #5954: refactor: significant Mutex refactoring
acd0f49d7b refactor: significant Mutex refactoring (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Don't use generic names; recursive mutexes where not needed; etc

  ## What was done?
  Includes:
  RecursiveMutex -> Mutex,
  renaming of `cs` to something more meaningful,
  usage of atomics where trivially possible,
  introduce a method CQuorum::SetVerificationVector to avoid needing to lock an internal mutex externally

  ## How Has This Been Tested?
  Compiling

  ## Breaking Changes
  None

  ## Checklist:
    _Go over all the following points, and put an `x` in all the boxes that apply._
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

Top commit has no ACKs.

Tree-SHA512: 76d0ee37e348680bdcd8f03237d3fc1febbf908a9c13e6ddea7be52a35adfca35cde3001ce6ecb140d7dba950ad19519d34d137de17a073306e3e7b26cb95b70
2024-05-14 09:16:33 -05:00
pasta
26cfbb00e2
Merge #6004: backport: merge bitcoin#21167, #22782, #21943, #22829, #24079, #24108, #24157, #25109 (network backports: part 5)
5dde8e7b33 merge bitcoin#25109: Strengthen AssertLockNotHeld assertions (Kittywhiskers Van Gogh)
a1f005ee71 merge bitcoin#24157: Replace RecursiveMutex cs_totalBytesSent with Mutex and rename it (Kittywhiskers Van Gogh)
de4b4bf9ee merge bitcoin#24108: Replace RecursiveMutex cs_addrLocal with Mutex, and rename it (Kittywhiskers Van Gogh)
2f7a138452 merge bitcoin#24079: replace RecursiveMutex cs_SubVer with Mutex (and rename) (Kittywhiskers Van Gogh)
23b152cd37 merge bitcoin#22829: various RecursiveMutex replacements in CConnman (Kittywhiskers Van Gogh)
362e3101ad merge bitcoin#21943: Dedup and RAII-fy the creation of a copy of CConnman::vNodes (Kittywhiskers Van Gogh)
bf98ad6a42 merge bitcoin#22782: Remove unused MaybeSetAddrName (Kittywhiskers Van Gogh)
2b65526818 merge bitcoin#21167: make CNode::m_inbound_onion public, initialize explicitly (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependent on https://github.com/dashpay/dash/pull/6001
  * Dependency for https://github.com/dashpay/dash/pull/6018
  * Partially reverts ff69e0d575 from https://github.com/dashpay/dash/pull/5336 due to `Span<CNode*>`'s incompatibility with `CConnman::NodesSnapshot::Snap()` (returning `const std::vector<CNode*>&`)

    ```
    masternode/sync.cpp:147:18: error: no matching member function for call to 'RequestGovernanceObjectVotes'
            m_govman.RequestGovernanceObjectVotes(snap.Nodes(), connman);
            ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ./governance/governance.h:360:9: note: candidate function not viable: no known conversion from 'const
    std::vector<CNode *>' to 'CNode &' for 1st argument
        int RequestGovernanceObjectVotes(CNode& peer, CConnman& connman) const;
          ^
    ./governance/governance.h:361:9: note: candidate function not viable: no known conversion from 'const std::vector<CNode *>' to 'Span<CNode *>' for 1st argument
        int RequestGovernanceObjectVotes(Span<CNode*> vNodesCopy, CConnman& connman) const;
          ^
    1 error generated.
    ```
  * Dash already implements its own `CNode*` iteration logic in [dash#1382](https://github.com/dashpay/dash/pull/1382) and implemented additional capabilities in [dash#1575](https://github.com/dashpay/dash/pull/1575), which meant backporting [bitcoin#21943](https://github.com/bitcoin/bitcoin/pull/21943) involved migrating Dash-specific code to upstream logic that needed to be modified to implement expected functionality.

  * Unlike Bitcoin, Dash maintains a map of every raw `SOCKET` corresponding to a pointer of their `CNode` instance and uses it to translate socket sets to their corresponding `CNode*` sets. This is done to accommodate for edge-triggered modes which have an event-socket relationship, as opposed to level-triggered modes, which have a socket-event relationship.

    This means that `CConnman::SocketHandlerConnected()` doesn't require access to a vector of all `CNode` pointers and therefore, the argument `nodes` has been omitted.

  ## 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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK 5dde8e7b33

Tree-SHA512: 5685d8ebb4fa1f10d018e60d9b0efc3100ea13ac437e7892a09ad3f86d6ac6756e4b5a08ebe70de2eabb27740678e10b975d319f2d553ae5b27dafa71dba0a9f
2024-05-10 11:01:14 -05:00
pasta
6028e37ad9
Merge #6017: backport: bitcoin#18836, #19046, #19490, #20403, #21127, #21238, #21329 - descriptor wallets part V & sethdseed
d3ad11d056 chore: add release notes for sethdseed RPC (Konstantin Akimov)
ad25d54300 Merge bitcoin/bitcoin#21329: descriptor wallet: Cache last hardened xpub and use in normalized descriptors (Samuel Dobson)
24b1f6bb27 Merge #21238: A few descriptor improvements to prepare for Taproot support (W. J. van der Laan)
14ac2b77f3 Merge #21127: wallet: load flags before everything else (Wladimir J. van der Laan)
19b2b27785 Merge #20403: wallet: upgradewallet fixes, improvements, test coverage (MarcoFalke)
708586c77e Merge #18836: wallet: upgradewallet fixes and additional tests (Andrew Chow)
752e4ca048 Merge #19490: wallet: Fix typo in comments; Simplify assert (Samuel Dobson)
63895fde23 Merge #19046: Replace CWallet::Set* functions that use memonly with Add/Load variants (Andrew Chow)
2c0d5b7c71 refactor: rename hdChain to m_hd_chain (Konstantin Akimov)
266aefc544 feat: sethdseed rpc added. Based on bitcoin#12560 and the newest related changes (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Next batch of backports related to descriptor wallets.
  See related issue to track a progress: https://github.com/dashpay/dash-issues/issues/59
  Changes in this PR also used in "hardware signing" feature (coming later)

  ## What was done?
  1. It implements a new rpc `sethdseed` that is based on bitcoin#12560 and newer related changes.
  2. refactoring to rename `hdChain` to `m_hd_chain` (see bitcoin#17681 which is DNM).
  3. Bitcoin backports (some of them uses sethdseed, and requires m_hd_chain to reduce conflicts):
   - bitcoin/bitcoin#19046
   - bitcoin/bitcoin#19490
   - bitcoin/bitcoin#18836
   - bitcoin/bitcoin#20403
   - bitcoin/bitcoin#21127
   - bitcoin/bitcoin#21238
   - bitcoin/bitcoin#21329

  ## How Has This Been Tested?
  Run unit/functional tests.
  The backports #18836 and #20403 are heavily modified to adopt `wallet_upgradewallet.py` to our codebase.

  ## Breaking Changes
  N/A
  Though, `sethdseed` implementation is not a final version as it is now, can be removed (superseeded by `upgradetohd` or got mnemonic-feature and super-seed `upgradetohd`).

  ## 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
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  PastaPastaPasta:
    utACK d3ad11d056

Tree-SHA512: 02182182ec7a5f89eb7d3bc34072d894a86cc89c5eea124e702cc5ed527f76863469b1fd9313b3ea643a8774a358031be927d7b78ec7cd39df0a9ca77559d66d
2024-05-10 09:14:40 -05:00