Commit Graph

42597 Commits

Author SHA1 Message Date
Ava Chow
f0abe90263 gui, psbt: Use SIGHASH_DEFAULT when signing PSBTs
SIGHASH_DEFAULT should be used to indicate SIGHASH_DEFAULT for taproot
inputs, and SIGHASH_ALL for all other input types. This avoids adding an
unnecessary byte to the end of all Taproot signatures added to PSBTs
signed in the GUI.

Github-Pull: gui#850
Rebased-From: 3e97ff9c5e
2025-01-14 23:16:25 +00:00
Hennadii Stepanov
90789a1e01 build, test: Build db_tests.cpp regardless of USE_BDB
While some tests are specific to BDB, `db_tests` as a whole are not
limited to BDB.

Github-Pull: #31617
Rebased-From: fd2d96d908
2025-01-14 21:07:03 +00:00
fanquake
cb9a4640ec guix: disable timezone tools & profiling in glibc
Removes `var/profiles/x86_64-linux-gnu/sbin/zdump`.

Profiling is disabled by default, but make that explicit.

Github-Pull: #31529
Rebased-From: b8710201fb
2025-01-14 04:26:09 +00:00
fanquake
1252d33cf0 guix: bump glibc 2.31 to 7b27c450c34563a28e634cccb399cd415e71ebfe
An additional commit has been backported to the 2.31 branch:
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.31/master.

Github-Pull: #31529
Rebased-From: 23b8a424fb
2025-01-14 04:26:09 +00:00
Luke Dashjr
a2badef7e4 GUI: Always show pruning explanation to avoid checkbox jumping around 2025-01-14 00:04:56 +00:00
Luke Dashjr
4c97d2af60 Minimise and keep somewhat compatible 2025-01-13 21:27:00 +00:00
0xb10c
f93f0c9396 tracing: Rename the MIN macro to _TRACEPOINT_TEST_MIN in log_raw_p2p_msgs
Inspired by: 00c1dbd26d (#31419)
2025-01-09 06:43:05 +00:00
MarcoFalke
9fd37323ba doc: Fix incorrect send RPC docs
Github-Pull: #31416
Rebased-From: fad83e759a
2025-01-09 06:29:52 +00:00
MarcoFalke
d834bfda34 Remove wallet::ParseISO8601DateTime, use ParseISO8601DateTime instead
Github-Pull: #31391
Rebased-From: faf70cc994
2025-01-09 04:11:43 +00:00
MarcoFalke
ab569e97b7 util: Implement ParseISO8601DateTime based on C++20
Github-Pull: #31391
Rebased-From: 2222aecd5f
2025-01-09 04:11:42 +00:00
MarcoFalke
88c7842f35 test: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py
This was forgotten by myself in commit fa5b58ea01

Github-Pull: #31383
Rebased-From: faa16ed4b9
2025-01-08 23:01:15 +00:00
Luke Dashjr
6deee076a9 Diff-minimise 2025-01-08 22:09:09 +00:00
Antoine Poinsot
f6b4f22808 miner: never create a template which exploits the timewarp bug
Github-Pull: #31376
Rebased-From: 733fa0b0a1
2025-01-08 22:09:09 +00:00
furszy
84719e6f55 wallet: fix crash during watch-only wallet migration
The crash occurs because we assume the cached scripts
structure will not be empty, but it can be empty when
the legacy wallet contained only watch-only and
solvable but not spendable scripts

Github-Pull: #31374
Rebased-From: 932cd1e92b
2025-01-08 21:46:56 +00:00
Sebastian Falbesoner
16d60e56de test: avoid internet traffic in rpc_net.py
Can be tested by running

```
$ sudo tcpdump -i eth0 host 11.22.33.44
```

and verifying that no packets appear in the tcpdump output.

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: #31343
Rebased-From: 988721d37a
2025-01-08 20:13:57 +00:00
Michael Little
2f7f2fae63 further RPC example corrections
Github-Pull: #31275
Rebased-From: 1f3f5c049b4080ecaf30604fd22d65aa0fc4af45
2025-01-08 20:03:20 +00:00
Michael Little
599a0811ac corrected lockunspent rpc quoting
Github-Pull: #31275
Rebased-From: 70ae8ca8b7435a38416c4eb469b3cdad6fb87b4f
2025-01-08 20:03:19 +00:00
Hodlinator
e1b776466d test: Add tests for directories in place of config files
Github-Pull: #31212
Rebased-From: 95a0104f2e
2025-01-08 18:48:13 +00:00
Hodlinator
866ba19192 args: Catch directories in place of config files
Previously passing a directory path as -conf would lead to an ifstream being opened for it, and would not trigger any errors.

Github-Pull: #31212
Rebased-From: e85abe92c7
2025-01-08 18:48:13 +00:00
Hodlinator
6b837312c6 test: Add tests for -noconf
Github-Pull: #31212
Rebased-From: e4b6b1822c
2025-01-08 18:48:13 +00:00
Hodlinator
088e9845f0 args: Properly support -noconf
-noconf would previously lead to an ifstream "successfully" being opened to the ".bitcoin"-directory (not a file). (Guards against the general case of directories as configs are added in grandchild commit to this one).

Other users of AbsPathForConfigVal() in combination with negated args have been updated earlier in this PR ("args: Support -nopid" and "args: Support -norpccookiefile...").

Github-Pull: #31212
Rebased-From: 483f0dacc4
2025-01-08 18:48:13 +00:00
Hodlinator
41970350d4 test refactor: feature_config_args.py - Stop nodes at the end of tests, not at the beginning
This ensures we don't needlessly start the node, and reduces implicit dependencies between test functions.

test_seed_peers() - Move assert calling RPC to verify correct chain after our own function actually started the node.

Github-Pull: #31212
Rebased-From: 312ec64cc0
2025-01-08 18:48:13 +00:00
Hodlinator
56c374dfad test: -norpccookiefile
Both bitcoind and bitcoin-cli.

Github-Pull: #31212
Rebased-From: 7402658bc2
2025-01-08 18:48:13 +00:00
Hodlinator
88ae15bb58 args: Support -norpccookiefile for bitcoind and bitcoin-cli
Replaces belt & suspenders check for initialization in RPCAuthorized() with not allowing empty passwords further down.

Github-Pull: #31212
Rebased-From: 39cbd4f37c
2025-01-08 18:48:13 +00:00
Hodlinator
0b3f7453b6 logs: Use correct path and more appropriate macros in cookie-related code
filepath_tmp -> filepath in last message.

More material changes to nearby code in next commit.

Github-Pull: #31212
Rebased-From: e82ad88452
2025-01-08 18:48:13 +00:00
Hodlinator
9b90eea2a1 test: Harden testing of cookie file existence
Github-Pull: #31212
Rebased-From: 6e28c76907
2025-01-08 18:48:13 +00:00
Hodlinator
a613155808 test: combine_logs.py - Output debug.log paths on error
Github-Pull: #31212
Rebased-From: 75bacabb55
2025-01-08 18:48:13 +00:00
Hodlinator
c850b5be46 args: Support -nopid
Github-Pull: #31212
Rebased-From: bffd92f00f
2025-01-08 18:48:13 +00:00
Hodlinator
397cc860ed scripted-diff: Avoid printing version information for -noversion
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended 's/\b(gArgs|args)\.IsArgSet\("-version"\)/\1.GetBoolArg("-version", false)/g' $(git grep -l '-version')
-END VERIFY SCRIPT-

Github-Pull: #31212
Rebased-From: 6ff9662760
2025-01-08 18:48:13 +00:00
Hodlinator
bb42993a30 doc args: Document narrow scope of -color
Github-Pull: #31212
Rebased-From: e8a2054edc
2025-01-08 18:48:12 +00:00
TheCharlatan
b4973b60b2 interpreter: Use the same type for SignatureHash in the definition
This was missed during the original PR switching the nHashType argument
to int32_t in SignatureHash in bc52cda1f3.

The problem was discovered after running into a linker error when
attempting to link this code as a static library using the header as a
declaration with a riscv32 bare metal toolchain. The compiler would
error with:

/opt/riscv-ilp32/lib/gcc/riscv32-unknown-elf/13.2.0/../../../../riscv32-unknown-elf/bin/ld: build_kernel_riscv/src/libbitcoin_consensus.a(interpreter.cpp.o): in function `GenericTransactionSignatureChecker<CTransaction>::CheckECDSASignature(std::vector<unsigned char, std::allocator<unsigned char> > const&, std::vector<unsigned char, std::allocator<unsigned char> > const&, CScript const&, SigVersion) const':
/home/user/bitcoin/build_kernel_riscv/./script/interpreter.cpp:2043:(.text._ZNK34GenericTransactionSignatureCheckerI12CTransactionE19CheckECDSASignatureERKSt6vectorIhSaIhEES6_RK7CScript10SigVersion[_ZNK34GenericTransactionSignatureCheckerI12CTransactionE19CheckECDSASignatureERKSt6vectorIhSaIhEES6_RK7CScript10SigVersion]+0xee): undefined reference to `uint256 SignatureHash<CTransaction>(CScript const&, CTransaction const&, unsigned int, int, long long const&, SigVersion, PrecomputedTransactionData const*)'

Github-Pull: #31365
Rebased-From: c288c790cd
2025-01-08 15:27:21 +00:00
Luke Dashjr
ff198b5ce5 run_command: Enable close_fds option to avoid lingering fds 2025-01-08 15:08:06 +00:00
Luke Dashjr
0cb1dc0be9 cpp-subprocess: Iterate through /proc/self/fd for close_fds option 2025-01-08 15:08:06 +00:00
MarcoFalke
81b6de569e test: Avoid logging error when logging error
Github-Pull: #31408
Rebased-From: cccca8a77f (minimised)
2025-01-08 14:19:17 +00:00
Ava Chow
32efe85043
Merge bitcoin/bitcoin#31594: [28.x] 28.1 backports and final changes
36314b8da2 doc: Update 28.1 release notes (MarcoFalke)
58910279dc doc: generate 28.1 manpages (Ava Chow)
6a68ef9bfb build: bump to 28.1 (Ava Chow)
5b368f88a9 depends: Fix CXXFLAGS on NetBSD (Hennadii Stepanov)
05cd448e33 test: generateblocks called by multiple threads (MarcoFalke)
621c634b7f rpc: Extend scope of validation mutex in generateblock (MarcoFalke)

Pull request description:

  Backports:

  - #31502
  - #31563

ACKs for top commit:
  glozow:
    reACK 36314b8da2
  achow101:
    ACK 36314b8da2

Tree-SHA512: c7a624b4c166f4322011d98d1ca814ae98eaf5fd2481a507cd65a50216f1abbb91f8643508ce81f64f8b10fa2210db1722254c343253f2a950b9c64667735e9b
2025-01-07 13:32:56 -05:00
MarcoFalke
36314b8da2 doc: Update 28.1 release notes 2025-01-06 11:04:28 +01:00
Ava Chow
58910279dc doc: generate 28.1 manpages 2025-01-02 20:53:02 +01:00
Ava Chow
6a68ef9bfb build: bump to 28.1 2025-01-02 20:53:02 +01:00
Hennadii Stepanov
5b368f88a9 depends: Fix CXXFLAGS on NetBSD
This change corrects an issue where CXXFLAGS were mistakenly overridden
by CFLAGS.

Github-Pull: 31502
Rebased-From: a10bb400e8
2025-01-02 14:18:28 +01:00
MarcoFalke
05cd448e33 test: generateblocks called by multiple threads
Co-Authored-By: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: 31563
Rebased-From: fa63b8232f
2025-01-02 14:17:02 +01:00
MarcoFalke
621c634b7f rpc: Extend scope of validation mutex in generateblock
The mutex (required by TestBlockValidity) must be held after creating
the block, until TestBlockValidity is called. Otherwise, it is possible
that the chain advances in the meantime and leads to a crash in
TestBlockValidity:

 Assertion failed: pindexPrev && pindexPrev == chainstate.m_chain.Tip() (validation.cpp: TestBlockValidity: 4338)

The diff can be reviewed with the git options
--ignore-all-space --function-context

Github-Pull: 31563
Rebased-From: fa62c8b1f0
2025-01-02 14:16:50 +01:00
Ava Chow
6db725662d
Merge bitcoin/bitcoin#31469: [28.x] 28.1rc2 backports
5576618152 doc: update release notes for 28.1rc2 (Ava Chow)
01fe07a2ce examples: Generate example bitcoin.conf (Ava Chow)
7ddfcf32da doc: Generate manpages (Ava Chow)
e0b27b234c build: Bump to 28.1rc2 (Ava Chow)
bdc6b3e531 Add release note for #31223 (Martin Zumsande)
a0585b6087 test: add functional test for -port behavior (Martin Zumsande)
bbde830b97 net, init: derive default onion port if a user specified a -port (Martin Zumsande)
227642d5af test: fix MIN macro-redefinition (0xb10c)
b8112cf422 util: use explicit cast in MultiIntBitSet::Fill() (Vasil Dimov)
2835158be0 fuzz: add cstdlib to FuzzedDataProvider (fanquake)

Pull request description:

  Backports:

  * #31223
  * #31448
  * #31431
  * #31419

ACKs for top commit:
  hodlinator:
    re-ACK 5576618152

Tree-SHA512: f99f3c5960f18f6894832c5f9a827f97fd3c6e086670341760ce1b77c304d53136492371c59148f3b4bbcfe2d5428c835fe632c61b229b40f1f6f6cf2b72cdca
2024-12-17 13:06:08 -05:00
Ava Chow
5576618152 doc: update release notes for 28.1rc2 2024-12-13 21:27:57 -05:00
Ava Chow
01fe07a2ce examples: Generate example bitcoin.conf 2024-12-13 21:20:23 -05:00
Ava Chow
7ddfcf32da doc: Generate manpages 2024-12-13 21:19:41 -05:00
Ava Chow
e0b27b234c build: Bump to 28.1rc2 2024-12-13 21:16:24 -05:00
Martin Zumsande
bdc6b3e531
Add release note for #31223
Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 1dd3af8fbc
2024-12-13 21:15:29 -05:00
Martin Zumsande
a0585b6087
test: add functional test for -port behavior
Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 997757dd2b
2024-12-13 21:15:26 -05:00
Martin Zumsande
bbde830b97
net, init: derive default onion port if a user specified a -port
After port collisions are no longer tolerated but lead to
a startup failure in v28.0, local setups of multiple nodes,
each with a different -port value would not be possible anymore
due to collision of the onion default port - even if the nodes
were using tor or not interested in receiving onion inbound connections.

Fix this by deriving the onion listening port to be -port + 1.
(idea by vasild / laanwj)

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 0e2b12b92a
2024-12-13 21:15:23 -05:00
0xb10c
227642d5af
test: fix MIN macro-redefinition
Renames the `MIN` macro to `_TRACEPOINT_TEST_MIN`.

From #31418:

```
stderr:
/virtual/main.c:70:9: warning: 'MIN' macro redefined [-Wmacro-redefined]
   70 | #define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
      |         ^
include/linux/minmax.h:329:9: note: previous definition is here
  329 | #define MIN(a,b) __cmp(min,a,b)
      |         ^
1 warning generated.
```

fixes: https://github.com/bitcoin/bitcoin/issues/31418

Github-Pull: bitcoin/bitcoin#31419
Rebased-From: 00c1dbd26d
2024-12-11 11:41:49 -05:00