Commit graph

42078 commits

Author SHA1 Message Date
stickies-v
285ab50ace
test: replace WtxidFromString with Wtxid::FromHex
The newly introduced Wtxid::FromHex is more robust and removes
the need for a WtxidFromString helper function
2024-07-31 16:47:39 +01:00
stickies-v
9a0b2a69c4
fuzz: increase FromHex() coverage 2024-07-31 16:47:38 +01:00
stickies-v
526a87ba6b
test: add uint256::FromHex unittest coverage
Simultaneously cover transaction_identifier::FromHex()
2024-07-31 16:47:37 +01:00
merge-script
9eb57d1ab6
Merge bitcoin/bitcoin#30559: test: Try previously intermittently broken USDT test again
fa2269dd65 test: Try previously intermittently broken USDT test again (MarcoFalke)

Pull request description:

  Seems fine to try it again, given that the infra changed in the meantime.

  Should be trivial to disable again, on the first failure.

  Ref: https://github.com/bitcoin/bitcoin/issues/27380#issuecomment-1637971779

ACKs for top commit:
  fanquake:
    ACK fa2269dd65 - seems fine to re-try this now.

Tree-SHA512: e203625b49019517def8e92cc465dd947d5aa85a080d370aabce7a45442efc3900b5c3783f6cc15720f81e5aaa3ff193a26be3d33048f20a73cd7b1fce320118
2024-07-31 15:25:33 +01:00
MarcoFalke
fa46a1b74b
test: Avoid CScript() as default function argument
This does not cause any issues, because CScript in the tests are const.
However, this change allows to enable the
"function-call-in-default-argument (B008)" lint rule.
2024-07-31 15:19:10 +02:00
merge-script
174bedd8d9
Merge bitcoin/bitcoin#30547: doc: Update work in progress section in doc/design/libraries.md
f70eb0eeef doc: Remove reference to resolved issue (Daniela Brozzoni)
b27ef8ec7f doc: Update issue reference for libbitcoinkernel (Daniela Brozzoni)

Pull request description:

  - The discussion of libbitcoinkernel has moved from 24303 to 27587
  - Issue 15732 has been resolved, removing it from the document

ACKs for top commit:
  maflcko:
    ACK f70eb0eeef

Tree-SHA512: 11b597d9710504010945aae66f7e488403895aa8e1e091f3a8f6737dc128a4fde185daff8d4709cbbb69f454d3a649c4217e82a6bfc8ee2b25c8a1c047b57f1b
2024-07-31 13:38:21 +01:00
dergoegge
afd237bb5d [fuzz] Harness for version handshake 2024-07-31 13:25:52 +01:00
dergoegge
a90ab4aec9 scripted-diff: Rename lazily initialized bloom filters
-BEGIN VERIFY SCRIPT-
sed -i 's/m_recent_confirmed_transactions/m_lazy_recent_confirmed_transactions/g' $(git grep -l 'm_recent_confirmed_transactions')
sed -i 's/m_recent_rejects_reconsiderable/m_lazy_recent_rejects_reconsiderable/g' $(git grep -l 'm_recent_rejects_reconsiderable')
sed -i 's/m_recent_rejects/m_lazy_recent_rejects/g' $(git grep -l 'm_recent_rejects')
-END VERIFY SCRIPT-
2024-07-31 13:23:46 +01:00
Daniela Brozzoni
f70eb0eeef
doc: Remove reference to resolved issue
Issue #15732 has been resolved, this commit removes it from
the WIP section of the libraries document.
2024-07-31 14:22:57 +02:00
dergoegge
82de1bc478 [net processing] Lazily initialize m_recent_confirmed_transactions 2024-07-31 13:09:55 +01:00
dergoegge
fa0c87f19c [net processing] Lazily initialize m_recent_rejects_reconsiderable 2024-07-31 13:09:44 +01:00
dergoegge
662e8db2d3 [net processing] Lazily initialize m_recent_rejects 2024-07-31 13:08:20 +01:00
MarcoFalke
fa2269dd65
test: Try previously intermittently broken USDT test again
This reverts commit faf8be7c32.
2024-07-31 14:06:51 +02:00
merge-script
c6b4718112
Merge bitcoin/bitcoin#30537: kernel: Only setup kernel context globals once
93fb0e7897 kernel: Only setup kernel context globals once (TheCharlatan)

