Correct a comment and an error#358
Conversation
pallets/subtensor/src/block_step.rs
Outdated
| // 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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
yes, the function doesn't update anything. just calculate the burn to be adjusted.
There was a problem hiding this comment.
yes let's do the rename then, could just be upgraded_burn
pallets/subtensor/src/block_step.rs
Outdated
| } | ||
|
|
||
| // 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 ) |
There was a problem hiding this comment.
Is updated burn calculated correctly? Why is there "target_registrations_per_interval + target_registrations_per_interval" in the code (addition vs. multiplication)?
There was a problem hiding this comment.
you are right. according to code, it should be addition. will update it also
fixes #342
Description
Find out an wrong error type and wrong comment.
Related Issue(s)
Type of Change
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
cargo fmtandcargo clippyto ensure my code is formatted and linted correctlyScreenshots (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.