-
Notifications
You must be signed in to change notification settings - Fork 106
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
fix(rpc): Mine standard and minimum difficulty blocks on testnet #5747
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
teor2345
added
C-bug
Category: This is a bug
P-Medium ⚡
A-rpc
Area: Remote Procedure Call interfaces
A-state
Area: State / database changes
labels
Nov 30, 2022
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5747 +/- ##
==========================================
- Coverage 78.79% 78.71% -0.09%
==========================================
Files 306 306
Lines 38702 38702
==========================================
- Hits 30496 30463 -33
- Misses 8206 8239 +33 |
Failed due to #5384 😭 |
teor2345
force-pushed
the
fix-gbt-time-testnet-min
branch
from
November 30, 2022 23:06
d00578f
to
36f5fb6
Compare
Merged
5 tasks
@Mergifyio update |
☑️ Nothing to do
|
arya2
reviewed
Dec 1, 2022
teor2345
commented
Dec 1, 2022
arya2
approved these changes
Dec 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In PR #5659, I added a check for testnet minimum difficulty blocks. But it accidentally made all the mined blocks on testnet into minimum difficulty blocks.
Depends-On: #5761
Solution
Check if the current time is close to the minimum difficulty time (2 target block intervals). If it is, use a minimum difficulty block. If there is plenty of time, use a standard difficulty block.
Split the testnet adjustment into its own function.
Cleanup some names and constants.
Review
This is a routine bug fix, @oxarbitrage might want to review it.
Reviewer Checklist