Skip to content

btc(rpc): always log daemon reject verdict on submitblock#752

Merged
frstrtr merged 1 commit into
masterfrom
btc/submitblock-reject-log
Jul 19, 2026
Merged

btc(rpc): always log daemon reject verdict on submitblock#752
frstrtr merged 1 commit into
masterfrom
btc/submitblock-reject-log

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 19, 2026

Copy link
Copy Markdown
Owner

What

submit_block_hex (the submitblock RPC sink for won blocks) is always called with ignore_failure=true so a daemon rejection never throws out of the found-block handler. But the reject-reason log line was gated on !ignore_failure, so bitcoind's verdict string was silently swallowed on every rejection.

Why it matters

A won block's reject reason is load-bearing diagnostic data. On the .121 g3btuned0 regtest, c2pool finds blocks at height 131 but every submit stalls pending -> rejected with no observable cause — bitcoind stuck at 130 for ~17h. The verdict string (bad-witness-merkle-match / high-hash / Superfluous witness record / ...) is exactly the discriminator between the two open G3b block-prod hypotheses (witness-commitment vs coinbase-only serialization).

Change

ignore_failure now governs fatality only (never throw); log visibility is unconditional. Rejections log LOG_ERROR << "submit_block_hex REJECTED by daemon: " << result.dump(). Param retained + (void)-cast to avoid a signature ripple / unused-param -Werror. Logging-only; no behavioral change to accept/return semantics.

Cut off origin/master. Unblocks the G3b diagnosis on the next rig cycle.

The won-block submitblock path calls submit_block_hex with ignore_failure=true
so a daemon rejection never throws out of the found-block handler. But the
reject-reason log was gated on !ignore_failure, so the daemon verdict string
(bad-witness-merkle-match / high-hash / Superfluous witness record / ...) was
silently swallowed on every rejection. A won block reject reason is
load-bearing diagnostic data and must always surface.

ignore_failure now governs fatality only (never throw), not log visibility.
Unblocks G3b block-prod debugging on the .121 tuned regtest, where submits
went pending -> rejected with no observable cause.
@frstrtr
frstrtr force-pushed the btc/submitblock-reject-log branch from 15e4d7c to 65be10d Compare July 19, 2026 09:36
@frstrtr
frstrtr merged commit c2055fe into master Jul 19, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant