Skip to content

fix: Pad script in V5 coinbase - #9620

Merged
mergify[bot] merged 3 commits into
mainfrom
fix-v5-coinbase-inputs
Jun 12, 2025
Merged

fix: Pad script in V5 coinbase#9620
mergify[bot] merged 3 commits into
mainfrom
fix-v5-coinbase-inputs

Conversation

@upbqdn

@upbqdn upbqdn commented Jun 12, 2025

Copy link
Copy Markdown
Member

Motivation

Solution

  • Include an extra byte in the coinbase data if the data is empty.

Tests

  • Add a test that fails when the consensus rule is not satisfied.

PR Checklist

  • The PR name is suitable for the release notes.
  • The solution is tested.
  • The documentation is up to date.

upbqdn added 3 commits June 12, 2025 10:21
Ensure that coinbase transactions with no extra data include an extra
byte, preventing violations of the consensus minimum script length for
coinbase heights less than 17.
@upbqdn upbqdn self-assigned this Jun 12, 2025
@upbqdn
upbqdn requested a review from a team as a code owner June 12, 2025 08:29
@upbqdn upbqdn added the C-bug Category: This is a bug label Jun 12, 2025
@upbqdn
upbqdn requested review from conradoplg and removed request for a team June 12, 2025 08:29
@upbqdn upbqdn added consensus Consensus-critical code: validation, cryptography, script I-consensus labels Jun 12, 2025

@conradoplg conradoplg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks

mergify Bot added a commit that referenced this pull request Jun 12, 2025
@mergify
mergify Bot merged commit 08b57ab into main Jun 12, 2025
@mergify
mergify Bot deleted the fix-v5-coinbase-inputs branch June 12, 2025 15:55
@natalieesk natalieesk added this to Zebra Jul 9, 2025
@natalieesk natalieesk moved this to Won't Fix in Zebra Jul 9, 2025
aphelionz pushed a commit to ShieldedLabs/zebra-crosslink that referenced this pull request Aug 12, 2025
* Fix coinbase data default to ensure compliance with script length rules

Ensure that coinbase transactions with no extra data include an extra
byte, preventing violations of the consensus minimum script length for
coinbase heights less than 17.

* Refactor comment formatting in Input::coinbase

No functional changes.

* Add unit test for constructing minimal coinbase tx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: This is a bug consensus Consensus-critical code: validation, cryptography, script

Projects

No open projects
Status: Won't Fix

Development

Successfully merging this pull request may close these issues.

V5 coinbase txs violate consensus rule at low heights

3 participants