tari icon indicating copy to clipboard operation
tari copied to clipboard

feat!: add pool and tari difficulties to sha3 miner and merge mining proxy

Open hansieodendaal opened this issue 5 months ago • 2 comments

Description

  • Added pool and tari difficulties to the p2pool request.
  • In p2pool mode, the SHA3 miner and the merge mining proxy will submit the block to the base node if the achieved difficulty equals or exceeds the Tari target difficulty.
  • Since the SHA3 miner and the merge mining proxy (the latter only if enabled in config) always calculate the achieved difficulty; it is now included in the SubmitBlockRequest as an option so that the local p2pool node does not have to recalculate it if provided.

Edit

  • For the merge mining proxy, evaluate the best block hash to decide if a new tari template must be requested. In re-orgs where the height will be the same as before the re-org, only checking height is insufficient.
  • Added pertinent information to proxy log messages.

Motivation and Context

When implemented fully in sha-p2pool:

  • Improved efficiency overall in submitting blocks to the base node.
  • Improved efficiency for the p2pool node internally when evaluating local blocks.

Edit

  • Many orphans were observed in the Tari blockchain when doing merged mining with sha-p2pool.

How Has This Been Tested?

Currently, all unit and cucumber tests pass as those run without p2pool mode. A combined system-level test is required when this is implemented.

What process can a PR reviewer use to test or verify this change?

Code review.

Breaking Changes

  • [ ] None
  • [ ] Requires data directory on base node to be deleted
  • [ ] Requires hard fork
  • [X] Other - Please specify

BREAKING CHANGE: gRPC SubmitBlockRequest interface change that will impact sha-p2pool.

hansieodendaal avatar Sep 25 '24 07:09 hansieodendaal