Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some checks when trying to join the same pool already joined #18822

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

emlowe
Copy link
Contributor

@emlowe emlowe commented Nov 5, 2024

Currently, if you are farming to a pool, and you join that same pool again, those transactions are merrily carried out on the chain even though this changes nothing for your farming.
Previous version would throw a cryptic error which was also a problem

This PR checks before creating any spends if the join pool URL is the same as the current pool URL
Fixes #7292

@emlowe emlowe added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Nov 5, 2024
@emlowe emlowe closed this Nov 5, 2024
@emlowe emlowe reopened this Nov 5, 2024
Copy link

coveralls-official bot commented Nov 6, 2024

Pull Request Test Coverage Report for Build 11716290246

Details

  • 64 of 69 (92.75%) changed or added relevant lines in 4 files are covered.
  • 39 unchanged lines in 9 files lost coverage.
  • Overall coverage increased (+0.03%) to 90.962%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/cmds/plotnft_funcs.py 7 12 58.33%
Files with Coverage Reduction New Missed Lines %
chia/full_node/pending_tx_cache.py 1 96.55%
chia/cmds/plotnft_funcs.py 1 17.52%
chia/wallet/util/wallet_sync_utils.py 1 86.07%
chia/wallet/wallet_node.py 4 88.18%
chia/full_node/weight_proof.py 4 90.48%
chia/server/ws_connection.py 4 88.1%
chia/server/address_manager.py 5 90.48%
chia/full_node/full_node.py 7 85.9%
chia/server/node_discovery.py 12 79.45%
Totals Coverage Status
Change from base Build 11710907999: 0.03%
Covered Lines: 102969
Relevant Lines: 112961

💛 - Coveralls

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Dec 5, 2024
Copy link
Contributor

github-actions bot commented Dec 5, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

@emlowe emlowe marked this pull request as ready for review December 6, 2024 16:14
@emlowe emlowe requested a review from a team as a code owner December 6, 2024 16:14
await time_out_assert(45, status_is_farming_to_pool, True, wallet_id)

# Test joining the same pool via the RPC client
with pytest.raises(ValueError, match="Already farming to pool"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs an import as well.

Suggested change
with pytest.raises(ValueError, match="Already farming to pool"):
with pytest.raises(ResponseFailureError, match="Already farming to pool"):

@@ -1020,3 +1022,48 @@ async def status_is_leaving_no_blocks() -> bool:

# Eventually, leaves pool
assert await status_is_farming_to_pool()

@pytest.mark.anyio
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this isn't WalletTestFramework?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nothing in this file was using WalletTestFramework at the time, so I followed the conventions here. But I think your question is a good one and I'll look to convert it to use the newer concepts

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Dec 12, 2024
Copy link
Contributor

This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed by the relevant parties.

@github-actions github-actions bot added the stale-pr Flagged as stale and in need of manual review label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog merge_conflict Branch has conflicts that prevent merge to main stale-pr Flagged as stale and in need of manual review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unfriendly error message when joining pool already joined: "'NoneType' object is not iterable".
3 participants