multiprocess: update multiprocess EventLoop construction to use options
What changed, and why it matters
This is a routine code update that changes how an internal logging object is created to match a newer version of an upstream library. There is no security issue visible in the change itself.
No security action needed. Review as normal upstream API compatibility change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates Bitcoin Core’s multiprocess IPC layer to use a new upstream mp::LogOptions constructor for EventLoop. It replaces passing a raw IpcLogFn callback pointer with passing a LogOptions struct containing the callback. The callback signature changes from (bool raise, std::string message) to (mp::LogMessage message), and the raise check becomes message.level == mp::Log::Raise. This is a compatibility/refactoring change with no observable security-relevant behavior change.
Changed components
src/ipc/capnp/protocol.cppInspect captured patch +11 / −5
diff --git a/src/ipc/capnp/protocol.cpp b/src/ipc/capnp/protocol.cpp
index 4150f9f4..4263aebd 100644
--- a/src/ipc/capnp/protocol.cpp
+++ b/src/ipc/capnp/protocol.cpp
@@ -30,10 +30,10 @@
namespace ipc {
namespace capnp {
namespace {
-void IpcLogFn(bool raise, std::string message)
+void IpcLogFn(mp::LogMessage message)
{
- LogDebug(BCLog::IPC, "%s\n", message);
- if (raise) throw Exception(message);
+ LogDebug(BCLog::IPC, "%s\n", message.message);
+ if (message.level == mp::Log::Raise) throw Exception(message.message);
}
class CapnpProtocol : public Protocol
@@ -62,7 +62,10 @@ public:
{
assert(!m_loop);
mp::g_thread_context.thread_name = mp::ThreadName(exe_name);
- m_loop.emplace(exe_name, &IpcLogFn, &m_context);
+ mp::LogOptions opts = {
+ .log_fn = IpcLogFn,
+ };
+ m_loop.emplace(exe_name, std::move(opts), &m_context);
if (ready_fn) ready_fn();
mp::ServeStream<messages::Init>(*m_loop, fd, init);
m_parent_connection = &m_loop->m_incoming_connections.back();
@@ -90,7 +93,10 @@ public:
std::promise<void> promise;
m_loop_thread = std::thread([&] {
util::ThreadRename("capnp-loop");
- m_loop.emplace(exe_name, &IpcLogFn, &m_context);
+ mp::LogOptions opts = {
+ .log_fn = IpcLogFn,
+ };
+ m_loop.emplace(exe_name, std::move(opts), &m_context);
m_loop_ref.emplace(*m_loop);
promise.set_value();
m_loop->loop();
Why 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.