35710 Commits

Author SHA1 Message Date
fanquake
bfce05cc34
Merge bitcoin/bitcoin#26372: build, msvc: Drop no longer required macro definitions for leveldb
393be867241bed175bc65c05ad40c7579b51c393 build, msvc: Drop no longer required macro definitions for leveldb (Hennadii Stepanov)

Pull request description:

  Since levedb v1.21:
  - the `__STDC_LIMIT_MACROS` macro definition is unneeded;
    commit: [50fbc87e8c62a816d6afd4740e0652a13ac6dc3e](50fbc87e8c)

  - the `LEVELDB_ATOMIC_PRESENT` macro is unused;
    commit: [04f39105c5a418905da8b7657ca244d672c99d3b](04f39105c5)

ACKs for top commit:
  sipsorcery:
    tACK 393be867241bed175bc65c05ad40c7579b51c393.
  jarolrod:
    crACK 393be867241bed175bc65c05ad40c7579b51c393

Tree-SHA512: 845bb310474cf17f9f0f70a585054a222914313a0fc28c42a023133250efbb9ab7fb2d1ebb355943233b6fd24d5bddfb73fbbf5dce71ea232ae652af8b695149
2022-10-25 10:07:16 +08:00
MacroFake
1c5c951713
Merge bitcoin/bitcoin#26380: Revert "test: check importing wallets when blocks are pruned throw an error"
e1eadaa72d6831d1d0a53ba97c215dc4cdb64436 Revert "test: check importing wallets when blocks are pruned throw an error" (Aurèle Oulès)

Pull request description:

  The test doesn't pass (not detected by the normal CI, because it is an extended test):

  ```
  Traceback (most recent call last):
    File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/test_framework/test_framework.py", line 133, in main
      self.run_test()
    File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/feature_pruning.py", line 480, in run_test
      self.wallet_test()
    File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/feature_pruning.py", line 361, in wallet_test
      assert_raises_rpc_error(-4, "Importing wallets is disabled when blocks are pruned", self.nodes[2].importwallet, "abc")
    File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/test_framework/util.py", line 130, in assert_raises_rpc_error
      assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
    File "/tmp/cirrus-ci-build/bitcoin-core/test/functional/test_framework/util.py", line 145, in try_rpc
      raise AssertionError(
  AssertionError: Expected substring not found in error message:
  substring: 'Importing wallets is disabled when blocks are pruned'
  error message: 'Only legacy wallets are supported by this command'.
  ```

  So revert it for now, which will be done anyway in https://github.com/bitcoin/bitcoin/pull/24865/commits. (This commit is taken from there)

ACKs for top commit:
  andrewtoth:
    ACK e1eadaa72d6831d1d0a53ba97c215dc4cdb64436

Tree-SHA512: 10f556ea1aa97dc9cb64f91055977eecb9534f658170aabb4909c3e85ca6c20588c7a021219356fab678e0e2bec999d347facd00054f07a9445ad393e6353b4c
2022-10-24 16:51:52 +02:00
glozow
3d0fca1288
Merge bitcoin/bitcoin#26355: p2p: Handle IsContinuationOfLowWorkHeadersSync return value correctly when new headers sync is started
7ad15d11005eac36421398530da127333d87ea80 [net processing] Handle IsContinuationOfLowWorkHeadersSync return value correctly when new headers sync is started (dergoegge)

Pull request description:

  This PR fixes a bug in the headers sync logic that enables submitting headers to a nodes block index that don't lead to a chain that surpasses our DoS limit.

  The issue is that we ignore the return value on [the first `IsContinuationOfLowWorkHeadersSync` call after a new headers sync is started](fabc031048/src/net_processing.cpp (L2553-L2568)), which leads to us passing headers to [`ProcessNewBlockHeaders`](fabc031048/src/net_processing.cpp (L2856)) when that initial `IsContinuationOfLowWorkHeadersSync` call returns `false`. One easy way (maybe the only?) to trigger this is by sending 2000 headers where the last header has a different `nBits` value than the prior headers (which fails the pre-sync logic [here](fabc031048/src/headerssync.cpp (L189))). Those 2000 headers will be passed to `ProcessNewBlockHeaders`.

  I haven't included a test here so far because we can't test this without changing the default value for `CRegTestParams::consensus.fPowAllowMinDifficultyBlocks` or doing some more involved refactoring.

ACKs for top commit:
  sipa:
    ACK 7ad15d11005eac36421398530da127333d87ea80
  glozow:
    ACK 7ad15d1100

Tree-SHA512: 9aabb8bf3700401e79863d0accda0befd2a83c4d469a53f97d827e51139e2f826aee08cdfbc8866b311b153f61fdac9b7aa515fcfa2a21c5e2812c2bf3c03664
2022-10-24 15:38:37 +01:00
MacroFake
3db23fd821
Merge bitcoin-core/gui#676: Update peers window "Transaction Relay" label and tooltip
a079103c94fbaabb40bc086d56e91af6fcee6fe9 gui: update peers window "Transaction Relay" label and tooltip (Jon Atack)

Pull request description:

  to current v24.0 p2p behavior.  Similar updates have been made to RPC getpeerinfo and CLI -netinfo.

Top commit has no ACKs.

Tree-SHA512: 400a794f655f799eefcb77c479fef6bcd3f81aede2af54a4a9bcb7c0c783e2e3f18bc5fd2484a79e8c30af279747a05fc0ebb69dbc47375d4c55b16ceba97b99
2022-10-24 10:42:47 +02:00
MacroFake
8fb3fd2ba4
Merge bitcoin-core/gui#673: Use fallback value for Version and User Agent during peer connection
c2a21c06703fd20e314da8431220776c8f1cc08d gui: use fallback value for Version and User Agent during peer connection (Jon Atack)

Pull request description:

  During connection setup for a peer, getpeerinfo returns `"version": 0, "subver": ""` and the GUI Peers window displays 0 and an empty field, respectively.

  Give these fields the same behavior as the other fields in the GUI Peers window: display the fallback value in `src/qt/forms/debugwindow.ui` (i.e. `N/A`) until a valid result is available after the peer connection completes.

  An alternative would be to display nothing for both, as is the case currently for User Agent.

ACKs for top commit:
  jarolrod:
    ACK c2a21c06703fd20e314da8431220776c8f1cc08d
  furszy:
    code ACK c2a21c06

Tree-SHA512: 4f0060fa9abde120a2bb48c9dcc87894d9bb70c33e6ab43b22400a4bcd0ceff0fa098adf7f385b0a7a4cf5d7053463b36fe1232e19a8d5025eecd8db9833f73b
2022-10-24 10:40:05 +02:00
MacroFake
c05673577d
Merge bitcoin/bitcoin#26358: doc: Rearrange a few lines in the dependency graph of libraries
1184a66347afbaeca69e2d891a138e435fbfd5bb doc: Rearrange some lines in the dependency graph of libraries (Stacie Waleyko)

Pull request description:

  In this PR, I've attempted to improve readability in the [dependency graph of libraries](https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md) by untangling a few crossed lines. I'm not sure if this is that big of an improvement but  wanted to throw it out there.

  I used an extremely scientific method of manually counting the number of crossed lines in the original diagram and got 15. This PR reduces that number down to about 10.

  I also changed the curve of the lines to "basis" which rounds the edges out. Again, not sure if it really is that much of an improvement, but it seems marginally easier on the eyes.

  Here is what the new graph looks like rendered:

  ![Screenshot from 2022-10-20 22-09-30](https://user-images.githubusercontent.com/1823216/197095545-5fc90cce-a817-4db2-a0f5-1a8a95380b70.png)

  The changes can be verified independently with [Mermaid](https://mermaid-js.github.io/mermaid/#/), with the easiest way being the online editor: https://mermaid.live/

  I did try moving some more stuff around, particularly the top level of library callers, but was not able to simplify the graph any further.

ACKs for top commit:
  shaavan:
    ACK 1184a66347afbaeca69e2d891a138e435fbfd5bb

Tree-SHA512: 61d33d68c1e6fa354aebdda5e06e9c7a722ca20886c6acc30dd08af7133d737130d7a646d87f9e5a8ae0bc5a5aabfbc64ded9ee04dfeed8f23d948444add916b
2022-10-24 10:28:03 +02:00
fanquake
50cc8ef5a7
Merge bitcoin/bitcoin#26302: refactor: Use type-safe time point for CWallet::m_next_resend
fa51cc965110e14661c848364a29c493287673be refactor: Use type-safe time point for CWallet::m_next_resend (MacroFake)

Pull request description:

  `GetTime` is not type-safe, thus deprecated, see 75cbbfa279/src/util/time.h (L62-L70)

ACKs for top commit:
  shaavan:
    Code Review ACK fa51cc965110e14661c848364a29c493287673be
  aureleoules:
    ACK fa51cc965110e14661c848364a29c493287673be

Tree-SHA512: 030de10070518580763ea75079442e2f934c54d3083be3ebe35e7f1bc6db2096745bb46d95aa1e6efe29ced30a048acfe5cd999178e6787b7647dfbec5ecb444
2022-10-24 10:11:13 +08:00
Hennadii Stepanov
393be86724
build, msvc: Drop no longer required macro definitions for leveldb
Since levedb v1.21:
- the `__STDC_LIMIT_MACROS` macro definition is unneeded;
  commit: 50fbc87e8c62a816d6afd4740e0652a13ac6dc3e

- the `LEVELDB_ATOMIC_PRESENT` macro is unused;
  commit: 04f39105c5a418905da8b7657ca244d672c99d3b
2022-10-23 08:05:43 +01:00
dergoegge
7ad15d1100 [net processing] Handle IsContinuationOfLowWorkHeadersSync return value correctly when new headers sync is started 2022-10-21 11:05:34 +01:00
MacroFake
6d40484684
Merge bitcoin/bitcoin#26352: doc: add scanblocks to list of descriptor RPCs
ff138f9cf11b94bdfa5b16d7d03af93e619842d8 doc: add `scanblocks` to list of descriptor RPCs (Sebastian Falbesoner)

Pull request description:

  This is a tiny documentation follow-up to #23549.

ACKs for top commit:
  aureleoules:
    ACK ff138f9cf11b94bdfa5b16d7d03af93e619842d8
  shaavan:
    ACK ff138f9cf11b94bdfa5b16d7d03af93e619842d8

Tree-SHA512: cc45b78c13ec4aa5bac688648f8e83f04a9ae54376e67371b280428f0253e2585cf0575fa51e3835d4c13c940559bfcdd88d7504bf97a81b2a73bb34a0db7577
2022-10-21 11:32:13 +02:00
MacroFake
8c5c98db47
Merge bitcoin/bitcoin#26248: net: Set relay in version msg to peers with relay permission in -blocksonly mode
dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247 net: Set relay in version msg to peers with relay permission (MacroFake)

Pull request description:

  Seems odd to set the `relay` permission in -blocksonly mode and also ask the peer not to relay transactions.

ACKs for top commit:
  dergoegge:
    ACK dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247
  naumenkogs:
    ACK dddd1acf58
  mzumsande:
    ACK dddd1acf58cb7bf328ce3e74d1dc0e8cbd503247

Tree-SHA512: 7bb0e964993ea4982747ae2801fe963ff88586e2ded03015b60ab83172b5b61f2d50e9cde9d7711b7ab207f8639467ecafc4d011ea151ec6c82c722f510f4df7
2022-10-21 11:18:48 +02:00
fanquake
f2859c3aa8
Merge bitcoin/bitcoin#25727: util, config: error on startup if conf or reindex are set in config file
deba6fe3158cd0b2283e0901a072e434ba5b594e test: update feature_config_args.py (josibake)
2e3826cbcd675dcd1d03970233ba5e143e09eb75 util: warn if reindex is used in conf (josibake)
5e744f423838fe7d45453541271bc1a07cd62eac util: disallow setting conf in bitcoin.conf (josibake)

Pull request description:

  In help from `bitcoind -h` it specifes that `conf` can only be used from the commandline. However, if `conf` is set in a `bitcoin.conf` file, there is no error and from reading the logs it seems as if the `conf=<other file>` is being used, despite it being ignored. To recreate, you can setup a `bitcoin.conf` file in the default directory, add `conf=<some other file>.conf` and in the separate config file set whichever config value you want and verify that it is being ignored. alternatively, if you set `includeconf=<some other file>.conf` , your config in `<some other file>` will be picked up.

  This PR fixes this by having the node error when reading the config file if `conf=` is set.

  Additionally, it was mentioned in a recent [PR review club](https://bitcoincore.reviews/24858) that if `reindex=1` is set in the config file, the node will reindex on every startup, which is undesirable:
   ```irc
  17:14 <larryruane> michaelfolkson: Reindex is requested by the user (node operator) as a configuration option (command line or in the config file, tho you probably would never put it in the file, or else it would reindex on every startup!)
  ```

  This PR also has a commit to warn if `reindex=1` is set in the config file.

ACKs for top commit:
  hebasto:
    ACK deba6fe3158cd0b2283e0901a072e434ba5b594e, tested on Ubuntu 22.04.
  aureleoules:
    tACK deba6fe3158cd0b2283e0901a072e434ba5b594e
  ryanofsky:
    Code review ACK deba6fe3158cd0b2283e0901a072e434ba5b594e.

Tree-SHA512: 619fd0aa14e98af1166d6beb92651f5ba3f10d38b8ee132957f094f19c3a37313d9f4d7be2e4019f3fc9a2ca5fa42d03eb539ad820e27efec7ee58a26eb520b1
2022-10-21 16:39:44 +08:00
fanquake
6da45649c2
Merge bitcoin/bitcoin#26259: test: Test year 2106 block timestamps
fafc96aaf4c92feec50074e34a3fc1edc13cab4c test: Test year 2106 block timestamps (MacroFake)

Pull request description:

  Alternative to https://github.com/bitcoin/bitcoin/pull/21362 that closes https://github.com/bitcoin/bitcoin/issues/21356

ACKs for top commit:
  Sjors:
    utACK fafc96a

Tree-SHA512: 196d98f42d6f7f0222312b7bd1c68b3bd30cb6f0cbaccb900cfc5fcc689494adb2a7d7d6023c1ff1e8cf871047ec37eeca41386e31029d99cabf9343b4fd2a03
2022-10-21 16:29:52 +08:00
fanquake
085f83940d
Merge bitcoin/bitcoin#26344: wallet: Fix sendall with watchonly wallets and specified inputs
315fd4dbabb6b631b755811742a3bdf93e1241bf test: Test for out of bounds vout in sendall (Andrew Chow)
b132c85650afb2182f2e58e903f3d6f86fd3fb22 wallet: Check utxo prevout index out of bounds in sendall (Andrew Chow)
708b72b7151c855cb5dac2fb6a81e8f35153c46f test: Test that sendall works with watchonly spending specific utxos (Andrew Chow)
6bcd7e2a3b52f855db84cd23b5ee70d27be3434f wallet: Correctly check ismine for sendall (Andrew Chow)

Pull request description:

  The `sendall` RPC would previously fail when used with a watchonly wallet and specified inputs. This failure was caused by checking isminetype equality with ISMINE_ALL rather than a bitwise AND as IsMine can never return ISMINE_ALL.

  Also added a test.

ACKs for top commit:
  w0xlt:
    ACK 315fd4dbab
  furszy:
    ACK 315fd4db

Tree-SHA512: fb55cf6524e789964770b803f401027319f0351433ea084ffa7c5e6f1797567a608c956b7f7c5bd542aa172c4b7b38b07d0976f5ec587569efead27266e8664c
2022-10-21 16:24:15 +08:00
Stacie Waleyko
1184a66347
doc: Rearrange some lines in the dependency graph of libraries 2022-10-20 22:09:54 -04:00
Sebastian Falbesoner
ff138f9cf1 doc: add scanblocks to list of descriptor RPCs 2022-10-20 23:24:16 +02:00
Andrew Chow
315fd4dbab test: Test for out of bounds vout in sendall 2022-10-20 13:25:13 -04:00
Andrew Chow
b132c85650 wallet: Check utxo prevout index out of bounds in sendall 2022-10-20 13:24:57 -04:00
Andrew Chow
708b72b715 test: Test that sendall works with watchonly spending specific utxos 2022-10-20 13:21:03 -04:00
Andrew Chow
fabc031048
Merge bitcoin/bitcoin#26158: bench: add "priority level" to the benchmark framework
3e9d0bea8deb61596c91ead997e9db83f5b0ff68 build: only run high priority benchmarks in 'make check' (furszy)
466b54bd4ab8227ff8c066a027a92791366a81c1 bench: surround main() execution with try/catch (furszy)
3da7cd2a762077fa81dc40832d556d8a3fd53674 bench: explicitly make all current benchmarks "high" priority (furszy)
05b8c76232dedf938740e8034c725ac16d32974a bench: add "priority level" to the benchmark framework (furszy)
f1593780b8e3b6adefee08b10d270c5c329f91fe bench: place benchmark implementation inside benchmark namespace (furszy)

Pull request description:

  This is from today's meeting, a simple "priority level" for the benchmark framework.

  Will allow us to run certain benchmarks while skip non-prioritized ones in `make check`.

  By default, `bench_bitcoin` will run all the benchmarks. `make check`will only run the high priority ones,
  and have marked all the existent benchmarks as "high priority" to retain the current behavior.

  Could test it by modifying any benchmark priority to something different from "high", and
  run `bench_bitcoin -priority-level=high` and/or `bench_bitcoin -priority-level=medium,low`
  (the first command will skip the modified bench while the second one will include it).

  Note: the second commit could be avoided by having a default arg value for the priority
  level but.. an explicit set in every `BENCHMARK` macro call makes it less error-prone.

ACKs for top commit:
  kouloumos:
    re-ACK 3e9d0bea8deb61596c91ead997e9db83f5b0ff68
  achow101:
    ACK 3e9d0bea8deb61596c91ead997e9db83f5b0ff68
  theStack:
    re-ACK 3e9d0bea8deb61596c91ead997e9db83f5b0ff68
  stickies-v:
    re-ACK 3e9d0bea8d

Tree-SHA512: ece59bf424c5fc1db335f84caa507476fb8ad8c6151880f1f8289562e17023aae5b5e7de03e8cbba6337bf09215f9be331e9ef51c791c43bce43f7446813b054
2022-10-20 11:05:03 -04:00
furszy
3e9d0bea8d
build: only run high priority benchmarks in 'make check' 2022-10-20 10:21:05 -03:00
furszy
466b54bd4a
bench: surround main() execution with try/catch
so we have a cleaner exit on internal runtime errors.
e.g. an unknown priority level.
2022-10-20 10:21:04 -03:00
furszy
3da7cd2a76
bench: explicitly make all current benchmarks "high" priority
no-functional changes. Only have set the priority level explicitly
on every BENCHMARK macro call.
2022-10-20 10:21:04 -03:00
furszy
05b8c76232
bench: add "priority level" to the benchmark framework
Will allow us to run certain benchmarks while skip
non-prioritized ones in 'make check'.
2022-10-20 10:21:04 -03:00
MacroFake
fafc96aaf4
test: Test year 2106 block timestamps
* Use maximum timestamp in getblocktemplate test
* Mine block with maximum timestamp and MTP in blockchain test
2022-10-20 14:45:50 +02:00
fanquake
2ac71d20b2
Merge bitcoin/bitcoin#25595: Verify PSBT inputs rather than check for fields being empty
e133264c5b1f72e94dcb9cebd85cdb523fcf8070 Add test for PSBT input verification (Greg Sanders)
d25699280af1ea45bebc884f63a10da7ea275ef9 Verify PSBT inputs rather than check for fields being empty (Greg Sanders)

Pull request description:

  In a few keys spots, PSBT finality is checked by looking for non-empty witness data.

  This complicates a couple things:
  1) Empty data can be valid in certain cases
  2) User may be passed bogus final data by a counterparty during PSBT work happening, and end up with incorrect signatures that they may not be able to check in other contexts if the UTXO doesn't exist yet in chain/mempool, timelocks, etc.

  On the whole I think these heavier checks are worth it in case someone is actually assuming the signatures are correct if our API is saying so.

ACKs for top commit:
  achow101:
    ACK e133264c5b1f72e94dcb9cebd85cdb523fcf8070

Tree-SHA512: 9de4fbb0be1257b081781f5df908fd55666e3acd5c4e36beb3b3f2f5a6aed69ff77068c44cde6127e159e773293fd9ced4c0bb47e693969f337e74dc8af030da
2022-10-20 08:13:14 +08:00
Andrew Chow
6bcd7e2a3b wallet: Correctly check ismine for sendall
sendall should be using a bitwise AND for sendall's IsMine check rather
than an equality as IsMine will never return ISMINE_ALL.
2022-10-19 15:13:11 -04:00
Aurèle Oulès
e1eadaa72d
Revert "test: check importing wallets when blocks are pruned throw an error"
This reverts commit 4aff7a48a4e0f1075306f181a276b8a74c857022.
2022-10-19 16:51:47 +02:00
MacroFake
a97791d9fb
Merge bitcoin/bitcoin#25830: refactor: Replace m_params with chainman.GetParams()
5d3f98d27879cd6d84b8590e947336e8d09613ed refactor: Replace m_params with chainman.GetParams() (Aurèle Oulès)

Pull request description:

  Fixes a TODO introduced in #24595.
  Removes `m_params` from `CChainState` class and replaces it with `m_chainman.GetParams()`.

ACKs for top commit:
  MarcoFalke:
    review ACK 5d3f98d27879cd6d84b8590e947336e8d09613ed 🌎

Tree-SHA512: de0fe31450d281cc7307c0d820495e86c93c7998e77a148db2c703da66cff1059e6560c041f1864913c42075aa24d259c2623d45e929ca0a8056ed330a9f9978
2022-10-19 10:04:34 +02:00
MacroFake
003050dfaf
Merge bitcoin/bitcoin#26286: test: Remove unused txmempool include from tests
1c48dae76fc808bf7154aca976e7303364c56509 test: Use C++11 member initializers for TestMemPoolEntryHelper (MacroFake)
fad7f2239c74a4db31b3023f2bcaf1f0852453f8 test: Remove unused txmempool include from tests (MacroFake)

Pull request description:

  Seems odd to include this heavy header in all tests despite it only being used in a few tests.

  Can be reviewed with `--color-moved=dimmed-zebra --ignore-all-space`

ACKs for top commit:
  aureleoules:
    reACK 1c48dae76fc808bf7154aca976e7303364c56509
  hebasto:
    ACK 1c48dae76fc808bf7154aca976e7303364c56509, I have reviewed the code and it looks OK, I agree it can be merged.
  w0xlt:
    ACK 1c48dae76f

Tree-SHA512: 31f2808d04ec33bfc2409832b8e59e6c870eaa98fbcf879e1c786492c7d07134711b30f8290bdb34e1b8f7b8f2f11dae8e10c64e7eb31f584b2f5c58fcc7743b
2022-10-19 09:41:47 +02:00
MacroFake
bbe2655309
Merge bitcoin/bitcoin#26142: Use PACKAGE_NAME in messages rather than hardcoding "Bitcoin Core"
b147322a7a387423164de5a7d91a33eacad51689 Use `PACKAGE_NAME` in messages rather than hardcoding "Bitcoin Core" (Hennadii Stepanov)

Pull request description:

  Usually, we do not hardcode "Bitcoin Core" in the user-faced messages.

  See:
  - bitcoin/bitcoin#18646
  - bitcoin/bitcoin#19282

  Also grammar has been improved -- singular instead of plural.

ACKs for top commit:
  jarolrod:
    ACK b147322a7a387423164de5a7d91a33eacad51689

Tree-SHA512: b135c18703dfdd7b63d4cb27d1ac48f6a9dbf69382142ae381f33bf561cbf57477a11d1c73263aa834f705206d7dd5716df2523d38ed0d4cfec8babc38bb017a
2022-10-19 09:22:22 +02:00
MacroFake
c102a558e1
Merge bitcoin/bitcoin#26179: bench: Add missed ECCVerifyHandle instance
f09d47b263459e27faf5416287255eb3aed369a2 bench: Add missed `ECCVerifyHandle` instance (Hennadii Stepanov)

Pull request description:

  To clearly observe the lack of an `ECCVerifyHandle` instance,
  - apply the following diff:
  ```diff
  --- a/src/Makefile.bench.include
  +++ b/src/Makefile.bench.include
  @@ -19,11 +19,9 @@ bench_bench_bitcoin_SOURCES = \
     bench/bench.h \
     bench/bench_bitcoin.cpp \
     bench/block_assemble.cpp \
  -  bench/ccoins_caching.cpp \
     bench/chacha20.cpp \
     bench/chacha_poly_aead.cpp \
     bench/checkblock.cpp \
  -  bench/checkqueue.cpp \
     bench/crypto_hash.cpp \
     bench/data.cpp \
     bench/data.h \
  @@ -46,8 +44,7 @@ bench_bench_bitcoin_SOURCES = \
     bench/rpc_blockchain.cpp \
     bench/rpc_mempool.cpp \
     bench/strencodings.cpp \
  -  bench/util_time.cpp \
  -  bench/verify_script.cpp
  +  bench/util_time.cpp

   nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES)

  ```
  - then
  ```
  $ ./autogen
  $ ./configure
  $ make clean
  $ make
  ```
  - then
  ```
  $ ./src/bench/bench_bitcoin -filter=ExpandDescriptor
  bench_bitcoin: pubkey.cpp:296: bool CPubKey::IsFullyValid() const: Assertion `secp256k1_context_verify && "secp256k1_context_verify must be initialized to use CPubKey."' failed.
  Aborted (core dumped)
  ```

ACKs for top commit:
  achow101:
    ACK f09d47b263459e27faf5416287255eb3aed369a2
  w0xlt:
    ACK f09d47b263

Tree-SHA512: e1f33f88d427c57fe31d5810d12e9f46fed2911f5736208ebf7d4a968de0dd8c1f6b73a0d1093316da117dd3bcfda5dde6e41d6c95fcdb99bdea62e19df5ad20
2022-10-19 09:16:29 +02:00
MacroFake
0aa641f5f4
Merge bitcoin/bitcoin#26206: test: check importing wallets when blocks are pruned throw an error
4aff7a48a4e0f1075306f181a276b8a74c857022 test: check importing wallets when blocks are pruned throw an error (brunoerg)

Pull request description:

  This PR adds test coverage for the following error:
  437b608df2/src/wallet/rpc/backup.cpp (L513-L518)

ACKs for top commit:
  andrewtoth:
    ACK 4aff7a48a4e0f1075306f181a276b8a74c857022

Tree-SHA512: fbbf6056cb3759f726b8a5ff25fca51bf47e973e5d655ec164e2bec88e2dbd3b243677869d2cf33af268ea635ca0f2e9f737c4734077fc5a936ac3a24ad4b88b
2022-10-19 09:11:47 +02:00
Jon Atack
a079103c94 gui: update peers window "Transaction Relay" label and tooltip
to current v24.0 p2p behavior
2022-10-18 15:26:52 -07:00
MacroFake
1c48dae76f
test: Use C++11 member initializers for TestMemPoolEntryHelper
Co-authored-by: Aurèle Oulès <aurele@oules.com>
2022-10-18 17:32:44 +02:00
MacroFake
fad7f2239c
test: Remove unused txmempool include from tests 2022-10-18 14:02:09 +02:00
fanquake
5974c49f90
Merge bitcoin/bitcoin#26321: Adjust .tx/config for new Transifex CLI
d6adbb7ee1de661ad89879609eecd11129322405 Adjust `.tx/config` for new Transifex CLI (Hennadii Stepanov)

Pull request description:

  The old Transifex Command-Line Tool is considered deprecated (as of January 2022) and will sunset on Nov 30, 2022.

  See: https://github.com/transifex/cli/blob/devel/README.md#migrating-from-older-versions-of-the-client

  An accompanying PR: https://github.com/bitcoin-core/bitcoin-maintainer-tools/pull/142

ACKs for top commit:
  jarolrod:
    ACK d6adbb7ee1de661ad89879609eecd1112932240

Tree-SHA512: aa63158e02dc136be1669f3ff9ca28a990da215227520a197968ebe1a0a6fa73526cbd6d8fd7eed608eb06ad242c66598826c58e124c1fc53beaa28ae6b53c37
2022-10-18 19:58:24 +08:00
MacroFake
ba441d493c
Merge bitcoin/bitcoin#26313: doc: consolidate library documentation to libraries.md
af781bf4b2998eb17e89b6b24d26a2590e548259 doc: fix typo in doc/libraries.md (fanquake)
9e9ae6101ff505b97a514148e86a5699acba20df doc: remove library commentary from src/Makefile.am (fanquake)

Pull request description:

  Deduplicate the makefile comments, in favour of doc/libraries.md. I think a single, more comprehensive source of truth is preferable. Diagrams are also useful. Came up in https://github.com/bitcoin/bitcoin/pull/26292#issuecomment-1275094478.

ACKs for top commit:
  ryanofsky:
    Code review ACK af781bf4b2998eb17e89b6b24d26a2590e548259, nice cleanups
  hebasto:
    ACK af781bf4b2998eb17e89b6b24d26a2590e548259, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: df61ed1394102221701ae2dfa42886dfabe9d9fd7f601b794e2195f93d8f7c2a1cd1c000a77d0a969b42328e8ebc0387755c57291837b283fdf376dbd98fdda1
2022-10-18 13:44:56 +02:00
glozow
e7a0e96271
Merge bitcoin/bitcoin#23443: p2p: Erlay support signaling
e56d1d2afdd477be6dd462d838617d385bac5d7b test: Add functional tests for sendtxrcncl message from outbound (Gleb Naumenko)
cfcef60779e62bcb81243e0bb8ffc8abb5b5baf5 test: Add functional tests for sendtxrcncl from inbound (Gleb Naumenko)
b99ee9d22d53777f501d0926d7ca6b0b45b237a1 test: Add unit tests for reconciliation negotiation (Gleb Naumenko)
f63f1d3f4bdef2923a8395473ca59e4763769bd7 p2p: clear txreconciliation state for non-wtxid peers (Gleb Naumenko)
88d326c8e3796b9685c141fa50628615d3e43a38 p2p: Finish negotiating reconciliation support (Gleb Naumenko)
36cf6bf2168f9f154a652c91bbb96480c2e1d044 Add helper to see if a peer is registered for reconciliations (Gleb Naumenko)
4470acf076289831ac60bcbafb6b3afa0e98e99d p2p: Forget peer's reconciliation state on disconnect (Gleb Naumenko)
3fcf78ee6ab59d1a539fdf54bbae21b5d29caea9 p2p: Announce reconciliation support (Gleb Naumenko)
24e36fac0a86aa371046470dc4f8dfed7a868fb2 log: Add tx reconciliation log category (Gleb Naumenko)

Pull request description:

  This is a part of the Erlay project:
  - [parent PR](https://github.com/bitcoin/bitcoin/pull/21515)
  - [associated BIP-330](https://github.com/bitcoin/bips/pull/1376).

  -------

  This PR adds a new p2p message `sendtxrcncl` signaling for reconciliation support.
  Before sending that message, a node is supposed to "pre-register" the peer by generating and storing an associated reconciliation salt component.
  Once the salts are exchanged within this new message, nodes "register" each other for future reconciliations by computing and storing the aggregate salt, along with the reconciliation parameters based on the connection direction.

ACKs for top commit:
  dergoegge:
    re-ACK e56d1d2afdd477be6dd462d838617d385bac5d7b
  sipa:
    re-ACK e56d1d2afdd477be6dd462d838617d385bac5d7b. No differences with a rebase of previously reviewed e91690e67dad180c7fb9bed0409a9c4567d3e5df.
  mzumsande:
    re-ACK e56d1d2afdd477be6dd462d838617d385bac5d7b
  vasild:
    ACK e56d1d2afdd477be6dd462d838617d385bac5d7b

Tree-SHA512: 0db953b7347364e2496ebca3bfe6a27ac336307eec698242523a18336fcfc7a1ab87e3b09ce8b2bdf800ebbb1c9d33736ffdb8f5672f93735318789aa4a45f39
2022-10-17 18:10:56 +01:00
Greg Sanders
e133264c5b Add test for PSBT input verification 2022-10-17 11:13:30 -04:00
Greg Sanders
d25699280a Verify PSBT inputs rather than check for fields being empty 2022-10-17 11:13:02 -04:00
Andrew Chow
a52ff619a4
Merge bitcoin/bitcoin#25985: Revert "build: Use Homebrew's sqlite package if it is available"
d216d714aae36e6f1c95f82aef81a0be74dee2f3 Revert "build: Use Homebrew's sqlite package if it is available" (fanquake)

Pull request description:

  This reverts ee7b84e63cbeadd5e680d69ff0548275581e9241 from #20527.

  That change was made without any rationale, maybe other than, a brew
  installed version might be newer, and that's "better". However when
  building from source on macOS, it just results in drastically worse
  performance, and issues / confusion like #25724.

  The difference in performance can be observed using the example from https://github.com/bitcoin/bitcoin/issues/25724#issuecomment-1213554922,
  but minified i.e:
  ```bash
  time src/bitcoin-cli createwallet speedy true
  time src/bitcoin-cli importdescriptors '[
    {"desc":"raw(00145846369f3d6ba366d6f5a903fb5cf4dca3763c0e)#k9wh6v62","timestamp":"now"},
    {"desc":"raw(001420800aabf13f3a4c4ce3ce4c66cecf1d17f21a6e)#6m0hlfh4","timestamp":"now"},
    {"desc":"raw(0014c6bf9715e06d73ebf9b3b02d5cc48d24d8bbabc1)#wyavh36r","timestamp":"now"},
    {"desc":"raw(00141ba7807b3f46af113beaea5c698428ce7138cd8a)#jctdsups","timestamp":"now"},
    {"desc":"raw(00140c1bd27f10fff01b36ddf3c1febaa1acff19b080)#9s6nc3pk","timestamp":"now"},
    {"desc":"raw(00141226e31987e4bc2e63c0ee12908f675e40464b20)#9pp7qm39","timestamp":"now"},
    {"desc":"raw(0014f73f149f7503960a5e849c6ee7a8a8c336f631cb)#qtkxv9fc","timestamp":"now"},
    {"desc":"raw(0014c8ccb4d81ffc769fc5fdd8d7eed69b0e0cae5749)#hn39qayv","timestamp":"now"},
    {"desc":"raw(001498565aead2d67a22a6021d55210f2a917fc22169)#6ar3vwsx","timestamp":"now"},
    {"desc":"raw(001403013248ac0cd9eabe176cad162cda2a19f771e1)#4m47mukd","timestamp":"now"}
  ]'
  ```

  Running master, when building from souce and using brew installed
  sqlite, this takes ~3.4s. With this PR, the same operation takes ~0.3s.

  Resolves the "build from source" portion of #25724. Building from
  depends is still not ideal, however I have some other changes that might
  help improve things in that case.

  Related performance issue reports:
  * https://github.com/bitcoindevkit/bdk/issues/749
  * https://bitcoin.stackexchange.com/questions/113898/bitcoin-v23-is-10-times-slower-than-v22-on-macos-for-basic-regtest-tests
  * https://github.com/bitcoin/bitcoin/issues/25724
  * https://github.com/bitcoin/bitcoin/pull/25985#issuecomment-1245942400

ACKs for top commit:
  achow101:
    ACK d216d714aae36e6f1c95f82aef81a0be74dee2f3
  jarolrod:
    ACK d216d714aae36e6f1c95f82aef81a0be74dee2f3
  hebasto:
    ACK d216d714aae36e6f1c95f82aef81a0be74dee2f3, I have reviewed the code and it looks OK, I agree it can be merged. No conflicts with our build [docs](d216d714aa/doc/build-osx.md (descriptor-wallet-support)).

Tree-SHA512: 1bb4b44385b11fa9fe66edd7449278f9e47a6cc679b7111f9adf17db94c34e29c9cceafc917454e134420db40b24b56da29226af6f43e6dbeff822b79b77ed60
2022-10-17 10:29:41 -04:00
Gleb Naumenko
e56d1d2afd test: Add functional tests for sendtxrcncl message from outbound 2022-10-17 12:36:14 +03:00
Gleb Naumenko
cfcef60779 test: Add functional tests for sendtxrcncl from inbound 2022-10-17 12:36:13 +03:00
Gleb Naumenko
b99ee9d22d test: Add unit tests for reconciliation negotiation 2022-10-17 12:35:44 +03:00
Gleb Naumenko
f63f1d3f4b p2p: clear txreconciliation state for non-wtxid peers
We optimistically pre-register a peer for txreconciliations
upon sending txreconciliation support announcement.
But if, at VERACK, we realize that the peer never sent
WTXIDRELAY message, we should unregister the peer
from txreconciliations, because txreconciliations rely on wtxids.
2022-10-17 12:35:44 +03:00
Gleb Naumenko
88d326c8e3 p2p: Finish negotiating reconciliation support
Once we received a reconciliation announcement support
message from a peer and it doesn't violate our protocol,
we store the negotiated parameters which will be used
for future reconciliations.
2022-10-17 12:35:44 +03:00
Gleb Naumenko
36cf6bf216 Add helper to see if a peer is registered for reconciliations 2022-10-17 12:35:44 +03:00
Gleb Naumenko
4470acf076 p2p: Forget peer's reconciliation state on disconnect 2022-10-17 12:35:44 +03:00
Gleb Naumenko
3fcf78ee6a p2p: Announce reconciliation support
If we're connecting to the peer which might support
transaction reconciliation, we announce we want to reconcile
with them.

We store the reconciliation salt so that when the peer
responds with their salt, we are able to compute the
full reconciliation salt.

This behavior is enabled with a CLI flag.
2022-10-17 12:35:43 +03:00