Skip to content

Conversation

wallentx
Copy link
Contributor

@wallentx wallentx commented Feb 9, 2025

Purpose:

chia get farm summary currently only returns values for OG plots.
Since the majority of people have long since switched to plotNFT plots, I'm not sure why pooling wallets are being excluded from this calculation.

Current Behavior:

chia rpc wallet get_farmed_amount

{
  "blocks_won": 114,
  "farmed_amount": 96752754128478,
  "farmer_reward_amount": 28500000000000,
  "fee_amount": 2754128478,
  "last_height_farmed": 3810216,
  "last_time_farmed": 1686871581,
  "pool_reward_amount": 68250000000000,
  "success": true
}

chia farm summary

Farming status: Farming
Total chia farmed: 96.752754128478
User transaction fees: 0.002754128478
Block rewards: 96.75
Last height farmed: 3810216
...

New Behavior:

chia rpc wallet get_farmed_amount

{
  "blocks_won": 114,
  "farmed_amount": 284002754128478,
  "farmer_reward_amount": 28500000000000,
  "fee_amount": 2754128478,
  "last_height_farmed": 6609397,
  "last_time_farmed": 1739076254,
  "pool_reward_amount": 255500000000000,
  "success": true
}

chia farm summary

Farming status: Farming
Total chia farmed: 284.002754128478
User transaction fees: 0.002754128478
Block rewards: 284.0
Last height farmed: 6609397
...

Testing Notes:

I don't know if the changed calculations here would result in some negative behavior elsewhere, like in the GUI.

@wallentx wallentx requested a review from a team as a code owner February 9, 2025 23:19
@emlowe
Copy link
Contributor

emlowe commented Feb 20, 2025

It's been that way since the first pools support. My guess is that the idea was those rewards go to the pool, so you shouldn't show them because someone might get confused why the farmed amount isn't in their wallet? But probably no-one has a real good recollection on this

@emlowe emlowe added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Feb 20, 2025
@wjblanke
Copy link
Contributor

wjblanke commented Mar 5, 2025

This will probably break people's scripts if they depend on it. I wouldn't be against a RPC/CLI option to include these numbers, if you are willing to change it to that it would get my approval.

@wallentx
Copy link
Contributor Author

@wjblanke sure!
Do you have any thoughts on how you'd want to differentiate the data by name, and which you'd like to present by default?

The current chia farm summary shows what appears to me to be farmed rewards that do not include the plotNFT plots.. Just OG plots. Like the plots before we had NFT "Pooling" plots.

What are the proper "in-the-code" names we have that differentiate ye olde plots from the newer ones?

This PR as it is currently, seems to display rewards that include OG rewards + plotNFT plot rewards.

For ME, the difference between the Total chia farmed and Block rewards value is that the Block rewards value just looks to be rounded to the nearest hundredth XCH.
I'm not sure if those numbers would ever be different for other people or not, so if this value is redundant, I'm happy to replace the redundant info with something like Blocks since last win or something.

@emlowe
Copy link
Contributor

emlowe commented Mar 18, 2025

I believe the suggestion is as follows:

  • default remains as current code - that is if you type chia farm summary you get the same answer pre and post PR
  • new option (say --include-pool-plots) so you can include those in the chia farm summary report.
  • there is no change to any output labels or any other changes other than totals:

chia farm summary

Farming status: Farming
Total chia farmed: 96.752754128478
User transaction fees: 0.002754128478
Block rewards: 96.75
Last height farmed: 3810216
...

chia farm summary --include-pool-plots

Farming status: Farming
Total chia farmed: 284.002754128478
User transaction fees: 0.002754128478
Block rewards: 284.0
Last height farmed: 6609397
...

@wallentx
Copy link
Contributor Author

I ended up going with -i/--include-pool-rewards, since that seemed to be the most accurate and consistent description with regard to the code.
I also included some additional detail output that is relevant to pool-rewards, and only shows up if using the above flags.

@wallentx wallentx force-pushed the wallentx/plotnft-rewards branch from b082d0d to d365037 Compare April 28, 2025 16:15
Copy link

Pull Request Test Coverage Report for Build 14713451425

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 12 of 21 (57.14%) changed or added relevant lines in 5 files are covered.
  • 14 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.03%) to 91.22%

Changes Missing Coverage Covered Lines Changed/Added Lines %
chia/cmds/farm_funcs.py 6 15 40.0%
Files with Coverage Reduction New Missed Lines %
chia/daemon/server.py 1 84.3%
chia/full_node/full_node_api.py 1 85.3%
chia/rpc/wallet_rpc_api.py 1 90.76%
chia/wallet/wallet_node.py 1 87.82%
chia/full_node/full_node.py 2 87.63%
chia/timelord/timelord.py 2 81.42%
chia/rpc/rpc_server.py 3 88.54%
chia/wallet/wallet_state_manager.py 3 96.96%
Totals Coverage Status
Change from base Build 14670885217: 0.03%
Covered Lines: 100781
Relevant Lines: 110370

💛 - Coveralls

@github-actions github-actions bot added the merge_conflict Branch has conflicts that prevent merge to main label Jun 16, 2025
Copy link
Contributor

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

@wjblanke
Copy link
Contributor

Will can u fight through these import renames. I promise to get it merged after this. Thanks

@wallentx
Copy link
Contributor Author

Will can u fight through these import renames. I promise to get it merged after this. Thanks

Yep, had a baby exactly 1 month ago, and have hardly had time to touch a keyboard since. Will get to this.

@wallentx wallentx force-pushed the wallentx/plotnft-rewards branch from b5b9c19 to 13ed3a6 Compare July 12, 2025 11:57
@github-actions github-actions bot removed the merge_conflict Branch has conflicts that prevent merge to main label Jul 12, 2025
@wallentx
Copy link
Contributor Author

@wjblanke I managed to get working tests, and worked out all the conflicts.

@wallentx wallentx requested a review from wjblanke July 14, 2025 23:37
@wallentx
Copy link
Contributor Author

@wjblanke codecov failing for lack of codecov on a test file 😵‍💫

@jack60612
Copy link
Contributor

@wallentx i reminded @wjblanke

Copy link
Contributor

@jack60612 jack60612 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@wjblanke wjblanke left a comment

Choose a reason for hiding this comment

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

aok! for main

@jack60612
Copy link
Contributor

Approved for merge despite coverage!

@pmaslana pmaslana merged commit 148b813 into Chia-Network:main Aug 1, 2025
513 of 515 checks passed
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 community-pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants