Skip to content

backport: Merge bitcoin#28956, 29034#7430

Draft
thepastaclaw wants to merge 2 commits into
dashpay:developfrom
thepastaclaw:takeover-7190-backport-28956-29034
Draft

backport: Merge bitcoin#28956, 29034#7430
thepastaclaw wants to merge 2 commits into
dashpay:developfrom
thepastaclaw:takeover-7190-backport-28956-29034

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jul 8, 2026

Copy link
Copy Markdown

Issue being fixed or feature implemented

Follow-up replacement work for #7190 after splitting bitcoin#29041 into #7429.

This PR backports bitcoin#28956, which removes adjusted network time from validation/mining paths, and bitcoin#29034, which makes functional-test OS detection consistently use platform.system().

What was done?

Notes on intentionally omitted upstream hunks:

How Has This Been Tested?

Local environment: macOS arm64, configured from a fresh worktree with:

./autogen.sh
./configure --without-gui --disable-bench --disable-fuzz-binary --without-miniupnpc --without-natpmp

Validation:

git diff --check upstream/develop...HEAD
COMMIT_RANGE=upstream/develop..HEAD test/lint/lint-whitespace.py
PYTHONPYCACHEPREFIX=/tmp/tracker-1912-pycache python3 -m py_compile test/functional/feature_bind_extra.py test/functional/feature_init.py test/functional/feature_notifications.py test/functional/feature_remove_pruned_files_on_startup.py test/functional/rpc_bind.py test/functional/test_framework/p2p.py test/functional/test_framework/test_node.py test/functional/test_runner.py test/functional/wallet_multiwallet.py
test/lint/lint-python.py test/functional/feature_bind_extra.py test/functional/feature_init.py test/functional/feature_notifications.py test/functional/feature_remove_pruned_files_on_startup.py test/functional/rpc_bind.py test/functional/test_framework/p2p.py test/functional/test_framework/test_node.py test/functional/test_runner.py test/functional/wallet_multiwallet.py
make -C src -j8 test/test_dash
make -C src -j8 dashd dash-cli
./src/test/test_dash --run_test=validation_tests/ --run_test=miner_tests/ --run_test=bls_tests/ --run_test=validation_chainstatemanager_tests/
test/functional/test_runner.py feature_init.py feature_bind_extra.py rpc_bind.py wallet_multiwallet.py feature_notifications.py feature_remove_pruned_files_on_startup.py

The two-commit stack was rebased onto current develop, both rewritten commits are GPG-signed, and upstream-vs-Dash file coverage was rechecked after the rebase. The bitcoin#25667 snapshot restart hunk and bitcoin#26533 prune-test hunk are now included because those prerequisites have since landed in Dash. The only remaining exclusions are the explicitly documented bitcoin#25717 and bitcoin#27302 prerequisite-dependent hunks above.

Breaking Changes

None expected.

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 (for repository code-owners and collaborators only)

@thepastaclaw

Copy link
Copy Markdown
Author

Prerequisite branch opened as #7431 for bitcoin#26533 + bitcoin#27302. I’m leaving this PR draft until that lands, then I’ll rebuild the bitcoin#28956/bitcoin#29034 branch on top so bitcoin#29034 has proper diff-on-diff hunks instead of carrying prereq-adapted context here.

@thepastaclaw

Copy link
Copy Markdown
Author

Correction on the prerequisite chain: #7431 is now scoped to bitcoin#26533 only. The next prerequisite before bitcoin#27302 / bitcoin#29034 is bitcoin#27419 (the common/args split), so I pulled bitcoin#27302 out of #7431 to avoid carrying cross-layout hunks.

@thepastaclaw

thepastaclaw commented Jul 21, 2026

Copy link
Copy Markdown
Author

🕓 Ready for review — 23 ahead in queue (commit df310c5)
Queue position: 24/24 · 2 reviews active
ETA: start ~14:12 UTC · complete ~14:33 UTC (median 21m across 30 recent reviews; 2 slots)
Queued 11h 18m ago · Last checked: 2026-07-23 10:10 UTC

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

Preliminary review — Codex only

At the exact head, three blocking issues remain: the test runner restores Windows behavior removed by an ancestor backport, and the advertised full bitcoin#28956 backport omits two upstream hunks without documenting those omissions as intentional exclusions. The two omitted bitcoin#29034 areas are explicitly excluded by the PR body, and the author comments correctly refine their prerequisite chains, so those claims are dropped.

Validated blockers were found in the Codex precheck. Sonnet is deferred until a fresh Codex revalidation clears the blocker gate.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — dash-core-commit-history (completed), gpt-5.6-sol — backport-reviewer (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet: not run (deferred by blocker gate)

🔴 3 blocking

3 additional finding(s) omitted (not in diff).

🤖 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 `test/functional/test_runner.py`:
- [BLOCKING] test/functional/test_runner.py:46-68: Preserve the newer Windows terminal logic while changing OS detection
  Commit e189624b5e58, which is an ancestor of this PR's base, deliberately removed the `sys.getwindowsversion()` guard and moved the ANSI formatting assignments into the non-Windows branch when Dash backported bitcoin#31172. This hunk reapplies the older pre-#31172 structure from bitcoin#29034 instead of changing only the OS detector. As a result, the obsolete version gate returns and Windows now receives the ANSI formatting assignments that the current base deliberately leaves disabled. Preserve the base structure and replace only `os.name == 'nt'` with `platform.system() == 'Windows'`.

In `src/headerssync.cpp`:
- [BLOCKING] src/headerssync.cpp:44: Missing prerequisite: bitcoin#25717
  Upstream bitcoin#28956 changes the `HeadersSyncState` commitment bound from `GetAdjustedTime()` to `NodeClock::now()` at `src/headerssync.cpp:44`. The block was introduced by bitcoin#25717, and neither `src/headerssync.cpp` nor its corresponding subsystem exists in this PR's Dash base or head. The PR advertises a full bitcoin#28956 backport, while its documented intentional exclusions cover only bitcoin#29034, so this omitted hunk is an undeclared prerequisite gap. Backport bitcoin#25717 and carry the bitcoin#28956 transformation, or explicitly re-scope and document this area as intentionally excluded.

In `src/test/validation_chainstatemanager_tests.cpp`:
- [BLOCKING] src/test/validation_chainstatemanager_tests.cpp:383-386: Missing prerequisite: bitcoin#25667
  Upstream bitcoin#28956 removes `.adjusted_time_callback = GetAdjustedTime` from the snapshot restart setup at `src/test/validation_chainstatemanager_tests.cpp:383`. A first-parent diff of the bitcoin#25667 merge shows that PR introduced `SnapshotTestSetup::SimulateNodeRestart()` and this callback assignment. Dash's exact base and head lack that test section, and the PR body does not declare the bitcoin#25667-dependent bitcoin#28956 hunk as intentionally excluded. Because the PR advertises the full upstream backport, the missing test prerequisite must be restored or explicitly excluded and tracked.

Note: GitHub does not allow PastaClaw to submit an approval or request changes on their own PR, so the canonical verifier result is transported as a COMMENT review.

achow101 added 2 commits July 22, 2026 17:44
ff9039f Remove GetAdjustedTime (dergoegge)

Pull request description:

  This picks up parts of bitcoin#25908.

  The use of adjusted time is removed from validation code while the warning to users if their clock is out of sync with the rest of the network remains.

ACKs for top commit:
  naumenkogs:
    ACK ff9039f
  achow101:
    ACK ff9039f
  maflcko:
    lgtm ACK ff9039f 🤽
  stickies-v:
    ACK ff9039f

Tree-SHA512: d1f6b9445c236915503fd2ea828f0d3b92285a5dbc677b168453276115e349972edbad37194d8becd9136d8e7219b576af64ec51c72bdb1923e57e405c0483fc
(cherry picked from commit 3c13f5d)
… using `platform.system()`

878d914 doc: test: mention OS detection preferences in style guideline (Sebastian Falbesoner)
4c65ac9 test: detect OS consistently using `platform.system()` (Sebastian Falbesoner)
37324ae test: use `skip_if_platform_not_linux` helper where possible (Sebastian Falbesoner)

Pull request description:

  There are at least three ways to detect the operating system in Python3:
  - `os.name` (https://docs.python.org/3.9/library/os.html#os.name)
  - `sys.platform` (https://docs.python.org/3.9/library/sys.html#sys.platform)
  - `platform.system()` (https://docs.python.org/3.9/library/platform.html#platform.system)

  We are currently using all of them in functional tests (both in individual tests and shared test framework code), which seems a bit messy. This PR consolidates into using `platform.system()`, as it appears to be one most consistent and easy to read (see also [IRC discussion](https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2023-12-08#989301;) and table below). `sys.platform` is inconsistent as it has the major version number encoded for BSD systems, which doesn't make much sense for e.g. OpenBSD, where there is no concept of major versions, but instead the version is simply increased by 0.1 on each release.

  Note that `os.name` is still useful to detect whether we are running a POSIX system (see `BitcoinTestFramework.skip_if_platform_not_posix`), so for this use-case it is kept as only exception. The following table shows values for common operating systems, found via
  ```
  $ python3 -c "import os; import sys; import platform; print(os.name, sys.platform, platform.system())"
  ```

  |     OS       | os.name | sys.platform | platform.system()  |
  |--------------|---------|--------------|--------------------|
  | Linux 6.2.0  |  posix  |   linux      |      Linux         |
  | MacOS*       |  posix  |   darwin     |      Darwin        |
  | OpenBSD 7.4  |  posix  |   openbsd7   |      OpenBSD       |
  | Windows*     |  nt     |   win32      |      Windows       |

  \* = I neither have a MacOS nor a Windows machine available, so I extracted the values from documentation and our current code. Also I'm relying on CI for testing the relevant code-paths. Having reviewers to this this locally would be very appreciated, if this gets Concept ACKed.

ACKs for top commit:
  kevkevinpal:
    ACK [878d914](bitcoin@878d914)
  achow101:
    ACK 878d914
  hebasto:
    ACK 878d914, I have reviewed the code and it looks OK.
  pablomartin4btc:
    tACK 878d914

Tree-SHA512: 24513d493e47f572028c843260b81c47c2c29bfb701991050255c9f9529cd19065ecbc7b3b6e15619da7f3f608b4825c345ce6fee30d8fd1eaadbd08cff400fc
(cherry picked from commit bb6de1b)
@thepastaclaw
thepastaclaw force-pushed the takeover-7190-backport-28956-29034 branch from c32a42a to df310c5 Compare July 22, 2026 22:49
@thepastaclaw

Copy link
Copy Markdown
Author

Addressed the preliminary backport-review findings in the rewritten two-commit stack:

Fresh local validation passed: whitespace/diff checks, Python compile + lint/mypy, signed-commit verification, test_dash build and targeted validation/miner/BLS/snapshot suites, dashd/dash-cli builds, and the touched functional tests.

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.

2 participants