Skip to content

refactor(dash)!: remove the bitcoinconsensus feature - #1318

Merged
ZocoLini merged 1 commit into
devfrom
refactor/remove-bitcoinconsensus
Nov 4, 2026
Merged

ZocoLini merged 1 commit into
devfrom
refactor/remove-bitcoinconsensus

Conversation

@xdustinface

@xdustinface xdustinface commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

The optional bitcoinconsensus feature wrapped Bitcoin Core's libbitcoinconsensus, which checks scripts by Bitcoin's rules and parses transactions in Bitcoin's format. It does not work for Dash. A correctly signed special transaction fails with ERR_TX_SIZE_MISMATCH, because the extra payload after the locktime is not part of Bitcoin's format and Dash also signs it. A valid DIP-0020 script such as one using OP_CAT fails with ERR_SCRIPT, because those opcodes are disabled in Bitcoin and active on Dash mainnet since height 1516032.

Bitcoin Core deprecated the library in v27 and removed it in v28, so 0.106.0+26.0 is the final crate release. Porting to it would also mean new flags, a new spent_outputs argument and dropping the Ord/Hash derives on script::Error. No downstream crate enables the feature: Platform, dash-evo-tool and dash-spv-wallet do not use it.

This removes Script::verify, Script::verify_with_flags, Transaction::verify, Transaction::verify_with_flags, the dashcore::bitcoinconsensus re-export and the script::Error variants BitcoinConsensus, UnknownSpentOutput and Serialization, which only that API used.

PR Hygiene · 8ec537d

  • Bots — coderabbitai skipped after its own rate limit
  • Self-review — post /self-reviewed
  • Build green
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • Removed
    • Script and transaction verification methods are no longer available through the library.
    • The optional consensus verification dependency and its public re-export have been removed.
    • Related verification errors and the feature-specific verification test have also been removed.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4bcd5db and 8ec537d.

Files selected for processing: 7
  • dash/Cargo.toml
  • dash/src/blockdata/script/borrowed.rs
  • dash/src/blockdata/script/builder.rs
  • dash/src/blockdata/script/mod.rs
  • dash/src/blockdata/script/tests.rs
  • dash/src/blockdata/transaction/mod.rs
  • dash/src/lib.rs

No actionable comments were generated in the recent review.

Walkthrough

The optional bitcoinconsensus integration is removed. This includes script and transaction verification APIs, related error variants, the crate re-export, and feature-gated tests.

Changes: bitcoinconsensus removal

Layer / File(s) Summary
Remove script verification API
dash/Cargo.toml, dash/src/lib.rs, dash/src/blockdata/script/*
Removes the optional dependency and crate re-export, script verification methods, related error variants and conversions, and the script verification test.
Remove transaction verification API
dash/src/blockdata/transaction/mod.rs
Removes transaction verification methods, their script import, and the verification test.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Suggested reviewers: zocolini, quantumexplorer

Merge Risk: Minimal · previous review 4bcd5

No actionable merge-blocking risk is established for this intentional API removal.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "refactor(dash)!: remove the bitcoinconsensus feature" matches the main change. The PR removes the optional bitcoinconsensus feature, its dependency, the Script and Transaction verify meth…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "refactor(dash)!: remove the bitcoinconsensus feature" matches the main change. The PR removes the optional bitcoinconsensus feature, its dependency, the Script and Transaction verify methods, the re-export, and the related script::Error variants. The title is short, specific, and uses a conventional-commit style prefix.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8e16c9f and 4bcd5db.

Files selected for processing: 7
  • dash/Cargo.toml
  • dash/src/blockdata/script/borrowed.rs
  • dash/src/blockdata/script/builder.rs
  • dash/src/blockdata/script/mod.rs
  • dash/src/blockdata/script/tests.rs
  • dash/src/blockdata/transaction/mod.rs
  • dash/src/lib.rs
Files with no reviewable changes: 6
  • dash/src/lib.rs
  • dash/src/blockdata/script/tests.rs
  • dash/Cargo.toml
  • dash/src/blockdata/script/builder.rs
  • dash/src/blockdata/script/borrowed.rs
  • dash/src/blockdata/transaction/mod.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head merge-conflict The PR conflicts with the target branch. labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 4, 2026
The optional `bitcoinconsensus` feature wrapped Bitcoin Core's libbitcoinconsensus, which checks scripts by Bitcoin's rules and parses transactions in Bitcoin's format. It does not work for Dash. A correctly signed special transaction fails with `ERR_TX_SIZE_MISMATCH`, because the extra payload after the locktime is not part of Bitcoin's format and Dash also signs it. A valid DIP-0020 script such as one using `OP_CAT` fails with `ERR_SCRIPT`, because those opcodes are disabled in Bitcoin and active on Dash mainnet since height 1516032.

Bitcoin Core deprecated the library in v27 and removed it in v28, so `0.106.0+26.0` is the final crate release. Porting to it would also mean new flags, a new `spent_outputs` argument and dropping the `Ord`/`Hash` derives on `script::Error`. No downstream crate enables the feature: Platform, dash-evo-tool and dash-spv-wallet do not use it.

This removes `Script::verify`, `Script::verify_with_flags`, `Transaction::verify`, `Transaction::verify_with_flags`, the `dashcore::bitcoinconsensus` re-export and the `script::Error` variants `BitcoinConsensus`, `UnknownSpentOutput` and `Serialization`, which only that API used.
@xdustinface
xdustinface force-pushed the refactor/remove-bitcoinconsensus branch from 4bcd5db to 8ec537d Compare November 4, 2026 04:22
@github-actions github-actions Bot removed the merge-conflict The PR conflicts with the target branch. label Nov 4, 2026
@xdustinface

Copy link
Copy Markdown
Collaborator Author

/self-reviewed

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.16%. Comparing base (5bb9d73) to head (8ec537d).

Files with missing lines Patch % Lines
dash/src/blockdata/script/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1318      +/-   ##
==========================================
- Coverage   82.18%   82.16%   -0.02%     
==========================================
  Files         290      290              
  Lines       76392    76289     -103     
==========================================
- Hits        62785    62686      -99     
+ Misses      13607    13603       -4     
Flag Coverage Δ
core 81.96% <0.00%> (-0.05%) ⬇️
ffi 60.37% <ø> (ø)
rpc 52.10% <ø> (ø)
spv 93.90% <ø> (-0.03%) ⬇️
wallet 83.13% <ø> (ø)
Files with missing lines Coverage Δ
dash/src/blockdata/script/borrowed.rs 70.19% <ø> (-3.94%) ⬇️
dash/src/blockdata/script/builder.rs 67.12% <ø> (ø)
dash/src/blockdata/transaction/mod.rs 92.00% <ø> (+0.25%) ⬆️
dash/src/blockdata/script/mod.rs 51.10% <0.00%> (+0.33%) ⬆️

... and 7 files with indirect coverage changes

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Nov 4, 2026
@ZocoLini
ZocoLini merged commit 8ad5824 into dev Nov 4, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants