Skip to content

Conversation

Sjors
Copy link
Owner

@Sjors Sjors commented Aug 12, 2025

This tests bitcoin#31802 plus:

0fa939acfa2de9c0ded533927b337073468f770bf2d2fa6400a1976b201e8dd5  guix-build-3d552223712e/output/aarch64-linux-gnu/SHA256SUMS.part
54cb62ae4cd2be8ef3cceb5f7fb27831095a2ab567dc3b867afe42f10683192f  guix-build-3d552223712e/output/aarch64-linux-gnu/bitcoin-3d552223712e-aarch64-linux-gnu-debug.tar.gz
6f2e8f904626993e2470d9d70dac14a9d4b6d4e63c805ebfb640eb409512716c  guix-build-3d552223712e/output/aarch64-linux-gnu/bitcoin-3d552223712e-aarch64-linux-gnu.tar.gz
efa0d4f3a63196d796e30b876993455b258e7d745e7b11f05b38e16d1b1731ca  guix-build-3d552223712e/output/arm-linux-gnueabihf/SHA256SUMS.part
6ca008e7a27918d7c1ea0f89269d60e92e09b1862723a3c320483405df2c1fd3  guix-build-3d552223712e/output/arm-linux-gnueabihf/bitcoin-3d552223712e-arm-linux-gnueabihf-debug.tar.gz
891e29b15ee7938b497ba8415fba3567f385c30e7815153149ee5d7e0bc2ce9f  guix-build-3d552223712e/output/arm-linux-gnueabihf/bitcoin-3d552223712e-arm-linux-gnueabihf.tar.gz
8c1d690ed33f3148a4540469f4d23e1da22c84ee97fbfb5df17e75d354a23bc7  guix-build-3d552223712e/output/arm64-apple-darwin/SHA256SUMS.part
d47ddf2baca4cec3933a481758fea7d5426c8b2d5047cfdd02eb7ba3b3d259fe  guix-build-3d552223712e/output/arm64-apple-darwin/bitcoin-3d552223712e-arm64-apple-darwin-codesigning.tar.gz
8319e47d1f8659f5b449c7650a401a607ea3f400ced92c35dfee7349cb621d9c  guix-build-3d552223712e/output/arm64-apple-darwin/bitcoin-3d552223712e-arm64-apple-darwin-unsigned.tar.gz
ab0e1c3ee7bdbd6664ef7739d5c9a9e6076a5825700a657d567139867c03ae4e  guix-build-3d552223712e/output/arm64-apple-darwin/bitcoin-3d552223712e-arm64-apple-darwin-unsigned.zip
9ee1ecf9b19dd8adfd7be13498531c1215b3f972be031175d509e59aa4e013d1  guix-build-3d552223712e/output/dist-archive/bitcoin-3d552223712e.tar.gz
e50b207cf1f2bdb4e528185c92f13cdc4102b4396405d700d8bbf0d05fb58769  guix-build-3d552223712e/output/powerpc64-linux-gnu/SHA256SUMS.part
2e578584618d94b6ef18cbba433fc0fa29cf77834bdb26b36211a24d6aaf3d4d  guix-build-3d552223712e/output/powerpc64-linux-gnu/bitcoin-3d552223712e-powerpc64-linux-gnu-debug.tar.gz
fe458ce291a31b0156ad66a7073a23a5ccb834ab8a34d89985d4d6f48a4ebba4  guix-build-3d552223712e/output/powerpc64-linux-gnu/bitcoin-3d552223712e-powerpc64-linux-gnu.tar.gz
749f746f6b2df7d6d42ad36525415866746ab7be31dd69e2688b0c2cf9102ab2  guix-build-3d552223712e/output/riscv64-linux-gnu/SHA256SUMS.part
667dd6d24c58905f55a550283bbec5de5bff32cd493fa3399e096a21d4ee8256  guix-build-3d552223712e/output/riscv64-linux-gnu/bitcoin-3d552223712e-riscv64-linux-gnu-debug.tar.gz
dfbf322f5d949ec6680c9b41d77c57b7e416b6204a0af8e0ae2401c17e3ba49f  guix-build-3d552223712e/output/riscv64-linux-gnu/bitcoin-3d552223712e-riscv64-linux-gnu.tar.gz
4d1d923f34386c58b4c9af87065603c28ae6b55f53961d9a42fe206336a25c20  guix-build-3d552223712e/output/x86_64-apple-darwin/SHA256SUMS.part
60dfca763407accc2f48e7bfbac65d1ef28a66a4a216fe89deeeb9196d8a324c  guix-build-3d552223712e/output/x86_64-apple-darwin/bitcoin-3d552223712e-x86_64-apple-darwin-codesigning.tar.gz
57ffa3d5ff8eb0b4da4cc756e672cc445a854ea0216ec8c625db700e6fa044a5  guix-build-3d552223712e/output/x86_64-apple-darwin/bitcoin-3d552223712e-x86_64-apple-darwin-unsigned.tar.gz
f5500b1576193bfdf9de4df605c602a51055bb975d4fb99830569be6d2c55d7d  guix-build-3d552223712e/output/x86_64-apple-darwin/bitcoin-3d552223712e-x86_64-apple-darwin-unsigned.zip
f8d0a14bfa73533e45cb40dac490340976b7a6deb8078deb836a824494c1edde  guix-build-3d552223712e/output/x86_64-linux-gnu/SHA256SUMS.part
f95cff0c43ba4a5bce4065284a33b33337c11c5acc0f27cc53cc3292ea6fe663  guix-build-3d552223712e/output/x86_64-linux-gnu/bitcoin-3d552223712e-x86_64-linux-gnu-debug.tar.gz
ed7f9a788f83ea9017b3060290a24adc933ac9f188142ad31e3b063b42e81567  guix-build-3d552223712e/output/x86_64-linux-gnu/bitcoin-3d552223712e-x86_64-linux-gnu.tar.gz
35453302242c0aa1cdd8979a62fba53375797e4ddfd8073d059c98e5082aba8b  guix-build-3d552223712e/output/x86_64-w64-mingw32/SHA256SUMS.part
53a2dbc41671a68a4286fc228bc3efe4b010955ad57fc22aea11f22888b03dc2  guix-build-3d552223712e/output/x86_64-w64-mingw32/bitcoin-3d552223712e-win64-codesigning.tar.gz
1005aa9295e59aee4db77827ce0aa3cf3c7f9ac276a9f68df2a849d145f54484  guix-build-3d552223712e/output/x86_64-w64-mingw32/bitcoin-3d552223712e-win64-debug.zip
ae7fbdc7c72a3a0d802f3137af2a97054aa94883c119f4bb31d2cdabd6ef8a09  guix-build-3d552223712e/output/x86_64-w64-mingw32/bitcoin-3d552223712e-win64-setup-unsigned.exe
fad4fa5816892e42a641c10fb737105724266a3d31ef577aba8586a0210db454  guix-build-3d552223712e/output/x86_64-w64-mingw32/bitcoin-3d552223712e-win64-unsigned.zip

