test(setup): lock miner service templates to pass --wallet (#5713) - #8317
Open
jjb9707 wants to merge 1 commit into
Open
test(setup): lock miner service templates to pass --wallet (#5713)#8317jjb9707 wants to merge 1 commit into
jjb9707 wants to merge 1 commit into
Conversation
…5713) The generated systemd units and launchd plists in setup.sh and scripts/install.sh were corrected in PR Scottcjn#5711 to pass the configured wallet on the command line, but nothing guards that. rustchain_linux_miner.py reads the wallet only from --wallet and falls back to LocalMiner._gen_wallet() otherwise, so an environment-only template silently mines under a throwaway wallet. Adds five assertions covering all four generated units. Closes Scottcjn#5713
Contributor
|
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! |
Contributor
Author
|
Reminder: upstream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
miners/linux/rustchain_linux_miner.pytakes the wallet only from the--walletCLI argument (rustchain_linux_miner.py:952,968) andLocalMiner.__init__falls back to_gen_wallet()when it is missing. A generated service that merely exportsWALLET_NAME/RUSTCHAIN_WALLETinto the environment therefore mines under a throwaway wallet — rewards and balance checks never line up with the wallet the user entered during setup.That was issue #5713 and PR #5711 fixed the templates, but the issue is still open and nothing guards the fix. Two contributors have since re-opened work against it (#7880, closed unmerged), so the regression surface is real.
Verified current state on
main(@5a9d6a8)setup.shsystemdExecStartsetup.sh:327setup.shlaunchdProgramArgumentssetup.sh:358-359scripts/install.shsystemdExecStartscripts/install.sh:383scripts/install.shlaunchdProgramArgumentsscripts/install.sh:421-422Change
One new test file,
tests/test_miner_service_wallet_5713.py(no production code touched). Five assertions:ExecStartfor the miner passes--wallet—setup.shandscripts/install.shProgramArgumentscontains--walletfollowed by a non-empty value — both scriptsWALLET_NAME/RUSTCHAIN_WALLETmust also pass--wallet(the exact Miner service templates ignore the configured wallet unless --wallet is passed #5713 shape)The helpers match on
MINER_SCRIPT/MINER_FILENAME/rustchain_linux_miner.pyrather than on fixed variable names, so renaming a shell variable will not silently void the guard.Verification
Ran the tests against the real
maincopies of both scripts, then re-ran them with--walletstripped from all four templates (the pre-#5711 shape), then restored:python -m py_compile tests/test_miner_service_wallet_5713.py-> OK.Closes #5713