Commit Graph

39764 Commits

Author SHA1 Message Date
fanquake
d854914043
Merge bitcoin/bitcoin#28992: ci: Use Ubuntu 24.04 Noble for asan,tsan,tidy,fuzz
fad2392c58 ci: Use Ubuntu 24.04 Noble for asan (MarcoFalke)
fa83b65ef8 ci: Use Ubuntu 24.04 Noble for tsan,tidy,fuzz (MarcoFalke)

Pull request description:

  23.10 will be EOL mid next year, so a bump is needed before then for the `master` branch (and possibly the `26.x` branch).

  Doing the bump now is fine, because the clang version is pinned to 17 inside the CI tasks. So a default clang version change in the system image should not affect the tasks. Once clang-18 is available and the default in April next year (https://discourse.ubuntu.com/t/noble-numbat-release-schedule/35649#planned-and-potentially-disruptive-archive-wide-activities-2), the pinned version could be bumped (for CI tasks that require a pin, like tidy), or the pin can be removed (for CI tasks that usually do not require a pin, like fuzz or the sanitizers).

ACKs for top commit:
  fanquake:
    ACK fad2392c58

Tree-SHA512: c40aede4e2281a5d539d5f65d2c08a57bf92e4a00b4f45a4260b57b7443a63d1a0603115da4a3bbd100ac5f6ade3f2eda0916e4b565573741162a76294ec0ac5
2023-12-06 14:13:42 +00:00
ismaelsadeeq
562664d263 test: wait for fee estimator to catch up before estimating fees 2023-12-06 15:01:54 +01:00
MarcoFalke
fae1e7e012
fuzz: p2p: Detect peer deadlocks 2023-12-06 13:11:38 +01:00
Sebastian Falbesoner
00e0658e77 test: fix v2 transport intermittent test failure (#29002)
Only relying on the number of peers for detecting a new connection
suffers from race conditions, as unrelated previous peers could
disconnect at anytime in-between. Use the more robust approach of
watching for an increased highest peer id instead (again using the
`getpeerinfo` RPC call), with a newly introduced context manager
method `TestNode.wait_for_new_peer()`.

Fixes #29009.
2023-12-06 00:28:28 +01:00
Martin Zumsande
9075a44646 test: add regression test for the getrawtransaction segfault
This fails on master without the previous commit.
2023-12-05 17:12:56 -05:00
furszy
1ce45baed7
rpc: getwalletinfo, return wallet 'birthtime'
And add coverage for it
2023-12-05 18:55:35 -03:00
furszy
83c66444d0
test: coverage for wallet birth time interaction with -reindex
Verifying the wallet updates the birth time accordingly when it
detects a transaction with a time older than the oldest descriptor
timestamp.
This could happen when the user blindly imports a descriptor with
'timestamp=now'.
2023-12-05 18:55:35 -03:00
furszy
6f497377aa
wallet: fix legacy spkm default birth time
To avoid scanning blocks, as assumed by a wallet with no
generated keys or imported scripts, the default value for
the birth time needs to be set to the maximum int64_t value.

Once the first key is generated or the first script is imported,
the legacy SPKM will update the birth time automatically.
2023-12-05 18:55:35 -03:00
furszy
ca09415e63
rpc, doc: encryptwallet, mention HD seed rotation and new backup
Better to notify users about the HD seed rotation and the new
backup requirement before executing the encryption process.
Ensuring they are prepared to update previous backups and
securely safeguard the updated wallet file.

Co-authored-by: jonatack <jon@atack.com>
2023-12-05 18:46:58 -03:00
Martin Zumsande
494a926d05 rpc: fix getrawtransaction segfault
The crash would happen when querying a mempool transaction with verbosity=2, while pruning.
2023-12-05 13:11:02 -05:00
MarcoFalke
fa8adbe7c1
build: Enable -Wunreachable-code 2023-12-05 15:36:08 +01:00
fanquake
6d5790956f
Merge bitcoin/bitcoin#28856: depends: Build the native_capnp and capnp packages with CMake
11d797e3a0 depends: Build `native_capnp` package with CMake (Hennadii Stepanov)
90389c95e9 depends: Build `capnp` package with CMake (Hennadii Stepanov)

Pull request description:

  The first commit fixes two bugs when cross-compiling the `capnp` package on the master branch @ 160d23677a:
  - for `x86_64-w64-mingw32` (see https://github.com/bitcoin/bitcoin/pull/28735#issuecomment-1790406668):
  ```
  libtool: link: x86_64-w64-mingw32-g++-posix -shared -nostdlib /usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib/dllcrt2.o /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtbegin.o  src/kj/.libs/cidr.o src/kj/.libs/common.o src/kj/.libs/units.o src/kj/.libs/memory.o src/kj/.libs/refcount.o src/kj/.libs/array.o src/kj/.libs/list.o src/kj/.libs/string.o src/kj/.libs/string-tree.o src/kj/.libs/source-location.o src/kj/.libs/hash.o src/kj/.libs/table.o src/kj/.libs/encoding.o src/kj/.libs/exception.o src/kj/.libs/debug.o src/kj/.libs/arena.o src/kj/.libs/io.o src/kj/.libs/mutex.o src/kj/.libs/thread.o src/kj/.libs/time.o src/kj/.libs/filesystem.o src/kj/.libs/filesystem-disk-unix.o src/kj/.libs/filesystem-disk-win32.o src/kj/.libs/test-helpers.o src/kj/.libs/main.o src/kj/parse/.libs/char.o   -L/home/hebasto/git/bitcoin/depends/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix -L/usr/lib/gcc/x86_64-w64-mingw32/12-posix/../../../../x86_64-w64-mingw32/lib -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32 /usr/lib/gcc/x86_64-w64-mingw32/12-posix/crtend.o  -mthreads -O2 -mthreads   -mthreads -o .libs/libkj-1-0-1.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libkj.dll.a
  /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x1dc): undefined reference to `__imp_inet_ntop'
  /usr/bin/x86_64-w64-mingw32-ld: src/kj/.libs/cidr.o:cidr.c++:(.text+0x44b): undefined reference to `__imp_inet_pton'
  collect2: error: ld returned 1 exit status
  ```
  - for `arm64-apple-darwin`:
  ```
  checking build system type... x86_64-pc-linux-gnu
  checking host system type... Invalid configuration `arm64-apple-darwin': machine `arm64-apple' not recognized
  configure: error: /bin/bash build-aux/config.sub arm64-apple-darwin failed
  ```

  The second commit applies the same changes for the `native_capnp` package for [consistency](https://github.com/bitcoin/bitcoin/pull/28856#issuecomment-1807936546).

ACKs for top commit:
  ryanofsky:
    Code review ACK 11d797e3a0. Since last review arm64-apple-darwin platform is now mentioned in the commit message, and the change to `depends/packages/libmultiprocess.mk` in d1604d4b1d1ee8df279a1776303e167cc3d06193 which was unrelated (but probably still a good optimization) was reverted.

Tree-SHA512: c636e53073ce6fcda9724723bc59f3990fa9629a3b2f73d93dbc102a5a1badfbe8f4c5fef841f03588ebcad5cd4883f3ce32b128afcd75f6bc21eb801796a586
2023-12-05 13:28:08 +00:00
fanquake
b3ab0c3819
Merge bitcoin/bitcoin#28997: fuzz: txorphan check wtxids using GenTxid::Wtxid not GenTxid::Txid
38816ff64e fuzz: txorphan check wtxids using GenTxid::Wtxid not GenTxid::Txid (Greg Sanders)

Pull request description:

  Fixes the bugs in the fuzz test with no more changes as an alternative to https://github.com/bitcoin/bitcoin/pull/28658

ACKs for top commit:
  naumenkogs:
    ACK 38816ff64e
  dergoegge:
    ACK 38816ff64e

Tree-SHA512: 5e46a83f2b2a2ac0672a63eb6200b019e01089ab1aa80c4ab869b6fcf27ccf2e84a064e96397f1a1869ccfa43b0c9638cbae681a27c4ca3c96ac71f41262601e
2023-12-05 10:56:07 +00:00
fanquake
8ea45e626e
build: use macOS 14 SDK (Xcode 15.0) 2023-12-05 09:55:01 +00:00
fanquake
51c97ffb69
build: patch boost process for macOS 14 SDK 2023-12-05 09:55:01 +00:00
fanquake
423949a13b
depends: add -platform_version to macOS build flags
```bash
-platform_version platform min_version sdk_version
    This is set to indicate the platform, oldest supported version
    of that platform that output is to be used on, and the SDK that
    the output was built against.
```
2023-12-05 09:35:32 +00:00
Ryan Ofsky
1c8893bd1c
Merge bitcoin/bitcoin#28852: script, assumeutxo: Enhance validations in utxo_snapshot.sh
11b7269d83 script: Enhance validations in utxo_snapshot.sh (pablomartin4btc)

Pull request description:

  This PR resolves #27841 and some more:

  - Ensure that the snapshot height is higher than the pruned block height when the node is pruned (Suggested by @Sjors [here](https://github.com/bitcoin/bitcoin/pull/28553#issuecomment-1804941396)).

  - Validate the correctness of the file path and check if the file already exists (@hazeycode's [#27845](https://github.com/bitcoin/bitcoin/pull/27845)).

  - Make network activity disablement optional for the user (Suggested by @Sjors [here](https://github.com/bitcoin/bitcoin/pull/16899#discussion_r342735815) and [here](https://github.com/bitcoin/bitcoin/pull/16899#issuecomment-536520911)).

  - Ensure the `reconsiderblock` command is triggered on exit (@hazeycode's same PR as above), even in the case of user interruption (Ctrl-C).

  In order to perform some testing please follow the instructions in the description of previous @hazeycode's PR #27845.

ACKs for top commit:
  Sjors:
    tACK 11b7269d83
  ryanofsky:
    Code review ACK 11b7269d83

Tree-SHA512: 2b699894c6f732ad5104f5a2bcf5dc86ed31edcc9d664690cab55b94a8ab00e2ca5bde901ee1d63acddca7ea80ad1734d8cfe78f9c02f8470f264fe93a2af759
2023-12-04 17:07:14 -05:00
Kashif Smith
c2b836b119 bitcoin-tx: Make replaceable value optional 2023-12-04 16:14:00 -05:00
Greg Sanders
38816ff64e fuzz: txorphan check wtxids using GenTxid::Wtxid not GenTxid::Txid 2023-12-04 14:42:13 -05:00
Ryan Ofsky
6db04be102 Get rid of shutdown.cpp/shutdown.h, use SignalInterrupt directly
This change is mostly a refectoring that removes some code and gets rid of an
unnecessary layer of indirection after #27861

But it is not a pure refactoring since StartShutdown, AbortShutdown, and
WaitForShutdown functions used to abort on failure, and the replacement code
logs or returns errors instead.
2023-12-04 15:39:15 -04:00
Andrew Chow
afdc4c3a30
Merge bitcoin/bitcoin#28946: init: don't delete PID file if it was not generated
8f6ab31863 init: don't delete PID file if it was not generated (willcl-ark)

Pull request description:

  In a similar vein to #28784, if a second `bitcoind` is started using the same datadir it will fail to start up, but during shutdown remove the PID file from the first `bitcoind` instance.

ACKs for top commit:
  achow101:
    ACK 8f6ab31863
  andrewtoth:
    ACK 8f6ab31863
  romanz:
    ACK 8f6ab31863

Tree-SHA512: c9af703cbfa179d33ef9580a51e86c1b0acbd28daa18c8d2e5e5ff796ab4d3e2009a962a47e6046a0e5ece936f8a06ee8af5fdf8ff4ae1e52cbcdbec4b942271
2023-12-04 14:39:15 -05:00
Ryan Ofsky
213542b625 refactor: Add InitContext function to initialize NodeContext with global pointers
Having InitContext() avoids the need to add duplicate code to src/init/*.cpp
files in the next commit. It also lets these files avoid referencing global
variables like gArgs.

There is no change in behavior in this commit.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
feeb7b816a refactor: Remove calls to StartShutdown from KernelNotifications
Use SignalInterrupt object instead. There is a slight change in behavior here
because the previous StartShutdown code used to abort on failure and the
new code logs errors instead.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
6824eecaf1 refactor: Remove call to StartShutdown from stop RPC
Use SignalInterrupt object instead. There is a slight change in behavior here
because the previous StartShutdown code used to abort on failure and the
new code returns an RPC error instead.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
1d92d89edb util: Get rid of uncaught exceptions thrown by SignalInterrupt class
Replace exceptions thrown by signal and wait methods with [[nodiscard]] return
values.

This is mostly a refactoring, but there is a slight change of behavior if
AbortShutdown function fails. The original behavior which was unintentionally
changed in #27861 is restored, so it now triggers an assert failure again
instead of throwing an exception. (The AbortShutdown function is only ever
called in the the GUI version of Bitcoin Core when corruption is detected on
loading and the user tries to reindex.)

Problems with using exceptions were pointed out by MarcoFalke in
https://github.com/bitcoin/bitcoin/pull/27861#discussion_r1255496707.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
ba93966368 refactor: Remove call to ShutdownRequested from IndexWaitSynced
Use the node interrupt object instead.

There is no change in behavior in this commit.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
42e5829d97 refactor: Remove call to ShutdownRequested from HTTPRequest
Pass HTTP server an interrupt object instead of having it depend on shutdown.h
and global shutdown state.

There is no change in behavior in this commit.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
73133c36aa refactor: Add NodeContext::shutdown member
Add NodeContext::shutdown variable and start using it to replace the
kernel::Context::interrupt variable. The latter can't easily be removed right
away but will be removed later in this PR.

Moving the interrupt object from the kernel context to the node context
increases flexibility of the kernel API so it is possible to use multiple
interrupt objects, or avoid creating one if one is not needed. It will also
allow getting rid of the kernel::g_context global later in this PR, replacing
it with a private SignalInterrupt instance in init.cpp

There is no change in behavior in this commit outside of unit tests. In unit
tests there should be no visible change either, but internally now each test
has its own interrupt variable so the variable will be automatically reset
between tests.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
f4a8bd6e2f refactor: Remove call to StartShutdown from qt
Use interfaces::Node object instead.

There is a minor change in behavior in this commit, because the new code calls
InterruptRPC() and StopRPC() when previous code did not do this.  But this
should be a good thing since it makes sense to interrupt RPC when the system is
shutting down, and it is better for the GUI shut down in a consistent way
regardless of how the shutdown is triggered.
2023-12-04 15:39:15 -04:00
Ryan Ofsky
f0c73c1336 refactor: Remove call to ShutdownRequested from rpc/mining
Use chainman.m_interrupt object instead

There is no change in behavior in this commit
2023-12-04 15:39:15 -04:00
Ryan Ofsky
263b23f008 refactor: Remove call to ShutdownRequested from chainstate init
Use chainman.m_interrupt object instead

There is no change in behavior in this commit
2023-12-04 15:39:15 -04:00
Hennadii Stepanov
11d797e3a0
depends: Build native_capnp package with CMake 2023-12-04 14:39:59 +00:00
Hennadii Stepanov
90389c95e9
depends: Build capnp package with CMake
This change fixes the `capnp` package cross-compiling for the
`x86_64-w64-mingw32` and `arm64-apple-darwin` platforms.
2023-12-04 14:39:58 +00:00
willcl-ark
8f6ab31863
init: don't delete PID file if it was not generated
Previously, starting a second bitcoind using the same datadir would
correctly fail to init and shutdown. However during shutdown the PID
file belonging to the first instance would be erroneously removed by
the second process shutting down.

Fix this to only delete the PID file if we created it.
2023-12-04 12:54:20 +00:00
MarcoFalke
fad2392c58
ci: Use Ubuntu 24.04 Noble for asan 2023-12-04 12:29:02 +01:00
MarcoFalke
fa83b65ef8
ci: Use Ubuntu 24.04 Noble for tsan,tidy,fuzz 2023-12-04 09:38:42 +01:00
Hennadii Stepanov
55e3dc3e03
test: Fix test by checking the actual exception instance
The BOOST_REQUIRE_THROW passes even if the command raises an exception
in the underlying subprocess implementation, which might have a type
derived from std::runtime_error.
2023-12-03 16:04:20 +00:00
Fabian Jahr
3ea54e5db7
net: Add continuous ASMap health check logging 2023-12-02 22:03:08 +01:00
fanquake
160d23677a
Merge bitcoin/bitcoin#28851: build: Patch Qt to handle minimum macOS version properly
05aca09381 build: Patch Qt to handle minimum macOS version properly (Hennadii Stepanov)

Pull request description:

  This PR is:
  - required to [switch](https://github.com/bitcoin/bitcoin/pull/28622) to macOS 14 SDK (Xcode 15).
  - an alternative to https://github.com/bitcoin/bitcoin/pull/28732 and https://github.com/bitcoin/bitcoin/pull/28775.

  Qt relies on the `__MAC_OS_X_VERSION_MIN_REQUIRED` macro, which is set in the `AvailabilityInternal.h` SDK header to
  the value provided by the Clang driver from the `-mmacos-version-min` / `-mmacosx-version-min` option.

  Xcode 12 SDK expects the OS-specific `__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__` macro:
  ```c++
  #ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
      #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
          /* compiler for Mac OS X sets __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ */
          #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
      #endif
  #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED*/
  ```

  In the other hand, Xcode 15 SDK expects a general `__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__` macro:
  ```c++
  #ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
      #if defined(__has_builtin) && __has_builtin(__is_target_os)
          #if __is_target_os(macos)
              #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
              #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
          #endif
      #elif  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
          #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
          #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
      #endif /*  __has_builtin(__is_target_os) && __is_target_os(macos) */
  #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
  ```

  The latter macro is not provided by LLVM Clang until c8e2dd8c6f, which is available in Clang 17.

  The suggested patch makes Qt "borrow" the `__MAC_OS_X_VERSION_MIN_REQUIRED` value from `MAC_OS_X_VERSION_MIN_REQUIRED`, which is set in the `AvailabilityMacros.h` SDK header.

ACKs for top commit:
  maflcko:
    lgtm ACK 05aca09381

Tree-SHA512: 8891aefde4b8a48885abf0648f4ec71a22f7fcfca1e17ebb8c70ce1ef44751ea5db6b8b652de6ee8a716ca5f96f720fef01600bc23986162d0146c946e2e8743
2023-12-01 20:28:23 +00:00
fanquake
5aa37ca01d
Merge bitcoin/bitcoin#28973: ci: remove libz-dev from macOS build deps
97d53e90ba ci: remove libz-dev from macOS build deps (fanquake)

Pull request description:

  Remove no-longer used libz-dev (from DMG compression).
  Followup to #28432.
  Missed this in #28932.

ACKs for top commit:
  TheCharlatan:
    ACK 97d53e90ba

Tree-SHA512: ea4e46d83a11cfb0d77e7c5b370359864a026ca58e02de1a3d30458e4463dabd338db9546da63b782a7fa0ce199446c418fbfdfc400f3803b0ea9dd626aed42f
2023-12-01 20:27:21 +00:00
Andrew Chow
a97a89244e
Merge bitcoin/bitcoin#28368: Fee Estimator updates from Validation Interface/CScheduler thread
91504cbe0d rpc: `SyncWithValidationInterfaceQueue` on fee estimation RPC's (ismaelsadeeq)
714523918b tx fees, policy: CBlockPolicyEstimator update from `CValidationInterface` notifications (ismaelsadeeq)
dff5ad3b99 CValidationInterface: modify the parameter of `TransactionAddedToMempool` (ismaelsadeeq)
91532bd382 tx fees, policy: update `CBlockPolicyEstimator::processBlock` parameter (ismaelsadeeq)
bfcd401368 CValidationInterface, mempool: add new callback to `CValidationInterface` (ismaelsadeeq)
0889e07987 tx fees, policy: cast with static_cast instead of C-Style cast (ismaelsadeeq)
a0e3eb7549 tx fees, policy: bugfix: move `removeTx` into reason != `BLOCK` condition (ismaelsadeeq)

Pull request description:

  This is an attempt to  #11775

  This Pr will enable fee estimator to listen to ValidationInterface notifications to process new transactions added and removed from the mempool.

  This PR includes the following changes:

  - Added a new callback to the Validation Interface `MempoolTransactionsRemovedForConnectedBlock`, which notifies listeners about the transactions that have been removed due to a new block being connected, along with the height at which the transactions were removed.
  - Modified the `TransactionAddedToMempool` callback parameter to include additional information about the transaction needed for fee estimation.
  - Updated `CBlockPolicyEstimator` to process transactions using` CTransactionRef` instead of `CTxMempoolEntry.`
  - Implemented the `CValidationInterface` interface in `CBlockPolicyEstimater` and overridden the `TransactionAddedToMempool`, `TransactionRemovedFromMempool`, and `MempoolTransactionsRemovedForConnectedBlock` methods to receive updates from their notifications.

  Prior to this PR, the fee estimator updates from the mempool, i.e whenever a new block is connected all transactions in the block that are in our mempool are going to be removed using the `removeForBlock` function in `txmempool.cpp`.

  This removal triggered updates to the fee estimator. As a result, the fee estimator would block mempool's `cs` until it finished updating every time a new block was connected.
  Instead of being blocked only on mempool tx removal, we were blocking on both tx removal and fee estimator updating.
  If we want to further improve fee estimation, or add heavy-calulation steps to it, it is currently not viable as we would be slowing down block relay in the process

  This PR is smaller in terms of the changes made compared to #11775, as it focuses solely on enabling fee estimator updates from the validationInterface/cscheduler thread notifications.

  I have not split the validation interface because, as I understand it, the rationale behind the split in #11775 was to have `MempoolInterface` signals come from the mempool and `CValidationInterface` events come from validation. I believe this separation can be achieved in a separate refactoring PR when the need arises.

  Also left out some commits from #11775
  - Some refactoring which are no longer needed.
  - Handle reorgs much better in fee estimator.
  - Track witness hash malleation in fee estimator

  I believe they are a separate change that can come in a follow-up after this.

ACKs for top commit:
  achow101:
    ACK 91504cbe0d
  TheCharlatan:
    Re-ACK 91504cbe0d
  willcl-ark:
    ACK 91504cbe0d

Tree-SHA512: 846dfb9da57a8a42458827b8975722d153907fe6302ad65748d74f311e1925557ad951c3d95fe71fb90ddcc8a3710c45abb343ab86b88780871cb9c38c72c7b1
2023-12-01 15:07:23 -05:00
Andrew Chow
18bed148af
Merge bitcoin/bitcoin#28784: rpc: keep .cookie file if it was not generated
7cb9367157 rpc: keep .cookie if it was not generated (Roman Zeyde)

Pull request description:

  Otherwise, starting bitcoind twice may cause the `.cookie` file generated by the first instance to be deleted by the second instance shutdown (after failing to obtain a lock).

ACKs for top commit:
  willcl-ark:
    re-ACK 7cb9367157
  achow101:
    ACK 7cb9367157
  kristapsk:
    re-ACK 7cb9367157
  stickies-v:
    ACK 7cb9367157

Tree-SHA512: 0960dbc457975b0e0535f3d814824a879d7f85c9f1191537415b3fc253429a316a8e4badde56c8bc139778f132392983cec5fbe03891fb15ff61d3bc3f6e681b
2023-12-01 12:24:29 -05:00
Andrew Chow
6b3927f79a
Merge bitcoin/bitcoin#28848: bugfix, Change up submitpackage results to return results for all transactions
f23ba24aa0 test_submitpackage: only make a chain of 3 txns (Greg Sanders)
e67a345162 doc: submitpackage vsize results are sigops-adjusted (Greg Sanders)
b67db52c39 RPC submitpackage: change return format to allow partial errors (Greg Sanders)

Pull request description:

  This was prompted by errors being returned that didn't "make any sense" to me, because it would for example return a "fee too low" error, when the "real" error was the child had something invalid, which disallowed CPFP evaluation. Rather than make judgment calls on what error is important(which is currently just return the "first"!), we simply return all errors and let the callers determine what's best.

  Added a top level `package_msg` for quick eye-balling of general success of the package.

  This PR also fixes a couple bugs:

  1) Currently we don't actually broadcast a transaction, even if it was entered into our mempool, if a subsequent transaction causes `PKG_TX` failure.
  2) "other-wtxid" is uncovered by tests, but IIUC was previously required to return "fees" and "vsize" results, but did not. I just make those results optional.

ACKs for top commit:
  Sjors:
    Light re-utACK f23ba24aa0
  achow101:
    ACK f23ba24aa0
  glozow:
    utACK f23ba24aa0, thanks for taking the suggestions

Tree-SHA512: ebfd716a4fed9e8c2dea3d2181ba6a6171b06718d29ac2324c67b7a30b374d199f7e1739f91ab5d036be172d0479de9bc89c32263ee62143c0338b9b622d0cca
2023-12-01 12:17:15 -05:00
fanquake
308aec3e56
build: disable external-signer for Windows
It's come to light that Boost ASIO (a Boost Process sub dep) has in some
instances, been queitly initialising our network stack on Windows (see
PR #28486 and discussion in #28940).

This has been shielding a bug in our own code, but the larger issue
is that Boost Process/ASIO is running code before main, and doing things
like setting up networking. This undermines our own assumptions about
how our binary works, happens before we get to run any sanity checks,
and also runs before we call our own code to setup networking.

It's also not clear why a feature like external signer would have a
dependency that would be doing anything network/socket related, given it
only exists to spawn a local process.
2023-12-01 10:46:19 +00:00
fanquake
35537318a1
ci: remove --enable-external-signer from win64 job
This is redundant in any case, because --enable-external-signer is
already in `BITCOIN_CONFIG_ALL`.
2023-12-01 10:45:57 +00:00
Andrew Chow
498994b6f5
Merge bitcoin/bitcoin#26762: bugfix: Make CCheckQueue RAII-styled (attempt 2)
5b3ea5fa2e refactor: Move `{MAX,DEFAULT}_SCRIPTCHECK_THREADS` constants (Hennadii Stepanov)
6e17b31680 refactor: Make `CCheckQueue` non-copyable and non-movable explicitly (Hennadii Stepanov)
8111e74653 refactor: Drop unneeded declaration (Hennadii Stepanov)
9cf89f7a5b refactor: Make `CCheckQueue` constructor start worker threads (Hennadii Stepanov)
d03eaacbcf Make `CCheckQueue` destructor stop worker threads (Hennadii Stepanov)
be4ff3060b Move global `scriptcheckqueue` into `ChainstateManager` class (Hennadii Stepanov)

Pull request description:

  This PR:
  - makes `CCheckQueue` RAII-styled
  - gets rid of the global `scriptcheckqueue`
  - fixes https://github.com/bitcoin/bitcoin/issues/25448

  The previous attempt was in https://github.com/bitcoin/bitcoin/pull/18731.

ACKs for top commit:
  martinus:
    ACK 5b3ea5fa2e
  achow101:
    ACK 5b3ea5fa2e
  TheCharlatan:
    ACK 5b3ea5fa2e

Tree-SHA512: 45cca846e7ed107e3930149f0b616ddbaf2648d6cde381f815331b861b5d67ab39e154883ae174b8abb1dae485bc904318c50c51e5d6b46923d89de51c5eadb0
2023-11-30 14:28:46 -05:00
fanquake
ff896d2581
contrib: drop GCC MAX_VERSION to 4.3.0 in symbol-check
Reflect the actual symbols used, i.e:

```bash
bitcoind: symbol __bswapsi2 from unsupported version GCC_4.3.0(7)
```
2023-11-30 17:42:26 +00:00
Ryan Ofsky
ffb021612b
Merge bitcoin/bitcoin#28451: refactor: Remove unused SER_DISK, SER_NETWORK, CDataStream
fa98a097a3 Rename version.h to node/protocol_version.h (MarcoFalke)
fa4fbd5816 Remove unused version.h include (MarcoFalke)
fa0ae22ff2 Remove unused SER_NETWORK, SER_DISK (MarcoFalke)
fae00fe9c2 Remove unused CDataStream (MarcoFalke)
fa7eb4f5c3 fuzz: Drop unused version from fuzz input format (MarcoFalke)

Pull request description:

  Seems odd to have code that is completely dead.

  Fix this by removing all of it.

ACKs for top commit:
  sipa:
    utACK fa98a097a3
  ajtowns:
    ACK fa98a097a3
  ryanofsky:
    Seems odd to not code review ACK fa98a097a3 (looks good)

Tree-SHA512: 9f1b9d9f92bda0512610bda6653e892756f637860362a9abfa439faab62de233cbad94b7df78ebacc160d9667aadfed4d9df08c0edefa618c040a049050fb913
2023-11-30 11:11:51 -05:00
fanquake
97d53e90ba
ci: remove libz-dev from macOS build deps
Remove no-longer used libz-dev (from DMG compression).
Followup to #28432.
Missed this in #28932.
2023-11-30 15:17:19 +00:00
fanquake
cdb772313c
Merge bitcoin/bitcoin#28965: guix: remove input labels
a4980da1ce guix: remove input labels (fanquake)

Pull request description:

  Migrate package definitions to use the newer format for propogated inputs. See https://guix.gnu.org/manual/en/html_node/package-Reference.html#index-inputs_002c-of-packages.

  This change remains compatible with Guix 1.2.0+.

  See also: https://guix.gnu.org/blog/2021/the-big-change/

  Guix Build (aarch64 & x86_64):
  ```bash
  4627c4eb83764f787f48b2aeab87b65bbaacb9ebfe33a5733d713165eec779af  guix-build-a4980da1ce5e/output/aarch64-linux-gnu/SHA256SUMS.part
  ecdd6db7fe0ee45fee1bd91ceaf23c0d8154ed5ad73586b74d86ee36964e18d4  guix-build-a4980da1ce5e/output/aarch64-linux-gnu/bitcoin-a4980da1ce5e-aarch64-linux-gnu-debug.tar.gz
  5f78980f95f3968248c27c4acd9993ec150ed3fa32802d89ccc6c6dc661a41bd  guix-build-a4980da1ce5e/output/aarch64-linux-gnu/bitcoin-a4980da1ce5e-aarch64-linux-gnu.tar.gz
  9af3dff2a8a4decf73048acea67d05f76d54ff84cecde833ea6860825bdaddc3  guix-build-a4980da1ce5e/output/arm-linux-gnueabihf/SHA256SUMS.part
  f53c6a5a229462a71f477db6f91112a2e9d31aafef294fca3c893916e904e2ed  guix-build-a4980da1ce5e/output/arm-linux-gnueabihf/bitcoin-a4980da1ce5e-arm-linux-gnueabihf-debug.tar.gz
  6ed01ecb71ed32098f70c8d667b1a48305b4b5b10f7bfc575eb8b5f787fe9534  guix-build-a4980da1ce5e/output/arm-linux-gnueabihf/bitcoin-a4980da1ce5e-arm-linux-gnueabihf.tar.gz
  6ceaaa7dc2959626f280b1e1de28ac9ff9223216e1a3fa333cdd55c416ff550d  guix-build-a4980da1ce5e/output/arm64-apple-darwin/SHA256SUMS.part
  633df184701a21746ee56a5de6e3705c229eac8712b9a1563a82f4de52130d05  guix-build-a4980da1ce5e/output/arm64-apple-darwin/bitcoin-a4980da1ce5e-arm64-apple-darwin-unsigned.tar.gz
  23b94cb4e870d71ae60bbb5a974362bbfabe901a73eeeb9d3bb5fbd70f5d649e  guix-build-a4980da1ce5e/output/arm64-apple-darwin/bitcoin-a4980da1ce5e-arm64-apple-darwin-unsigned.zip
  f60b802b3e92fb9cf3b45b835f6cfb8988221cfdd39146ee3a11dbab977733bc  guix-build-a4980da1ce5e/output/arm64-apple-darwin/bitcoin-a4980da1ce5e-arm64-apple-darwin.tar.gz
  9df0a08896a2bc42f97193b34beb29536783eab04d3ae5fe5642258188fc6e55  guix-build-a4980da1ce5e/output/dist-archive/bitcoin-a4980da1ce5e.tar.gz
  3fef561dd35dd4a4e9d0308591ebbdd5b1d26814ea48ff1f0c2732c62aef961b  guix-build-a4980da1ce5e/output/powerpc64-linux-gnu/SHA256SUMS.part
  187b8283f443bb29ed27546f983a5d098dfe49a059f52bc8ba0607242d37a5ae  guix-build-a4980da1ce5e/output/powerpc64-linux-gnu/bitcoin-a4980da1ce5e-powerpc64-linux-gnu-debug.tar.gz
  3f520b4bf1fbf955f9d25b5aa333f90989428cc9e417431998daa7c1041cb3bb  guix-build-a4980da1ce5e/output/powerpc64-linux-gnu/bitcoin-a4980da1ce5e-powerpc64-linux-gnu.tar.gz
  39abec9623d5086990a303c964a36e7f767bd6218e57261df95b616603eca0b8  guix-build-a4980da1ce5e/output/powerpc64le-linux-gnu/SHA256SUMS.part
  b71352ad4e8849937e42ad897d75f65866a529fd4d18059c5e6c39659a17f723  guix-build-a4980da1ce5e/output/powerpc64le-linux-gnu/bitcoin-a4980da1ce5e-powerpc64le-linux-gnu-debug.tar.gz
  4fb92753e1baa253780088649bfe6816525e0ada7b17c5acc57ec804d9ab32f8  guix-build-a4980da1ce5e/output/powerpc64le-linux-gnu/bitcoin-a4980da1ce5e-powerpc64le-linux-gnu.tar.gz
  ed422d4365354a16b98ba7d4184a118ce98473e1b70ac8ba62a617aa3af3c784  guix-build-a4980da1ce5e/output/riscv64-linux-gnu/SHA256SUMS.part
  9f002a8893748b0f6b581ab9d158a524e32140a3c271604b50cf1580b30b3000  guix-build-a4980da1ce5e/output/riscv64-linux-gnu/bitcoin-a4980da1ce5e-riscv64-linux-gnu-debug.tar.gz
  6844df378ad2f4c209d323ffa3e77c6aa28f7f087b8755b2baa2a0d1119c365b  guix-build-a4980da1ce5e/output/riscv64-linux-gnu/bitcoin-a4980da1ce5e-riscv64-linux-gnu.tar.gz
  ce0e27b6d831d5836ba3c5c8be377f08f4b92e9f390a7242aca5b68e67d1975e  guix-build-a4980da1ce5e/output/x86_64-apple-darwin/SHA256SUMS.part
  329c990fa71e694869bdcdd3e327a28eed2ad0b12f06d86e0957c6cb05e88910  guix-build-a4980da1ce5e/output/x86_64-apple-darwin/bitcoin-a4980da1ce5e-x86_64-apple-darwin-unsigned.tar.gz
  c44ec330e40285c1eba421f8d2e70a1538742fadbcc87f7f2f5a49bd83a72a7b  guix-build-a4980da1ce5e/output/x86_64-apple-darwin/bitcoin-a4980da1ce5e-x86_64-apple-darwin-unsigned.zip
  e3626284d9bd61b67b170433d7bdb226b0f7f63d20dad4dd0482e55d7418ef64  guix-build-a4980da1ce5e/output/x86_64-apple-darwin/bitcoin-a4980da1ce5e-x86_64-apple-darwin.tar.gz
  3e2a16e9dbb89d86e1e1884e0277160c3d1953c5ea5f88f29fe0a093a6f89599  guix-build-a4980da1ce5e/output/x86_64-linux-gnu/SHA256SUMS.part
  eb389467219c4af983f30e50e1f8d48601ed74690538bff76a55c0e585594a92  guix-build-a4980da1ce5e/output/x86_64-linux-gnu/bitcoin-a4980da1ce5e-x86_64-linux-gnu-debug.tar.gz
  d81fd209c03e74aebd7b28b42d3ea21f57957ede7fcb7baae721c8abb2885b6c  guix-build-a4980da1ce5e/output/x86_64-linux-gnu/bitcoin-a4980da1ce5e-x86_64-linux-gnu.tar.gz
  51de8a813459c1ce79bf9a2e39bf9f17b4771c6146ef55829f3ee0415d0ec9ec  guix-build-a4980da1ce5e/output/x86_64-w64-mingw32/SHA256SUMS.part
  63dc5386467d0fc7f3c7b621273d019a822551fc9ac00be94c7d4ee446201836  guix-build-a4980da1ce5e/output/x86_64-w64-mingw32/bitcoin-a4980da1ce5e-win64-debug.zip
  3a4f2ef53165031648b1c3badc05698891d7c6541de3f67e9df513395c5c88c3  guix-build-a4980da1ce5e/output/x86_64-w64-mingw32/bitcoin-a4980da1ce5e-win64-setup-unsigned.exe
  92f0d67fbb8b37b6026287073df95431c961ad1820d7f8b9cd3b1ffcf58d4188  guix-build-a4980da1ce5e/output/x86_64-w64-mingw32/bitcoin-a4980da1ce5e-win64-unsigned.tar.gz
  3414b6c99d0bbd9ad88c0f88aafa70561dc107d1180fd42c90ad85033871c160  guix-build-a4980da1ce5e/output/x86_64-w64-mingw32/bitcoin-a4980da1ce5e-win64.zip
  ```

ACKs for top commit:
  TheCharlatan:
    lgtm ACK a4980da1ce

Tree-SHA512: cbb8ca9613125d4c443124b99a600b44533688f322c8535c9d82fb3bb8de66b46e63c6aafcf2917f169494181ece6efd02e2efaa32ef4f138a520731540d600c
2023-11-30 15:09:50 +00:00