Sjors and others added 13 commits August 12, 2025 14:42
This causes IPC binaries (bitcoin-node, bitcoin-gui) to be included
in releases.

The effect on CI is that this causes more depends builds to build IPC
binaries, but still the only build running functional tests with them
is the i686_multiprocess one.

Except for Windows.
The bitcoin-node binary is built on all platforms which have
multiprocess enabled, but for functional tests it's only used in
CentOS native (depends) job. The next commit will also add a
non-depends job.
Additionally update wallet instructions to reflect that sqlite is
expected (but can be opted out).

The minimum version for Cap'n Proto is the oldest version tested in CI.

OpenBSD does not have this package, so recommend building from source
for now.
c090cc8619 build: require CapnProto 1.0.1 or better
b4120d34ba Merge bitcoin-core/libmultiprocess#192: doc: fix typos
6ecbdcd35a doc: fix typos
a11e6905c2 Merge bitcoin-core/libmultiprocess#186: Fix mptest failures in bitcoin CI
6f340a583f doc: fix DrahtBot LLM Linter error
c6f7fdf173 type-context: revert client disconnect workaround
e09143d2ea proxy-types: fix UndefinedBehaviorSanitizer: null-pointer-use
84b292fcc4 mptest: fix MemorySanitizer: use-of-uninitialized-value
fe4a188803 proxy-io: fix race conditions in disconnect callback code
d8011c8360 proxy-io: fix race conditions in ProxyClientBase cleanup handler
97e82ce19c doc: Add note about Waiter::m_mutex and interaction with the EventLoop::m_mutex
81d58f5580 refactor: Rename ProxyClient cleanup_it variable
07230f259f refactor: rename ProxyClient<Thread>::m_cleanup_it
c0efaa5e8c Merge bitcoin-core/libmultiprocess#187: ci: have bash scripts explicitly opt out of locale dependence.
0d986ff144 mptest: fix race condition in TestSetup constructor
d2f6aa2e84 ci: add thread sanitizer job
3a6db38e56 ci: rename configs to .bash
401e0ce1d9 ci: add copyright to bash scripts
e956467ae4 ci: export LC_ALL
8954cc0377 Merge bitcoin-core/libmultiprocess#184: Add CI jobs and fix clang-tidy and iwyu errors
757e13a755 ci: add gnu32 cross-compiled 32-bit build
15bf349000 doc: fix typo found by DrahtBot
1a598d5905 clang-tidy: drop 'bitcoin-*' check
cbb1e43fdc ci: test libc++ instead of libstdc++ in one job
76313450c2 type-context: disable clang-tidy UndefinedBinaryOperatorResult error
4896e7fe51 proxy-types: fix clang-tidy EnumCastOutOfRange error
060a739269 proxy-types: fix clang-tidy StackAddressEscape error
977d721020 ci: add github actions jobs testing gcc, clang-20, clang-tidy, and iwyu
0d5f1faae5 iwyu: fix add/remove include errors
753d2b10cc util: fix clang-tidy modernize-use-equals-default error
ae4f1dc2bb type-number: fix clang-tidy modernize-use-nullptr error
07a741bf69 proxy-types: fix clang-tidy bugprone-use-after-move error
3673114bc9 proxy-types: fix clang-tidy bugprone-use-after-move error
422923f384 proxy-types: fix clang-tidy bugprone-use-after-move error
c6784c6ade mpgen: disable clang-tidy misc-no-recursion error
c5498aa11b tidy: copy clang-tidy file from bitcoin core
258a617c1e Merge bitcoin-core/libmultiprocess#160: refactor: EventLoop locking cleanups + client disconnect exception
84cf56a0b5 test: Test disconnects during IPC calls
949573da84 Prevent IPC server crash if disconnected during IPC call
0198397580 Merge bitcoin-core/libmultiprocess#179: scripted-diff: Remove copyright year (ranges)
ea38392960 Prevent EventLoop async cleanup thread early exit during shutdown
616d9a75d2 doc: Document ProxyClientBase destroy_connection option
56fff76f94 Improve IPC client disconnected exceptions
9b8ed3dc5f refactor: Add clang thread safety annotations to EventLoop
52256e730f refactor: Remove DestructorCatcher and AsyncCallable
f24894794a refactor: Drop addClient/removeClient methods
2b830e558e refactor: Use EventLoopRef instead of addClient/removeClient
315ff537fb refactor: Add ProxyContext EventLoop* member
9aaeec3678 proxy-io.h: Add EventLoopRef RAII class handle addClient/removeClient refcounting
f58c8d8ba2 proxy-io.h: Add more detailed EventLoop comment
5108445e5d test: Add test coverage for client & server disconnections
59030c68cb Merge bitcoin-core/libmultiprocess#181: type-function.h: Fix CustomBuildField overload
688140b1df test: Add coverage for type-function.h
8b96229da5 type-function.h: Fix CustomBuildField overload
fa2ff9a668 scripted-diff: Remove copyright year (ranges)

git-subtree-dir: src/ipc/libmultiprocess
git-subtree-split: c090cc8619d6c003b86cbf63c1d43e64ff167d78
Use EventLoopRef to avoid reference counting bugs and be more exception safe
and deal with removal of addClient/removeClient methods in
bitcoin-core/libmultiprocess#160

A test update is also required due to
bitcoin-core/libmultiprocess#160 to deal with changed
reference count semantics. In IpcPipeTest(), it is now necessary to destroy
the client Proxy object instead of just the client Connection object to
decrease the event loop reference count and allow the loop to exit so the test
does not hang on shutdown.
Currently this code is not called in unit tests. Calling should make it
possible to write tests for things like IPC exceptions being thrown during
shutdown.
This fixes behavior reported by Antoine Poinsot <darosior@protonmail.com>
bitcoin#29409 (comment) where if
an IPC client is connected, the node will wait forever for it to disconnect
before exiting.
Fix some comments that were referring to previous versions of these methods and
did not make sense.
This fixes an error reported by Antoine Poinsot <darosior@protonmail.com> in
bitcoin-core/libmultiprocess#123 that does not happen
in master, but does happen with bitcoin#10102
applied, where if Ctrl-C is pressed when `bitcoin-node` is started, it is
handled by both `bitcoin-node` and `bitcoin-wallet` processes, causing the
wallet to shutdown abruptly instead of waiting for the node and shutting down
cleanly.

This change fixes the problem by having the wallet process print to stdout when
it receives a Ctrl-C signal but not otherwise react, letting the node shut
everything down cleanly.
This fixes an error reported by Antoine Poinsot <darosior@protonmail.com> in
bitcoin-core/libmultiprocess#123 that does not happen
in master, but does happen with bitcoin#10102
applied, where if the child bitcoin-wallet process is killed (either by an
external signal or by Ctrl-C as reported in the issue) the bitcoin-node process
will not shutdown cleanly after that because chain client stop()
calls will fail.

