Merge bitcoin/bitcoin#36817: ipc: remove pre-v14 libmultiprocess compat definitions
What changed, and why it matters
This commit removes old compatibility code that was only needed for an earlier version of a supporting library called libmultiprocess. It is a routine cleanup: the project now requires libmultiprocess v14.0 or newer, so the fallback definitions for older versions are no longer needed. There is no security fix or vulnerability patch here.
No security action needed. Treat as normal maintenance/cleanup. Ensure build systems and CI images have libmultiprocess v14.0 or newer before merging.
Security signals we found
No strong security signals were identified.
Evidence from the diff
PR #36817 deletes src/ipc/util.h, which provided shims (EventLoop alias, ProcessId/SocketId types, SocketPair, SpawnProcess, StartSpawned, CurrentThread) used when libmultiprocess was older than v14. The commit updates includes to use
Changed components
src/ipc/process.hsrc/ipc/protocol.hsrc/ipc/test/fuzz/ipc.cppsrc/ipc/util.h (deleted)doc/dependencies.mdInspect captured patch +3 / −68
### doc/dependencies.md
@@ -37,7 +37,7 @@ Bitcoin Core requires one of the following compilers.
| Dependency | Releases | Minimum required |
| --- | --- | --- |
| [Cap'n Proto](../depends/packages/native_capnp.mk) ([IPC](multiprocess.md)) | [link](https://capnproto.org/) | [0.9.2](https://github.com/bitcoin/bitcoin/pull/36747) (1.0 with Clang) |
-| [libmultiprocess](../depends/packages/native_libmultiprocess.mk) ([IPC](multiprocess.md)) | [link](https://github.com/bitcoin-core/libmultiprocess/tags) | [v7.0-pre1](https://github.com/bitcoin/bitcoin/pull/33517) |
+| [libmultiprocess](../depends/packages/native_libmultiprocess.mk) ([IPC](multiprocess.md)) | [link](https://github.com/bitcoin-core/libmultiprocess/tags) | [v14.0](https://github.com/bitcoin/bitcoin/pull/36817) |
| Python (scripts, tests) | [link](https://www.python.org) | [3.10](https://github.com/bitcoin/bitcoin/pull/30527) |
| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/archive/qt/) | [6.2](https://github.com/bitcoin/bitcoin/pull/30997) |
| [qrencode](../depends/packages/qrencode.mk) (gui) | [link](https://fukuchi.org/works/qrencode/) | N/A |
### src/ipc/process.h
@@ -5,10 +5,10 @@
#ifndef BITCOIN_IPC_PROCESS_H
#define BITCOIN_IPC_PROCESS_H
+#include <mp/util.h>
#include <util/fs.h>
#include <memory>
-#include <ipc/util.h>
#include <optional>
#include <string>
### src/ipc/protocol.h
@@ -6,7 +6,7 @@
#define BITCOIN_IPC_PROTOCOL_H
#include <interfaces/init.h>
-#include <ipc/util.h>
+#include <mp/util.h>
#include <cstddef>
#include <functional>
### src/ipc/test/fuzz/ipc.cpp
@@ -7,7 +7,6 @@
#include <ipc/test/fuzz/ipc_fuzz.capnp.h>
#include <ipc/test/fuzz/ipc_fuzz.capnp.proxy.h>
#include <ipc/test/fuzz/ipc_fuzz.h>
-#include <ipc/util.h>
#include <kj/memory.h>
#include <mp/proxy-io.h>
#include <mp/proxy.h>
### src/ipc/util.h
@@ -1,64 +0,0 @@
-// Copyright (c) The Bitcoin Core developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-
-#ifndef BITCOIN_IPC_UTIL_H
-#define BITCOIN_IPC_UTIL_H
-
-#include <tinyformat.h>
-#include <util/strencodings.h>
-
-#include <array>
-#include <cstdint>
-#include <functional>
-#include <kj/debug.h>
-#include <mp/proxy-io.h>
-#include <mp/util.h>
-#include <mp/version.h>
-#include <sys/socket.h>
-
-namespace mp {
-// Definitions that can be deleted when libmultiprocess subtree is updated to
-// v14. Having these allows Bitcoin Core changes to be decoupled from
-// libmultiprocess changes so they don't have to be reviewed in a single PR.
-#if MP_MAJOR_VERSION < 14
-class EventLoop;
-using ProcessId = int;
-using SocketId = int;
-inline constexpr SocketId SocketError{-1};
-
-using Stream = SocketId;
-inline Stream MakeStream(EventLoop&, SocketId socket)
-{
- return socket;
-}
-
-inline std::array<SocketId, 2> SocketPair()
-{
- int pair[2];
- KJ_SYSCALL(socketpair(AF_UNIX, SOCK_STREAM, 0, pair));
- return {pair[0], pair[1]};
-}
-
-inline std::tuple<ProcessId, SocketId> SpawnProcess(const std::function<std::vector<std::string>(std::string)>& spawn_argv)
-{
- ProcessId pid;
- SocketId socket = SpawnProcess(pid, [&](int fd) { return spawn_argv(strprintf("%d", fd)); });
- return {pid, socket};
-}
-
-inline SocketId StartSpawned(const std::string& connect_info)
-{
- auto socket = ToIntegral<SocketId>(connect_info);
- if (!socket) throw std::invalid_argument(strprintf("Invalid socket descriptor '%s'", connect_info));
- return *socket;
-}
-
-inline ThreadContext& CurrentThread()
-{
- return g_thread_context;
-}
-#endif
-} // namespace mp
-
-#endif // BITCOIN_IPC_UTIL_HWhy this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.