Skip to content

Conversation

@PastaPastaPasta
Copy link
Member

Issue being fixed or feature implemented

batch of backports

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@PastaPastaPasta PastaPastaPasta added this to the 23 milestone Aug 4, 2025
@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@coderabbitai
Copy link

coderabbitai bot commented Aug 4, 2025

Walkthrough

This set of changes updates scripts, documentation, and source files across several areas. The ci/dash/lint-tidy.sh script now captures and processes run-clang-tidy output more robustly by saving it to a temporary file, checking the command's exit status, and printing error context on failure. The Docker install script configures Git globally to mark all directories as safe, addressing permission issues with mounted source directories. Documentation for building Dash Core with Qt on Unix updates the required Qt development packages. An error message in bitcoin-cli.cpp is expanded to suggest running "dash-cli -help" for more information. In src/index/base.cpp, the synchronization flag assignment is reordered to occur after a commit operation. Two test comments in argsman_tests.cpp are corrected to reference the proper test suite name. The fuzz test runner script adds a new argument to control minimum fuzzing time for empty corpora, refactors function signatures to use a configurable fuzz binary path, and adjusts fuzzing command-line arguments accordingly. The memory reduction documentation generalizes glibc malloc arena behavior and improves wording.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

  • Most changes are straightforward and low complexity, including documentation updates, comment corrections, error message improvements, and simple script modifications.
  • The most substantial change is in test/fuzz/test_runner.py, which introduces a new command-line argument, updates function signatures, and modifies fuzzing logic based on corpus state, requiring careful review.
  • No changes impact public APIs or exported entities in core application code, and no complex algorithmic modifications are present.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d04979f and 9e0f19f.

📒 Files selected for processing (1)
  • doc/reduce-memory.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • doc/reduce-memory.md
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
ci/test/04_install.sh (1)

64-66: Wildcard safe.directory weakens Git trust model – consider scoping

Setting

git config --global --add safe.directory "*"

disables Git’s owner-check for every path inside the container. While the CI job runs in a controlled environment, narrowing the rule to the mounted source directory achieves the same goal with less blast-radius:

-$DOCKER_CI_CMD_PREFIX_ROOT git config --global --add safe.directory "*"
+$DOCKER_CI_CMD_PREFIX_ROOT git config --global --add safe.directory "$BASE_ROOT_DIR"

(or the precise path that may differ after rsync).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 588a6e0 and d04979f.

📒 Files selected for processing (7)
  • ci/dash/lint-tidy.sh (1 hunks)
  • ci/test/04_install.sh (1 hunks)
  • doc/build-unix.md (1 hunks)
  • src/bitcoin-cli.cpp (1 hunks)
  • src/index/base.cpp (1 hunks)
  • src/test/argsman_tests.cpp (2 hunks)
  • test/fuzz/test_runner.py (11 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{cpp,h,cc,cxx,hpp}

📄 CodeRabbit Inference Engine (CLAUDE.md)

src/**/*.{cpp,h,cc,cxx,hpp}: Dash Core C++ codebase must be written in C++20 and require at least Clang 16 or GCC 11.1
Dash uses unordered_lru_cache for efficient caching with LRU eviction

Files:

  • src/bitcoin-cli.cpp
  • src/test/argsman_tests.cpp
  • src/index/base.cpp
doc/**

📄 CodeRabbit Inference Engine (CLAUDE.md)

Unless specifically prompted, avoid making changes to the doc directory (documentation)

Files:

  • doc/build-unix.md
ci/**

📄 CodeRabbit Inference Engine (CLAUDE.md)

Unless specifically prompted, avoid making changes to the ci directory (continuous integration)

Files:

  • ci/test/04_install.sh
  • ci/dash/lint-tidy.sh
src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp}

📄 CodeRabbit Inference Engine (CLAUDE.md)

Unit tests for C++ code should be placed in src/test/, src/wallet/test/, or src/qt/test/ and use Boost::Test or Qt 5 for GUI tests

Files:

  • src/test/argsman_tests.cpp
🧠 Learnings (15)
📓 Common learnings
Learnt from: kwvg
PR: dashpay/dash#6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: UdjinM6
PR: dashpay/dash#6786
File: ci/test/04_install.sh:99-101
Timestamp: 2025-08-01T07:46:37.840Z
Learning: In backport PRs like #6786, UdjinM6 prefers to defer non-critical fixes (such as shell command expansion issues) to separate commits/PRs to maintain focus on the primary backport objectives, consistent with the project's pattern of avoiding scope creep.
Learnt from: kwvg
PR: dashpay/dash#6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp} : Unit tests for C++ code should be placed in src/test/, src/wallet/test/, or src/qt/test/ and use Boost::Test or Qt 5 for GUI tests
Learnt from: kwvg
PR: dashpay/dash#6754
File: contrib/containers/guix/docker-compose.yml:18-19
Timestamp: 2025-07-14T10:11:05.011Z
Learning: In the Guix build process for Dash Core, the `guix.sigs` directory requires write access as signatures are written to it during the build process, and `dash-detached-sigs` may be updated with `git pull` operations, so both directories need rw permissions in the Docker volume mounts.
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/**/*.{cpp,h,cc,cxx,hpp} : Dash Core C++ codebase must be written in C++20 and require at least Clang 16 or GCC 11.1
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/{crc32c,dashbls,gsl,immer,leveldb,minisketch,secp256k1,univalue}/** : Do not make changes under any circumstances to vendored dependencies in src/crc32c, src/dashbls, src/gsl, src/immer, src/leveldb, src/minisketch, src/secp256k1, src/univalue
📚 Learning: in dash core, error() is used (instead of state.invalid()) to report critical failures that require ...
Learnt from: kwvg
PR: dashpay/dash#6530
File: src/validation.cpp:4514-4516
Timestamp: 2025-01-14T08:40:00.994Z
Learning: In Dash Core, error() is used (instead of state.Invalid()) to report critical failures that require immediate user intervention, particularly for database/disk errors and data corruption scenarios. This is an established pattern seen in validation.cpp.

Applied to files:

  • src/bitcoin-cli.cpp
📚 Learning: dash core uses bitcoin_ prefix for header guards as the standard convention, inherited from bitcoin ...
Learnt from: kwvg
PR: dashpay/dash#6761
File: src/chainlock/signing.h:5-6
Timestamp: 2025-07-23T09:30:34.631Z
Learning: Dash Core uses BITCOIN_ prefix for header guards as the standard convention, inherited from Bitcoin Core. Only a few BLS-specific files in src/bls/ use DASH_ prefix. The vast majority of files (385+) use BITCOIN_ prefix.

Applied to files:

  • src/bitcoin-cli.cpp
📚 Learning: in dash masternode proregtx validation, platform ports (platformhttpport and platformp2pport) are ma...
Learnt from: kwvg
PR: dashpay/dash#6665
File: src/evo/deterministicmns.cpp:1284-1287
Timestamp: 2025-06-16T17:59:55.669Z
Learning: In Dash masternode ProRegTx validation, platform ports (platformHTTPPort and platformP2PPort) are mandatory and must be non-zero, while netInfo (ipAndPort) is optional. This means that even if an empty netInfo returns 0 from GetPrimary().GetPort(), it won't cause false positives in port duplication checks since platform ports cannot be 0.

Applied to files:

  • src/bitcoin-cli.cpp
📚 Learning: the dash core deploy container runs a single process and doesn't require complex init systems, servi...
Learnt from: PastaPastaPasta
PR: dashpay/dash#6564
File: contrib/containers/deploy/Dockerfile:1-1
Timestamp: 2025-02-11T19:25:05.487Z
Learning: The Dash Core deploy container runs a single process and doesn't require complex init systems, service supervision, or system utilities that Phusion baseimage provides, making vanilla Ubuntu a more suitable base image choice.

Applied to files:

  • doc/build-unix.md
  • ci/test/04_install.sh
📚 Learning: in the guix build process for dash core, the `guix.sigs` directory requires write access as signatur...
Learnt from: kwvg
PR: dashpay/dash#6754
File: contrib/containers/guix/docker-compose.yml:18-19
Timestamp: 2025-07-14T10:11:05.011Z
Learning: In the Guix build process for Dash Core, the `guix.sigs` directory requires write access as signatures are written to it during the build process, and `dash-detached-sigs` may be updated with `git pull` operations, so both directories need rw permissions in the Docker volume mounts.

Applied to files:

  • doc/build-unix.md
  • ci/test/04_install.sh
  • ci/dash/lint-tidy.sh
📚 Learning: the deploy container for dash core is designed to be minimal, requiring only basic container functio...
Learnt from: PastaPastaPasta
PR: dashpay/dash#6564
File: contrib/containers/deploy/Dockerfile:1-1
Timestamp: 2025-02-11T19:25:05.487Z
Learning: The deploy container for Dash Core is designed to be minimal, requiring only basic container functionality without complex init systems or service management.

Applied to files:

  • doc/build-unix.md
📚 Learning: applies to ci/** : unless specifically prompted, avoid making changes to the ci directory (continuou...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to ci/** : Unless specifically prompted, avoid making changes to the ci directory (continuous integration)

Applied to files:

  • ci/test/04_install.sh
  • ci/dash/lint-tidy.sh
📚 Learning: applies to .github/** : unless specifically prompted, avoid making changes to .github (github workfl...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to .github/** : Unless specifically prompted, avoid making changes to .github (GitHub workflows and configs)

Applied to files:

  • ci/test/04_install.sh
📚 Learning: always run linting before commits using test/lint/all-lint.py...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Always run linting before commits using test/lint/all-lint.py

Applied to files:

  • ci/dash/lint-tidy.sh
📚 Learning: code blocks marked with `// clang-format off` and `// clang-format on` directives should be excluded...
Learnt from: kwvg
PR: dashpay/dash#6529
File: src/rpc/governance.cpp:1074-1089
Timestamp: 2025-02-14T15:15:58.165Z
Learning: Code blocks marked with `// clang-format off` and `// clang-format on` directives should be excluded from clang-format suggestions as they are intentionally formatted manually for better readability.

Applied to files:

  • ci/dash/lint-tidy.sh
📚 Learning: applies to src/**/*.{cpp,h,cc,cxx,hpp} : dash core c++ codebase must be written in c++20 and require...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/**/*.{cpp,h,cc,cxx,hpp} : Dash Core C++ codebase must be written in C++20 and require at least Clang 16 or GCC 11.1

Applied to files:

  • ci/dash/lint-tidy.sh
📚 Learning: in the test framework consolidation pr (#6718), user kwvg prefers to limit functional changes to tho...
Learnt from: kwvg
PR: dashpay/dash#6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.

Applied to files:

  • src/test/argsman_tests.cpp
📚 Learning: applies to src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp} : unit tests for c++ code should b...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp} : Unit tests for C++ code should be placed in src/test/, src/wallet/test/, or src/qt/test/ and use Boost::Test or Qt 5 for GUI tests

Applied to files:

  • src/test/argsman_tests.cpp
📚 Learning: applies to src/fuzz/**/*.{cpp,h,cc,cxx,hpp} : fuzzing harnesses should be placed in src/fuzz/...
Learnt from: CR
PR: dashpay/dash#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-20T18:42:49.794Z
Learning: Applies to src/fuzz/**/*.{cpp,h,cc,cxx,hpp} : Fuzzing harnesses should be placed in src/fuzz/

Applied to files:

  • test/fuzz/test_runner.py
🔇 Additional comments (12)
src/index/base.cpp (1)

150-158: Synchronisation flag now set only after successful Commit – good fix

Moving m_synced = true to after Commit() prevents the index from advertising a synced state before the last DB write has succeeded, eliminating a brief window where other threads could rely on an out-of-date persisted state.

doc/build-unix.md (1)

107-111: Update to Qt package list looks correct

Replacing the runtime libraries with the umbrella dev package (qtbase5-dev) is all that’s needed for building; the change aligns with current Debian/Ubuntu package naming.

src/test/argsman_tests.cpp (2)

904-909: Comment typo fixed – no functional impact

The updated hint now references the correct test name; nothing else to flag.


1007-1012: Analogous comment fix acknowledged

Same minor documentation correction for the ChainMerge test section.

src/bitcoin-cli.cpp (1)

831-834: LGTM! Improved error message formatting and user guidance.

The enhanced error message provides better formatting with explicit newlines and helpful guidance by suggesting dash-cli -help. This improves the user experience without affecting the underlying error handling logic.

ci/dash/lint-tidy.sh (1)

15-19: LGTM! Enhanced error handling and reporting.

The improved approach captures run-clang-tidy output to a file and provides better error reporting by showing errors with context and a clear failure message. This makes CI failures easier to diagnose and debug.

test/fuzz/test_runner.py (6)

9-9: LGTM! Modern path handling with pathlib.

Adding the Path import improves path handling throughout the script, which is consistent with modern Python best practices.


45-49: LGTM! Useful configuration option for empty corpus handling.

The new --empty_min_time argument provides valuable control over fuzzing behavior when corpus directories are empty, improving the script's flexibility.


85-85: LGTM! Consistent path object usage.

Converting corpus_dir to a Path object enables better path manipulation and is consistent with the pathlib import.


102-103: LGTM! Configurable fuzz binary path.

Using the DASHFUZZ environment variable makes the script more flexible while maintaining backward compatibility with a sensible default path.


106-107: LGTM! Consistent function signature refactoring.

The systematic update of function signatures to use fuzz_bin instead of build_dir makes the interfaces more explicit about their requirements and supports the configurable binary path feature.

Also applies to: 172-173, 183-184, 193-195, 199-199, 238-238, 276-276


279-291: LGTM! Well-implemented empty corpus handling logic.

The conditional fuzzing logic properly handles empty corpus directories using time-based fuzzing when empty_min_time is set, while maintaining the traditional runs=1 approach for non-empty directories. The use of Path.iterdir() for empty directory detection is clean and efficient.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

CI failures are unrelated, should go away on rebase/merge (https://github.com/UdjinM6/dash/actions/runs/16738506802)

utACK d04979f

Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK 9e0f19f

(ci failure is unrelated, rebase on top of develop should fix it)

@PastaPastaPasta PastaPastaPasta merged commit ed5c410 into dashpay:develop Aug 5, 2025
28 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants