Add extra debug logging for payout address, script hex in coinbase txn, etc#175
Open
yortug wants to merge 2 commits intoOCEAN-xyz:masterfrom
Open
Add extra debug logging for payout address, script hex in coinbase txn, etc#175yortug wants to merge 2 commits intoOCEAN-xyz:masterfrom
yortug wants to merge 2 commits intoOCEAN-xyz:masterfrom
Conversation
giving the user confidence that coinbase transactions are being built as expected (especially important when NOT mining into the pool, where it's desirable for address payout / behaviour to be confirmed)
luke-jr
requested changes
Apr 6, 2026
Comment on lines
+463
to
+464
| DLOG_DEBUG("Coinbase payout address: %s", datum_config.mining_pool_address); | ||
| DLOG_DEBUG("Coinbase payout value: %" PRIu64 " sats (%.8f BTC)", s->coinbase_value, (double)s->coinbase_value / 100000000.0); |
Contributor
There was a problem hiding this comment.
The coinbase is in lieu of inputs; it's not part of the outputs.
Contributor
There was a problem hiding this comment.
Please don't mess with all the whitespace!
Comment on lines
+462
to
+466
| DLOG_DEBUG("Raw coinb2 outputs hex (payout + witness + locktime): %s", s->coinbase[0].coinb2); | ||
| DLOG_DEBUG("Coinbase payout address: %s", datum_config.mining_pool_address); | ||
| DLOG_DEBUG("Coinbase payout value: %" PRIu64 " sats (%.8f BTC)", s->coinbase_value, (double)s->coinbase_value / 100000000.0); | ||
| DLOG_DEBUG("Coinbase primary tag: %s", datum_config.mining_coinbase_tag_primary); | ||
| DLOG_DEBUG("Coinbase secondary tag: %s", datum_config.mining_coinbase_tag_secondary); |
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.
This adds optional
DLOG_DEBUGstatements insrc/datum_coinbaser.cto print:Particularly useful when
mining_pool_address = ""(i.e. NOT mining in the pool, "lottery" mining, keeping the reward, etc).Under such circumstances, these extra debugs provide some extra confidence that the coinbasetxn has been built as expected, and (in the extremely unlikely scenario you hit a block) will send through to the correct address.
You cannot simple use
bitcoin-cli getblocktemplate ...to address these concerns, as it doesn't have the additional context that DATUM is using here to stitch together the txn it's actually using.If I did everything correctly, the logs should only appear at log level 0 (ALL) or 1 (DEBUG) - no impact at INFO or higher.
I've tested using a single BitAxe miner with
mining_pool_address = ""and saw the expected output logged viajournalctl -u datum_gateway -f.If you don't think these would be useful, feel free to close - or, if there's a better way to implement debug logs like these, let me know!