fix: use rustchain.org for SDK public defaults#5580
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
|
Security Review ✅ Use rustchain.org for SDK public defaults. Ensures SDK points to correct official endpoint. Reviewed by Xeophon - Solana: Lt9nERv6VHsojw15LpFeiaabuphAggzfLF9sM9UXRrZ |
strongkeep-debug
left a comment
There was a problem hiding this comment.
I checked this at head dbd6211a4205e57265d3bfbe359ce30acd170e92. This resolves #2283's public-default problem in the SDK/macOS surfaces while keeping the installer fallback out of scope as requested by the issue.
Validation I ran locally:
| Check | Result |
|---|---|
| Duplicate/overlap search for #2283 / SDK raw-IP defaults | no overlapping PR found |
git diff --check origin/main...HEAD |
pass |
python -m py_compile sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/__init__.py miners/macos/rustchain_mac_miner_v2.5.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.py |
pass |
python tools/bcos_spdx_check.py --base-ref origin/main |
pass |
rg -n "https://50\.28\.86\.131" <touched SDK/macOS/test files> |
no remaining matches |
python -m pytest tests/test_tls_config.py --noconftest -q |
4 passed |
uv run --no-project --with pytest --with pytest-asyncio --with respx --with httpx --with cryptography --with pynacl python -B -m pytest -q sdk/python/rustchain_sdk/tests/test_client.py --noconftest |
20 passed |
The remaining 50.28.86.131 references outside this patch are intentionally not covered by #2283's SDK/macOS default scope, so this looks ready to merge from my side.
kongwen686
left a comment
There was a problem hiding this comment.
Reviewed head dbd6211 for issue #2283.
I checked the PR diff and the head file contents through the GitHub API. The Python SDK now centralizes the public default as DEFAULT_NODE_URL = "https://rustchain.org", the CLI default --node options import and use that constant, the SDK test fixture now targets https://rustchain.org, and tests/test_tls_config.py covers the public SDK/macOS default surfaces against the legacy raw IP.
The only failing CI job fails during unrelated full-suite pytest collection because the runner is missing optional dependencies such as aiohttp, flask_cors, and matplotlib before the touched tests can run. The other checks pass, and I do not see a blocking issue in this change.
Note: install.sh still keeping the raw IP is consistent with #2283, which asked to keep it as a fallback for DNS-unavailable environments.
ZacharyZhang-NY
left a comment
There was a problem hiding this comment.
Reviewed PR #5580 at head dbd6211.
Requesting changes for the macOS installer integrity path. This PR changes miners/macos/rustchain_mac_miner_v2.5.py by updating the default NODE_URL to https://rustchain.org, which changes the miner artifact bytes. setup_miner.py still expects the old Darwin artifact SHA-256 e50cea51a24c8c0337e340287a05e6431f6d95883ab913a1a79c19e99bc03dd8.
Hash evidence on this PR head:
python -c "import hashlib, pathlib; p=pathlib.Path('miners/macos/rustchain_mac_miner_v2.5.py'); print(hashlib.sha256(p.read_bytes()).hexdigest()); print(p.stat().st_size)"
# 1ea8d6eb68326761cd7fdd96c9bea04d1c06f72b12a8c2c552bc1d227be077f9
# 25553
git show origin/main:miners/macos/rustchain_mac_miner_v2.5.py | python -c "import sys,hashlib; data=sys.stdin.buffer.read(); print(hashlib.sha256(data).hexdigest()); print(len(data))"
# e50cea51a24c8c0337e340287a05e6431f6d95883ab913a1a79c19e99bc03dd8
# 25552
After this lands, setup_miner.py will download https://raw.githubusercontent.com/Scottcjn/Rustchain/main/miners/macos/rustchain_mac_miner_v2.5.py, compute 1ea8d6eb..., compare it to the stale expected e50cea51..., and raise Downloaded miner SHA-256 mismatch for Darwin users.
Please update the Darwin entry in setup_miner.py to the new macOS miner SHA-256, or add a test that keeps the installer artifact hashes synchronized with the checked-in miner files.
Validation run:
git diff --check origin/main...HEAD -- miners/macos/rustchain_mac_miner_v2.5.py sdk/python/README.md sdk/python/rustchain_sdk/__init__.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/tests/test_client.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.py
python -B -m py_compile miners/macos/rustchain_mac_miner_v2.5.py sdk/python/rustchain_sdk/__init__.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/tests/test_client.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.py
python -B -m pytest -q tests/test_tls_config.py --tb=short
PYTHONPATH=sdk/python python -B -m pytest -q sdk/python/rustchain_sdk/tests/test_client.py --tb=short
Result: diff check clean, py_compile clean, TLS config tests 4 passed. SDK client tests could not collect in this environment because httpx is missing.
|
Addressed the macOS installer hash blocker in commit What changed:
TDD/validation:
Note: the existing all-platform setup miner artifact test still encounters the older Linux mismatch until #5510 is merged/rebased; this PR only fixes the new macOS mismatch introduced by the macOS default URL change. |
ZacharyZhang-NY
left a comment
There was a problem hiding this comment.
Follow-up review on current head e49d26f.
Approved for the macOS installer hash blocker I raised earlier. The Darwin SHA-256 in setup_miner.py now matches the modified miners/macos/rustchain_mac_miner_v2.5.py artifact bytes, and the new focused macOS artifact-pin regression passes.
Verification:
python -c "import hashlib, pathlib, setup_miner; p=pathlib.Path('miners/macos/rustchain_mac_miner_v2.5.py'); print(hashlib.sha256(p.read_bytes()).hexdigest()); print(setup_miner.MINER_ARTIFACTS['Darwin']['sha256'])"
# 1ea8d6eb68326761cd7fdd96c9bea04d1c06f72b12a8c2c552bc1d227be077f9
# 1ea8d6eb68326761cd7fdd96c9bea04d1c06f72b12a8c2c552bc1d227be077f9
git diff --check origin/main...HEAD -- miners/macos/rustchain_mac_miner_v2.5.py sdk/python/README.md sdk/python/rustchain_sdk/__init__.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/tests/test_client.py sdk/python/test_rustchain_sdk.py setup_miner.py tests/test_setup_miner_downloads.py tests/test_tls_config.py
python -B -m py_compile miners/macos/rustchain_mac_miner_v2.5.py sdk/python/rustchain_sdk/__init__.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/tests/test_client.py sdk/python/test_rustchain_sdk.py setup_miner.py tests/test_setup_miner_downloads.py tests/test_tls_config.py
python -B -m pytest -q tests/test_setup_miner_downloads.py::test_setup_miner_pins_current_macos_artifact tests/test_tls_config.py --tb=short
Result: diff check clean, py_compile clean, macOS artifact focused test plus TLS config tests 5 passed.
Context for maintainers: the full tests/test_setup_miner_downloads.py file still reports the existing Linux artifact pin mismatch (9475fe15... expected vs 91815ecf... current file hash). That path is covered by the separate Linux setup-miner hash PR, so this follow-up clears the macOS regression introduced by this branch.
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Great work on this PR. 🚀
TJCurnutte
left a comment
There was a problem hiding this comment.
Verified this default-node cleanup.
What I checked at head e49d26f7da0b2bf3fff67403dfae0398d224fec8:
git diff --check origin/main...HEADpassed for the full PR diff.python3 -B -m py_compile sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/__init__.py miners/macos/rustchain_mac_miner_v2.5.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.py setup_miner.py tests/test_setup_miner_downloads.pypassed.PYTHONPATH=node:. python3 -B -m pytest -q -o addopts='' --noconftest tests/test_tls_config.pypassed with4 passed in 0.05s.PYTHONPATH=sdk/python uv run --no-project --with pytest --with pytest-asyncio --with respx --with httpx --with cryptography --with pynacl python -B -m pytest -q -o addopts='' --noconftest sdk/python/rustchain_sdk/tests/test_client.pypassed with20 passed in 0.15s.- Runtime probe confirmed
DEFAULT_NODE_URL=https://rustchain.org,RustChainClient()._base_url=https://rustchain.org, and_tls_verify=True. - The changed macOS miner artifact hash in
setup_miner.pymatches the updated Darwin miner file. The same hash probe still shows an unrelated/base-side Linux hash mismatch, but the Darwin hash touched by this PR is correct. python3 tools/bcos_spdx_check.py --base-ref origin/mainreturnedBCOS SPDX check: OK.
The SDK and macOS miner defaults now move off the raw IP and onto the TLS-valid public domain while preserving explicit override paths and TLS verification. Looks good to merge.
kekehanshujun
left a comment
There was a problem hiding this comment.
I reviewed the SDK default-node migration. Centralizing the public default as DEFAULT_NODE_URL = https://rustchain.org keeps the Python client and CLI aligned, and the TLS regression test checks that public surfaces no longer default to the raw node IP.
This also preserves explicit custom base_url/--node behavior. I do not see a blocker in this patch.
Fixes #2283.
Summary
https://rustchain.orgValidation
PYTHONPATH=node:. python3 -B -m pytest -q tests/test_tls_config.py --noconftest-> 4 passedPYTHONPATH=sdk/python uv run --no-project --with pytest --with pytest-asyncio --with respx --with httpx --with cryptography --with pynacl python -B -m pytest -q sdk/python/rustchain_sdk/tests/test_client.py --noconftest-> 20 passedpython3 -B -m py_compile sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/__init__.py miners/macos/rustchain_mac_miner_v2.5.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.pygit diff --check -- miners/macos/rustchain_mac_miner_v2.5.py sdk/python/README.md sdk/python/rustchain_sdk/__init__.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/tests/test_client.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.pypython3 tools/bcos_spdx_check.py --base-ref origin/main-> BCOS SPDX check: OKrg -n "https://50\\.28\\.86\\.131" miners/macos/rustchain_mac_miner_v2.5.py sdk/python/README.md sdk/python/rustchain_sdk/__init__.py sdk/python/rustchain_sdk/cli.py sdk/python/rustchain_sdk/client.py sdk/python/rustchain_sdk/tests/test_client.py sdk/python/test_rustchain_sdk.py tests/test_tls_config.py || true-> no remaining matches in touched files