Pull request description:

  The globals setup by the function calls when creating a new kernel context only need to be setup once. Calling them multiple times may be wasteful and has no apparent benefit.

  Besides kernel users potentially creating multiple contexts, this change may also be useful for tests creating multiple setups.

ACKs for top commit:
  stickies-v:
    re-ACK 93fb0e7897
  maflcko:
    ACK 93fb0e7897 👝
  tdb3:
    re ACK 93fb0e7897

Tree-SHA512: c8418c23b34883b9b6af2b93c48760a931c246c9190fae372fb808f573408d332f53ca43b9c783eef561c4a6681e2fb63f215c939b40a87d597c0518dabea22a
2024-07-31 12:17:14 +01:00
merge-script
33884e7e60
Merge bitcoin/bitcoin#30545: test: fix intermittent failures in feature_proxy.py
a6efc7e16e test: fix intermittent failures in feature_proxy.py (Martin Zumsande)

Pull request description:

  Fixes #29871

  If addnode connections are made with v2transport and the peer immediately disconnects us, reconnections with v1 are scheduled. This could interfere with later checks depending on timing. Avoid this by using `v2transport=False` in the addnode rpc - this test isn't about the message layer anyway, so running it with v2 would add no value.

ACKs for top commit:
  maflcko:
    ACK a6efc7e16e
  tdb3:
    cr re ACK a6efc7e16e

Tree-SHA512: 39353a392e75e4c6257d971ceecb65fb76ec6d3b121a087869831c24b767a18f57e2ae2968da445c7fa731cb03053c90df37dd2cd6e86f786ad4121bc68ca235
2024-07-31 12:03:22 +01:00
merge-script
be969292db
Merge bitcoin/bitcoin#30552: test: fix constructor of msg_tx
ec5e294e4b test: fix constructor of msg_tx (Martin Zumsande)

Pull request description:

  In python, if the default value is a mutable object (here: a class) it is shared over all instances, so that one instance being changed would affect others to be changed as well.
  This was the source of #30543, and possibly various other intermittent bugs in the functional tests, see
  https://github.com/bitcoin/bitcoin/issues/29621#issuecomment-1999298224.

  Fixes #30543
  Fixes #29621
  Fixes #25128

ACKs for top commit:
  sipa:
    utACK ec5e294e4b. I believe some linters even warn about doing this.
  maflcko:
    ACK ec5e294e4b
  vasild:
    ACK ec5e294e4b ❤️
  theStack:
    ACK ec5e294e4b

Tree-SHA512: a6204fb1a326de3f9aa965f345fd658f6a4dcf78731db25cc905ff6eb8d4eeb65d14cc316305eebd89387aec8748c57c3a4f4ca62408f8e5ee53f535b88b1411
2024-07-31 12:01:33 +01:00
Marnix
3cd24aadb2 doc: remove obsolete mention and link to closed PR 2024-07-31 12:38:29 +02:00
Vasil Dimov
a7f5d188cc
doc: add release notes for #22729 2024-07-31 11:24:44 +02:00
merge-script
2ed82060b9
Merge bitcoin/bitcoin#30551: doc: mention optional dependencies (qrencode, zmq) in OpenBSD build docs
903def1ffd doc: mention optional dependencies (qrencode, zmq) in OpenBSD build docs (Sebastian Falbesoner)

Pull request description:

  The wording is taken from the FreeBSD build docs.

  Tested on OpenBSD 7.5. See the following links for the package names:
  - https://openbsd.app/?search=libqrencode
  - https://openbsd.app/?search=zeromq

  Thanks to hebasto for noticing that this was missing.

ACKs for top commit:
  maflcko:
    review ACK 903def1ffd
  hebasto:
    ACK 903def1ffd, I can successfully build with the `libqrencode` and `zeromq` packages on my OpenBSD 7.5 installation.

Tree-SHA512: 955e4892948a7703627d304a41a774f7cca0e4c672bdfa0edf531587d6970444aa49195b0f6f531ce375c8e7c2af6bbfa1a12e0612ae7a65f3e454fb17958672
2024-07-31 09:50:38 +01:00
merge-script
2401a24387
Merge bitcoin/bitcoin#30452: guix: bump time-machine to efc26826400762207cde9f23802cfe75a737963c
6ee000e56f guix: bump time-machine to efc26826400762207cde9f23802cfe75a737963c (fanquake)
cbeb2c20e1 guix: patch /gnu/store paths out of winpthreads (fanquake)

Pull request description:

  Needed for https://github.com/bitcoin/bitcoin/issues/30210. This doesn't switch runtimes, because upstream is
  still configured to use the old runtime. See:
  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=17188be0f723e00377b21b767f5447d7938a116e.

  git-mimimal `2.45.1` -> `2.45.2`
  Kernel Headers `6.1.92` -> `6.1.100`
  LLVM `18.1.6` -> `18.1.8`
  mingw-w64 `11.0.1` -> `12.0.0`
  NSIS `3.09` -> `3.10`
  patch `2.7.6` -> `2.7.6-0.f144b35`

ACKs for top commit:
  TheCharlatan:
    ACK 6ee000e56f

Tree-SHA512: f4f99d16dd8cab5b2b7c5d82111af86de20e1669cc3b4054d72ab4a67b2956757df170f0df28c96d18653c1c9d2ebdd0ecc441005726a20cd963d98513b4a851
2024-07-31 09:50:10 +01:00
MarcoFalke
fadf621825
test: Make leaf_script mandatory when scriptpath is set in TaprootSignatureMsg
This removes the default value, because there should not be a use-case
to fall back to a an empty leaf_script by default. (If there was, it
could trivially be added back)
2024-07-31 09:57:42 +02:00
Martin Zumsande
ec5e294e4b test: fix constructor of msg_tx
In python, if the default value is a mutable object (here: a class)
its shared over all instances, so that one instance being changed
would affect others to be changed as well.
This was likely the source of various intermittent bugs in the
functional tests.
2024-07-30 17:49:07 -04:00
Sebastian Falbesoner
903def1ffd doc: mention optional dependencies (qrencode, zmq) in OpenBSD build docs
The wording is taken from the FreeBSD build docs.

See the following links for the package names:
- https://openbsd.app/?search=libqrencode
- https://openbsd.app/?search=zeromq

Thanks to hebasto for noticing that this was missing.
2024-07-30 22:34:35 +02:00
Greg Sanders
75648cea5a test: add P2A ProduceSignature coverage 2024-07-30 14:06:58 -04:00
Greg Sanders
7998ce6b20 Add release note for P2A output feature 2024-07-30 14:06:58 -04:00
Greg Sanders
71c9b02a04 test: add P2A coverage for decodescript 2024-07-30 14:06:58 -04:00
Greg Sanders
1349e9ec15 test: Add anchor mempool acceptance test 2024-07-30 14:06:58 -04:00
Greg Sanders
9d89209937 policy: stop 3rd party wtxid malleability of anchor spend 2024-07-30 14:06:58 -04:00
Greg Sanders
b60aaf8b23 policy: make anchor spend standard
Only standard when non-nested.
2024-07-30 14:06:58 -04:00
Greg Sanders
455fca86cf policy: Add OP_1 <0x4e73> as a standard output type
These outputs are called anchors, and allow
key-less anchor spends which are vsize-minimized
versus keyed anchors which require larger outputs
when creating and inputs when spending.
2024-07-30 14:06:58 -04:00
Hennadii Stepanov
d367a4e36f
Merge bitcoin-core/gui#505: Hide peers details
41a1a8615d gui: Hide peers details (@RandyMcMillan)

Pull request description:

  Add a close (X) button to the Peers Detail panel.
  Reuse the same icon used in the Console Tab.
  The close button deselects the peer highlighted
  in the PeerTableView and hides the detail panel.

  fixes #485

      Co-authored-by: @w0xlt <w0xlt@users.noreply.github.com>

ACKs for top commit:
  pablomartin4btc:
    re ACK 41a1a8615d
  hebasto:
    ACK 41a1a8615d, tested on Ubuntu 23.10.

Tree-SHA512: fc692891eec61bd1e6878f2433b478de3c69bf0b3ce3471f2faafda6f63d371e2cc125ae8290fd2ac3e4d8659031b79d85665318cfc5a9481e967ef99d245f9c
2024-07-30 17:55:44 +01:00
TheCharlatan
93fb0e7897
kernel: Only setup kernel context globals once
The globals setup by the function calls when creating a new kernel
context only need to be setup once. Calling them multiple times may be
wasteful and has no apparent benefit.

Besides kernel users potentially creating multiple contexts, this change
may also be useful for tests creating multiple setups.

Co-authored-by: stickies-v <stickies-v@protonmail.com>
2024-07-30 18:07:21 +02:00
Hennadii Stepanov
be419674da
qt: Update translation source file
The diff is generated by executing `make -C src translate`.
2024-07-30 16:26:39 +01:00
Hennadii Stepanov
e49d858aab
qt: Bump Transifex slug for 28.x 2024-07-30 16:14:19 +01:00
Hennadii Stepanov
31b33019b7
qt: Pull recent translations from Transifex
The diff is generated by executing the `update-translations.py` script.
Removals of translation files have been discarded.
2024-07-30 16:12:24 +01:00
Martin Zumsande
a6efc7e16e test: fix intermittent failures in feature_proxy.py
If addnode connections are made with v2transport and the peer immediately disconnects us, reconnections
with v1 are scheduled. This could interfere with later checks depending on timing. Avoid this by using
`v2transport=False` in the addnode rpc - this test isn't about the message layer anyway, so running it
with v2 would add no value.
2024-07-30 10:52:53 -04:00
Daniela Brozzoni
b27ef8ec7f
doc: Update issue reference for libbitcoinkernel
The discussion of libbitcoinkernel has moved from #24303 to #27587,
this commit updates the documentation accordingly.
2024-07-30 16:12:03 +02:00
merge-script
4c62f4b535
Merge bitcoin/bitcoin#30451: depends: remove Darwin ENV unsetting
bda537f7c4 depends: remove ENV unsetting for darwin (fanquake)
1807760f09 guix: improve ENV unsetting for macOS (fanquake)
0b2aeee21d depends: patch explicit -lm usage out of Qt tools (fanquake)

Pull request description:

  Now that we use the native compiler, and have fixed Qt, and these vars
  are (almost) unset in Guix, we can remove the unsetting from our compiler
  command here.

  I couldn't manage to make a darwin-clang-cross only exclusion of `-lm` work properly
  for Qt, so opted for just removing the explicit link entirely. I do not think this should have
  any other unwanted side-effects.

  Fixes #21552.

ACKs for top commit:
  TheCharlatan:
    ACK bda537f7c4

Tree-SHA512: 97a2d85de7d4b1d65717ecb521399ecba5f53863b8aef21af62ede5ceee59ee1a9392663da3a3852cad1b6d8b420dd4b0b5f0eea38d30a81785d8b2718620b5f
2024-07-30 14:32:14 +01:00
Michael Dietz
2e86f2b201 rpc: fix maybe-uninitialized compile warning in getchaintxstats
This resolves the compiler warning about potential uninitialized
use of window_tx_count introduced in fa2dada.
2024-07-29 12:14:27 -05:00
glozow
f66738f79c
Merge bitcoin/bitcoin#30542: ci: enable berkley db on test each commit job
93ee17c1d6 ci: enable berkley db on test each commit job (Max Edwards)

Pull request description:

  As the "test each commit" job installs `libdb++-dev` it looks like it was intended that it would compile with Berkeley DB support.

  This PR enables it.

  CI run log with the change: https://github.com/m3dwards/bitcoin/actions/runs/10142921800/job/28043223197?pr=1

ACKs for top commit:
  maflcko:
    ACK 93ee17c1d6
  danielabrozzoni:
    ACK 93ee17c1d6
  hebasto:
    ACK 93ee17c1d6.

