Skip to content

fix(pow): LWMA bootstrap resets to a realistic difficulty (v30.3.1) - #2

Merged
Blocklechain merged 1 commit into
masterfrom
fix/lwma-bootstrap
Oct 20, 2026
Merged

Blocklechain merged 1 commit into
masterfrom
fix/lwma-bootstrap

Conversation

@Blocklechain

Copy link
Copy Markdown
Owner

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.

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
@Blocklechain
Blocklechain merged commit 450b7a3 into master Oct 20, 2026
6 of 38 checks passed
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.

1 participant