Repository navigation
fix(pow): LWMA bootstrap resets to a realistic difficulty (v30.3.1) - #2
Merged
Merged
Conversation
Reported by Andy (sha256-mining.shears.co.uk) reviewing v30.3.0: resetting to powLimit (diff ~0.004) for the first N post-fork blocks lets whoever mines at the fork grind ~300 near-free blocks (~150k PERBUG) in minutes before LWMA converges. Reset instead to a realistic level — powLimit / nLwmaStartDifficulty (default 40000, ~1.3 TH/s @ 2.5-min blocks) — a ~150x drop from the stuck 6.4M so the chain still unsticks immediately, but LWMA takes over from a sane point. Also move the fork height 75730 -> 75760 so no node still on v30.3.0 (which has the diff-1 bootstrap) activates the old rule; everyone rebuilds to v30.3.1 first. (Andy's optional LWMA future-time-limit tightening is a sensible follow-up.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hi9Fj21YnCdsu73fPDkw6o
This file contains hidden or 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
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.
Follow-up to #1, from Andy's (sha256-mining.shears.co.uk) review.
Bug: the v30.3.0 bootstrap resets difficulty to
powLimit(diff ~0.004) for the first 90 post-fork blocks. At diff-1 a single ~1.2 TH/s miner finds ~240 blocks in the first minute, and it takes ~400 blocks for LWMA to climb back to the real level — so the miner present at the fork pockets ~300 extra blocks (~150k PERBUG) in minutes. Bad look for a revival, and a rented-hashrate hopper could grab it.Fix: reset to a realistic level instead —
powLimit / nLwmaStartDifficulty(default 40000, ~1.3 TH/s @ 2.5-min blocks). Still a ~150x drop from the stuck 6.4M, so the chain unsticks immediately, but LWMA converges from a sane point instead of from near-zero.Also: move the fork height 75730 → 75760 so nobody still on v30.3.0 (diff-1 bootstrap) activates the old rule — everyone rebuilds to v30.3.1 first.
Unit test updated (
pow_tests/lwma_difficulty): bootstrap now expects the start-difficulty bits. Andy's optional future-time-limit tightening is a sensible follow-up (kept separate).Ships as v30.3.1; Andy offered to test before tagging.