Review report

core: PR #36097

Design and approach

Define the client-side CancelGuard lifetime (src/ipc/capnp/common-types.h:206, head)

The client hook immediately discards the CancelGuard returned by the caller's CancelArg. If callers use that callback to register the supplied cancellation function with a scoped cancellation source, destroying the guard unregisters it before the IPC request completes, so later cancellation will not reach the request. Is client-side CancelArg intentionally limited to one-shot handoffs that retain the function independently? If not, keep the guard alive for the request lifetime. If so, document or separate that contract from the server-side RAII registration.

๐ŸŸ  Major

Scope cancellation to each mining request (src/node/interfaces.cpp:974, head)

This callback sets the shared m_interrupt_mining flag used by every waitTipChanged() and createNewBlock() call on this MinerImpl. InterruptWait() wakes all waiters, and WaitTipChanged() clears the flag when one waiter observes it. With concurrent requests, an unrelated waiter can consume the cancellation and return nullopt, leaving the canceled request blocked. The shared m_interrupt_wait in waitNext() has the same issue. Use state scoped to each in-flight request so cancellation wakes and stops only that request.

๐ŸŸก Minor

Join the cancellation thread before asserting (src/test/miner_tests.cpp:166, head)

If this BOOST_REQUIRE fails, stack unwinding skips canceler.join(). The still-joinable std::thread then calls std::terminate when destroyed, obscuring the test failure and potentially terminating the test process. Save the result, join the thread, then assert it, or use cleanup that guarantees the join.

๐Ÿ’ก Suggestion

Verify waitTipChanged() exits after its promise is dropped (test/functional/interface_ipc_mining.py:164, head)

This check observes the canceled log, which libmultiprocess emits before invoking the registered cancellation callback. Because the test ends immediately afterward, it can pass even if the callback fails to release the blocked waitTipChanged() call. After dropping the promise, issue a bounded follow-up request using the same context or otherwise signal server-side completion. This would verify worker release without changing the cancellation behavior being tested.

Review coverage was incomplete. The adversarial review had incomplete evidence. The adversarial_glm review did not complete.