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

Remove SQRT from accumulated difficulty #2380

Merged

Conversation

SWvheerden
Copy link
Collaborator

@SWvheerden SWvheerden commented Oct 23, 2020

Description

Remove the SQRT from the difficulty only using the squared results.

Motivation and Context

We remove the SQRT as this looses resolution due to rounding to u64.

How Has This Been Tested?

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.

@SWvheerden SWvheerden changed the base branch from development to v0.6 October 23, 2020 15:06
@@ -160,7 +160,7 @@ impl BlockHeader {
/// Calculates the total accumulated difficulty for the blockchain from the genesis block up until (and including)
/// this block.
pub fn total_accumulated_difficulty_inclusive_squared(&self) -> Result<u128, PowError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method can probably be removed entirely

@stringhandler stringhandler merged commit f041d9e into tari-project:v0.6 Oct 26, 2020
@SWvheerden SWvheerden changed the title remove sqrt from accumulated difficulty Remove SQRT from accumulated difficulty Oct 26, 2020
@SWvheerden SWvheerden deleted the sw_change_accumulated_dif branch November 26, 2020 13:19
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.

None yet

2 participants