Skip to content

Raise COINBASE_TYPE_YUGE to 64000 bytes and the coinbaser output limit to 2048 - #30

Open
iohzrd wants to merge 2 commits into
CONVOYMining:masterfrom
iohzrd:yuge-64000
Open

iohzrd wants to merge 2 commits into
CONVOYMining:masterfrom
iohzrd:yuge-64000

Conversation

@iohzrd

@iohzrd iohzrd commented Oct 6, 2026 •

Copy link
Copy Markdown

Based on #28, which is based on #24. Review the last commit. This is an alternative to #29: merge one of the two.

Needs #26 on musl. datum_protocol_pow keeps 140528 bytes on the stack, and assembleBlockAndSubmit keeps 133280 (gcc 16.2 -fstack-usage, x86_64, default CMake build). Both are more than musl's 128 KiB default thread stack.

On BLAKE2b work every miner is served COINBASE_TYPE_YUGE, and the coinbase never reaches the miner, so no firmware limit applies to its size. This raises it. Fingerprinting and classes 1, 2, 3 and 5 are unchanged.

  • MAX_DICTATED_COINBASE_SIZE is 64000 (YUGE was 16000). That holds 2048 P2WPKH outputs or about 1480 taproot outputs.
  • datum_stratum_coinbase_fit_to_template still cuts the coinbase to the template's room. At the node's default -blockreservedweight (8000 WU) that is about 1800 bytes on a full block. Filling 64000 bytes needs about 257000 WU, 32% of an 800000 WU RDTS block.
  • MAX_COINBASER_OUTPUTS is 2048 (was 512). It sets the coinbaser parse limit and the size of available_coinbase_outputs.
  • STRATUM_COINBASE2_MAX_LEN is 131072 hex characters (was 32768), so coinb2 can be up to 65535 bytes. The share's coinbase section writes each part's length as a uint16.
  • MAX_POW_MESSAGE_SIZE (MAX_COINBASE_TXN_SIZE_BYTES + 4096) replaces 32768 as the size of datum_protocol_pow's message buffers and as the replay limit.
  • DATUM_PROTOCOL_COINBASER_BUFFER_SIZE is 65536 (was 32768) for the coinbaser response, whose length field is a uint32. A response is one byte plus its outputs encoded as in the coinbase, so it holds every dictated output a 64000-byte coinbase has room for.
  • Test: 2048 P2WPKH outputs fit one coinbase, with a three-byte output count.

64000 is below the protocol's limit for this layout, 65610 bytes: coinb2 at 65535, the 63-byte coinb1 of a DATUM job with no tags, and the 12-byte extranonce. The largest share carrying a 64000-byte coinbase is 65372 bytes (encrypted, with its pad), so it fits a 64 KiB frame.

The pool server has to accept a share coinbase section (coinb1 + coinb2) of up to 63988 bytes, a share message of up to 65372 bytes, and a coinbaser response of up to 65535 bytes.

BSS goes from 89.5 MB to 212.3 MB.

The commit also reformats datum_stratum.h: Allman braces, and spaces for alignment.

Every commit builds with -Wall -Werror and passes --test.

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