Skip to content

ipc: submitSolution with an AuxPoW version leaves the template unserializable, and the next getBlock aborts qbit-node #291

Open

Description

@kiwidream

Summary

A local IPC mining client can abort qbit-node. If it calls submitSolution with a version that has the AuxPoW bit set, the submission is rejected correctly, but the version stays in the block template. The next getBlock or getBlockHeader on that template throws while serializing, and nothing catches the exception on the IPC thread, so the process terminates.

Observed

Reproduced during review of the #278 backport, on 1.x.x plus that backport built with -DENABLE_IPC=ON. The same code is on 1.x.x without the backport.

  • submitSolution (src/node/interfaces.cpp:931-935) calls AddMerkleRootAndCoinbase (src/node/miner.cpp:451), which writes the client's version into the template before validation.
  • With an AuxPoW-flagged version such as 0x2f58c101, ProcessNewBlock rejects the block with bad-auxpow-missing-payload and submitSolution returns false, as it should.
  • The next getBlock serializes the template. CBlockHeader throws std::ios_base::failure("auxpow version missing payload") (src/primitives/block.h:37). The exception escapes fn.invoke (src/ipc/libmultiprocess/include/mp/type-context.h:126), and the node aborts: terminate called after throwing an instance of 'std::ios_base::failure', exit code -6.

Impact

Low. Only a local client with access to the IPC socket can trigger it, but the whole node goes down. IPC is enabled by default in non-Windows builds (ENABLE_IPC).

Suggested fix

Reject versions with the AuxPoW bit in submitSolution before the template is changed, since IPC cannot carry an AuxPoW payload. Alternatively, restore the template's header when a submission is rejected. Separately, the IPC server should not let one call's exception terminate the process.

Activity

  1. added
    bug
    on Nov 4, 2026
  2. kiwidream commented on Nov 4, 2026

    @kiwidream
    MemberAuthor

    Related, found in the same review: submitSolution changes the shared block template in place without synchronization, so concurrent IPC calls on the same template can race. Upstream has the same code. A fix that stops a rejected submission from changing the template should cover both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions