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

Correct a comment and an error #358

Merged
merged 5 commits into from
Apr 25, 2024
Merged

Correct a comment and an error #358

merged 5 commits into from
Apr 25, 2024

Conversation

open-junius
Copy link
Contributor

@open-junius open-junius commented Apr 23, 2024

fixes #342

Description

Find out an wrong error type and wrong comment.

Related Issue(s)

  • No

Type of Change

  • 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 not work as expected)
  • Documentation update
  • Other (please describe):

Breaking Change

If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if applicable)

Please include any relevant screenshots or GIFs that demonstrate the changes made.

Additional Notes

Please provide any additional information or context that may be helpful for reviewers.

@open-junius open-junius requested review from sam0x17 and a team April 23, 2024 14:22
@open-junius open-junius self-assigned this Apr 23, 2024
@sam0x17 sam0x17 requested a review from a team April 23, 2024 16:41
@@ -517,7 +517,7 @@ impl<T: Config> Pallet<T> {
}
}

// Performs the burn adjustment by multiplying the current difficulty by the ratio ( reg_actual + reg_target / reg_target * reg_target )
// Performs the burn adjustment by multiplying the current burn by the ratio ( reg_actual + reg_target / reg_target * reg_target )
// We use I110F18 to avoid any overflows on u64. Also min_burn and max_burn bound the range.
//
pub fn adjust_burn(
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, the function name is off: It doesn't adjust anything, just returns updated value. Maybe we should rename it too? Something like get_upgated_burn is more accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, the function doesn't update anything. just calculate the burn to be adjusted.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes let's do the rename then, could just be upgraded_burn

@@ -517,7 +517,7 @@ impl<T: Config> Pallet<T> {
}
}

// Performs the burn adjustment by multiplying the current difficulty by the ratio ( reg_actual + reg_target / reg_target * reg_target )
// Performs the burn adjustment by multiplying the current burn by the ratio ( reg_actual + reg_target / reg_target * reg_target )
Copy link
Contributor

Choose a reason for hiding this comment

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

Is updated burn calculated correctly? Why is there "target_registrations_per_interval + target_registrations_per_interval" in the code (addition vs. multiplication)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right. according to code, it should be addition. will update it also

@sam0x17 sam0x17 self-requested a review April 25, 2024 03:53
@open-junius open-junius requested a review from gztensor April 25, 2024 05:08
@open-junius open-junius merged commit d44ea6e into development Apr 25, 2024
8 checks passed
@sam0x17 sam0x17 deleted the fix-wrong-comments branch April 25, 2024 15:50
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.

Issue setting up a node to run on testnet
3 participants