btc(rpc): always log daemon reject verdict on submitblock#752
Merged
Conversation
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
force-pushed
the
btc/submitblock-reject-log
branch
from
July 19, 2026 09:36
15e4d7c to
65be10d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
submit_block_hex(the submitblock RPC sink for won blocks) is always called withignore_failure=trueso 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
.121g3btuned0 regtest, c2pool finds blocks at height 131 but every submit stallspending -> rejectedwith 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_failurenow governs fatality only (never throw); log visibility is unconditional. Rejections logLOG_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.