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

Boost mining speeds #2539

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

dunnock
Copy link
Contributor

@dunnock dunnock commented Jan 17, 2021

Description

This PR improves miner application:

  • Improved early mining restart logic: when mine_on_tip_only option is set miner will exit if node is reporting that current height is already taken by another block (tip).
  • Improved mining restart logic, to start new threads in parallel with closing down previous threads.
  • Implement own sha3 hashing logic, which caches hash product before nonce, accounting for timestamp changes too. Gives boost on mining +50%.

Motivation and Context

This should improve mining speeds as well as lower down wasted mining power.

How Has This Been Tested?

Run locally with 2 disconnected nodes and a wallet.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I ran cargo test successfully before submitting my PR.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@dunnock dunnock force-pushed the mining-early-restart branch 3 times, most recently from 87ab5f8 to ff16b65 Compare January 19, 2021 17:08
@dunnock dunnock changed the title [WIP] Boost mining speeds Boost mining speeds Jan 19, 2021
@dunnock dunnock force-pushed the mining-early-restart branch 3 times, most recently from 0832359 to e4f0cbf Compare January 19, 2021 17:24
Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

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

Please see my comments about the config files. I know it is a bit confusing, and on our TODO list to fix/consolidate the config files. This is the current state:

  • tari_sample.toml has minimal settings for all Tari executables, but is not really used in our official releases
  • windows.toml is used to create the Windows installer, and apart from the path separators identical to tari_config_example.toml
  • tari_config_example.toml is used to create the OSX and Ubuntu installation tarbals, and apart from the path separators identical to windows.toml

Improved mining restart logic, to start new threads in parallel with closing down previous threads.
Implement own sha3 hashing logic, which caches hash product before nonce, accounting for timestamp changes too. Gives boost on mining +50%.
Decrease dependency on tari_core
Improved configs by @hansieodendaal comments.
@dunnock
Copy link
Contributor Author

dunnock commented Jan 20, 2021

Please see my comments about the config files. I know it is a bit confusing, and on our TODO list to fix/consolidate the config files. This is the current state:

  • tari_sample.toml has minimal settings for all Tari executables, but is not really used in our official releases
  • windows.toml is used to create the Windows installer, and apart from the path separators identical to tari_config_example.toml
  • tari_config_example.toml is used to create the OSX and Ubuntu installation tarbals, and apart from the path separators identical to windows.toml

Cool, thank you, this is clear now, I definitely put settings in a wrong file. Should be fixed now

Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

Tested and working great!

@stringhandler stringhandler merged commit c5cf3a7 into tari-project:development Jan 20, 2021
@dunnock dunnock deleted the mining-early-restart branch January 20, 2021 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants