Skip to content

feat(rpc): tag Zebra-mined blocks with a 🦓 coinbase marker - #10836

Merged
mergify[bot] merged 2 commits into
mainfrom
coinbase-zebra-tag
Jul 1, 2026
Merged

feat(rpc): tag Zebra-mined blocks with a 🦓 coinbase marker#10836
mergify[bot] merged 2 commits into
mainfrom
coinbase-zebra-tag

Conversation

@upbqdn

@upbqdn upbqdn commented Jun 26, 2026

Copy link
Copy Markdown
Member

Motivation

Closes #10835.

Solution

  • Prepend a 🦓 marker (ZEBRA_COINBASE_MARKER) to the coinbase input of every block Zebra builds, as a single script push. When extra_coinbase_data is set, a ": " separator and the operator data follow.
  • Make mining.extra_coinbase_data a validating newtype (ExtraCoinbaseData) capped at 86 bytes (the 94-byte coinbase budget minus the 4-byte marker, 2-byte separator, and 2-byte push opcode). Oversized values are unrepresentable, so the config fails to load and Zebra refuses to start.
  • Update the mining book and rustdoc.

A separate marker push would need a zcash_transparent change; the single push carries marker + separator + data.

Why 🦓, not "Zebra"?

The marker is for machines — explorers and hashrate monitors that detect Zebra blocks by scanning coinbase data. Plain ASCII like "Zebra" is something miners genuinely type (pool names, messages, the word itself), so matching it would mis-tag other blocks. The 4-byte emoji (f0 9f a6 93) is vanishingly unlikely in human text, so a hit is almost certainly a Zebra block — and it's 1 byte smaller than "Zebra", leaving more room in the tight coinbase budget. A leading emoji also reads as a deliberate tag, not incidental text.

AI Disclosure

  • AI tools were used: Claude Code implemented the change, docs, and test.

Copilot AI review requested due to automatic review settings June 26, 2026 12:59
@upbqdn upbqdn self-assigned this Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ValarDragon

Copy link
Copy Markdown
Contributor

Thank you for adding this back!

@nuttycom nuttycom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK! 🦓

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread zebra-rpc/src/methods/types/get_block_template/tests.rs
Comment thread zebra-rpc/src/methods/types/get_block_template.rs Outdated
Comment thread zebra-rpc/src/methods/types/get_block_template.rs

@jvff jvff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had an idea, but it's more of a style tweak, not a blocker.

Comment thread zebra-rpc/src/methods/types/get_block_template.rs Outdated
Comment thread zebra-rpc/src/config/mining.rs Outdated
Comment thread zebra-rpc/src/config/mining.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread zebra-rpc/src/config/mining.rs
Comment thread zebra-rpc/src/config/mining.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

jvff
jvff previously approved these changes Jul 1, 2026
@gustavovalverde

Copy link
Copy Markdown
Member

/changelog

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Proposed changelog entries for this PR. Review and paste into the relevant
CHANGELOG.md [Unreleased] sections:

**`CHANGELOG.md`** (node operators)

### Breaking Changes
- The `coinbasetxn.data` field in `getblocktemplate` now always includes a `🦓` marker (`f09fa693`) after the encoded block height, changing the coinbase transaction for all blocks built by Zebra. ([#10836](https://github.com/ZcashFoundation/zebra/pull/10836))
- `mining.extra_coinbase_data` is now limited to 86 bytes (was 94); Zebra refuses to start if this limit is exceeded. ([#10836](https://github.com/ZcashFoundation/zebra/pull/10836))

### Added
- Zebra prepends a `🦓` marker to the coinbase input of every block it builds. When `extra_coinbase_data` is set, it is appended after the marker and a `": "` separator. ([#10836](https://github.com/ZcashFoundation/zebra/pull/10836))

**`zebra-rpc/CHANGELOG.md`**

### Breaking Changes
- `config::mining::Config::extra_coinbase_data` is now `Option<ExtraCoinbaseData>` (was `Option<String>`), limited to 86 bytes and validated on construction. ([#10836](https://github.com/ZcashFoundation/zebra/pull/10836))

### Added
- `config::mining::ExtraCoinbaseData` and `config::mining::ExtraCoinbaseDataTooLong` types. ([#10836](https://github.com/ZcashFoundation/zebra/pull/10836))

@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-01 20:01 UTC · Rule: batched · triggered by rule move to any queue if GitHub Rulesets are satisfied
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-01 20:12 UTC · at 18a68fd407eb4519428eda4d3d7d8298bb1cd01d

This pull request spent 10 minutes 34 seconds in the queue, including 4 seconds running CI.

Required conditions to merge

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag Zebra-mined blocks with a coinbase marker

8 participants