This change fixes the problem by handling ipc::Exception errors thrown during
the stop() calls, and it relies on the fixes to disconnect detection
implemented in bitcoin-core/libmultiprocess#160 to work
effectively.
@Sjors Sjors force-pushed the 2025/08/ipc-plus branch from c99c8b3 to 1364b3c Compare August 12, 2025 18:00
Fixes:
```bash
/distsrc-base/distsrc-d3b8a54a8120-x86_64-linux-gnu/build/bin/bitcoind: symbol __divmodti4 from unsupported version GCC_7.0.0(14)
/distsrc-base/distsrc-d3b8a54a8120-x86_64-linux-gnu/build/bin/bitcoind: failed IMPORTED_SYMBOLS
```

which is occuring after bitcoin#32750. I can't see any supported distro that is
shipping a new enough glibc (2.31), but a GCC older than 7.0.
@Sjors
Copy link
Owner Author

Sjors commented Aug 12, 2025

I'll let this CI run finish with 1.0.1 as the minimum.

ryanofsky added a commit to bitcoin-core/libmultiprocess that referenced this pull request Aug 13, 2025
30930df build: require CapnProto 0.7.0 or better (Sjors Provoost)

Pull request description:

  Although 1.0.1. is the oldest version currently covered by Bitcoin Core's extensive CI, Debian Bookwork ships 0.9.2 and #194 introduces test coverage for even older versions. 0.7 has been required since #88.

  The CI run of Sjors/bitcoin#100 @ [3d55222](https://github.com/Sjors/bitcoin/pull/100/checks?sha=3d552223712eed88d17e5ead1ef7d1ba6fd7e89e) previously checked Bitcoin Core CI against 1.0.1 as the minimum. Lowering the minimum further should not be a problem for that CI.

ACKs for top commit:
  ryanofsky:
    Code review ACK 30930df. Planning to follow up in #194 to actually test minimum version and error if capnproto version detected is affected by CVE-2022-46149

Tree-SHA512: bed5843973c8ff1f0b2bd93efe7169824c2306097efefaace1752efeb06606df765b68b7ef50c07f5d703010c4d1b324099d6780fa0363e126d34ac1307fba1a
@Sjors Sjors force-pushed the 2025/02/ipc-yea branch 2 times, most recently from a91a1af to a12733e Compare August 13, 2025 13:37
@Sjors Sjors closed this Aug 13, 2025
Sjors pushed a commit that referenced this pull request Aug 21, 2025
The `-assumevalid` option skips script verification for a specified block and all its ancestors during Initial Block Download.
Many new users are surprised when this suddenly slows their node to a halt.
This commit adds a log message to clearly indicate when this optimization ends and full validation begins (and vice versa).

When using `-assumeutxo`, logging is suppressed for the active assumed-valid chainstate and for the background validation chainstate to avoid the confusing toggles.

-------

> cmake -B build && cmake --build build && mkdir -p demo && build/bin/bitcoind -datadir=demo -stopatheight=500 | grep 'signature validation'

```
2025-08-08T20:59:21Z Disabling signature validations at block #1 (00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048).
2025-08-08T20:59:21Z Enabling signature validations at block #100 (000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a).
2025-08-08T20:59:21Z Disabling signature validations at block bitcoin#200 (000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320).
2025-08-08T20:59:21Z Enabling signature validations at block bitcoin#300 (0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609).
```
Sjors pushed a commit that referenced this pull request Aug 21, 2025
…hange

fab2980 assumevalid: log every script validation state change (Lőrinc)

Pull request description:

  The `-assumevalid` option skips script verification for a specified block and all its ancestors during Initial Block Download.
  Many new [users are surprised](bitcoin#32832) when this suddenly slows their node to a halt.
  This commit adds a log message to clearly indicate when this optimization ends and full validation begins (and vice versa).

  <details>
  <summary>Testing instructions</summary>

  The behavior can easily be tested by adding this before the new log:
  ```C++
      // TODO hack to enable/disable script checks based on block height for testing purposes
           if (pindex->nHeight < 100) fScriptChecks = false;
      else if (pindex->nHeight < 200) fScriptChecks = true;
      else if (pindex->nHeight < 300) fScriptChecks = false;
      else if (pindex->nHeight < 400) fScriptChecks = true;
  ```
  and exercise the new code with:
  ```bash
  cmake -B build && cmake --build build && mkdir -p demo && build/bin/bitcoind -datadir=demo -stopatheight=500 | grep 'signature validation'
  ```
  showing something like:
  * Disabling signature validations at block #1 (00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048).
  * Enabling signature validations at block #100 (000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a).
  * Disabling signature validations at block bitcoin#200 (000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320).
  * Enabling signature validations at block bitcoin#300 (0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609).

  </details>

ACKs for top commit:
  achow101:
    ACK fab2980
  ajtowns:
    crACK fab2980
  davidgumberg:
    untested crACK bitcoin@fab2980

Tree-SHA512: e90b66f7423b639356daace476942ce83e65e70466544394cbe2f15738bdbf716163eaf590c64c5448f9b41aeeaafe3342c48c6a7a478678a70b0310ca94e11d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants