martomi / chiadog

A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7.
MIT License
457 stars 120 forks source link

Pool Support: Correct handling of partial proofs #252

Closed djdookie closed 3 years ago

djdookie commented 3 years ago

When farming for a pool using the new pool protocol, chiadog triggers hundreds of "found proof" notifications per day, because your farmer finds proofs for partials (low difficulty solutions for a pool) all the time. This gets you a lot of messages by a telegram bot for example. ;)

Suggestion: Teach chiadog to differentiate "normal" proofs from partial proofs and disable partial proof notifications. Daily notifications about partial proofs should be sufficient. Or just make proof notification deactivatale.

rhernaus commented 3 years ago

We could perhaps monitor log for "farmed unfinished_block" instead of "found X proof"

f7byu3e4jn commented 3 years ago

I was so happy when i received this ‘ ℹ️ Chia HARVESTER Found 1 proof(s)!’ message for the first time ever. Almost took my GF out to diner on the spot.

Too bad it was just a false positive, based on the 100’s of additional proof-found messages that came in afterwards 😃

ZwaZo22 commented 3 years ago

+1 here - Chiadog used to be discreet but with the partial proof found notifications, it is barking so much that my Telegram bot is now spammed ;)

I believe that the partial proofs could be simply mentionned in the daily report.

martomi commented 3 years ago

Until we have changed the default behaviour, you can comment / delete this line:

https://github.com/martomi/chiadog/blob/429b90cf2d3f74a885d4ffcb748fb63b1521e48b/src/chia_log/handlers/harvester_activity_handler.py#L30

djdookie commented 3 years ago

Thanks. This seems to work fine for a temporary solution.

springjools commented 3 years ago

I was thinking of just counting the partial proofs and report them daily. That shouldn't be hard to code

kilbot commented 3 years ago

The very next log event after a partial proof should contain something like Submitting partial for XXX to https://pool.url. So additional checker will be needed for this.

Then a special exception needs to be put into the activity handler which waits to append the Proof event until the next line has been checked.

I believe @springjools has volunteered for the pull request 😜

springjools commented 3 years ago

I'll try, but it's 28 °C outside and inside so my brains works slowly

kilbot commented 3 years ago

One thing: I'm not sure if the farmer submits a partial to the pool if the proof actually creates a new block. Unfortunately I would have to wait checks notes .. 1 year and 10 months before I could confirm that in my logs.

Perhaps someone can get hold of the logs for a block forming proof so we can compare?

btbamman989 commented 3 years ago

The very next log event after a partial proof should contain something like Submitting partial for XXX to https://pool.url. So additional checker will be needed for this.

Then a special exception needs to be put into the activity handler which waits to append the Proof event until the next line has been checked.

I believe @springjools has volunteered for the pull request stuck_out_tongue_winking_eye

@kilbot One thing you may want to think about is that if a user is using DEBUG as their log level then the Submitting partial for XXX to https://pool.url would not be the next line after the found proof log entry. So that might change the logic you were going to use if you were going to just look at the next line for text.

pieterhelsen commented 3 years ago

Could someone please post some log files with partials (preferably in debug mode as @btbamman989 suggested)

kilbot commented 3 years ago

Logging level INFO is required for Chiadog to work at the moment.

okkar commented 3 years ago
Harvester and farmer logs in INFO mode from the one minute with 3 partials ``` grep -E "2021-07-12T04:17:" mainnet/log/debug.log | grep -E "chia.harvester.harvester|chia.farmer.farmer" 2021-07-12T04:17:03.158 harvester chia.harvester.harvester: INFO 2 plots were eligible for farming a34de8c137... Found 0 proofs. Time: 0.35711 s. Total 570 plots 2021-07-12T04:17:12.054 harvester chia.harvester.harvester: INFO 2 plots were eligible for farming a34de8c137... Found 1 proofs. Time: 0.90075 s. Total 570 plots 2021-07-12T04:17:12.083 farmer chia.farmer.farmer : INFO Submitting partial for <> to https://asia1.pool.space 2021-07-12T04:17:12.617 farmer chia.farmer.farmer : INFO Pool response: {'new_difficulty': 1} 2021-07-12T04:17:22.544 harvester chia.harvester.harvester: INFO 2 plots were eligible for farming a34de8c137... Found 2 proofs. Time: 2.25946 s. Total 570 plots 2021-07-12T04:17:22.576 farmer chia.farmer.farmer : INFO Submitting partial for <> to https://asia1.pool.space 2021-07-12T04:17:22.592 farmer chia.farmer.farmer : INFO Submitting partial for <> to https://asia1.pool.space 2021-07-12T04:17:22.876 farmer chia.farmer.farmer : INFO Pool response: {'new_difficulty': 1} 2021-07-12T04:17:23.126 farmer chia.farmer.farmer : INFO Pool response: {'new_difficulty': 1} 2021-07-12T04:17:30.144 harvester chia.harvester.harvester: INFO 1 plots were eligible for farming a34de8c137... Found 0 proofs. Time: 0.16493 s. Total 570 plots 2021-07-12T04:17:41.789 harvester chia.harvester.harvester: INFO 0 plots were eligible for farming a34de8c137... Found 0 proofs. Time: 0.13492 s. Total 570 plots 2021-07-12T04:17:49.748 harvester chia.harvester.harvester: INFO 0 plots were eligible for farming a34de8c137... Found 0 proofs. Time: 0.14340 s. Total 570 plots 2021-07-12T04:17:58.439 harvester chia.harvester.harvester: INFO 1 plots were eligible for farming a34de8c137... Found 0 proofs. Time: 0.29906 s. Total 570 plots ```
schui95 commented 3 years ago

The very next log event after a partial proof should contain something like Submitting partial for XXX to https://pool.url. So additional checker will be needed for this. Then a special exception needs to be put into the activity handler which waits to append the Proof event until the next line has been checked. I believe @springjools has volunteered for the pull request stuck_out_tongue_winking_eye

@kilbot One thing you may want to think about is that if a user is using DEBUG as their log level then the Submitting partial for XXX to https://pool.url would not be the next line after the found proof log entry. So that might change the logic you were going to use if you were going to just look at the next line for text.

Interesting option.. the logfile wouldn't get too verbose if using DEBUG mode?

kilbot commented 3 years ago

Thanks for the log, @okkar, that's helpful. And I see what you are saying now, @btbamman989, scanning multiple lines is not going to work because it can be inconsistent. So, I'm changing my suggestion to:

Is anyone lucky enough to have farmed a block for a pool so we can confirm that log message?

springjools commented 3 years ago

I agree with the above suggestions, it's better than what I was going to suggest, which was to make an own counter from scratch

kanasite commented 3 years ago

I have a work-in-progress implementation with parsing Farmed block and submitting partial

https://github.com/kanasite/chiadog/tree/farming-log

kanasite commented 3 years ago

I have a work-in-progress implementation with parsing Farmed block and submitting partial

https://github.com/kanasite/chiadog/tree/farming-log

the default behavior proof/partial notification will be disabled

kanasite commented 3 years ago

example of daily stats:

ℹ️ Chia DAILY Hello farmer! 👋 Here's what happened in the last 12 hours:

Received ☘️: 0.0000005 XCH Proofs 🧾: 100 found! Search 🔍:

schui95 commented 3 years ago

example of daily stats:

Chia DAILY Hello farmer! Here's what happened in the last 12 hours:

Received : 0.0000005 XCH Proofs : 100 found! Search :

  • average: 0.53s over 3694 searches
  • over 5s: 0 occasions (0.0%)
  • over 15s: 0 occasions (0.0%) Plots seedling: 1524 Eligible plots 1st_place_medal: 2.95 average Skipped SPs warning: 2 (0.05%) Partials submitted receipt: 100! Blocks package: None

Is it ready to test it on a live environment?

kanasite commented 3 years ago

I added for my own usage, then it came across make me thinking if Submitting partial is worth noting since it's not much different from a found proof.

kilbot commented 3 years ago

Keep in mind that some people will be solo farming plus pool farming (possible to multiple pools). I agree that there is no point duplicating information, but we also want to make sure important debugging info is surfaced.

I'm still unsure how blocks created should be handled. This is something that I'm sure most farmers will want to know about the most, eg: if a block has been created and whether is it solo or submitted to the pool. It would be great to get some logs for these situations.

How about something like:

chia DAILY
Hello farmer! Here's what happened in the last 24 hours:

Received : 0.0000005 XCH
Proofs : 100 found!
     - 58 partials submitted to pool.url
     - 42 partials submitted to pool2.url
     - 0 blocks created
Search : 
     - average: 0.20s over 9332 searches
     - over 5s: 144 occasions (1.5%)
     - over 15s: 0 occasions (0.0%)
Plots : 1524
Eligible plots : 0.21 average
Skipped SPs : 11 (0.12%)
martomi commented 3 years ago

@kanasite did a great job on a first shot at implementing this. Please check out his PR here: https://github.com/martomi/chiadog/pull/268

Further feedback and testing would be appreciated there.

martomi commented 3 years ago

The release 0.7.0 including this change is now out!

ZwaZo22 commented 3 years ago

Great job! Thanks a lot!!!