Skip to content

backport: Merge bitcoin#27254#7432

Draft
thepastaclaw wants to merge 7 commits into
dashpay:developfrom
thepastaclaw:takeover-7190-backport-27419
Draft

backport: Merge bitcoin#27254#7432
thepastaclaw wants to merge 7 commits into
dashpay:developfrom
thepastaclaw:takeover-7190-backport-27419

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jul 8, 2026

Copy link
Copy Markdown

Issue being fixed or feature implemented

Backports bitcoin#27254, the earliest remaining prerequisite in the bitcoin#29034 backport chain.

This PR previously bundled bitcoin#27254 and bitcoin#27419. It has been split back to one prerequisite at a time; bitcoin#27419 will follow separately.

What was done?

  • Moved filesystem helpers from util/system into util/fs and util/fs_helpers.
  • Updated direct includes for the moved filesystem APIs, including Dash-specific callers.
  • Completed omitted platform-specific extraction hunks and the direct node/chainstate.cpp include.
  • Preserved Dash's existing descriptive FileCommit() errors and RenameOver() behavior.
  • Removed an unrelated util/bitdeque.h include copied from later history.

The final change is scoped to bitcoin#27254 only: 95 files changed, 468 insertions, and 393 deletions.

How Has This Been Tested?

On macOS:

git diff --check
python3 test/lint/lint-whitespace.py
python3 test/lint/lint-includes.py
python3 test/lint/lint-include-guards.py
python3 test/lint/lint-format-strings.py
python3 test/lint/lint-circular-dependencies.py
make -C src -j6 CCACHE_DIR=/private/tmp/dash-ccache test/test_dash
src/test/test_dash --run_test=fs_tests,util_tests,argsman_tests,getarg_tests,settings_tests

The targeted unit-test run completed 83 test cases with no errors.

Local pre-push backport prerequisite gate: passed at 8b4b8ad02fca18eec8dc226dba6fa50f0cbadef8 with no findings.

Breaking Changes

None expected. This is a filesystem-helper extraction with Dash-specific behavior preserved.

Checklist:

  • 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

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

Source: exact-SHA automated review for 173bd17f8f3d023626255ece0b48ed50916afb57; dash-core-commit-history and backport-reviewer specialists ran. Opus/Claude reviewer and verifier lanes failed due quota (resets Jul 10, 8am America/Chicago); Codex gpt-5.5 reviewer lanes and Codex verifier completed. No existing GitHub review-thread context was present for this PR.

Note: posted as a COMMENT review because GitHub does not allow formal approval/request-changes on my own PR.

🔴 1 blocking

  • Missing prerequisite: bitcoin#27254 (src/common/args.cpp:39-41)

    Upstream bitcoin#27419 starts after bitcoin#27254, where src/util/fs.h and src/util/fs_helpers.h exist and common/args.cpp includes them directly. At this exact Dash SHA, the full Dash merge f5dec3bce1a named in the PR description is not an ancestor; the branch only contains the older partial 27254 compatibility commit.

    The current backport works around that by forward-declaring RenameOver and GetSpecialFolderPath in src/common/args.cpp, while src/common/args.h still includes the old <fs.h> and exports GetDefaultDataDir instead of getting it from util/fs_helpers.h. That may be an intentional Dash adaptation, but then the PR/commit description needs to explicitly say Dash is keeping the partial 27254 layout and explain these deviations. Otherwise, backport the full bitcoin#27254 prerequisite first.

    Policy gate (backport-prereq-restore): For full upstream backport PRs, a missing prerequisite is blocking unless explicitly allowlisted, for example with intentional_exclusion / policy_override evidence.

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `src/common/args.cpp`:
- [BLOCKING] src/common/args.cpp:39-41: Missing prerequisite: bitcoin#27254
  Upstream bitcoin#27419 starts after bitcoin#27254, where `src/util/fs.h` and `src/util/fs_helpers.h` exist and `common/args.cpp` includes them directly. At this exact Dash SHA, the full Dash merge `f5dec3bce1a` named in the PR description is not an ancestor; the branch only contains the older partial 27254 compatibility commit. Either backport the full bitcoin#27254 prerequisite first or explicitly document that Dash is intentionally keeping the partial 27254 layout and that these declarations/header placements are deliberate.

@thepastaclaw

thepastaclaw commented Jul 9, 2026

Copy link
Copy Markdown
Author

✅ Review complete (commit e86f8b3)

@thepastaclaw thepastaclaw changed the title backport: Merge bitcoin#27419 backport: Merge bitcoin#27254, 27419 Jul 9, 2026
@thepastaclaw
thepastaclaw force-pushed the takeover-7190-backport-27419 branch from 173bd17 to 2c5de6d Compare July 9, 2026 02:59
00e9b97 refactor: Move fs.* to util/fs.* (TheCharlatan)
106b46d Add missing fs.h includes (TheCharlatan)
b202b3d Add missing cstddef include in assumptions.h (TheCharlatan)
18fb363 refactor: Extract util/fs_helpers from util/system (Ben Woosley)

Pull request description:

  This pull request is part of the `libbitcoinkernel` project bitcoin#24303 https://github.com/bitcoin/bitcoin/projects/18 and more specifically its "Step 2: Decouple most non-consensus code from libbitcoinkernel". This commit was originally authored by empact and is taken from its parent PR bitcoin#25152.

  #### Context

  There is an ongoing effort to decouple the `ArgsManager` used for command line parsing user-provided arguments from the libbitcoinkernel library (bitcoin#25290, bitcoin#25487, bitcoin#25527, bitcoin#25862, bitcoin#26177, and bitcoin#27125). The `ArgsManager` is defined in `system.h`. A similar pull request extracting functionality from `system.h` has been merged in bitcoin#27238.

  #### Changes

  Next to providing better code organization, this PR removes some reliance of the tree of libbitcoinkernel header includes on `system.h` (and thus the `ArgsManager` definition) by moving filesystem related functions out of the `system.*` files.

  There is already a pair of `fs.h` / `fs.cpp` in the top-level `src/` directory. They were not combined with the files introduced here, to keep the patch cleaner and more importantly because they are often included without the utility functions. The new files are therefore named `fs_helpers` and the existing `fs` files are moved into the util directory.

  Further commits splitting more functionality out of `system.h` are still in bitcoin#25152 and will be submitted in separate PRs once this PR has been processed.

ACKs for top commit:
  hebasto:
    ACK 00e9b97

Tree-SHA512: 31422f148d14ba3c843b99b1550a6fd77c77f350905ca324f93d4f97b652246bc58fa9696c64d1201979cf88733e40be02d262739bb7d417cf22bf506fdb7666
@thepastaclaw
thepastaclaw force-pushed the takeover-7190-backport-27419 branch from 2c5de6d to e86f8b3 Compare July 9, 2026 03:47
Add the direct filesystem include from the upstream prerequisite and remove platform setup that moved to fs_helpers.cpp.
Keep the descriptive FileCommit errors already backported in bitcoin#26654 and avoid importing an unrelated RenameOver workaround while moving the helpers.
@thepastaclaw
thepastaclaw force-pushed the takeover-7190-backport-27419 branch from e86f8b3 to 8b4b8ad Compare July 13, 2026 22:32
@thepastaclaw thepastaclaw changed the title backport: Merge bitcoin#27254, 27419 backport: Merge bitcoin#27254 Jul 13, 2026
@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants