Commit Graph

34324 Commits

Author SHA1 Message Date
Sebastian Falbesoner
be8d0dba15 test: refactor: save MiniWallet mode explicitly
Rather than abusing the member variables self._priv_key and
self._address to determine the MiniWallet mode, save it explicitly
instead in the constructor to increase the readability and
maintainability of the code.
2022-06-21 10:54:42 +02:00
MacroFake
a09033e22c
Merge bitcoin/bitcoin#25409: doc: fix typos
20c58a3e50 doc: typo fix (Marnix)

Pull request description:

  `contrib/devtools/test-symbol-check.py`: envinonment -> environment
  `contrib/seeds/asmap.py`: succesful -> successful

ACKs for top commit:
  brunoerg:
    ACK 20c58a3e50

Tree-SHA512: acbe060b7c27673208715c4f6d0fac913c61c94a5e7e37b0ab9865d099067568dc683bd0099e5dc46e3602b13b5dae512ec713bd65f56fa10a59d946d5fd2649
2022-06-20 11:36:52 +02:00
Marnix
20c58a3e50 doc: typo fix 2022-06-18 18:34:50 +02:00
MacroFake
8e7eeb5971
Merge bitcoin/bitcoin#25410: wallet: fix warning: "argument name 'feerate' in comment does not match parameter name"
7ca8726f63 wallet: fix warning: "argument name 'feerate' in comment does not match parameter name" (furszy)

Pull request description:

  Should solve the tiny https://github.com/bitcoin/bitcoin/pull/25005#issuecomment-1159403854.

  Which merely happens for the extra "=" character after the comma.

ACKs for top commit:
  Empact:
    Code Review ACK 7ca8726f63

Tree-SHA512: e5368c1114f715bd93cb653c607fd0942ab0b79f709ed7aa627b3fc7e7efd096c92c5c86908c7f26c363b21e391a8faa812727eb32c285e54da3ce0429290361
2022-06-18 18:10:17 +02:00
furszy
7ca8726f63
wallet: fix warning: "argument name 'feerate' in comment does not match parameter name"
Happened because the "feerate=" comment was after the comma.
2022-06-18 12:45:27 -03:00
Andrew Chow
8be652e439
Merge bitcoin/bitcoin#25005: wallet: remove extra wtx lookup in 'AvailableCoins' + several code cleanups.
fd5c996d16 wallet: GetAvailableBalance, remove double walk-through every available coin (furszy)
162d4ad10f wallet: add 'only_spendable' filter to AvailableCoins (furszy)
cdf185ccfb wallet: remove unused IsSpentKey(hash, index) method (furszy)
4b83bf8dbc wallet: avoid extra IsSpentKey -> GetWalletTx lookups (furszy)
3d8a282257 wallet: decouple IsSpentKey(scriptPubKey) from IsSpentKey(hash, n) (furszy)
a06fa94ff8 wallet: IsSpent, 'COutPoint' arg instead of (hash, index) (furszy)
91902b7720 wallet: IsLockedCoin, 'COutPoint' arg instead of (hash, index) (furszy)
9472ca0a65 wallet: AvailableCoins, don't call 'wtx.tx->vout[i]' multiple times (furszy)
4ce235ef8f wallet: return 'CoinsResult' struct in `AvailableCoins` (furszy)

Pull request description:

  This started in #24845 but grew out of scope of it.

  So, points tackled:

  1) Avoid extra `GetWalletTx` lookups inside `AvailableCoins -> IsSpentKey`.
      `IsSpentKey` was receiving the tx hash and index to internally lookup the tx inside the wallet's map. As all the `IsSpentKey` function callers already have the wtx available, them can provide the `scriptPubKey` directly.

  2) Most of the time, we call `Wallet::AvailableCoins`, and later on the process, skip the non-spendable coins from the result in subsequent for-loops. So to speedup the process: introduced the ability to filter by "only_spendable" coins inside `Wallet::AvailableCoins` directly.
  (the non-spendable coins skip examples are inside `AttemptSelection->GroupOutputs` and `GetAvailableBalance`).

  4) Refactored `AvailableCoins` in several ways:

     a) Now it will return a new struct `CoinsResult` instead of receiving the vCoins vector reference (which was being cleared at the beginning of the method anyway). --> this is coming from #24845 but cherry-picked it here too to make the following commits look nicer.

     b) Unified all the 'wtx.tx->vout[I]' calls into a single call (coming from this comment https://github.com/bitcoin/bitcoin/pull/24699#discussion_r854163032).

  5) The wallet `IsLockedCoin` and `IsSpent` methods now accept an `OutPoint` instead of a hash:index. Which let me cleanup a bunch of extra code.

  6) Speeded up the wallet 'GetAvailableBalance': filtering `AvailableCoins` by spendable outputs only and using the 'AvailableCoins' retrieved `total_amount` instead of looping over all the retrieved coins once more.

  -------------------------------------------------------

  Side topic, all this process will look even nicer with #25218

ACKs for top commit:
  achow101:
    ACK fd5c996d16
  brunoerg:
    crACK fd5c996d16
  w0xlt:
    Code Review ACK fd5c996d16

Tree-SHA512: 376a85476f907f4f7d1fc3de74b3dbe159b8cc24687374d8739711ad202ea07a33e86f4e66dece836da3ae6985147119fe584f6e672f11d0450ba6bd165b3220
2022-06-17 18:02:33 -04:00
laanwj
f8586b25f6
Merge bitcoin/bitcoin#25289: test: implement 'bech32m' mode for getnewdestination() helper
dcf36fe8e3 test: implement 'bech32m' mode for `getnewdestination()` helper (Sebastian Falbesoner)
1999dcfa40 test: add helpers for creating P2TR scripts/addresses from output key (Sebastian Falbesoner)

Pull request description:

  This PR adds the missing 'bech32m' mode for the `getnewdestination()` helper and sets it as default, i.e. the function returns a tuple (output x-only-pubkey, scriptPubKey, taproot address) now if not specified otherwise. In a preparation commit, the helpers `output_key_to_p2tr{_script}` are introduced. Note that in contrast to all other common script output types, there are usually _two_ keys involved in creating a taproot output (internal key and output key), hence the prefix `output_` is used to clarify that the  output key is expected and the helpers don't do any key tweaking.

  Thanks to michaelfolkson (for pointing out this TODO that I forgot about) and sipa (for patiently explaining basic things about BIP341).

ACKs for top commit:
  michaelfolkson:
    ACK dcf36fe8e3
  w0xlt:
    reACK dcf36fe8e3

Tree-SHA512: 5bb8d5fd96c63092ede10c3f022ffb2e13c14e333c4aa73348d95deb70cbf0a74745218dc4a7c419eb846793dd69e8217a7b4332a13ae2b2758e100b51fb1a9f
2022-06-17 22:51:42 +02:00
laanwj
e5df0ba0d9
Merge bitcoin/bitcoin#25360: build: SystemTap 4.7 (RISC-V support)
b8c146b877 build: systemtap 4.7 (fanquake)

Pull request description:

  As of version 4.6, SystemTap now fully supports 64-bit RISC-V.

  Full SystemTap NEWS is here: https://sourceware.org/git/?p=systemtap.git;a=blob;f=NEWS;

  Guix Build (x86_64):
  ```bash
  2c4cf36ea601de27ce1b56b923d41aee30d9d64295a700dcc705bd518865c81c  guix-build-b8c146b87720/output/aarch64-linux-gnu/SHA256SUMS.part
  10dbe855ab64e0e76398fc27e9471071820b9cd5289773c8d9d272f9bb51b7ba  guix-build-b8c146b87720/output/aarch64-linux-gnu/bitcoin-b8c146b87720-aarch64-linux-gnu-debug.tar.gz
  530808f3803a31c4fe84ec85e7b6c284e52850ba32df12dd1e273e9896bad7ff  guix-build-b8c146b87720/output/aarch64-linux-gnu/bitcoin-b8c146b87720-aarch64-linux-gnu.tar.gz
  9fa9e1f2412854f87d980e97cb7b4df37a1a13d48a633b9df5b0006d60c10ede  guix-build-b8c146b87720/output/arm-linux-gnueabihf/SHA256SUMS.part
  dcf44666f80b71637403d5f6fb4eb8159ef61815b3feedc84e3a26c99bd18152  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf-debug.tar.gz
  8623a1e969a8f40286060ebbd9085f3d4f621c507fd5448b38ba36129ba0950a  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf.tar.gz
  59a71bdc8403f4fff4370922a297a7a2200b0a206d68ac71960f09e728bf0781  guix-build-b8c146b87720/output/arm64-apple-darwin/SHA256SUMS.part
  5e17c76526da9f4630ffed2cc2870aa058139fa439d4c756055d8b9f53fc05dc  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.dmg
  72ebdf006dd279128b33e3b0902f8d3d1291d90fd2d67be60bbbd0f0d5e5b336  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.tar.gz
  d3a1bafba070e8197d2d3f790053b6204e6779b8352c41118c82e16f2e500620  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin.tar.gz
  76510b7e6aaccfa8c0f370e1a6d4b6f79e21572ebc0a369d2195557cfc9f6966  guix-build-b8c146b87720/output/dist-archive/bitcoin-b8c146b87720.tar.gz
  cb18e130efa70ca58df2b89d7cc368f0374ad3cf6c59f97cee4c12cfbec6982c  guix-build-b8c146b87720/output/powerpc64-linux-gnu/SHA256SUMS.part
  1028f9deaa1bd140ead816e0278ea5f3eb27e0d70e3e3b11d1f6098da46a0538  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu-debug.tar.gz
  013d97e33f51b985b2b514dbdae093806c890d9f6ca58aec1d62814a874efb8a  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu.tar.gz
  3b2cfa1d9418682eeed02718de36137e330573df24b28b5681301a5cb5320e6b  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/SHA256SUMS.part
  480fd977d8eda3bb9440bfa3e37452ecbeb0f1f4e36a35f6bfa820e7666d2a71  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu-debug.tar.gz
  eabab79ff95df3f326dc1e40dba4925b9a6de374763180c4170a30cdfe26136a  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu.tar.gz
  7f5b6d482bee0c73cf0727395d78591559ab974a2b9bff9689ca2262d0612f39  guix-build-b8c146b87720/output/riscv64-linux-gnu/SHA256SUMS.part
  228cc22329e50d99edc33465f10e136742833ebc675920bdbde07ca3388523d7  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu-debug.tar.gz
  b5d2565a0b05d51e9834c0212b34903c362061c2489878c82dfbe04729cefa2c  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu.tar.gz
  dde6dcf82d7b2f3279150564302a5008d69a3a0fcdedc717c124d460d73ff71d  guix-build-b8c146b87720/output/x86_64-apple-darwin/SHA256SUMS.part
  a5c2e69aba46a164425013b0360674d77687dfe8accc8e8cb97dc630542dc1d3  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.dmg
  cea73001db5a31880ec119f959bb0db21b3f7a12ac21a630b2f12247c4c0b578  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.tar.gz
  8cf6ba1de32f68c70ee23a19fbbeadb59df4c008792c717ac22d476ebe9aa921  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin.tar.gz
  061247b31ba1012689817e304357fca0b7262106223d6eaf8d0b31148bd764d1  guix-build-b8c146b87720/output/x86_64-linux-gnu/SHA256SUMS.part
  20caf9d234a88333b696e0261284c29ea4f83c3b9e590696230614220b2c7e2e  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu-debug.tar.gz
  54c3e57cc4cc6173aa2bb4e17f47e85a346ef752973d6b97f7a3ff015d4f5068  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu.tar.gz
  47f4104cbd46c96bf9c3cb4fcf9e813ee73566781a599e850bf8c5c8d6e7970a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/SHA256SUMS.part
  b337b2841988f0cdcd8aebec669467f38354b626a7d331e84a5a7b7fc47f6a47  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-debug.zip
  25e97d46edb35dd87a55b285dad03a6c571336ab93f8c7457571498e3057118a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-setup-unsigned.exe
  bc9870404d52a5423ce8fee37cae3ebda00d9958b1469d2930aa8f0d61ab55ef  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-unsigned.tar.gz
  194615a1645bed622d91e8760cd3ec33fd0ef684dd6a7a04d1731272f7fd1557  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  442bf81809c481be38317703bdf6ae45d9dd6f1b044515dfe36be514eae8b66a  guix-build-b8c146b87720/output/arm-linux-gnueabihf/SHA256SUMS.part
  a104a61a1dd4f663e809344cc86d500254d4d451f23c062f48e50c6418fcd135  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf-debug.tar.gz
  12f84be1ad44d28595144bbb6319cb2f6fb95b27c633f54771815ccff4fb40aa  guix-build-b8c146b87720/output/arm-linux-gnueabihf/bitcoin-b8c146b87720-arm-linux-gnueabihf.tar.gz
  e6b42524123488ef3342d0806ac562985a1fff214c1bfcd1a26ab8e288caf24a  guix-build-b8c146b87720/output/arm64-apple-darwin/SHA256SUMS.part
  bb01d384bff21c5280d4a193bd4fb158ecaa41d0746db30a52c135e5a6e76750  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.dmg
  2ebeca13939e408aae304f77eb32c683ce703262475d70f9c0a9a51533cabdb4  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin-unsigned.tar.gz
  b5df98dc9b66eb1ae725c050f9e1d94a551ce9637cef29f82cb38ef784996c1c  guix-build-b8c146b87720/output/arm64-apple-darwin/bitcoin-b8c146b87720-arm64-apple-darwin.tar.gz
  76510b7e6aaccfa8c0f370e1a6d4b6f79e21572ebc0a369d2195557cfc9f6966  guix-build-b8c146b87720/output/dist-archive/bitcoin-b8c146b87720.tar.gz
  d38cc0e933f37108f71d826e20d6cc1510fe98d830484977d032fbb66d94ab02  guix-build-b8c146b87720/output/powerpc64-linux-gnu/SHA256SUMS.part
  8dc33ebac8ec67cefe842419015ab42f344971a9fe071bda2b09f6b1696fea68  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu-debug.tar.gz
  57b01141e859246a70c9110c5daa2b388dfc5bab442a873f6b715981bd3dfca1  guix-build-b8c146b87720/output/powerpc64-linux-gnu/bitcoin-b8c146b87720-powerpc64-linux-gnu.tar.gz
  282befd619cfb541c31d1a81495e08c409f2d9174e876f05dc7bd361a3a1821e  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/SHA256SUMS.part
  8ef3a9e19393ef36c8a001477e9ee08dba705978775fcebb5c2349612ce22808  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu-debug.tar.gz
  bbfde476e8f630783a12e9d900d91ab2ab24ee2c7e607699e37fd2d273627a0e  guix-build-b8c146b87720/output/powerpc64le-linux-gnu/bitcoin-b8c146b87720-powerpc64le-linux-gnu.tar.gz
  b0f8f33becc355ab70f549ed4d33b49f73aa5b4adb793b0e661ff1180861cdba  guix-build-b8c146b87720/output/riscv64-linux-gnu/SHA256SUMS.part
  7ee185e1aa6a7b4c536f375d165dd0232a310892a2e9446de713081b471d5d9e  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu-debug.tar.gz
  8d15acb1da57c753131e887453d95c0539f2d4bbb4e3a6deb976e17dee306946  guix-build-b8c146b87720/output/riscv64-linux-gnu/bitcoin-b8c146b87720-riscv64-linux-gnu.tar.gz
  dde6dcf82d7b2f3279150564302a5008d69a3a0fcdedc717c124d460d73ff71d  guix-build-b8c146b87720/output/x86_64-apple-darwin/SHA256SUMS.part
  a5c2e69aba46a164425013b0360674d77687dfe8accc8e8cb97dc630542dc1d3  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.dmg
  cea73001db5a31880ec119f959bb0db21b3f7a12ac21a630b2f12247c4c0b578  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin-unsigned.tar.gz
  8cf6ba1de32f68c70ee23a19fbbeadb59df4c008792c717ac22d476ebe9aa921  guix-build-b8c146b87720/output/x86_64-apple-darwin/bitcoin-b8c146b87720-x86_64-apple-darwin.tar.gz
  a05b02f8270bc1928e89ac03d2ab40da9e1fc35cf5416c511fe67a197c64b241  guix-build-b8c146b87720/output/x86_64-linux-gnu/SHA256SUMS.part
  9f213cfc3afb899cf1e06b796f0ab7e4414f60e267f286837d10944c592d0cad  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu-debug.tar.gz
  7f8100bbf4415f4cf531e0b652026e1429877df873bce6b45433e7e1b638efe4  guix-build-b8c146b87720/output/x86_64-linux-gnu/bitcoin-b8c146b87720-x86_64-linux-gnu.tar.gz
  8d5ad864562ca22a37380a89db7a78574462b78bd74fcf8b663b8164043e800f  guix-build-b8c146b87720/output/x86_64-w64-mingw32/SHA256SUMS.part
  3713b4d70e4eb56b0875d07c698eab270c680da0f81be5394ea16750c5b56490  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-debug.zip
  25e97d46edb35dd87a55b285dad03a6c571336ab93f8c7457571498e3057118a  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-setup-unsigned.exe
  bc9870404d52a5423ce8fee37cae3ebda00d9958b1469d2930aa8f0d61ab55ef  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64-unsigned.tar.gz
  1d78eb522fdebb8e494c63656212972657f323406b43a5f6af835f272529915f  guix-build-b8c146b87720/output/x86_64-w64-mingw32/bitcoin-b8c146b87720-win64.zip
  ```

ACKs for top commit:
  laanwj:
    Tested ACK b8c146b877

Tree-SHA512: e62621b3b51fe7e391f262137de87231a3fb0e39c4090017990317ae758493fab36e5764843b905b86a5d48bbf2c8a08de7c596c1cc590585099fe5bc9cc18be
2022-06-17 22:07:08 +02:00
laanwj
1b0469199b
Merge bitcoin/bitcoin#25281: build: Remove unused LIBBITCOIN_KERNEL variable
ce1c8104aa build: Remove unused `LIBBITCOIN_KERNEL` variable (Hennadii Stepanov)

Pull request description:

  Noticed that while working on moving the build system to CMake. But I [am not the first](https://github.com/bitcoin/bitcoin/pull/24322/files#r860472867) one :)

ACKs for top commit:
  laanwj:
    ACK ce1c8104aa

Tree-SHA512: 877b9f0d64c4c72f403335d7a8462e551f6f8cd5648a211f980d6da5ed7683521d6549f6acf15ac8e55f67915c556201a1980228c975a22135507746e2f392ce
2022-06-17 22:04:38 +02:00
laanwj
015717e2b8
Merge bitcoin/bitcoin#25299: doc: Correct comments re. units of constants
241c4d047e doc: Correct comment describing value of MAX_FILE_SIZE_PSBT as in MiB (Ben Woosley)
64f81a38b9 doc: Correct nPruneTarget misidentifying units of variable (darosior)

Pull request description:

  In https://github.com/bitcoin/bitcoin/pull/15848, darosior fixed up a comment which mis-identified the units of a constant.

  Another comment misidentified a value as in MiB rather than MB.

ACKs for top commit:
  laanwj:
    Code review ACK 241c4d047e
  darosior:
    ACK 241c4d047e, with or without https://github.com/bitcoin/bitcoin/pull/25299#discussion_r892705277

Tree-SHA512: 96c03a35140e5c53759f387bd292a8f8f621ba74c3cf6621939fad40f48892d23141c747ad3ab4fd71108e3b737670175abc2eb3990a1bd1660366c55d61ddf8
2022-06-17 21:47:33 +02:00
laanwj
3b3c66f859
Merge bitcoin/bitcoin#25392: scripts: remove no-longer-needed ignored exports
84e56b45b4 scripts: remove no-longer-needed ignored exports (fanquake)

Pull request description:

  Haven't checked which commit this changed (I assume the GCC-10 consolidation), however Guix builds no-longer require these exports to be ignored.

  Guix Build (x86_64):
  ```bash
  9be92af4d0697aec2e54fd105002f690c174e0da07fd62506865a7d52395afb5  guix-build-84e56b45b45e/output/aarch64-linux-gnu/SHA256SUMS.part
  a7c9e708c9a8e6e8c98dab326e010719f6f89c2d81e6ce61a9d976e1a179ea44  guix-build-84e56b45b45e/output/aarch64-linux-gnu/bitcoin-84e56b45b45e-aarch64-linux-gnu-debug.tar.gz
  e0ba3a6a9c319739cfdb0cf6d3f389cfd1e16008385fcad6d70ac404c9bf9db0  guix-build-84e56b45b45e/output/aarch64-linux-gnu/bitcoin-84e56b45b45e-aarch64-linux-gnu.tar.gz
  f3e71a81727a4a177454e9c15d2a07fcf8f9431e0259eabd31d5cef72682f33c  guix-build-84e56b45b45e/output/arm-linux-gnueabihf/SHA256SUMS.part
  ff8cf7390281bdd3c421f1ee19b68727732e0676058eb2dd442b7ae1fc80e0f1  guix-build-84e56b45b45e/output/arm-linux-gnueabihf/bitcoin-84e56b45b45e-arm-linux-gnueabihf-debug.tar.gz
  561f69b6862a4c24bc00a18249e1ef0064c221ab96047ac8fd57b54dc102332c  guix-build-84e56b45b45e/output/arm-linux-gnueabihf/bitcoin-84e56b45b45e-arm-linux-gnueabihf.tar.gz
  a1352d3e1720d8b67e009596dea8bfe873e9200150b2ff9219d2c44b14273b10  guix-build-84e56b45b45e/output/arm64-apple-darwin/SHA256SUMS.part
  fe6ab4fb695322fe5247f8b355ca5d0a2f94d5dda67b44f710b640971fa8b29c  guix-build-84e56b45b45e/output/arm64-apple-darwin/bitcoin-84e56b45b45e-arm64-apple-darwin-unsigned.dmg
  13aa79cfb9642efe00fe03389dd4b358d767a9ee8268da3705f0c6d112400b8a  guix-build-84e56b45b45e/output/arm64-apple-darwin/bitcoin-84e56b45b45e-arm64-apple-darwin-unsigned.tar.gz
  e62df23e9bbccaa6864eef8d8efa2a701a0b1322d6feca7b134311ba13621f99  guix-build-84e56b45b45e/output/arm64-apple-darwin/bitcoin-84e56b45b45e-arm64-apple-darwin.tar.gz
  0d22f8d02f9b16aace107c013166b52e4ea9b3f7babf44257b6c51bb30418f27  guix-build-84e56b45b45e/output/dist-archive/bitcoin-84e56b45b45e.tar.gz
  edd3cd49d8bf1765cc008f63a94e53cb153a646f072599637153573f77f4696a  guix-build-84e56b45b45e/output/powerpc64-linux-gnu/SHA256SUMS.part
  868602e7bbdce98a0974eb057b1b3670e87c9bcd110d40004e86e20768c8de32  guix-build-84e56b45b45e/output/powerpc64-linux-gnu/bitcoin-84e56b45b45e-powerpc64-linux-gnu-debug.tar.gz
  449c261eb9125764f0c9796bb48f01a12e3d034dd9591bb7722fa85451e4abf9  guix-build-84e56b45b45e/output/powerpc64-linux-gnu/bitcoin-84e56b45b45e-powerpc64-linux-gnu.tar.gz
  154e03ba9103ecc72c9cfa1fa2dbad1ab626e44502b520599791de3772656fd1  guix-build-84e56b45b45e/output/powerpc64le-linux-gnu/SHA256SUMS.part
  a9469869fcf1d0b92abe6ecdb1eb99d251da158ad867db342ef8bd1875b3ec13  guix-build-84e56b45b45e/output/powerpc64le-linux-gnu/bitcoin-84e56b45b45e-powerpc64le-linux-gnu-debug.tar.gz
  5118caa6e4df5f99f0fd11911578758e8969d11766a042b986bcb83fbe1ba114  guix-build-84e56b45b45e/output/powerpc64le-linux-gnu/bitcoin-84e56b45b45e-powerpc64le-linux-gnu.tar.gz
  879f536a3a1486465611281b50fd4607c78da935b9cf9478b75c204560cc919c  guix-build-84e56b45b45e/output/riscv64-linux-gnu/SHA256SUMS.part
  25665580fc1cb830483dfb8ae0238dba14237e726e830028a043b09c93ef71a1  guix-build-84e56b45b45e/output/riscv64-linux-gnu/bitcoin-84e56b45b45e-riscv64-linux-gnu-debug.tar.gz
  833c7e202c937c2577ecee2c974c9d15c5042e7e1a0a19c10bd80e8ea748c643  guix-build-84e56b45b45e/output/riscv64-linux-gnu/bitcoin-84e56b45b45e-riscv64-linux-gnu.tar.gz
  372c6778a9cdb488b02600d6a0b7c4f0acb7418a00bc80817cbf09e7ed20d56a  guix-build-84e56b45b45e/output/x86_64-apple-darwin/SHA256SUMS.part
  b711303e1fcda56ca9e804d12c674687a1906a0d33025153f0795b374d35f8a4  guix-build-84e56b45b45e/output/x86_64-apple-darwin/bitcoin-84e56b45b45e-x86_64-apple-darwin-unsigned.dmg
  8a41582ca663a12c4e46752f96cff2f82b3c03b9a99a6d2aa9b545d49f2c3adf  guix-build-84e56b45b45e/output/x86_64-apple-darwin/bitcoin-84e56b45b45e-x86_64-apple-darwin-unsigned.tar.gz
  5d622bdf94e009483fa287b611a3eb6c887e88fd3c242e323015f96aaa7ae645  guix-build-84e56b45b45e/output/x86_64-apple-darwin/bitcoin-84e56b45b45e-x86_64-apple-darwin.tar.gz
  836ec0b63b44cfaca13fe1bbf150a250a04b748457a01b72f7d178df8bf3d7ea  guix-build-84e56b45b45e/output/x86_64-linux-gnu/SHA256SUMS.part
  ed2ad8864c361df278288b5e18047f1d98960a0d10bf34f09e30558237610ba8  guix-build-84e56b45b45e/output/x86_64-linux-gnu/bitcoin-84e56b45b45e-x86_64-linux-gnu-debug.tar.gz
  bda24f092de4bb7d995e9d21714619a0a8bc4ee762e0ef3063201a2b38311256  guix-build-84e56b45b45e/output/x86_64-linux-gnu/bitcoin-84e56b45b45e-x86_64-linux-gnu.tar.gz
  ad21413d411dada0b40b566311531a21022dc0b6eea77ec1807ba59a7000deff  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/SHA256SUMS.part
  5573d65bce9ce5ee65f9ae34b2bd4da8af0ff4ec60a67dfb45ac76bf696711a0  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64-debug.zip
  09e29350ef8f6246d5cd16b7b7d6602bf04f0aea41445ae3f7aa235a1ace79d4  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64-setup-unsigned.exe
  d5804a4e267a36b603723e149833cbb1e1740d34a89f66034e80c3caff31c4cf  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64-unsigned.tar.gz
  aa54a35c667f560609a3f418defd8558806b6081a5a027707954f69557b36f63  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  8cedaaa26db8ad04063b350e475834beaaede949ae985d67bb661f367cacbd5c  guix-build-84e56b45b45e/output/arm-linux-gnueabihf/SHA256SUMS.part
  134a567e6671ac31d911956118794347e37abd647940183f291f985146595ebf  guix-build-84e56b45b45e/output/arm-linux-gnueabihf/bitcoin-84e56b45b45e-arm-linux-gnueabihf-debug.tar.gz
  1a53bd0029537e153be032f09c69a4d950442319c03a6c1f7f2a16ef444c39b7  guix-build-84e56b45b45e/output/arm-linux-gnueabihf/bitcoin-84e56b45b45e-arm-linux-gnueabihf.tar.gz
  b9de5a0182e15c43223bce6a5dcd423c760d1be5c2c3256b69948e35e574e530  guix-build-84e56b45b45e/output/arm64-apple-darwin/SHA256SUMS.part
  86dc1aef2d7fc52b52c26bff5c57415a38d84600430761b296669891dd5dd216  guix-build-84e56b45b45e/output/arm64-apple-darwin/bitcoin-84e56b45b45e-arm64-apple-darwin-unsigned.dmg
  043ba78adfac04bbeda75fd9c8718980abd2073716e0925a0eda688755e91765  guix-build-84e56b45b45e/output/arm64-apple-darwin/bitcoin-84e56b45b45e-arm64-apple-darwin-unsigned.tar.gz
  1adccc66e8bfe48e1cfaaa9c5a254310565b6897d7b0134d5fc5c787c8d56583  guix-build-84e56b45b45e/output/arm64-apple-darwin/bitcoin-84e56b45b45e-arm64-apple-darwin.tar.gz
  0d22f8d02f9b16aace107c013166b52e4ea9b3f7babf44257b6c51bb30418f27  guix-build-84e56b45b45e/output/dist-archive/bitcoin-84e56b45b45e.tar.gz
  50e98b648087f4d20f7e6b4cdee07f200523a9ba7474db8ac9771fdedd391c76  guix-build-84e56b45b45e/output/powerpc64-linux-gnu/SHA256SUMS.part
  35f200e58e9b206d2743a1e94e0857e0494fa650be91683b89328fcad55e643f  guix-build-84e56b45b45e/output/powerpc64-linux-gnu/bitcoin-84e56b45b45e-powerpc64-linux-gnu-debug.tar.gz
  09d1263b33bee32c9a7584155c4cd2e129ae0cff1b7a1f7049773501841b74b5  guix-build-84e56b45b45e/output/powerpc64-linux-gnu/bitcoin-84e56b45b45e-powerpc64-linux-gnu.tar.gz
  d63b6e9e47ed0fb6f52b7285638eb7030b68d1e821978b8f7fb4a94122f88106  guix-build-84e56b45b45e/output/powerpc64le-linux-gnu/SHA256SUMS.part
  3addd674c1b45bab6b9e5882cce6a0e1138df876a214297554cf957cc9abd3ad  guix-build-84e56b45b45e/output/powerpc64le-linux-gnu/bitcoin-84e56b45b45e-powerpc64le-linux-gnu-debug.tar.gz
  5b2353043239b78a28607cd037729181ddd3705cb6595df0cefc8d2c38e8ce35  guix-build-84e56b45b45e/output/powerpc64le-linux-gnu/bitcoin-84e56b45b45e-powerpc64le-linux-gnu.tar.gz
  7ee90e3c72890bd10ada21ae9223301ea7faf283f937993d9e036bb423351526  guix-build-84e56b45b45e/output/riscv64-linux-gnu/SHA256SUMS.part
  4e660b9a497cc0d1142dfc91ed2ac85bff16eaafe6a28a4f31b3b7650d0b9345  guix-build-84e56b45b45e/output/riscv64-linux-gnu/bitcoin-84e56b45b45e-riscv64-linux-gnu-debug.tar.gz
  6779bcabe53ce8d276082d7694fc897bb0e366a038bca5d45a81ca357fa7a3bc  guix-build-84e56b45b45e/output/riscv64-linux-gnu/bitcoin-84e56b45b45e-riscv64-linux-gnu.tar.gz
  372c6778a9cdb488b02600d6a0b7c4f0acb7418a00bc80817cbf09e7ed20d56a  guix-build-84e56b45b45e/output/x86_64-apple-darwin/SHA256SUMS.part
  b711303e1fcda56ca9e804d12c674687a1906a0d33025153f0795b374d35f8a4  guix-build-84e56b45b45e/output/x86_64-apple-darwin/bitcoin-84e56b45b45e-x86_64-apple-darwin-unsigned.dmg
  8a41582ca663a12c4e46752f96cff2f82b3c03b9a99a6d2aa9b545d49f2c3adf  guix-build-84e56b45b45e/output/x86_64-apple-darwin/bitcoin-84e56b45b45e-x86_64-apple-darwin-unsigned.tar.gz
  5d622bdf94e009483fa287b611a3eb6c887e88fd3c242e323015f96aaa7ae645  guix-build-84e56b45b45e/output/x86_64-apple-darwin/bitcoin-84e56b45b45e-x86_64-apple-darwin.tar.gz
  a20620da9eddd9039a4af4a22ac675047fd84b2897c1077c0c23ce29836617e9  guix-build-84e56b45b45e/output/x86_64-linux-gnu/SHA256SUMS.part
  caeea4294f8b3e76f3a997fc0a4ac11c26b4c6d65430d6293318f2e74bfda8fe  guix-build-84e56b45b45e/output/x86_64-linux-gnu/bitcoin-84e56b45b45e-x86_64-linux-gnu-debug.tar.gz
  59cba65f31fd34d656a86bcf5b6ea8326d7e7cdb215931fc9943dadedcc84ed3  guix-build-84e56b45b45e/output/x86_64-linux-gnu/bitcoin-84e56b45b45e-x86_64-linux-gnu.tar.gz
  3b70924b559c1bd7c05bb8862bb19051af674488b9f03364a20164dc6ae05f36  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/SHA256SUMS.part
  cb0dc3594503b41d0e716be7049eaffe87a85ff15c746e03130ca79f64c308da  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64-debug.zip
  09e29350ef8f6246d5cd16b7b7d6602bf04f0aea41445ae3f7aa235a1ace79d4  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64-setup-unsigned.exe
  d5804a4e267a36b603723e149833cbb1e1740d34a89f66034e80c3caff31c4cf  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64-unsigned.tar.gz
  62881744e69b717cba75cf449fbcd0d4cdee21a88fb002cafaa71439abec339a  guix-build-84e56b45b45e/output/x86_64-w64-mingw32/bitcoin-84e56b45b45e-win64.zip
  ```

ACKs for top commit:
  laanwj:
    Tested ACK 84e56b45b4
  hebasto:
    ACK 84e56b45b4

Tree-SHA512: 682527f4492f04bddfe9f669171c1121da987a485525bcd33a3da9e60b29416e5bab751c9c47849970bfed03a3705475b0a513579c6dde6e896d66e49f0510eb
2022-06-17 17:57:40 +02:00
laanwj
874529665c
Merge bitcoin/bitcoin#22380: build: add and use C_STANDARD and CXX_STANDARD in depends
f7595f1354 build: add and use CXX_STANDARD in depends (fanquake)
7e7b3e42fa build: add and use C_STANDARD in depends (fanquake)

Pull request description:

  By explicitly setting a C standard version we avoid any potential for issues/differences in libraries that may come about due to C STD version, as well as avoid potentially being opted into newer code / features in libraries when compiler defaults change (i.e as of 11.0.0, Clang now defaults to gnu17 over gnu11).

  This should be a no-op for our release builds, because it's just explicitly setting the default that is [already being used](https://github.com/fanquake/core-review/blob/master/compiler-defaults.md). However this is relevant for anyone building depends with a newer compiler.

  I found [one broken `__STDC_VERSION__` check in the](https://github.com/miniupnp/miniupnp/pull/552) miniupnpc header.

  At the same time, add `CXX_STANDARD` for setting our C++ standard, and use that over setting `-std=c++17` for cxx packages.

  Guix builds:
  ```bash
  ```

ACKs for top commit:
  dongcarl:
    Code Review ACK f7595f1354
  laanwj:
    Code review ACK f7595f1354

Tree-SHA512: 9255190d91ba3de20762b1d6af35c59d64f3d77a52bbe9a3f1dfb6bcf16daef66054ebef96b58e7285cd01bf613e69a78bd5e8681c21293e254f23d1fa7b0f71
2022-06-16 23:53:48 +02:00
laanwj
7f2c983e1c
Merge bitcoin/bitcoin#24864: contrib: Use asmap for ASN lookup in makeseeds
667e316bcb contrib: Update makeseeds to asmap-nextgen (laanwj)
ae00b9e02c contrib: add seeds progress indicator and remove asmap one in makeseeds script (Jon Atack)
b54180303d contrib: Use asmap for ASN lookup in makeseeds (laanwj)

Pull request description:

  Add an argument `-a` to provide a asmap file to do the IP to ASN lookups.

  This speeds up the script greatly, and makes the output deterministic. Also removes the dependency on `dns.lookup`.

  I've annotated the output with ASxxxx comments to provide a way to verify the functionality.

  For now I've added instructions in README.md to download and use the `demo.map` from the asmap repository. When we have some other mechanism for distributing asmap files we could switch to that.

  This continues #24824. I've removed the fallbacks and extra complexity, as everyone will be using the same instructions anyway.

  Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
  Co-authored-by: russeree <reese.russell@ymail.com>

ACKs for top commit:
  sipa:
    ACK 667e316bcb
  dunxen:
    re-ACK 667e316

Tree-SHA512: c4cedfbd1dee6be7547aa92dd9e262c46f0ff8099e647559b2a40eab0cc9874e9a813706630dd5c880390d23f432e789fb3e7e8a09f376f567071e68f5904c65
2022-06-16 21:44:52 +02:00
Andrew Chow
b0c8306349
Merge bitcoin/bitcoin#24649: wallet: do not count wallet utxos as external
7832e9438f test: fundrawtransaction preset input weight calculation (S3RK)
c3981e379f wallet: do not count wallet utxos as external (S3RK)

Pull request description:

  Correctly differentiating between external vs non-external utxos in coin control produces more accurate weight and fee estimations.

  Weight for external utxos is estimated based on the maximum signature size, while for the wallet utxos we expect minimal signature due to signature grinding.

ACKs for top commit:
  achow101:
    re-ACK 7832e9438f
  Xekyo:
    re-ACK 7832e9438f
  furszy:
    ACK 7832e943

Tree-SHA512: bb5635b0bd85fa9a76922a53ad3fa062286424c06a695a0e87407c665713e80a33555b644fbb13bcc1ab503dcd7f53aacbdc368d69ac0ecff8005603623ac94f
2022-06-16 14:11:19 -04:00
laanwj
0ea92cad52
Merge bitcoin/bitcoin#24356: refactor: replace CConnman::SocketEvents() with mockable Sock::WaitMany()
6e68ccbefe net: use Sock::WaitMany() instead of CConnman::SocketEvents() (Vasil Dimov)
ae263460ba net: introduce Sock::WaitMany() (Vasil Dimov)
cc74459768 net: also wait for exceptional events in Sock::Wait() (Vasil Dimov)

Pull request description:

  _This is a piece of #21878, chopped off to ease review._

  `Sock::Wait()` waits for IO events on one socket. Introduce a similar `virtual` method `WaitMany()` that waits simultaneously for IO events on more than one socket.

  Use `WaitMany()` instead of `CConnman::SocketEvents()` (and ditch the latter). Given that the former is a `virtual` method, it can be mocked by unit and fuzz tests. This will help to make bigger parts of `CConnman` testable (unit and fuzz).

ACKs for top commit:
  laanwj:
    Code review ACK 6e68ccbefe
  jonatack:
    re-ACK 6e68ccbefe per `git range-diff e18fd47 6747729 6e68ccb`, and verified rebase to master and debug build

Tree-SHA512: 917fb6ad880d64d3af1ebb301c06fbd01afd8ff043f49e4055a088ebed6affb7ffe1dcf59292d822f10de5f323b6d52d557cb081dd7434634995f9148efcf08f
2022-06-16 20:05:03 +02:00
laanwj
489b587669
Merge bitcoin/bitcoin#25215: [kernel 2d/n] Reduce CTxMemPool constructor call sites
d273e53b6e bench/rpc_mempool: Create ChainTestingSetup, use its CTxMemPool (Carl Dong)
020caba3df bench: Use existing CTxMemPool in TestingSetup (Carl Dong)
86e732def3 scripted-diff: test: Use CTxMemPool in TestingSetup (Carl Dong)
213457e170 test/policyestimator: Use ChainTestingSetup's CTxMemPool (Carl Dong)
319f0ceeeb rest/getutxos: Don't construct empty mempool (Carl Dong)
03574b956a tree-wide: clang-format CTxMemPool references (Carl Dong)

Pull request description:

  This is part of the `libbitcoinkernel` project: #24303, https://github.com/bitcoin/bitcoin/projects/18

  This PR reduces the number of call sites where we explicitly construct CTxMemPool. This is done in preparation for later PRs which decouple the mempool module from `ArgsManager`, eventually all of libbitcoinkernel will be decoupled from `ArgsManager`.

  The changes in this PR:

  - Allows us to have less code churn as we modify `CTxMemPool`'s constructor in later PRs
  - In many cases, we can make use of existing `CTxMemPool` instances, getting rid of extraneous constructions
  - In other cases, we construct a `ChainTestingSetup` and use the `CTxMemPool` there, so that we can rely on the logic in `setup_common` to set things up correctly

  ## Notes for Reviewers

  ### A note on using existing mempools

  When evaluating whether or not it's appropriate to use an existing mempool in a `*TestingSetup` struct, the key is to make sure that the mempool has the same lifetime as the `*TestingSetup` struct.

  Example 1: In [`src/fuzz/tx_pool.cpp`](b4f686952a/src/test/fuzz/tx_pool.cpp), the `TestingSetup` is initialized in `initialize_tx_pool` and lives as a static global, while the `CTxMemPool` is in the `tx_pool_standard` fuzz target, meaning that each time the `tx_pool_standard` fuzz target gets run, a new `CTxMemPool` is created. If we were to use the static global `TestingSetup`'s CTxMemPool we might run into problems since its `CTxMemPool` will carry state between subsequent runs. This is why we don't modify `src/fuzz/tx_pool.cpp` in this PR.

  Example 2: In [`src/bench/mempool_eviction.cpp`](b4f686952a/src/bench/mempool_eviction.cpp), we see that the `TestingSetup` is in the same scope as the constructed `CTxMemPool`, so it is safe to use its `CTxMemPool`.

  ### A note on checking `CTxMemPool` ctor call sites

  After the "tree-wide: clang-format CTxMemPool references" commit, you can find all `CTxMemPool` ctor call sites with the following command:

  ```sh
  git grep -E -e 'make_unique<CTxMemPool>' \
              -e '\bCTxMemPool\s+[^({;]+[({]' \
              -e '\bCTxMemPool\s+[^;]+;' \
              -e '\bnew\s+CTxMemPool\b'
  ```

  At the end of the PR, you will find that there are still quite a few call sites that we can seemingly get rid of:

  ```sh
  $ git grep -E -e 'make_unique<CTxMemPool>' -e '\bCTxMemPool\s+[^({;]+[({]' -e '\bCTxMemPool\s+[^;]+;' -e '\bnew\s+CTxMemPool\b'
  # rearranged for easier explication
  src/init.cpp:        node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), mempool_check_ratio);
  src/test/util/setup_common.cpp:    m_node.mempool = std::make_unique<CTxMemPool>(m_node.fee_estimator.get(), 1);
  src/rpc/mining.cpp:        CTxMemPool empty_mempool;
  src/test/util/setup_common.cpp:    CTxMemPool empty_pool;
  src/bench/mempool_stress.cpp:    CTxMemPool pool;
  src/bench/mempool_stress.cpp:    CTxMemPool pool;
  src/test/fuzz/rbf.cpp:    CTxMemPool pool;
  src/test/fuzz/tx_pool.cpp:    CTxMemPool tx_pool_{/*estimator=*/nullptr, /*check_ratio=*/1};
  src/test/fuzz/tx_pool.cpp:    CTxMemPool tx_pool_{/*estimator=*/nullptr, /*check_ratio=*/1};
  src/test/fuzz/validation_load_mempool.cpp:    CTxMemPool pool{};
  src/txmempool.h:    /** Create a new CTxMemPool.
  ```
  Let's break them down one by one:

  ```
  src/init.cpp:        node.mempool = std::make_unique<CTxMemPool>(node.fee_estimator.get(), mempool_check_ratio);
  src/test/util/setup_common.cpp:    m_node.mempool = std::make_unique<CTxMemPool>(m_node.fee_estimator.get(), 1);
  ```

  Necessary

  -----

  ```
  src/rpc/mining.cpp:        CTxMemPool empty_mempool;
  src/test/util/setup_common.cpp:    CTxMemPool empty_pool;
  ```

  These are fixed in #25223 where we stop requiring the `BlockAssembler` to have a `CTxMemPool` if it's not going to consult it anyway (as is the case in these two call sites)

  -----

  ```
  src/bench/mempool_stress.cpp:    CTxMemPool pool;
  src/bench/mempool_stress.cpp:    CTxMemPool pool;
  ```

  Fixed in #24927.

  -----

  ```
  src/test/fuzz/rbf.cpp:    CTxMemPool pool;
  src/test/fuzz/tx_pool.cpp:    CTxMemPool tx_pool_{/*estimator=*/nullptr, /*check_ratio=*/1};
  src/test/fuzz/tx_pool.cpp:    CTxMemPool tx_pool_{/*estimator=*/nullptr, /*check_ratio=*/1};
  src/test/fuzz/validation_load_mempool.cpp:    CTxMemPool pool{};
  ```

  These are all cases where we don't want the `CTxMemPool` state to persist between runs, see the previous section "A note on using existing mempools"

  -----

  ```
  src/txmempool.h:    /** Create a new CTxMemPool.
  ```

  It's a comment (someone link me to a grep that understands syntax plz thx)

ACKs for top commit:
  laanwj:
    Code review ACK d273e53b6e

Tree-SHA512: c4ff3d23217a7cc4a7145defc7b901725073ef73bcac3a252ed75f672c87e98ca0368d1d8c3f606b5b49f641e7d8387d26ef802141b650b215876f191fb6d5f9
2022-06-16 19:49:34 +02:00
laanwj
faf25b09d9
Merge bitcoin/bitcoin#25282: Bugfix: configure: Define default for use_libevent
f0f5cd79b5 Bugfix: configure: Define default for use_libevent (Luke Dashjr)

Pull request description:

  Another trivial fix like #25051 - I think this is the only other one missing.

ACKs for top commit:
  laanwj:
    Code review ACK f0f5cd79b5

Tree-SHA512: 888c2e6d032ef1de5af635e2a9b2b8ab560c86bd10a6cee54aa9aa62ae43f03c19889bb6a2b64cf8982d4cd514f97ca3ed743c71ed0651e9295a4b1726955b9b
2022-06-16 18:19:49 +02:00
fanquake
f7595f1354
build: add and use CXX_STANDARD in depends 2022-06-16 17:01:05 +01:00
fanquake
7e7b3e42fa
build: add and use C_STANDARD in depends 2022-06-16 16:59:05 +01:00
fanquake
84e56b45b4
scripts: remove no-longer-needed ignored exports 2022-06-16 16:12:45 +01:00
MacroFake
8035b5c80d
Merge bitcoin/bitcoin#25369: Unsubtree Univalue
d873ff96e5 refactor: cleanups post unsubtree'ing univalue (fanquake)
e2aa7047f9 refactor: un-subtree univalue (fanquake)

Pull request description:

  At this point, maintaining Univalue as a subtree doesn’t serve much purpose, other than being an inconvenience for making changes to the code (along with polluting our repo with a number of files we don’t use). Our [Univalue fork](https://github.com/bitcoin-core/univalue-subtree) currently deviates from the [upstream API](https://github.com/jgarzik/univalue), and for some time has been marked as not-maintained for use by other projects (I'm not aware of any that use it). The upstream Univalue is not maintained, and has not been for some time. There are no new releases, bugs remain unfixed, and PR's we've upstreamed, https://github.com/jgarzik/univalue/pulls, are not being commented on/merged.

  Another substantial benefit of no-longer maintaining a subtree is removing the rather awkward work-flow currently required to make changes to the Univalue code, particularly breaking changes / introducing new features, e.g. https://github.com/bitcoin-core/univalue-subtree/pull/27. We need to dance around and merge changes to our fork, with a flag, then pull them down here, then switch to using the new code, then go back to our Univalue repo, and remove the old code / flag, then pull the repo down here again, and remove our usage of the flag. Quite the overcomplicated mess.

  With this PR I'm proposing we stop treating Univalue like a subtree, or upstream project/fork, and going forward, treat it as part of this codebase, which we can refactor directly (with pulls to this repo. Ideally, after this is merged, our univalue subtree repo could be marked as "archived". In this repo, I think there is a good chance that the Univalue code will ultimately be refactored away into "modern" C++, i.e using `std::variant` (at least one person has played around with doing this).

  Univalue history:
  - Subtree first introduced: https://github.com/bitcoin/bitcoin/pull/6637
  - `--system-univalue` option introduced: https://github.com/bitcoin/bitcoin/pull/7349
    Suggestion was to use system Univalue by default.
    This was pushed back on by contributors, as well as the [upstream Univalue](https://github.com/jgarzik/univalue) maintainer (jgarzik).
  - Our fork's README was updated to say `It is not maintained for usage by other projects. Notably, the API may break in non-backward-compatible ways.` : https://github.com/bitcoin-core/univalue-subtree/pull/17
  - Our fork README additionally updated to say `the API is broken in non-backward-compatible ways.` : https://github.com/bitcoin-core/univalue-subtree/pull/30
  - `--system-univalue` option removed: https://github.com/bitcoin/bitcoin/pull/22646
  - Univalue "subtree" removed: This PR.

  Guix Build (x86_64):
  ```bash
  06748985a9a386457d10a411b5afe1d59536e5653ec9c5bc8ac8410cd715d073  guix-build-d873ff96e51a/output/aarch64-linux-gnu/SHA256SUMS.part
  57d81891f6d4ae417dd3bcbfc90839600e103da9c7d7b09dbebb82f0119241f3  guix-build-d873ff96e51a/output/aarch64-linux-gnu/bitcoin-d873ff96e51a-aarch64-linux-gnu-debug.tar.gz
  7bb70d3b67253f5e8e5af8158bbf1b4b3e25e782f951d3defb7976534ae67d62  guix-build-d873ff96e51a/output/aarch64-linux-gnu/bitcoin-d873ff96e51a-aarch64-linux-gnu.tar.gz
  b1acb90877d6e3b8d4bd2d57103889e0474263e4153f302eba8cb304fd1aecd7  guix-build-d873ff96e51a/output/arm-linux-gnueabihf/SHA256SUMS.part
  91f9f65aebc131522cae5b523359c62e402a2c929670e1cca19d6a2760d29e04  guix-build-d873ff96e51a/output/arm-linux-gnueabihf/bitcoin-d873ff96e51a-arm-linux-gnueabihf-debug.tar.gz
  1fc3ed39bfc95592503b8dd11f468240deca4fb757f9adb08a0f07f5c0690837  guix-build-d873ff96e51a/output/arm-linux-gnueabihf/bitcoin-d873ff96e51a-arm-linux-gnueabihf.tar.gz
  a5cf5bd0ee0de92fb03f6bca91cfa6667ed77885112e71dd92a82bbd8670141e  guix-build-d873ff96e51a/output/arm64-apple-darwin/SHA256SUMS.part
  f6715399cebb5ac0a09f190fe805146c13d1e8eba57401541d0628da3badc588  guix-build-d873ff96e51a/output/arm64-apple-darwin/bitcoin-d873ff96e51a-arm64-apple-darwin-unsigned.dmg
  07cf82cab4e459ed4e862fc3a2903e49ac750adc6b6fe0534ec165f00e666230  guix-build-d873ff96e51a/output/arm64-apple-darwin/bitcoin-d873ff96e51a-arm64-apple-darwin-unsigned.tar.gz
  81bc076aa415183109e2848fa3cc0265b34f6af3e75b76bcbc6cff524db76a0f  guix-build-d873ff96e51a/output/arm64-apple-darwin/bitcoin-d873ff96e51a-arm64-apple-darwin.tar.gz
  8751b05a3395d668e31217c92cbce9c131aa3566b3784a7e3544adf34fc89fe8  guix-build-d873ff96e51a/output/dist-archive/bitcoin-d873ff96e51a.tar.gz
  526b7780a16a3de3c6006606d3d7a8c2ca565ef28669e2f6f303349a252e4977  guix-build-d873ff96e51a/output/powerpc64-linux-gnu/SHA256SUMS.part
  ff917a50d2b20d41a5954e1ba1e8fb39498a9c8867828483af3f501573148ede  guix-build-d873ff96e51a/output/powerpc64-linux-gnu/bitcoin-d873ff96e51a-powerpc64-linux-gnu-debug.tar.gz
  0311455c821ad392013fc3999a2b2d027fdb5c28e7eb6c3fea9cec29f3730d2d  guix-build-d873ff96e51a/output/powerpc64-linux-gnu/bitcoin-d873ff96e51a-powerpc64-linux-gnu.tar.gz
  983c2553990eb7cebb26e1a0a3e5a9308259dea60d0b64ab6782892d02a7abc1  guix-build-d873ff96e51a/output/powerpc64le-linux-gnu/SHA256SUMS.part
  aba604827d969348671ec3f36dbf37469292715d3f756a7f44a0a5243dbe02f3  guix-build-d873ff96e51a/output/powerpc64le-linux-gnu/bitcoin-d873ff96e51a-powerpc64le-linux-gnu-debug.tar.gz
  e450bd82020d5086f3bb0a23181263315cc05eaf6e5809d0a2115bff4e7ddb2e  guix-build-d873ff96e51a/output/powerpc64le-linux-gnu/bitcoin-d873ff96e51a-powerpc64le-linux-gnu.tar.gz
  476e8e2c80498b241af154abd9112bd2767110c0d6d7e9fa11761de716cb760f  guix-build-d873ff96e51a/output/riscv64-linux-gnu/SHA256SUMS.part
  a76435b3492efcd9af47ad652170605fad50691fd5aff2b46bce0bd08014879e  guix-build-d873ff96e51a/output/riscv64-linux-gnu/bitcoin-d873ff96e51a-riscv64-linux-gnu-debug.tar.gz
  83985d409cd90bf7120cf7902ee442595d28a1469b7c600b666ef901981e5190  guix-build-d873ff96e51a/output/riscv64-linux-gnu/bitcoin-d873ff96e51a-riscv64-linux-gnu.tar.gz
  61c89850244ddf5813ff80c242eff89925d30bccadfa5cb63e968c3af49eb964  guix-build-d873ff96e51a/output/x86_64-apple-darwin/SHA256SUMS.part
  cd219fab8918b061a342357d298aca0c044feb34c6d50a7851d5d3bf18cec267  guix-build-d873ff96e51a/output/x86_64-apple-darwin/bitcoin-d873ff96e51a-x86_64-apple-darwin-unsigned.dmg
  1170d3fdb199fbfca2c20b2a77cc81a6fe24b7e4973543a4461e887f14ac68e9  guix-build-d873ff96e51a/output/x86_64-apple-darwin/bitcoin-d873ff96e51a-x86_64-apple-darwin-unsigned.tar.gz
  71e93297ed8c581a7ed32a6948ef7b1ea2e7c43cb054181de3b5f604f7a2c28b  guix-build-d873ff96e51a/output/x86_64-apple-darwin/bitcoin-d873ff96e51a-x86_64-apple-darwin.tar.gz
  fc8b7b670de9d175775e73df47dc855581c873a9be4adf1d81a4dbb2831d5348  guix-build-d873ff96e51a/output/x86_64-linux-gnu/SHA256SUMS.part
  5703b02c2647f9997aa5ca12514d6a54b1eb2e29046223ca062383326b95894f  guix-build-d873ff96e51a/output/x86_64-linux-gnu/bitcoin-d873ff96e51a-x86_64-linux-gnu-debug.tar.gz
  bab4b932b83476cf6fc2e0b5bf0d2203287f7fd0d1a968e325f2edd5b1d8415b  guix-build-d873ff96e51a/output/x86_64-linux-gnu/bitcoin-d873ff96e51a-x86_64-linux-gnu.tar.gz
  5d180b0415fa8e825d46928c168cb1ae6e27016841b2ff8e190bf13879a5545c  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/SHA256SUMS.part
  d469695a32f6414b25fef7b5fdfda4d854071450ba25148a1dce468114fa9057  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64-debug.zip
  2e7d4e533a5998863c115c586c61b75b4039cd329e12ed24cff78b7f16b6ea57  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64-setup-unsigned.exe
  3dabbd627b532beef57c3d4b5bd30c93c5ea74c492918484cf24685aca8d7bc4  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64-unsigned.tar.gz
  3a40660fba08f7632efd1f73c198f8298db33eab6ef5eaca88b997d95fc31f29  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64.zip
  ```

  Guix Build (arm64):
  ```bash
  0e764679199358fc321dcfcb58c6302e6518f55b3fd27bdd47f2da2a826ba16a  guix-build-d873ff96e51a/output/arm-linux-gnueabihf/SHA256SUMS.part
  5955d28e6d56e5a3297dab723b8478f1b0bb7f5b86476c581339122f34cc7f14  guix-build-d873ff96e51a/output/arm-linux-gnueabihf/bitcoin-d873ff96e51a-arm-linux-gnueabihf-debug.tar.gz
  49c68bc0066f709be68f1e5731425d51fb3cb8062a24aa9fa599987165759cad  guix-build-d873ff96e51a/output/arm-linux-gnueabihf/bitcoin-d873ff96e51a-arm-linux-gnueabihf.tar.gz
  ca678d4eb27c9fa3c527211c0ccb145322a15f327545b5c82f1d1b8d3c310e5a  guix-build-d873ff96e51a/output/arm64-apple-darwin/SHA256SUMS.part
  38366d7fbd769b426f1097e966abe39f01a7ce743f6af1cd0f228b1801d3c87f  guix-build-d873ff96e51a/output/arm64-apple-darwin/bitcoin-d873ff96e51a-arm64-apple-darwin-unsigned.dmg
  0c05dc9c17f5d8237b3e003c2e4c715455c3868bd4cd014e2a15ceb152b27b9c  guix-build-d873ff96e51a/output/arm64-apple-darwin/bitcoin-d873ff96e51a-arm64-apple-darwin-unsigned.tar.gz
  32676e1f9f07f3f77143f8b6038c943da6ba93b081232ec52c2ff940f9f7cc88  guix-build-d873ff96e51a/output/arm64-apple-darwin/bitcoin-d873ff96e51a-arm64-apple-darwin.tar.gz
  8751b05a3395d668e31217c92cbce9c131aa3566b3784a7e3544adf34fc89fe8  guix-build-d873ff96e51a/output/dist-archive/bitcoin-d873ff96e51a.tar.gz
  bdae66515060cab0b362784f0b2019b77da0435f1732d3c91fabcfb5e8c675f6  guix-build-d873ff96e51a/output/powerpc64-linux-gnu/SHA256SUMS.part
  8d837391310b4cdec2296a6e78a9f9b3ea2b3da7870881a5cedf86a3429c08c6  guix-build-d873ff96e51a/output/powerpc64-linux-gnu/bitcoin-d873ff96e51a-powerpc64-linux-gnu-debug.tar.gz
  efe825d6f36338bd4c0b427901b72d666f819858fb241a4211f03bbb738f6961  guix-build-d873ff96e51a/output/powerpc64-linux-gnu/bitcoin-d873ff96e51a-powerpc64-linux-gnu.tar.gz
  7494cf8c5f384ca3205b3ed44dd4c0edebcb9e0a6bf9c8e649fc6d99cc5a10b2  guix-build-d873ff96e51a/output/powerpc64le-linux-gnu/SHA256SUMS.part
  8ceeb21d7fce9e164dbb47b35d0551b59819075fc44dcea39603132340f80c41  guix-build-d873ff96e51a/output/powerpc64le-linux-gnu/bitcoin-d873ff96e51a-powerpc64le-linux-gnu-debug.tar.gz
  bfbbb20dc4e7b30444a52f5f57b5789b5d1edee80abdc8066129b48c59ee65c9  guix-build-d873ff96e51a/output/powerpc64le-linux-gnu/bitcoin-d873ff96e51a-powerpc64le-linux-gnu.tar.gz
  65d578b81b00a1032039362dc6be1a71368f390188e0f948829afd03b8858ed2  guix-build-d873ff96e51a/output/riscv64-linux-gnu/SHA256SUMS.part
  e5233d7e7a8832893ff414c78eb3d4bca3ae30d1a1f789a23419c6739b203022  guix-build-d873ff96e51a/output/riscv64-linux-gnu/bitcoin-d873ff96e51a-riscv64-linux-gnu-debug.tar.gz
  fb6d9f5a063dc7752fcc2acc95a0052322d7c8c86d2c6373e0ceb949dcf22f49  guix-build-d873ff96e51a/output/riscv64-linux-gnu/bitcoin-d873ff96e51a-riscv64-linux-gnu.tar.gz
  61c89850244ddf5813ff80c242eff89925d30bccadfa5cb63e968c3af49eb964  guix-build-d873ff96e51a/output/x86_64-apple-darwin/SHA256SUMS.part
  cd219fab8918b061a342357d298aca0c044feb34c6d50a7851d5d3bf18cec267  guix-build-d873ff96e51a/output/x86_64-apple-darwin/bitcoin-d873ff96e51a-x86_64-apple-darwin-unsigned.dmg
  1170d3fdb199fbfca2c20b2a77cc81a6fe24b7e4973543a4461e887f14ac68e9  guix-build-d873ff96e51a/output/x86_64-apple-darwin/bitcoin-d873ff96e51a-x86_64-apple-darwin-unsigned.tar.gz
  71e93297ed8c581a7ed32a6948ef7b1ea2e7c43cb054181de3b5f604f7a2c28b  guix-build-d873ff96e51a/output/x86_64-apple-darwin/bitcoin-d873ff96e51a-x86_64-apple-darwin.tar.gz
  46e9b067ec385ee14642aebc5ec09d7d2382e0204eeb17dc64587013eddd5dff  guix-build-d873ff96e51a/output/x86_64-linux-gnu/SHA256SUMS.part
  23278b19daac51e7df65b817b79fc93562d0f4eb193ef87472456f4bed1464d7  guix-build-d873ff96e51a/output/x86_64-linux-gnu/bitcoin-d873ff96e51a-x86_64-linux-gnu-debug.tar.gz
  4d5e5e23f089a59185f62faf367d8ca86476e406e6b7bbc9e8950cd89d94534d  guix-build-d873ff96e51a/output/x86_64-linux-gnu/bitcoin-d873ff96e51a-x86_64-linux-gnu.tar.gz
  eec8ab97ee9aceef8cb4e7cb5026225ffc5c7b8e8a6d376e8348020000e5af88  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/SHA256SUMS.part
  a31819e67c373f30eafce8dbcb3d6d0c61d1dcf59c51023aa79321934f8a7d2a  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64-debug.zip
  2e7d4e533a5998863c115c586c61b75b4039cd329e12ed24cff78b7f16b6ea57  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64-setup-unsigned.exe
  3dabbd627b532beef57c3d4b5bd30c93c5ea74c492918484cf24685aca8d7bc4  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64-unsigned.tar.gz
  ec438531b4694913dbbf7c91920dcbd957354b164f807867c16a001898edf669  guix-build-d873ff96e51a/output/x86_64-w64-mingw32/bitcoin-d873ff96e51a-win64.zip
  ```

ACKs for top commit:
  laanwj:
    Code review ACK d873ff96e5
  MarcoFalke:
    re-ACK d873ff96e5 only changes: 📼

Tree-SHA512: fc7d781e8cc0fc0a0080eb4b5019e91c55275e087149ed3b5abc6b691170b0ab76f1dd3ce9bb8846eef023897a89123e14751ce8facf2a170829858199904bff
2022-06-16 13:47:01 +02:00
fanquake
d6832217ef
Merge bitcoin/bitcoin#25382: doc requirement that replacement must have higher feerate than direct conflicts
2224bcabc4 [doc] RBF feerate rule (glozow)

Pull request description:

  RBF policy requires the replacement transaction have a higher feerate than each of the directly conflicting transactions (see `PaysMoreThanConflicts`).
  It was pointed out that this rule is undocumented: https://github.com/bitcoin/bitcoin/pull/25038#discussion_r889064935

ACKs for top commit:
  laanwj:
    ACK 2224bcabc4
  w0xlt:
    ACK 2224bcabc4
  darosior:
    ACK 2224bcabc4
  ariard:
    ACK 2224bcab
  t-bast:
    ACK 2224bcabc4

Tree-SHA512: 0d3915100973b66d115c3294f3037d0c5473c00236c8823a4b2fe12ff172457af56c295b41ac0ef983de030f40f0817c046bb486bf60a5a593d1c4524fe1b9d2
2022-06-16 08:09:34 +01:00
Carl Dong
d273e53b6e bench/rpc_mempool: Create ChainTestingSetup, use its CTxMemPool
This is correct because:

- The ChainTestingSetup is constructed before the call to bench.run(...)
- All the runs are performed on the same mempool
2022-06-15 17:28:55 -04:00
Carl Dong
020caba3df bench: Use existing CTxMemPool in TestingSetup 2022-06-15 17:28:55 -04:00
Carl Dong
86e732def3 scripted-diff: test: Use CTxMemPool in TestingSetup
After this commit, there should be no explicit instantiation of
CTxMemPool in src/test other than those in fuzz/ and setup_common

-BEGIN VERIFY SCRIPT-
find_regex="CTxMemPool\s+([^;({]+)(|\(\)|\{\});" \
    && git grep -l -E "$find_regex" -- src/test \
        | grep -v -e "^src/test/util/setup_common.cpp$" \
                  -e "^src/test/fuzz/" \
        | xargs sed -i -E "s@$find_regex@CTxMemPool\& \1 = *Assert(m_node.mempool);@g"
-END VERIFY SCRIPT-
2022-06-15 17:28:55 -04:00
Carl Dong
213457e170 test/policyestimator: Use ChainTestingSetup's CTxMemPool 2022-06-15 17:28:55 -04:00
Carl Dong
319f0ceeeb rest/getutxos: Don't construct empty mempool
...just don't try to consult it at all when fCheckMemPool is false
2022-06-15 17:28:55 -04:00
glozow
2224bcabc4 [doc] RBF feerate rule 2022-06-15 20:24:46 +01:00
Andrew Chow
51eebe082d
Merge bitcoin/bitcoin#25368: doc: Update importaddress mention incompatibility with descriptor wallet
e3609cdc01 doc: Update importaddress mention incompatibility with descriptor wallet (BrokenProgrammer)

Pull request description:

  This is related to #25363 and offers a small update to the error messages from `EnsureLegacyScriptPubKeyMan` and `EnsureConstLegacyScriptPubKeyMan` to mention that they only are compatible with legacy wallets.

  The RPC documentation for `importaddress` is also updated to mention this as well as guide the user to the alternative `importdescriptors` for cases when using descriptor wallets.

  I'm thinking that we can introduce a "porting guide" document mentioned in #25363 in a separate PR since I would have to make myself more familiar with the subject before being able to tackle that.

ACKs for top commit:
  laanwj:
    Code review ACK e3609cdc01
  achow101:
    ACK e3609cdc01

Tree-SHA512: c7a924a7283fe59dc4e04c8c8fa034c15601f0b25eff09d975e98e2e8db5268ff470336b2d978d6916af9f782f9257b840d64bd15485b1742b4a8b8bfd0bb50f
2022-06-15 13:40:32 -04:00
MacroFake
6acba84603
Merge bitcoin/bitcoin#25358: test: passing a value below 5 MB to -maxmempool should throw an error
216c9b00ec test: passing a value below 5 MB to -maxmempool should throw an error (brunoerg)

Pull request description:

  This PR adds test coverage for the following init error:
  5174a139c9/src/init.cpp (L931-L935)

  By default, the minimum value is 5 MB. See:
  https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-memory.md#memory-pool

ACKs for top commit:
  laanwj:
    Code review ACK 216c9b00ec
  furszy:
    Code review ACK 216c9b00

Tree-SHA512: 0c8fdcefb85e3dabb986a6294ad18503168a04246926614cbfa2d09d9e997312c937b01994f2999b1dc583e2eac5cdb8058bd58577baeb3eb23fdc690400cab9
2022-06-15 19:24:14 +02:00
Hennadii Stepanov
26ec2f2d6b
Merge bitcoin-core/gui#618: refactor: Add transactionoverviewwidget.cpp source file
a50e0b1bcb qt, refactor: Add `transactionoverviewwidget.cpp` source file (Hennadii Stepanov)

Pull request description:

  The `TransactionOverviewWidget` class was added in bitcoin-core/gui#176 as a header-only one.

  Apparently, in upcoming [CMake project](https://github.com/hebasto/bitcoin/pull/3), CMake [AUTOMOC](https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html) could be integrated better/simpler, if `QObject`-derived class implementation been placed into a source file.

  From our [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#source-code-organization):
  > Implementation code should go into the `.cpp` file and not the `.h`, unless necessary due to template usage or when performance due to inlining is critical.

ACKs for top commit:
  Sjors:
    tACK a50e0b1bcb
  shaavan:
    ACK a50e0b1bcb

Tree-SHA512: 4707b6be1c5e794c4014475f826ac45ec833e472db11f12d29995f9c5a599ee98622ad54f0af72734b192144b626411c69acdafa0e6d1a390bdebfd7e570f377
2022-06-15 18:08:51 +02:00
fanquake
a7a36590f5
Merge bitcoin/bitcoin#25223: [kernel 2e/n] miner: Make mempool optional, stop constructing temporary empty mempools
0f1a259657 miner: Make mempool optional for BlockAssembler (Carl Dong)
cc5739b27d miner: Make UpdatePackagesForAdded static (Carl Dong)
f024578b3a miner: Absorb SkipMapTxEntry into addPackageTxs (Carl Dong)

Pull request description:

  This is part of the libbitcoinkernel project: #24303, https://github.com/bitcoin/bitcoin/projects/18

  This is **_NOT_** dependent on, but is a "companion-PR" to #25215.

  ### Abstract

  This PR removes the need to construct `BlockAssembler` with temporary, empty mempools in cases where we don't want to source transactions from the mempool (e.g. in `TestChain100Setup::CreateBlock` and `generateblock`). After this PR, `BlockAssembler` will accept a `CTxMemPool` pointer and handle the `nullptr` case instead of requiring a `CTxMemPool` reference.

  An overview of the changes is best seen in the changes in the header file:

  ```diff
  diff --git a/src/node/miner.h b/src/node/miner.h
  index 7cf8e3fb9e..7e9f503602 100644
  --- a/src/node/miner.h
  +++ b/src/node/miner.h
  @@ -147,7 +147,7 @@ private:
       int64_t m_lock_time_cutoff;

       const CChainParams& chainparams;
  -    const CTxMemPool& m_mempool;
  +    const CTxMemPool* m_mempool;
       CChainState& m_chainstate;

   public:
  @@ -157,8 +157,8 @@ public:
           CFeeRate blockMinFeeRate;
       };

  -    explicit BlockAssembler(CChainState& chainstate, const CTxMemPool& mempool);
  -    explicit BlockAssembler(CChainState& chainstate, const CTxMemPool& mempool, const Options& options);
  +    explicit BlockAssembler(CChainState& chainstate, const CTxMemPool* mempool);
  +    explicit BlockAssembler(CChainState& chainstate, const CTxMemPool* mempool, const Options& options);

       /** Construct a new block template with coinbase to scriptPubKeyIn */
       std::unique_ptr<CBlockTemplate> CreateNewBlock(const CScript& scriptPubKeyIn);
  @@ -177,7 +177,7 @@ private:
       /** Add transactions based on feerate including unconfirmed ancestors
         * Increments nPackagesSelected / nDescendantsUpdated with corresponding
         * statistics from the package selection (for logging statistics). */
  -    void addPackageTxs(int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(m_mempool.cs);
  +    void addPackageTxs(const CTxMemPool& mempool, int& nPackagesSelected, int& nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs);

       // helper functions for addPackageTxs()
       /** Remove confirmed (inBlock) entries from given set */
  @@ -189,15 +189,8 @@ private:
         * These checks should always succeed, and they're here
         * only as an extra check in case of suboptimal node configuration */
       bool TestPackageTransactions(const CTxMemPool::setEntries& package) const;
  -    /** Return true if given transaction from mapTx has already been evaluated,
  -      * or if the transaction's cached data in mapTx is incorrect. */
  -    bool SkipMapTxEntry(CTxMemPool::txiter it, indexed_modified_transaction_set& mapModifiedTx, CTxMemPool::setEntries& failedTx) EXCLUSIVE_LOCKS_REQUIRED(m_mempool.cs);
       /** Sort the package in an order that is valid to appear in a block */
       void SortForBlock(const CTxMemPool::setEntries& package, std::vector<CTxMemPool::txiter>& sortedEntries);
  -    /** Add descendants of given transactions to mapModifiedTx with ancestor
  -      * state updated assuming given transactions are inBlock. Returns number
  -      * of updated descendants. */
  -    int UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set& mapModifiedTx) EXCLUSIVE_LOCKS_REQUIRED(m_mempool.cs);
   };

   int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
  ```

  ### Alternatives

  Aside from approach in this current PR, we can also take the approach of moving the `CTxMemPool*` argument from the `BlockAssembler` constructor to `BlockAssembler::CreateNewBlock`, since that's where it's needed anyway. I did not push this approach because it requires quite a lot of call sites to be changed. However, I do have it coded up and can do that if people express a strong preference. This would look something like:

  ```
  BlockAssembler::BlockAssembler(CChainState& chainstate, const Options& options);
  BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, const CTxMemPool* maybe_mempool);
  ```

  ### Future work

  Although wholly out of scope for this PR, we could potentially refine the `BlockAssembler` interface further, so that we have:

  ```
  BlockAssembler::BlockAssembler(CChainState& chainstate, const Options& options);
  BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, std::vector<CTransaction>& txs);
  BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, const CTxMemPool& mempool);
  ```

  Whereby `TestChain100Setup::CreateBlock` and `generateblock` would call the `BlockAssembler::CreateNewBlock` that takes in `CTransaction`s and we can potentially remove `RegenerateCommitments` altogether. All other callers can use the `CTxMemPool` version.

ACKs for top commit:
  glozow:
    ACK 0f1a259657
  laanwj:
    Code review ACK 0f1a259657
  MarcoFalke:
    ACK 0f1a259657 🐊

Tree-SHA512: 2b4b1dbb43d85719f241ad1f19ceb7fc50cf764721da425a3d1ff71bd16328c4f86acff22e565bc9abee770d3ac8827a6676b66daa93dbf42dd817ad929e9448
2022-06-15 16:40:48 +01:00
fanquake
d873ff96e5
refactor: cleanups post unsubtree'ing univalue
Mostly changes to remove src/univalue exceptions from the various linters,
and the required code changes to make them happy. As well as minor doc
changes.
2022-06-15 12:56:44 +01:00
fanquake
e2aa7047f9
refactor: un-subtree univalue
Remove all the files we don't use.
This should not change behavior, or anything at all, as none of these
files are currently used in our build system.
2022-06-15 09:32:41 +01:00
MacroFake
fa07ee165e
Merge bitcoin/bitcoin#25339: RPC/blockchain: Elaborate on scantxoutset documentation
7862c4ac4e RPC/blockchain: Reorder result documentation for scantxoutset (Luke Dashjr)
98718d03be scripted-diff: RPC/blockchain: Lowercase "when" in scantxoutset documentation (Luke Dashjr)
b283e4d823 RPC/blockchain: Elaborate on scantxoutset documentation (Luke Dashjr)

Pull request description:

  Minor doc improvements

ACKs for top commit:
  achow101:
    ACK 7862c4ac4e

Tree-SHA512: a8b16a9b77c3ca216ce2556c26d6a049b12f73500bdb35c172432409b3b9321cc24a08daca1210926e0f75674b2e680e850637700c516c195fb75ce6555c17c4
2022-06-15 08:58:58 +02:00
MacroFake
4c0d1fec16
Merge bitcoin/bitcoin#25374: test: remove unused create_confirmed_utxos helper
42b2fdfd5f test: remove unused `create_confirmed_utxos` helper (Sebastian Falbesoner)

Pull request description:

  After more and more non-wallet tests have been converted to use MiniWallet (#25087, #24839, #24749 etc.), the `create_confirmed_utxos` helper is now not used anymore and can be removed. An alternative would be to create a MiniWallet version of `create_confirmed_utxos`, but it seems that it's not worth it, considering that would be only two lines (calling MiniWallet's `send_self_transfer_multi` with a subsequent `generate` call), see comment https://github.com/bitcoin/bitcoin/pull/24839#discussion_r896472729.

ACKs for top commit:
  MarcoFalke:
    cr ACK 42b2fdfd5f

Tree-SHA512: 274418156265a6071940f53cbcd77f6779af5e951cfa1e5efbf07a5c61487b521ee19f36b4105e5c0a808139d121e5e262e77525ea3d1486a0421f01abcf58fd
2022-06-15 08:38:19 +02:00
MacroFake
a57492f65d
Merge bitcoin/bitcoin#25370: test: check for getblocktxn request with out-of-bounds tx index
5a8c321444 test: check for `getblocktxn` request with out-of-bounds tx index (Sebastian Falbesoner)

Pull request description:

  This PR adds missing test coverage for the `getblocktxn` message handler, in the case that any of the contained indices is out-of-bounds:
  a05876619a/src/net_processing.cpp (L2180-L2183)

ACKs for top commit:
  dunxen:
    ACK 5a8c321

Tree-SHA512: 2743c2c6d8aed57b22f825aefd60ba3e670321b60625a42ea7248e7b0fc41c73e9a5945153567c02824ba3b5f0fce7f4125bffc974973fc608b6ffbe49e14b65
2022-06-15 08:19:45 +02:00
MacroFake
ede9089096
Merge bitcoin/bitcoin#25156: refactor: Introduce PeerManagerImpl::RejectIncomingTxs
fafddafc2c refactor: Introduce PeerManagerImpl::RejectIncomingTxs (MacroFake)

Pull request description:

  Currently there are some confusions in net_processing:

  * There is confusion between `-blocksonly mode` and `block-relay-only`, so adjust all comments to use the same nomenclature.
  * Whether to disconnect peers for providing invs/txs is implemented differently. For example, it seems a bit confusing to disconnect `block-relay-only` peers with `relay` permission when they send a tx message, but not when they send an inv message. Also, keeping track of their inv announcements seems both wasteful and confusing, as it does nothing. This isn't possible in practice, as outbound connections do not have permissions assigned, but sees fragile to rely on. Especially in light of proposed changes to make that possible: https://github.com/bitcoin/bitcoin/pull/17167

ACKs for top commit:
  MarcoFalke:
    Should be trivial to re-ACK with `git range-diff bitcoin-core/master  fa2b5fe0c1 fafddafc2c`.
  jnewbery:
    Code review ACK fafddafc2c
  mzumsande:
    ACK fafddafc2c

Tree-SHA512: 73bf91afe93be619169cfbf3bf80cb08a5e6f73df4e0318b86817bd4d45f67408ea85998855992281d2decc9d24f7d75cffb83a0518d670090907309df8a3490
2022-06-15 08:14:02 +02:00
MacroFake
38c63e3683
Merge bitcoin/bitcoin#25338: scripted-diff: Avoid incompatibility with CMake AUTOUIC feature
018d70b587 scripted-diff: Avoid incompatibility with CMake AUTOUIC feature (Hennadii Stepanov)

Pull request description:

  Working on [migration](https://github.com/hebasto/bitcoin/pull/3) from Autotools to CMake build system, I found that our current code base needs to be adjusted.

  CMake [allows](https://cmake.org/cmake/help/latest/prop_tgt/AUTOUIC.html) to
  > handle the Qt `uic` code generator automatically

  When using this feature, statements like `#include "ui_<ui_base>.h"` are processed in a special way.

  The `node/ui_interface.h` unintentionally breaks this feature. Of course, it is possible to provide a list of source files to be excluded from `AUTOUIC`. But, unfortunately, this approach does not work for the `qt/sendcoinsdialog.cpp` source file, where there are both b71d37da2c/src/qt/sendcoinsdialog.cpp (L10) and b71d37da2c/src/qt/sendcoinsdialog.cpp (L24)

ACKs for top commit:
  MarcoFalke:
    cr ACK 018d70b587
  ryanofsky:
    Code review ACK 018d70b587
  furszy:
    Code review ACK 018d70b5

Tree-SHA512: 4fc83f2e5a82c8ab15c3c3d68f48b9863c47b96c0a66b6276b9b4dfc6063abffd73a16382acfe116553487b3ac697dbde2d9ada1b92010c5d8f8c6aa06f56428
2022-06-15 08:10:38 +02:00
Sebastian Falbesoner
42b2fdfd5f test: remove unused create_confirmed_utxos helper
Confirmed UTXOs in functional tests can simply be created by using
MiniWallet's `send_self_transfer_multi` method with a subsequent
`generate` call to mine a block.
2022-06-15 00:58:02 +02:00
BrokenProgrammer
e3609cdc01 doc: Update importaddress mention incompatibility with descriptor wallet 2022-06-14 20:54:45 +02:00
laanwj
df933596e7
Merge bitcoin/bitcoin#23611: build: add LTO option to depends
094772656d build: support LTO in depends (fanquake)

Pull request description:

  This adds an `LTO` option to depends, i.e `make -C depends LTO=1`, which passes `-flto` when building packages (not currently qt), and automatically configures with `--enable-lto` when doing a build using a `CONFIG_SITE`.

  The following tables comapres the size (in bytes) of the stripped `x86_64` Linux binaries produced with master and this PR (full depends build):

  | Binary | stripped master | stripped LTO=1 | saving |
  | -------- | ----------------: | -------------: | --------: |
  | bitcoin-cli | 1178632 | 469872 | 60% |
  | bitcoin-tx  | 2710584 | 1866504 | 31% |
  | bitcoin-util | 952880 | 240104 | 74% |
  | bitcoin-wallet | 7992888 | 5365984 | 32% |
  | bitcoind | 13421336 | 11868592 | 12% |
  | bitcoin-qt | 37680496 | 31640976 | 16% |

ACKs for top commit:
  laanwj:
    Tested ACK 094772656d

Tree-SHA512: 6b8483ea490e57a153105ad8c38b25fb1af5d55b1af22db398c7c2573612aaf71b4d2b4cf09c18fd6331b1358dba01641eeaa03e5018a925392e1937118d984a
2022-06-14 20:11:54 +02:00
Sebastian Falbesoner
5a8c321444 test: check for getblocktxn request with out-of-bounds tx index 2022-06-14 18:11:22 +02:00
Hennadii Stepanov
a50e0b1bcb
qt, refactor: Add transactionoverviewwidget.cpp source file
Required for better/simpler interaction with CMake AUTOMOC.
2022-06-14 16:55:22 +02:00
MacroFake
a05876619a
Merge bitcoin/bitcoin#25367: [contrib] message-capture-parser: fix out of bounds error for empty vectors
42bbbba7c8 message-capture-parser: fix out of bounds error for empty vectors (Sebastian Falbesoner)

Pull request description:

  The script [message-capture-parser.py](https://github.com/bitcoin/bitcoin/blob/master/contrib/message-capture/message-capture-parser.py) currently throws an "out of bounds" error if a message containing an empty integer vector element is tried to converted to JSON (e.g. by the BIP157 message `cfcheckpt` with empty `FilterHeaders` vector):
  ```
  Traceback (most recent call last):
    File "/home/honey/bitcoin/./contrib/message-capture/message-capture-parser.py", line 217, in <module>
      main()
    File "/home/honey/bitcoin/./contrib/message-capture/message-capture-parser.py", line 202, in main
      process_file(str(capture), messages, "recv" in capture.stem, progress_bar)
    File "/home/honey/bitcoin/./contrib/message-capture/message-capture-parser.py", line 162, in process_file
      msg_dict["body"] = to_jsonable(msg)
    File "/home/honey/bitcoin/./contrib/message-capture/message-capture-parser.py", line 85, in to_jsonable
      elif slot in HASH_INT_VECTORS and isinstance(val[0], int):
  IndexError: list index out of range
  ```

  Fix this by using the `all(...)` predicate rather to access the first element `val[0]` (which in the error case doesn't exist).

ACKs for top commit:
  laanwj:
    Code review ACK 42bbbba7c8

Tree-SHA512: 139ec6b90304a69f26ec731e6f12b216fa10e554f777505b61adfa1e569f6861a4a849159dd1eae7a1aa0427e8598af226b6f0c4015020dcac8ab109fbc35dba
2022-06-14 15:15:22 +02:00
Sebastian Falbesoner
42bbbba7c8 message-capture-parser: fix out of bounds error for empty vectors 2022-06-14 14:28:50 +02:00
Sebastian Falbesoner
dcf36fe8e3 test: implement 'bech32m' mode for getnewdestination() helper 2022-06-14 13:37:18 +02:00
Sebastian Falbesoner
1999dcfa40 test: add helpers for creating P2TR scripts/addresses from output key 2022-06-14 13:32:57 +02:00
fanquake
094772656d
build: support LTO in depends
No Qt for now.
2022-06-14 12:08:27 +01:00
laanwj
9e4fbebcc8
Merge bitcoin/bitcoin#25306: logging: add LogPrintfCategory to log unconditionally with category
ecff20db28 logging: use LogPrintfCategory rather than a manual category (Jon Atack)
eb8aab759f logging: add LogPrintfCategory to log unconditionally with category (Jon Atack)

Pull request description:

  These are the next two commits from #25203.

  - Add `LogPrintfCategory` to log unconditionally while prefixing the output with the passed category name. Add documentation and a unit test, and update the `lint-logs.py` and `lint-format-strings.py` scripts.

  - Replace the log messages that manually print a category, with `LogPrintfCategory`. In upcoming commits, it will likely be used in many other cases, such as to replace `LogPrintf` where it makes sense.

ACKs for top commit:
  klementtan:
    Code Review ACK ecff20db28
  laanwj:
    Code review ACK ecff20db28
  brunoerg:
    ACK ecff20db28

Tree-SHA512: ad3a82835254f7606efcd14b88f3d9072f1eb9b25db1321ed38ef6a4ec60efd555d78f5e19d93736f2f8500251d06f8beee9d694a153f24bf5cce3590a2a45a5
2022-06-14 11:46:32 +02:00