Commit graph

39156 commits

Author SHA1 Message Date
Pablo Greco
b63f7ab9b5
Merge pull request #1433 from kilrau/reduce-default-dust-relay-fee
feat: reduce default dust relay fee
2025-03-13 08:00:07 -07:00
Byron Hambly
32390d1552
test: use bitcoin default dustrelayfee in mempool_accept.py 2025-03-13 09:38:10 +02:00
Byron Hambly
721d55b9f3
test: use bitcoin default dustrelayfee in transaction_tests 2025-03-13 09:38:10 +02:00
Pablo Greco
abbc17048a
Merge pull request #1432 from tomt1664/merged-master_23.x-pick
merged-master vs. elements-23.x cherry pick
2025-03-12 08:44:10 -07:00
Thomas Trevethan
9483c0a065 Revert "Apply acc06bc91f fix also to pip upgrade"
This reverts commit 49f151f013.
2025-03-11 23:49:01 +00:00
Byron Hambly
c2694cf426 lint: fix trailing windows whitespace in win-codesign.cert 2025-03-11 07:34:37 +00:00
Thomas Trevethan
d74af31c9e use elements regtest address for derive test 2025-03-10 23:02:16 +00:00
muxator
0cb8f113df rpc: add non-regression test about deriveaddresses crash when index is 2147483647
This test would cause a crash in bitcoind (see #26274) if the fix given in the
previous commit was not applied.

Github-Pull: #26275
Rebased-From: 9153ff3e27
2025-03-10 17:56:03 +00:00
muxator
5a43eac4d3 rpc: fix crash in deriveaddresses when derivation index is 2147483647
2147483647 is the maximum positive value of a signed int32, and - currently -
the maximum value that the deriveaddresses bitcoin RPC call accepts as
derivation index due to its input validation routines.

Before this change, when the derivation index (and thus range_end) reached
std::numeric_limits<int_32_t>::max(), the "i" variable in the for cycle (which
is declared as int, and as such 32 bits in size on most platforms) would be
incremented at the end of the first iteration and then warp back to
-2147483648. This caused SIGABRT in bitcoind and a core dump.

This change assigns "i" an explicit size of 64 bits on every platform,
sidestepping the problem.

Fixes #26274.

Github-Pull: #26275
Rebased-From: addf9d6502
2025-03-10 17:55:48 +00:00
fanquake
be7b6c7990 Revert "build: Use Homebrew's sqlite package if it is available"
This reverts ee7b84e63c from #20527.
This 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
perofrmance, and results in issues / confusions like #25724.

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.

The difference in performance can be observed using the example from
https://github.com/bitcoin/bitcoin/issues/25724#issuecomment-1213554922,
but minified to only 10 descriptors. 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.

Github-Pull: #25985
Rebased-From: d216d714aa
2025-03-10 17:55:32 +00:00
Hennadii Stepanov
5def1b2a98 Prevent data race for pathHandlers
Github-Pull: bitcoin/bitcoin#25983
Rebased-From: 4296dde287
2025-03-10 16:57:10 +00:00
fanquake
cd457a5212 guix: use --build={arch}-guix-linux-gnu in cross toolchain
Technically we are always cross-compiling, so make that explicit.

Fixes: #22458.

Github-Pull: #25861
Rebased-From: 56e79fe683
2025-03-10 16:56:53 +00:00
fanquake
f12ddd1a5c guix: patch NSIS to remove .reloc sections from install stubs
With the release of binutils/ld 2.36, ld swapped to much improved
default settings when producing windows binaries with mingw-w64. One of
these changes was to stop stripping the .reloc section from binaries,
which is required for working ASLR.

.reloc section stripping is something we've accounted for previously,
see #18702. The related upstream discussion is in this thread:
https://sourceware.org/bugzilla/show_bug.cgi?id=19011.

When we switched to using a newer Guix time-machine in #23778, we begun
using binutils 2.37 to produce releases. Since then, our windows
installer (produced with makensis) has not functioned correctly when run on
a Windows system with the "Force randomization for images (Mandatory ASLR)"
option enabled. Note that all of our other release binaries, which all
contain .reloc sections, function fine under the same option, so it
cannot be just the presence of a .reloc section that is the issue.

For now, restore makensis to it's pre-binutils-2.36 behaviour, which
fixes the produced installer. The underlying issue can be further
investigated in future.

Github-Pull: #25788
Rebased-From: 7a0b129c41
2025-03-10 16:56:41 +00:00
fanquake
8821acdace bdb: disable Werror for format-security
This is causing build failures in some build environments, like NixOS.
I don't think we are going to patch bdb at this point, and this warning
has existed for as long as we've used bdb.

Fixes #25211.

Tested (in Docker) with:
```bash
docker run -it nixos/nix
nix-shell -p gitMinimal gcc12 libtool pkg-config curl gnumake patch autoconf automake
git clone https://github.com/bitcoin/bitcoin
make -C bitcoin/depends bdb
```

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>

Github-Pull: #25763
Rebased-From: b46c6ec52e
2025-03-10 16:56:29 +00:00
Andrew Chow
b682cac34c Disallow encryption of watchonly wallets
Watchonly wallets do not have any private keys to encrypt. It does not
make sense to encrypt such wallets, so disable the option to encrypt
them.

This avoids an assertion that can be hit when encrypting watchonly descriptor
wallets.

Github-Pull: bitcoin-core/gui#631
Rebased-From: 4c495413e1
2025-03-10 16:56:11 +00:00
fanquake
ebc21211b4 build: suppress array-bounds errors in libxkbcommon
These occur when building with GCC 12.1.

It might be the case that these would be suppressed by updating the
package, but that would also require installing new build tools (meson),
as well as potentially more dependencies (wayland).

```bash
In function 'ExprCreateBoolean',
    inlined from 'BoolVarCreate' at src/xkbcomp/ast-build.c:316:19:
src/xkbcomp/ast-build.c:119:23: error: array subscript 'ExprDef[0]' is partly outside array bounds of 'unsigned char[32]' [-Werror=array-bounds]
  119 |     expr->boolean.set = set;
      |     ~~~~~~~~~~~~~~~~~~^~~~~
In function 'ExprCreate',
    inlined from 'ExprCreateBoolean' at src/xkbcomp/ast-build.c:118:5,
    inlined from 'BoolVarCreate' at src/xkbcomp/ast-build.c:316:19:
src/xkbcomp/ast-build.c:75:21: note: object of size 32 allocated by 'malloc'
   75 |     ExprDef *expr = malloc(size);
      |                     ^~~~~~~~~~~~
```

Github-Pull: #25436
Rebased-From: 1bdbbbdc46
2025-03-10 16:55:55 +00:00
Martin Zumsande
33c7e40662 p2p: always set nTime for self-advertisements
If we self-advertised to an inbound peer with the address they gave us,
nTime was left default-initialized, so that our peer wouldn't relay it
any further along.

Github-Pull: #25314
Rebased-From: 99b9e5f3a9
2025-03-10 16:22:03 +00:00
brunoerg
2f9042a967 test: ensure createmultisig and addmultisigaddress are not returning any warning for expected cases
Github-Pull: #25220
Rebased-From: 3a9b9bb38e
2025-03-10 16:21:52 +00:00
brunoerg
063ab84097 rpc: fix inappropriate warning for address type p2sh-segwit in createmultisig and addmultisigaddress
Github-Pull: #25220
Rebased-From: eaf6f630c0
2025-03-10 16:21:39 +00:00
Martin Zumsande
0a9b960d32 rpc: Capture potentially large UniValue by ref for rpcdoccheck
Github-Pull: 25237
Rebased-From: 20ff4991e5
2025-03-10 16:21:25 +00:00
Andrew Chow
078731cd46 windeploy: Renewed windows code signing certificate
Github-Pull: #25201
Rebased-From: 7e9fe6d800
2025-03-10 16:21:00 +00:00
Kilian
e4c4890d09
feat: reduce default dust relay fee 2025-03-10 17:00:40 +01:00
fanquake
0f68c548ac guix: fix GCC 10.3.0 + mingw-w64 setjmp/longjmp issues
This commit backports a patch to the GCC 10.3.0 we build for Windows
cross-compilation in Guix. The commit has been backported to the GCC
releases/gcc-10 branch, but hasn't yet made it into a release.

The patch corrects a regression from an earlier GCC commit, see:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=357c4350680bf29f0c7a115424e3da11c53b5582
and
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=074226d5aa86cd3de517014acfe34c7f69a2ccc7,
related to the way newer versions of mingw-w64 implement setjmp/longjmp.

Ultimately this was causing a crash for us when Windows users were
viewing the network traffic tab inside the GUI. After some period, long
enough that a buffer would need reallocating, a call into FreeTypes
gray_record_cell() would result in a call to ft_longjmp (longjmp), which
would then trigger a crash.

Fixes: https://github.com/bitcoin-core/gui/issues/582.

See also:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e8d1ca7d2c344a411779892616c423e157f4aea8.
https://bugreports.qt.io/browse/QTBUG-93476.

Github-Pull: #24842
Rebased-From: 457148a803
2025-03-10 15:57:39 +00:00
Luke Dashjr
ae24ae306c RPC: Switch getblockfrompeer back to standard param name blockhash
This commit partially reverts 923312fbf6.

Github-Pull: #24806
Rebased-From: 88917f93cc
2025-03-10 15:38:57 +00:00
Pavol Rusnak
7470961fb0 build, qt: bump Qt5 version to 5.15.3
Qt 5.15.3 release is a patch release made on the top of Qt 5.15.2. As a patch
release, Qt 5.15.3 does not add any new functionality but provides bug fixes
and other improvements.

https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/5.15.3/release-note.md

* dropped patches:
  - patches/qt/dont_use_avx_android_x86_64.patch
  - patches/qt/fix_bigsur_style.patch
* adjusted patches:
  - patches/qt/fix_android_jni_static.patch
  - patches/qt/fix_limits_header.patch
  - patches/qt/use_android_ndk23.patch

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>

Github-Pull: bitcoin/bitcoin#24668
Rebased-From: ef20add4c9
2025-03-10 15:37:34 +00:00
fanquake
d572cdf759 guix: fix vmov alignment issues with gcc 10.3.0 & mingw-w64
This introduces a patch to our GCC (10.3.0) mingw-w64 compiler, in Guix, to make
it avoid using aligned vmov instructions. This works around a longstanding issue
in GCC, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412, which was recently
discovered to be causing issues, see #24726.

Note that distros like Debian are also patching around this issue, and that is
where this patch comes from. This would also explain why we haven't run into this
problem earlier, in development builds. See:
https://salsa.debian.org/mingw-w64-team/gcc-mingw-w64/-/blob/master/debian/patches/vmov-alignment.patch.

Fixes #24726.
Alternative to #24727.

See also:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939559

Github-Pull: #24736
Rebased-From: d6fae988ef
2025-03-10 15:37:18 +00:00
Hennadii Stepanov
8bde23c8e7 build: Fix "ERR: Unsigned tarballs do not exist"
Github-Pull: #24733
Rebased-From: 7762c5683f
2025-03-10 15:37:04 +00:00
Hennadii Stepanov
cc323e0d95 wallet: Postpone NotifyWalletLoaded() for encrypted wallets
Too early NotifyWalletLoaded() call in CWallet::Create() results the
notification goes before DescriptorScriptPubKeyMans were created and
added to an encrypted wallet.

Co-authored-by: Andrew Chow <achow101-github@achow101.com>

Github-Pull: bitcoin/bitcoin#24711
Rebased-From: 0c12f0116c
2025-03-10 15:36:55 +00:00
Hennadii Stepanov
92a518c4f3 wallet, refactor: Add wallet::NotifyWalletLoaded() function
This change is a prerequisite for the following bugfix.

Github-Pull: bitcoin/bitcoin#24711
Rebased-From: aeee419c6a
2025-03-10 15:36:42 +00:00
Hennadii Stepanov
17562c0a58 util: Add inotify_rm_watch to syscall sandbox (AllowFileSystem)
Github-Pull: bitcoin#24690
Rebased-From: f05a4cd
2025-03-10 15:35:55 +00:00
Andrew Chow
fb888905f5 tests: Calculate input weight more accurately
The external input test with specifying input weight would make a
pessimistic estimate of the input weight. However this would result in a
test failure as it is sometimes too pessimistic when an ECDSA signature
ends up being smaller than usual. To correct this, we can calculate the
input weight more accurately.

Github-Pull: #24454
Rebased-From: 8a04a386f7
2025-03-10 15:15:58 +00:00
fanquake
ba78a0a8cb util: add linkat to syscall sandbox (AllowFileSystem)
Github-Pull: bitcoin#24659
Rebased-From: 9809db3
2025-03-10 15:15:25 +00:00
Vasil Dimov
ff3e02f606 options: flip listenonion to false if not listening
If the user has unchecked "Allow incoming connections" in
`Settings->Options...->Network` then `fListen=false` is saved in
`~/.config/Bitcoin/Bitcoin-Qt.conf`. This flips `-listen` to `false`
during startup, but leaves `-listenonion` to `true`.

This flipping of `-listen` is done in `OptionsModel::Init()` after
`InitParameterInteraction()` has been executed which would have flipped
`-listenonion`, should it have seen `-listen` being `false`
(this is a difference between `bitcoind` and `bitcoin-qt`).

Fixes: https://github.com/bitcoin-core/gui/issues/567

Github-Pull: bitcoin-core/gui#568
Rebased-From: 7f90dc26c8
2025-03-10 15:14:53 +00:00
Thomas Trevethan
218360bb71 fix prefix 2025-03-10 14:39:32 +00:00
MarcoFalke
e8941f064a rpc: Exclude descriptor when address is excluded
Github-Pull: bitcoin#24636
Rebased-From: faf37c2
2025-03-10 13:35:38 +00:00
Jon Atack
ccb3a3e636 Clarify in -maxtimeadjustment that only outbound peers influence time data
Github-Pull: bitcoin#24609
Rebased-From: 1bba72d
2025-03-10 13:33:32 +00:00
Andrew Chow
d5746d466e Update signapple for platform identifier fix
Github-Pull: #24573
Rebased-From: 3c74f775ac
2025-03-10 13:33:14 +00:00
Hennadii Stepanov
e182058ad0 guix: Use "win64" for Windows artifacts consistently
Github-Pull: #24549
Rebased-From: 53dd6165b8
2025-03-10 13:33:03 +00:00
Thomas Trevethan
45fdd42927 fixed tests 2025-03-10 13:03:15 +00:00
Hennadii Stepanov
513c001fab guix: Drop "-signed" suffix for signed macOS .dmg files
This change makes naming of the signed artifacts consistent across
different OSes, including Windows.

Github-Pull: #24549
Rebased-From: 4b4b04a66d
2025-03-10 11:52:24 +00:00
Sebastian Falbesoner
62b5e053d8 contrib: fix signet miner (sighash mismatch)
PSBT signing was changed to use SIGHASH_DEFAULT by default in #22514.
The signet miner script sets the sighash type of the created PSBT to
SIGHASH_ALL, hence this leads to a sighash mismatch when the
`walletprocesspsbt` RPC is called. Fix this by explicitly passing the
correct sighash type.

Note that the same change was needed in one of our functional tests,
see commit d3992669df.

Reported by gruve-p.

Github-Pull: bitcoin#24553
Rebased-From: 12cc020
2025-03-10 11:52:12 +00:00
Hennadii Stepanov
fd2a5b7a4e guix: Use $HOST instead of generic osx{64} for macOS artifacts
Github-Pull: #24549
Rebased-From: 933a43018f
2025-03-10 11:52:05 +00:00
Jon Atack
608381c1e8 rpc: rename getdeploymentinfo status-next to status_next
Github-Pull: bitcoin#24528
Rebased-From: 5d7c69b
2025-03-10 11:51:55 +00:00
Martin Zumsande
b670213579 test: set segwit height back to 0 on regtest
This was changed in #22818 from 0 to 1. Since it changes
BLOCK_OPT_WIT of the genesis block, older versions of bitcoin
core would not read regtest directories created with newer versions
without a reindex.

Github-Pull: bitcoin#24527
Rebased-From: 5ce3057
2025-03-10 11:51:38 +00:00
Andrew Chow
141288d44d build, mac: Include arch in codesignature tarball
Github-Pull: #24506
Rebased-From: 0189df1d31
2025-03-10 11:51:22 +00:00
Andrew Chow
638095e811 guix: use latest signapple
Github-Pull: #24506
Rebased-From: 6e9308c6d4
2025-03-10 11:50:24 +00:00
Ryan Ofsky
7e7dbadf44 test: Add tests for GetArg methods / settings.json type coercion
Just add tests. No changes to application behavior. Tests will be
updated in the next commit changing & improving current behavior.

Include a Qt test for GUI startup crash reported by Rspigler in
https://github.com/bitcoin/bitcoin/issues/24457 caused by GetArg
behavior that happens if settings.json contains an integer value for any
of the configuration options which GUI settings can currently clash with
(-dbcache, -par, -spendzeroconfchange, -signer, -upnp, -natpmp, -listen,
-server, -proxy, -proxy, -onion, -onion, -lang, and -prune).

Github-Pull: bitcoin/bitcoin#24498
Rebased-From: 84b0973e35
2025-03-10 11:49:53 +00:00
fanquake
33fe2da55e guix: use same commit for codesigning time-machine
The time machines should be updated in lockstep.

Github-Pull: #24484
Rebased-From: 29862bdd40
2025-03-10 11:49:42 +00:00
Byron Hambly
0eb2ea5cbe
Merge pull request #1425 from ElementsProject/simplicity
Avoid double free in simplicity pointer when copying PrecomputedTrans…
2025-03-04 14:53:57 +02:00
Russell O'Connor
3a80782963 Avoid double free in simplicity pointer when copying PrecomputedTransactionData
We cannot put a raw pointer into a class that has a default copy constructor.
2025-03-03 17:35:07 -05:00