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

Apply LWMA algo with diff adjustiment trait #971

Merged
merged 1 commit into from
Nov 6, 2019
Merged

Apply LWMA algo with diff adjustiment trait #971

merged 1 commit into from
Nov 6, 2019

Conversation

SWvheerden
Copy link
Collaborator

Description

This PR adds in a difficulty adjustment algorithm.

Motivation and Context

We need to adjust the difficulty per block. This PR adds the LWMA algorithm as per zawy12/difficulty-algorithms#3
This should be proficient for early testnet versions.

How Has This Been Tested?

Added unit test testing for changes in the algorithm.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)S
  • 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
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

base_layer/core/src/proof_of_work/lwma.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@CjS77 CjS77 left a comment

Choose a reason for hiding this comment

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

Looks good; a few things for readability and then we can merge

base_layer/core/src/proof_of_work/lwma_diff.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma_diff.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma_diff.rs Outdated Show resolved Hide resolved
base_layer/core/src/proof_of_work/lwma_diff.rs Outdated Show resolved Hide resolved
This PR adds in a difficulty adjustment algorithm.

Motivation and Context

We need to adjust the difficulty per block. This PR adds the LWMA
algorithm as per zawy12/difficulty-algorithms#3
Copy link
Collaborator

@CjS77 CjS77 left a comment

Choose a reason for hiding this comment

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

LGTM

CjS77 added a commit that referenced this pull request Nov 6, 2019
Merge pull request #971

We need to adjust the difficulty per block. This PR adds the LWMA
algorithm as per zawy12/difficulty-algorithms#3
@CjS77 CjS77 merged commit 9725a1b into development Nov 6, 2019
@CjS77 CjS77 deleted the SW_LWMA branch November 6, 2019 12:13
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