Fix install dry-run side effects#6348
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! |
MolhamHamwi
left a comment
There was a problem hiding this comment.
I reviewed install.sh in this PR and ran bash -n install.sh plus bash install.sh --dry-run locally on macOS; the early dry-run path now exits cleanly before the installer reaches prompts/downloads.
Two technical observations:
-
The dry-run fix duplicates the OS-to-miner/fingerprint mapping at lines 73-91 while the real install path keeps the same mapping again later around lines 124-137. That makes the behavior correct today, but it creates a drift risk: adding/changing a platform or miner path later would need to update both blocks or
--dry-runcould preview a different artifact than the real installer downloads. A small helper/shared case block would make this safer. -
The PR contains an unrelated first commit touching
node/ergo_raw_tx.pyandtests/test_ergo_raw_tx.py, while the PR title/body only describeinstall.sh --dry-run. Even though the Ergo JSON hardening looks reasonable, merging it together with the installer fix makes review/rollback harder and could accidentally close the dry-run issue with extra behavior bundled in.
I received RTC compensation for this review.
shadow88sky
left a comment
There was a problem hiding this comment.
Reviewed the installer dry-run change plus the bundled Ergo raw-tx hardening commit.
Validation performed locally:
bash install.sh --dry-run
# exits 0 and prints OS/architecture/miner/fingerprint/checksum/wallet/node/silent plan without prompts or downloads
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest tests/test_ergo_raw_tx.py -q
12 passed
.venv/bin/python -m py_compile node/ergo_raw_tx.py tests/test_ergo_raw_tx.py
passed
Two concrete observations:
-
The installer fix is in the right place for the stated issue: the new early
DRY_RUNbranch runs immediately after argument parsing, before the banner, prompts, install-directory creation, or download path. That avoids the side effects the old late dry-run check could still trigger. -
The Ergo JSON parsing hardening is also reasonable on its own.
response_json_object()/response_json_list()prevent non-object or non-list API responses from leaking into wallet box, node height, and signing logic, and the new tests cover malformed unspent-box responses plus non-object signed transactions.
Non-blocking cleanup suggestion: the PR title only mentions install dry-run side effects, while the diff also contains node/ergo_raw_tx.py and tests/test_ergo_raw_tx.py. If this is intentional, retitling the PR to mention both changes would make review/merge history clearer; otherwise the Ergo commit would be cleaner as a separate PR.
I received RTC compensation for this review.
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
minyanyi
left a comment
There was a problem hiding this comment.
Reviewed the install dry-run change and the Ergo raw transaction response hardening.
Validation performed:
python -B -m pytest -q tests/test_ergo_raw_tx.py --tb=short-> 12 passed, 1 warningpython -B -m py_compile node/ergo_raw_tx.py tests/test_ergo_raw_tx.py-> passedgit diff --check origin/main...HEAD-> passedbash -n install.sh-> passedbash install.sh --dry-run --wallet test-walleton Windows/MSYS exits as unsupported OS before side effects, which is consistent with the script's Linux/Darwin support gate
No blocking issues found. I received RTC compensation for this review.
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
jaxint
left a comment
There was a problem hiding this comment.
Great work! Thanks for contributing to RustChain! 🦀
Fixes #6346.\n\nThis moves the dry-run handling to immediately after argument parsing, so
bash install.sh --dry-runexits before GPU/Python checks, pip installs, wallet prompts, mkdir/downloads, or other side effects.\n\nValidation:\n-bash -n install.sh\n-timeout 5 bash install.sh --dry-run(prints preview and exits without prompting)