Skip to content

Merge bitcoin/bitcoin#28639: refactor: Remove unused nchaintx from SnapshotMetadata constructor, fix test, add test#962

Open
DashCoreAutoGuix wants to merge 2 commits into
backport-0.23-batch-678from
backport-0.23-batch-678-pr-28639
Open

Merge bitcoin/bitcoin#28639: refactor: Remove unused nchaintx from SnapshotMetadata constructor, fix test, add test#962
DashCoreAutoGuix wants to merge 2 commits into
backport-0.23-batch-678from
backport-0.23-batch-678-pr-28639

Conversation

@DashCoreAutoGuix
Copy link
Copy Markdown
Owner

@DashCoreAutoGuix DashCoreAutoGuix commented Aug 5, 2025

Backports bitcoin#28639

Original commit: 448790c

Backported from Bitcoin Core v0.26

Note: The test file changes were not included as test/functional/feature_assumeutxo.py doesn't exist in Dash (it's for the assumeutxo feature which isn't implemented in Dash).

Summary by CodeRabbit

  • Refactor
    • Updated internal handling of snapshot metadata to streamline parameters used during snapshot creation. No changes to user-facing features or functionality.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 5, 2025

Warning

Rate limit exceeded

@DashCoreAutoGuix has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a2fef30 and a687d45.

📒 Files selected for processing (1)
  • src/rpc/blockchain.cpp (2 hunks)

Walkthrough

The constructor of the SnapshotMetadata class in utxo_snapshot.h was updated to remove the nchaintx parameter. Correspondingly, the instantiation of SnapshotMetadata in blockchain.cpp was modified to match the new constructor signature, eliminating the use of the chain transaction count.

Changes

Cohort / File(s) Change Summary
SnapshotMetadata Constructor Update
src/node/utxo_snapshot.h
Removed the nchaintx parameter from the SnapshotMetadata constructor and updated its initialization list accordingly.
Constructor Usage Update
src/rpc/blockchain.cpp
Updated the call to the SnapshotMetadata constructor in CreateUTXOSnapshot to remove the third argument (tip->nChainTx).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch backport-0.23-batch-678-pr-28639

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

- Remove wrong nChainTx comment and cast as per Bitcoin commit faa90f6
- Complete the refactor by removing unnecessary cast to uint64_t

Resolves validation issues while preserving Bitcoin intent.
Test file changes not applicable as test/functional/feature_assumeutxo.py
does not exist in Dash.
@DashCoreAutoGuix
Copy link
Copy Markdown
Owner Author

✅ Backport Verification - Issues Fixed

I found 1 issue and automatically applied fixes.

Original Bitcoin commit: 448790c00ad
Changes pushed to branch: backport-0.23-batch-678-pr-28639
Fix commit: a687d4556a
Reviewed commit hash: a2fef305e03-verify-1754371513

Issues Found and Fixed:

Missing Bitcoin changes: The PR was missing the removal of wrong nChainTx comment and cast from src/rpc/blockchain.cpp

  • Added missing change: removed unnecessary comment and uint64_t cast
  • This completes the refactor as per Bitcoin commit faa90f6

File Analysis:

Core refactor applied correctly: SnapshotMetadata constructor parameter removed
RPC changes now complete: Comment and cast removal applied
ℹ️ Test changes N/A: test/functional/feature_assumeutxo.py does not exist in Dash

Reviewer Feedback Analysis:

PastaPastaPasta comments reviewed: 0
Other human comments reviewed: 0
Total human comments: 0

Validation Results:

  • File operations match Bitcoin's intent
  • All missing changes now included
  • No scope creep or dependency explosions
  • CI checks: normal (0 failures)
  • No witness/segwit code detected

The backport is now complete and faithful to the original Bitcoin change. The test portion cannot be applied as the assumeutxo test file doesn't exist in Dash, but the core refactoring is fully implemented. ✅

@DashCoreAutoGuix DashCoreAutoGuix added the fixes-applied Issues found and fixes automatically applied label Aug 5, 2025
@DashCoreAutoGuix
Copy link
Copy Markdown
Owner Author

✅ Backport Verification Successful

No issues found! This backport is complete and faithful to the original Bitcoin change.

Original Bitcoin commit: 448790c00ad
Backport PR: #962
Reviewed commit hash: a687d4556ac-verify-1754372029

Verification Details:

  • File operations match Bitcoin's intent
  • No missing changes detected
  • No scope creep or dependency explosions
  • CI checks passing (0 failures out of 41 checks)
  • PR comments reviewed and addressed

Analysis Summary:

This PR correctly implements the core refactoring from Bitcoin commit faa90f6e7b6 which removes the unused nchaintx parameter from SnapshotMetadata constructor and removes the wrong nChainTx comment and cast.

The missing test file test/functional/feature_assumeutxo.py from the second Bitcoin commit is not applicable to Dash since Dash doesn't have the assumeUTXO functionality that the test covers.

Reviewer Feedback Analysis:

PastaPastaPasta comments reviewed: 0
Other human comments reviewed: 0

No human reviewer feedback requiring action.

This PR is ready for merge. ✅

@DashCoreAutoGuix DashCoreAutoGuix added the verified Backport verification passed - ready for merge label Aug 5, 2025
@PastaPastaPasta PastaPastaPasta removed the verified Backport verification passed - ready for merge label Dec 3, 2025
@DashCoreAutoGuix
Copy link
Copy Markdown
Owner Author

✅ Verification Complete - APPROVED

Bitcoin Commit: faa90f6e7b (bitcoin#28639)

Verification Summary

All fixes have been correctly applied and the backport is now faithful to the Bitcoin commit:

Changes Applied:

  1. ✅ Removed nchaintx parameter from SnapshotMetadata constructor (src/node/utxo_snapshot.h:29)
  2. ✅ Removed tip->nChainTx argument from constructor call (src/rpc/blockchain.cpp:2731)
  3. ✅ Removed obsolete comment and cast from result.pushKV("nchaintx", ...) (src/rpc/blockchain.cpp:2758)

Test Changes:

  • Test file test/functional/feature_assumeutxo.py correctly excluded (Dash doesn't support assumeutxo)

CI Status: ✅ All 53 checks passing

Size Ratio: Changes appropriately sized for this refactor (removed unused parameter and its references)

The backport accurately reflects Bitcoin's intent to remove the unused nchaintx parameter from the snapshot metadata constructor while preserving the value in the RPC response output.

@DashCoreAutoGuix DashCoreAutoGuix added the verified Backport verification passed - ready for merge label Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes-applied Issues found and fixes automatically applied verified Backport verification passed - ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants