Provider refusals
write_verifier: Provider declined the request because of a cybersecurity restriction. Experiments remain incomplete; static verification can continue.
3 major findings · 6 minor findings · 2 suggestions
Earlier concerns neither republished nor resolved: 2 minor findings · 3 suggestions. See the Run archive for their assessments.
Findings
[major] · A failed IPC notification callback can terminate bitcoin-node
An IPC subscriber disconnecting during notification delivery can raise an uncaught ipc::Exception on the scheduler thread and terminate bitcoin-node.
Location: src/ipc/capnp/chain.capnp:92 (head).
Details and suggested fix
handleNotifications registers a NotificationsProxy that forwards validation events directly to the generated remote client. A failed callback or transport disconnect makes clientInvoke throw through IpcLogFn. Neither validation iteration nor the task runner contains the exception, and CScheduler::serviceQueue and TraceThread rethrow it out of the scheduler's std::thread. There is also a window after synchronous proxy disconnection but before asynchronous Handler destruction unregisters the subscription, when another notification can throw immediately. Contain transport exceptions at the notification forwarding boundary and safely unregister failed subscriptions rather than letting them escape validation delivery. Add a regression test that disconnects a subscriber during delivery and checks that the node remains running.
[major] · Early IPC Chain lookups can abort node startup
With -ipcbind, a Chain lookup before chainman initialization reaches an aborting Assert because the new factories do not wait for chainstate readiness.
Location: src/ipc/capnp/init.capnp:27 (head).
Details and suggested fix
AppInitMain starts accepting IPC requests before calling InitAndLoadChainstate, where node.chainman is constructed. Both Chain factories immediately return a ChainImpl; a lookup such as findBlock then calls chainman(), which evaluates Assert(m_node.chainman). A client connecting before construction completes can therefore abort the node. The reindex retry path also resets chainman and mempool while these IPC calls remain possible. Gate the IPC-facing factories on chainstate_loaded, with shutdown handling like MakeMining, and add a startup lookup regression test. No current client connecting during this window was identified, so production frequency is unconfirmed.
[major] · Invalid UnstableChain heights can terminate bitcoin-node
An authorized IPC client can terminate bitcoin-node with an invalid getBlockHash height or hasBlocks maximum instead of receiving a recoverable error.
Location: src/ipc/capnp/chain.capnp:67 (head).
Details and suggested fix
getBlockHash with a negative or above-tip height reaches an aborting Assert on the null active-chain lookup. For hasBlocks, a known block hash with hasMaxHeight=true and maxHeight=-1 causes GetAncestor(-1) to return null, followed immediately by a read of block->nStatus. Omitting the maximum or supplying an unknown hash avoids that second failure, but neither guard protects this request. These native preconditions already existed; the new factories make them reachable over IPC. Validate heights and optional range bounds at the boundary, reject a null ancestor before the loop, and add malformed-call cases that verify the node remains running.
[minor] · handleRpc marshals messages outside cancellation protection
A client cancellation or disconnect during the custom handleRpc path can invalidate request, response, or Connection storage while the IPC worker still accesses it.
Location: src/ipc/capnp/chain.cpp:176 (head).
Details and suggested fix
ServerCall releases cancel_lock before invoking this specialization and checks request_canceled only after it returns. The custom CRPCCommand& hook skips ordinary argument decoding, so the specialization reads parameters, constructs the actor client, accesses results, and dereferences the Connection inside that unprotected interval. Cancellation can delete the message storage or Connection before these accesses finish; retaining the server capability does not retain those objects. The running-RPC registration check does not protect the preceding parameter reads. Decode the command in the protected argument stage and construct the Handler response only after reacquiring the lock and checking cancellation, leaving only the native handleRpc call unlocked. Add a disconnect-during-registration regression test.
[minor] · IPC RPC registration races with the command table
IPC registration and Handler cleanup mutate CRPCTable without synchronization, allowing races with startup registration and, after warmup, command execution.
Location: src/ipc/capnp/chain.cpp:186 (head).
Details and suggested fix
handleRpc constructs a RpcHandlerImpl on an IPC worker, which appends to the unlocked mapCommands. IPC listening starts before core RPC registration, so those insertions can overlap. The running-RPC check rejects later registrations when RPC is running, but with -server=0 registration remains allowed while IPC RPC execution or the GUI console can read the table after warmup. Removal has neither that check nor a registry lock. If an early-registered client's Handler is destroyed during execution, asynchronous cleanup can erase the command vector and free commands or actors still in use. Synchronize table access and retain command and actor ownership until each invocation finishes. No current IPC client registering RPCs was identified, so production impact is unconfirmed.
[minor] · IPC notification cleanup can outlive ValidationSignals
A notification Handler retained by an IPC client at shutdown can be destroyed asynchronously after ValidationSignals, leaving its destructor with a dangling reference.
Location: src/ipc/capnp/chain.capnp:92 (head).
Details and suggested fix
disconnectIncoming() erases the connection, but ProxyServerBase queues destruction of the Handler implementation on the asynchronous cleanup thread and returns without waiting. Shutdown then unregisters validation interfaces and resets node.validation_signals. If cleanup runs afterward, ~NotificationsHandlerImpl calls UnregisterSharedValidationInterface through its stored ValidationSignals&. Clearing the registry does not reset the Handler's m_proxy, so it does not suppress that call. This is a scheduling-dependent use-after-free. Drain IPC implementation cleanup, or explicitly disconnect IPC-owned notification handlers, before destroying validation_signals.
[minor] · Unresponsive IPC notifications can block shutdown
Shutdown waits for synchronous notification callbacks before disconnecting IPC clients, so a subscriber that keeps its connection open but stops responding can prevent shutdown from completing.
Location: src/ipc/capnp/chain.capnp:111 (head).
Details and suggested fix
NotificationsProxy delivers validation events through blocking IPC calls, and clientInvoke has no response timeout. Shutdown first calls scheduler->stop(), which joins the scheduler after its current task finishes, and later flushes remaining validation callbacks on the shutdown thread. Only afterward does it reach disconnectIncoming(). If either delivery is waiting on a silent subscriber, shutdown cannot reach that disconnect while the client remains connected and unresponsive. Disconnect or cancel incoming subscriptions before joining or flushing the scheduler, and contain the resulting transport exceptions so cancellation does not terminate the node.
[minor] · Unknown txids produce uninitialized ancestry fields over IPC
For a txid outside the mempool, getTransactionAncestry serializes uninitialized ancestorsize and ancestorfees, causing undefined behavior and potentially returning stale stack values to the authorized IPC client.
Location: src/ipc/capnp/chain.capnp:72 (head).
Details and suggested fix
ancestorsize and ancestorfees are output-only pointer parameters with no want* fields, so the generated server always requests them. The pointer adapter declares Decay<LocalType> param; without initialization and serializes it after the call. CTxMemPool::GetTransactionAncestry writes these outputs only when the transaction exists in mapTx, and ChainImpl leaves them untouched on its no-mempool early return as well. Confirmed, evicted, or unknown txids therefore reach serialization with indeterminate values even though ancestors and cluster_count are zero. Initialize both optional outputs to zero in ChainImpl::getTransactionAncestry before the lookup.
[minor] · The C++ Chain factory bypasses unstable-interface versioning
The native makeChain override sends stable ordinal @5 and automatically casts to UnstableChain, so renumbering @6 cannot reject an incompatible older C++ client.
Location: src/ipc/capnp/init.capnp:31 (head).
Details and suggested fix
$Proxy.name("makeChain") selects the server-side implementation but does not rename the generated client method or request. Code holding interfaces::Init& therefore calls stable makeChain @5, while makeUnstableChain is a separate generated method absent from that native interface. The stable result conversion then performs an unchecked castAs<UnstableChain>(). After an incompatible unstable-method change, this path would still acquire a capability and send the old unstable ordinals. Route the native override through the versioned factory, for example by naming @6 makeChain and retaining @5 under a separate schema name. That preserves the stable wire entry point while making native acquisition subject to renumbering. No C++ caller uses this path over IPC in this revision.
Optional improvements
[suggestion] · Mempool replay holds both node locks across IPC round trips
A populated-mempool request keeps cs_main and mempool.cs locked across every synchronous IPC callback, delaying other lock users for client round trips or a stalled response.
Location: src/ipc/capnp/chain.capnp:103 (head).
Details and suggested fix
requestMempoolTransactions takes both locks and calls transactionAddedToMempool once per entry. Over IPC, each call waits for the remote response without a timeout, so the lock-held work now includes one round trip per transaction and can wait indefinitely for an unresponsive client. Avoid making remote delivery part of these locks' lifetime. Evaluate snapshotting the CTransactionRefs under the locks and delivering them after release, while preserving synchronous completion and checking ordering against queued removal notifications before changing the implementation. Batching while retaining the locks would reduce round trips but would still depend on the client answering.
[suggestion] · Most custom Chain conversions lack IPC regression coverage
The new smoke test checks only height and time on successful block lookups, leaving the found flag, recursive outputs, notifications, result branches, and settings callbacks unverified.
Location: test/functional/interface_ipc.py:66 (head).
Details and suggested fix
The fixture is at height 200, and the block lookups request the tip and its height-zero ancestor with only wantHeight and wantTime. Removing builder.setFound(true) would leave these assertions unchanged, even though the C++ result reader returns immediately when that flag is false. Python also bypasses the C++ request builder and result reader. Add native IPC round trips for recursive nextBlock results at a successor and the tip, plus a missing hash with sentinel outputs. Extend coverage to BlockInfo notification delivery and Handler disconnect with a drain barrier, and a temporary-setting read-modify-write callback. Synthetic C++ fixture values can exercise the Expected and ResultVoid success and error branches without depending on fee-estimator or mempool state.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Test FoundBlock marshalling over IPC
- [suggestion]: Test Chain wire conversions over IPC
- [minor]: Out-of-range broadcast values wrap to public broadcast (earlier report)
- [minor]: Failed
SpawnProcesssetup can leak socket descriptors (earlier report) - [suggestion]: The broad C++23 warning suppression is added whenever supported (earlier report)