Tree-SHA512: b6c2a7cea104a84221814fd121fd4fef2d7c0c3717f8c3fe35ec3c42e850e72085e9e6407b61ca1f9e86571346fa33a2cdd924210b26155956835011775320b2
2024-07-29 16:18:49 +01:00
Max Edwards
93ee17c1d6 ci: enable berkley db on test each commit job 2024-07-29 11:43:47 +01:00
Hennadii Stepanov
c9b7a792e2
Merge bitcoin-core/gui#828: Rendering an amp characters in the wallet name for QMenu
8233ee41ab gui: correct replacement of amp character in the wallet name for QMenu (Konstantin Akimov)

Pull request description:

  In the current implementation Qt uses '&' as a signal to underscore letter and use it as a hot-key, which is not expected for case of wallet name.

  The [comment in the code](https://github.com/bitcoin/bitcoin/pull/30446/files#diff-2ecf8cbf369cf3d2f3d2b1cf5cfe4c1a647d63e11e2885d2fd0ac11fb5f7a804L402-L404) regarding the use of an "&" on a menu item is misleading.
  If a wallet name has an "&" in it, it is not supposed to be interpreted as a hot-key, but it should be shown as it is without replacing it to an underscore.

  See screenshots before & after:
  ![Screenshot_20240713_122454](https://github.com/user-attachments/assets/e36d6e4c-d872-4b4c-b55e-bcfde9881281)
  ![Screenshot_20240713_131304](https://github.com/user-attachments/assets/9484687d-0aea-4061-a461-5d187762a4b4)

ACKs for top commit:
  hebasto:
    re-ACK 8233ee41ab.
  pablomartin4btc:
    tACK 8233ee41ab
  BrandonOdiwuor:
    ACK 8233ee41ab. Tested on Ubuntu 22.04 using Qt version 5.15.3

Tree-SHA512: 918c2c05555d203a8b203794c138651d4a1691a05a858631d5a4664b78e150402d1ae4a02ee5181f63a5b22a09badca0a4ea14a626f45f8cbe557226c308b8c5
2024-07-29 10:33:32 +01:00
merge-script
ec7ba7a3cf
Merge bitcoin/bitcoin#30534: guix: move bison from global scope, to Linux
e6df3485ed guix: move bison from global scope, to Linux (fanquake)

Pull request description:

  This is only needed for the Qt build (libxkbcommon), on Linux, so does not need to be built/present for the macOS or Windows builds.

ACKs for top commit:
  hebasto:
    ACK e6df3485ed.
  TheCharlatan:
    ACK e6df3485ed

Tree-SHA512: b66111e398b4fce88f912adfd808d537e2d85e1f0078befd264bb700b201ca1bbe322810e80a212e0023657e9e3693a106761c43743d66aabd16e2afe7f599e6
2024-07-29 10:08:07 +01:00
merge-script
38c30a4b50
Merge bitcoin/bitcoin#30515: rpc: add utxo's blockhash and number of confirmations to scantxoutset output
17845e7f21 rpc: add utxo's blockhash and number of confirmations to scantxoutset output (Luis Schwab)

Pull request description:

  This PR resolves #30478 by adding two fields to the `scantxoutset` RPC:
  - blockhash: the blockhash that an UTXO was created
  - confirmations: the number of confirmations an UTXO has relative to the chaintip.

  The rationale for the first field is that a blockhash is a much more reliable identifier than the height:
  > When using the scantxoutset RPC, the current behaviour is to show the block height of the UTXO. This is not optimal, as block height is ambiguous, especially in the case of a block reorganization happening at the same instant of the query. In this case, an UTXO that does not exist would be assumed to exist, unless the chain's tip hash is recorded before the scan, and make sure it still exists after, as per https://github.com/bitcoindevkit/bdk/issues/895#issuecomment-1475766797 comment by evanlinjin.

  The second one was suggested by maflcko, and I agree it's useful for human users:
  > While touching this, another thing to add could be the number of confirmations? I understand that this wouldn't help machine consumers of the interface, but human callers may find it useful?

  This will yield an RPC output like so:

  ```diff
  bitcoin-cli scantxoutset start "[\"addr(bc1q5q9344vdyjkcgv79ve3tldz4jmx4lf7knmnx6r)\"]"
  {
    "success": true,
    "txouts": 185259116,
    "height": 853622,
    "bestblock": "00000000000000000002e97d9be8f0ddf31829cf873061b938c10b0f80f708b2",
    "unspents": [
      {
        "txid": "fae435084345fe26e464994aebc6544875bca0b897bf4ce52a65901ae28ace92",
        "vout": 0,
        "scriptPubKey": "0014a00b1ad58d24ad8433c56662bfb45596cd5fa7d6",
        "desc": "addr(bc1q5q9344vdyjkcgv79ve3tldz4jmx4lf7knmnx6r)#smk4xmt7",
        "amount": 0.00091190,
        "coinbase": false,
        "height": 852741,
  +     "blockhash": "00000000000000000002eefe7e7db44d5619c3dace4c65f3fdcd2913d4945c13",
  +     "confirmations": 882
      }
    ],
    "total_amount": 0.00091190
  }
  ```

ACKs for top commit:
  sipa:
    utACK 17845e7f21
  Eunovo:
    ACK 17845e7f21
  tdb3:
    ACK 17845e7f21

Tree-SHA512: 02366d0004e5d547522115ef0efe6794a35978db53dda12c675cfae38197bf43f0bf89ca99a3d79e3d2cff95186015fe1ab764abb8ab82bda440ae9302ad973b
2024-07-28 13:36:15 +01:00
Luis Schwab
17845e7f21 rpc: add utxo's blockhash and number of confirmations to scantxoutset output 2024-07-27 18:58:11 -03:00
fanquake
e6df3485ed
guix: move bison from global scope, to Linux
This is only needed for the Qt build, on Linux, so does not need to be
built/present for the macOS or Windows builds.
2024-07-26 17:17:45 +01:00
MarcoFalke
fa895c7283
mingw: Document mode wbx workaround 2024-07-26 17:31:15 +02:00
MarcoFalke
fa359255fe
Add -blocksxor boolean option 2024-07-26 17:30:53 +02:00
MarcoFalke
fa530ec543
rpc: Return precise loadtxoutset error messages
The error messages should never happen in normal operation. However, if
they do, they are helpful to return to the user to debug the issue. For
example, to notice a truncated file.
2024-07-26 14:11:24 +02:00
Ryan Ofsky
30cef53707
Merge bitcoin/bitcoin#30386: Early logging improvements
b4dd7ab43e logging: use std::string_view (Anthony Towns)
558df5c733 logging: Apply formatting to early log messages (Anthony Towns)
6cf9b34440 logging: Limit early logging buffer (Anthony Towns)
0b1960f1b2 logging: Add DisableLogging() (Anthony Towns)
6bbc2dd6c5 logging: Add thread safety annotations (Anthony Towns)

Pull request description:

  In order to cope gracefully with `Log*()` calls that are invoked prior to logging being fully configured (indicated by calling `StartLogging()` we buffer early log messages in `m_msgs_before_open`. This has a couple of minor issues:

   * if there are many such log messages the buffer can become arbitrarily large; this can be a problem for users of libkernel that might not wish to worry about logging at all, and as a result never invoke `StartLogging()`
   * early log messages are formatted before the formatting options are configured, leading to inconsistent output

  Fix those issues by buffering the log info prior to formatting it, and setting a limit on the size of the buffer (dropping the oldest lines, and reporting the number of lines skipped).

  Also adds some thread safety annotations, and the ability to invoke `LogInstance().DisableLogging()` if you want to disable logging entirely, for a minor efficiency improvement.

ACKs for top commit:
  maflcko:
    re-ACK b4dd7ab43e 🕴
  ryanofsky:
    Code review ACK b4dd7ab43e
  TheCharlatan:
    Nice, ACK b4dd7ab43e

Tree-SHA512: 966660181276939225a9f776de6ee0665e44577d2ee9cc76b06c8937297217482e6e426bdc5772d1ce533a0ba093a8556b6a50857d4c876ad8923e432a200440
2024-07-26 08:06:08 -04:00