Skip to content

refactor(dash-spv)!: split FeedError into DiffFeedError and QRInfoFeedError - #1276

Closed
ZocoLini wants to merge 1 commit into
devfrom
refactor/feed-error-non-generic
Closed

ZocoLini wants to merge 1 commit into
devfrom
refactor/feed-error-non-generic

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

FeedError<E> is only ever FeedError<SmlError> or FeedError<QuorumValidationError>. The type parameter forced a hand-written From<StorageError> for each of them, and the names didn't say which message was refused.

They are now two enums, each with HeaderStorage(StorageError) and Refused(_):

  • DiffFeedError, refusing with SmlError, returned by apply_diff.
  • QRInfoFeedError, refusing with QuorumValidationError, returned by feed_qr_info.

thiserror now derives the StorageError conversions, and the one conversion left by hand is DiffFeedError to QRInfoFeedError, for the diffs a QRInfo applies. apply_diff still reports the exact SmlError, so an exhaustive match on the refusal reason keeps working.

The variant docs are gone from both enums.

Breaking for test_utils users, because FeedError is replaced by the two new types.

Testing: cargo clippy -p dash-spv --all-targets --all-features -- -D warnings, cargo fmt --check and cargo doc -p dash-spv --no-deps --all-features pass, and so does cargo test -p dash-spv --lib -- sml_engine validation sync::masternodes, which last ran before the docs were removed. The dashd tests were not run locally.

🤖 Generated with Claude Code

PR Hygiene · a41e72e

  • Bots — coderabbitai skipped after its own rate limit
  • Self-review — post /self-reviewed
  • Build green
  • Approvals
    • dash-spv (dash-spv/src/sml_engine.rs, dash-spv/src/test_utils/mod.rs, dash-spv/src/validation/masternode_list.rs) — QuantumExplorer or xdustinface

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.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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 2 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 7760595 and a41e72e.

Files selected for processing: 3
  • dash-spv/src/sml_engine.rs
  • dash-spv/src/test_utils/mod.rs
  • dash-spv/src/validation/masternode_list.rs
  • 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

@github-actions

github-actions Bot commented Nov 1, 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 the waiting-bots Waiting for the review bots to report on this head label Nov 1, 2026
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.74%. Comparing base (4f1bfcb) to head (a41e72e).
⚠️ Report is 7 commits behind head on dev.

Files with missing lines Patch % Lines
dash-spv/src/sml_engine.rs 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1276      +/-   ##
==========================================
+ Coverage   80.73%   80.74%   +0.01%     
==========================================
  Files         291      291              
  Lines       77841    77892      +51     
==========================================
+ Hits        62847    62897      +50     
- Misses      14994    14995       +1     
Flag Coverage Δ
core 78.48% <ø> (+0.13%) ⬆️
ffi 58.20% <ø> (ø)
rpc 52.05% <ø> (ø)
spv 93.68% <89.47%> (-0.09%) ⬇️
wallet 82.91% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/validation/masternode_list.rs 96.66% <100.00%> (-0.11%) ⬇️
dash-spv/src/sml_engine.rs 97.28% <88.23%> (-0.01%) ⬇️

... and 9 files with indirect coverage changes

…dError

FeedError was only ever used with SmlError or QuorumValidationError.
Name the two cases instead of keeping a type parameter, which also lets
thiserror derive the StorageError conversions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ZocoLini
ZocoLini force-pushed the refactor/feed-error-non-generic branch from d0da8a6 to a41e72e Compare November 1, 2026 12:12
@ZocoLini ZocoLini changed the title refactor(dash-spv)!: make FeedError non-generic refactor(dash-spv)!: split FeedError into DiffFeedError and QRInfoFeedError Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 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.

@xdustinface xdustinface 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.

Hm, so we would duplicate the enum with its variants and message and we would still have handwritten conversion and the comments are gone. Can you explain why this is better?

@github-actions

github-actions Bot commented Nov 1, 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. merge-conflict The PR conflicts with the target branch. and removed waiting-bots Waiting for the review bots to report on this head labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 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.

@ZocoLini

ZocoLini commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

nvm

@ZocoLini ZocoLini closed this Nov 1, 2026
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. merge-conflict The PR conflicts with the target branch. 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