-
Notifications
You must be signed in to change notification settings - Fork 296
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
[release-v1.7] blockchain: Enforce testnet difficulty throttling. #2979
Merged
davecgh
merged 3 commits into
decred:blockchain_v4
from
davecgh:rel17_blockchain_enforce_testnet_diff_throttling
Aug 3, 2022
Merged
[release-v1.7] blockchain: Enforce testnet difficulty throttling. #2979
davecgh
merged 3 commits into
decred:blockchain_v4
from
davecgh:rel17_blockchain_enforce_testnet_diff_throttling
Aug 3, 2022
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
davecgh
force-pushed
the
rel17_blockchain_enforce_testnet_diff_throttling
branch
from
August 2, 2022 12:20
5d7ebd0
to
3387e4e
Compare
This updates to the following Github Actions: - actions/setup-go@f6164bd #v3.0.0 - actions/checkout@a12a394 #v3.0.0 It also updates golangci-lint to 1.45.2 and also to use the latest recommended installation method and corrects the issues the updated version identified.
davecgh
force-pushed
the
rel17_blockchain_enforce_testnet_diff_throttling
branch
from
August 2, 2022 12:29
3387e4e
to
5d2cba5
Compare
alexlyp
approved these changes
Aug 2, 2022
matheusd
reviewed
Aug 2, 2022
davecgh
force-pushed
the
rel17_blockchain_enforce_testnet_diff_throttling
branch
from
August 2, 2022 19:34
5d2cba5
to
c5a5e20
Compare
matheusd
approved these changes
Aug 2, 2022
This makes the calcNextRequiredDifficulty method a little more consistent with the code in terms of the name of the parameter and using a shorter local convenience var to avoid overly long lines.
davecgh
force-pushed
the
rel17_blockchain_enforce_testnet_diff_throttling
branch
from
August 3, 2022 00:56
c5a5e20
to
661a630
Compare
Currently, version 3 of the test network implements a minimum difficulty reduction rule that was inherited from btcsuite which intends to act as mechanism to deal with major difficulty spikes due to ASICs which are typically not running testnet and since it's not reasonable to require high-powered hardware to keep the test network running smoothly. Unfortunately, this existing rule is not a particularly good solution in general as it is not very deterministic and introduces additional complications around difficulty selection. It is an even worse solution in the the case of Decred due to its hybrid model. Rather than the aforementioned reactive approach, this introduces more deterministic proactive testnet rules in order limit the type of games that ASICs can play on testnet. In particular, two new rules are introduced that are only imposed started with block height 962928: - A maximum allowed difficulty is now imposed on testnet such that CPU mining will still be feasible without resorting to any type of reactive and more complicated difficulty dropping - Once the maximum allowed difficulty is reached on testnet, blocks must be at least 1 minute apart The combination of these rules will prevent the difficulty on testnet from ever rising to levels that are out of reach for CPUs to continue mining blocks and throttle production in the case of higher-powered hardware such as GPUs and ASICs. It should be noted that this solution is only suitable on a test network where no real monetary value is in play and thus the typical game theory mechanics do not apply. Finally, code to invalidate the existing extremely high work testnet chain which has stalled testnet after that point is added to allow the test network to be recovered without needing to fire up a bunch of ASICs.
davecgh
force-pushed
the
rel17_blockchain_enforce_testnet_diff_throttling
branch
from
August 3, 2022 01:30
661a630
to
0b3e9a9
Compare
chappjc
approved these changes
Aug 3, 2022
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.
This is a backport of the
blockchain
portions of #2978 to the 1.7 release branch.