Skip to content

Conversation

@kwvg
Copy link
Collaborator

@kwvg kwvg commented Jul 18, 2025

Motivation

feature_unsupported_utxo_db.py (introduced with bitcoin#24236 as 79fcd30 in dash#6733) creates problems on macOS for the following reasons:

  • The platform identifier detection code was placed after v20 when it should've been positioned before, as the prior condition was met, platform identifier was taken to be osx64, which is incorrect (release).

    Error log:
    $ ./test/get_previous_releases.py -b -t "releases" ${PREVIOUS_RELEASES_TO_DOWNLOAD}
    Releases directory: releases
    Fetching: https://github.com/dashpay/dash/releases/download/v0.12.1.5/dashcore-0.12.1.5-osx64.tar.gz
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
      0     9    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
    100     9  100     9    0     0     34      0 --:--:-- --:--:-- --:--:--    34
    Checksum for given version doesn't exist
    
  • Dash Core v0.12.2.x and earlier did not include daemon or utility binaries for macOS (i.e. dashd, as needed by the functional test suite), shipping only Dash-Qt using a disk image, in comparison to v0.12.3.x which do offer them in a tarbundle (release).

  • Dash Core v0.12.2.3 was incorrectly excluded from the old platform determination logic due to the less than comparison.

In light of this, get_previous_releases.py will now error out if attempting to download versions <v0.12.3.x as we cannot obtain the binaries needed to run functional tests. Additionally, feature_unsupported_utxo_db.py will bail out on non-Linux platforms as previous release tests assume all the versions are populated and will otherwise cause general failure.

Error log:
$ ./test/functional/feature_unsupported_utxo_db.py
2025-07-18T10:09:06.884000Z TestFramework (INFO): PRNG seed is: 5491056264691271257
2025-07-18T10:09:06.884000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_dkrhioh0
2025-07-18T10:09:06.885000Z TestFramework (INFO): Create previous version (v0.12.1.5) utxo db
2025-07-18T10:09:06.885000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/src/dash/test/functional/test_framework/test_framework.py", line 162, in main
    self.run_test()
  File "/src/dash/./test/functional/feature_unsupported_utxo_db.py", line 35, in run_test
    self.start_node(0)
  File "/src/dash/test/functional/test_framework/test_framework.py", line 644, in start_node
    node.start(*args, **kwargs)
  File "/src/dash/test/functional/test_framework/test_node.py", line 249, in start
    self.process = subprocess.Popen(all_args, env=subp_env, stdout=stdout, stderr=stderr, cwd=cwd, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/src/dash/releases/v0.12.1.5/bin/dashd'
2025-07-18T10:09:06.936000Z TestFramework (INFO): Stopping nodes
[...]

Special thanks to PastaPastaPasta for flagging this issue!

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 (note: N/A)
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation (note: N/A)
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

kwvg added 4 commits July 18, 2025 09:52
v0.12.2.3 is the last version to use the old platform identification
scheme but the less than check inadvertently excludes it. Let's correct
that and set it to less than the v0.12.3.x series instead as that marks
the start the newer identification scheme
@kwvg kwvg added this to the 23 milestone Jul 18, 2025
@kwvg kwvg changed the title fix: avoid short-circuit when evaluating platform identifier for <v0.12.3.x, bail out if trying to download for macOS, make feature_unsupported_utxo_db Linux-only fix: avoid short-circuit when evaluating platform identifier for <v0.12.3.x and bail out on macOS, make feature_unsupported_utxo_db Linux-only Jul 18, 2025
@kwvg kwvg requested a review from UdjinM6 July 18, 2025 10:56
@kwvg kwvg marked this pull request as ready for review July 18, 2025 19:33
@kwvg kwvg requested review from PastaPastaPasta and knst July 18, 2025 19:33
@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

The changes introduce a new platform check in the functional test feature_unsupported_utxo_db.py, causing the test to be skipped unless running on a Linux platform. In get_previous_releases.py, the logic for handling macOS platform binaries in the download_binary function was restructured. For tags earlier than "v0.12.3", attempting to download binaries for macOS platforms now results in an explicit message and error, while for tags between "v0.12.3" and "v20", macOS platforms are mapped to "osx64". The lower bound for this mapping was also updated from "v0.12.2.3" to "v0.12.3". No changes were made to public interfaces.


📜 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 d5fc8bf and 7ace512.

📒 Files selected for processing (2)
  • test/functional/feature_unsupported_utxo_db.py (1 hunks)
  • test/get_previous_releases.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
test/functional/**/*.py

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • CLAUDE.md
🧠 Learnings (2)
📓 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: 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: kwvg
PR: dashpay/dash#6516
File: ci/test/00_setup_env_mac.sh:11-11
Timestamp: 2025-01-02T08:33:26.751Z
Learning: The removal of DMG support in the macOS packaging process eliminates the need for python-based scripts or python3-setuptools in the build environment. The PACKAGES variable in ci/test/00_setup_env_mac.sh is vestigial due to the use of a general-purpose Docker container defined in contrib/containers/ci/Dockerfile.
Learnt from: kwvg
PR: dashpay/dash#6752
File: src/wallet/load.cpp:164-164
Timestamp: 2025-07-17T15:48:29.398Z
Learning: In Dash Core, kwvg prefers using assert() statements to document expected behavior in code paths, especially when the called function also has internal asserts. This is used as a defensive programming pattern rather than requiring conditional error handling.
test/functional/feature_unsupported_utxo_db.py (1)
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.
🧬 Code Graph Analysis (1)
test/functional/feature_unsupported_utxo_db.py (1)
test/functional/test_framework/test_framework.py (1)
  • skip_if_platform_not_linux (1043-1046)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: linux64_sqlite-test / Test source
  • GitHub Check: linux64-test / Test source
🔇 Additional comments (2)
test/get_previous_releases.py (1)

133-144: LGTM! Platform handling logic correctly addresses binary availability issues.

The changes properly handle the platform detection issues described in the PR objectives:

  1. Version boundary correction: Changed from "v0.12.2.3" to "v0.12.3" to correctly include v0.12.2.3 in the old platform determination logic.

  2. Explicit macOS error handling: Added proper error handling for macOS platforms (x86_64-apple-darwin, arm64-apple-darwin) on versions earlier than v0.12.3, since these binaries are unavailable.

  3. Updated osx64 mapping: The condition for mapping macOS platforms to "osx64" now correctly applies to versions between v0.12.3 and v20.

This resolves the short-circuit evaluation issue and prevents download failures for unavailable macOS binaries.

test/functional/feature_unsupported_utxo_db.py (1)

23-23: LGTM! Platform restriction aligns with binary availability constraints.

Adding the Linux-only platform check is appropriate because:

  1. Consistent with binary availability: The test requires v0.12.1.5, which falls under the pre-v0.12.3 category where macOS binaries are unavailable (as addressed in get_previous_releases.py).

  2. Prevents test failures: Without this check, the test would fail on macOS when trying to download the required previous release binary.

  3. Follows existing patterns: The method skip_if_platform_not_linux() is properly implemented in the test framework (as shown in the relevant code snippets).

This change ensures the test only runs where it can succeed, maintaining test suite reliability.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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

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

utACK 7ace512

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK 7ace512

@PastaPastaPasta PastaPastaPasta merged commit 4e62ee9 into dashpay:develop Jul 23, 2025
85 of 90 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.

3 participants