You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(rpc): stop eagerly future-dating Testnet getblocktemplate timestamps
On Testnet, `getblocktemplate` switched to a minimum-difficulty block
template `2 * PoWTargetSpacing` (150s) before the consensus
minimum-difficulty threshold, clamping `cur_time` up to just past the
threshold. This future-dated the block's timestamp and produced spurious
minimum-difficulty blocks that depress Testnet difficulty far below its
equilibrium. Switch to a minimum-difficulty template only once `cur_time`
reaches the consensus threshold itself.
This is a Testnet-only, template-construction (non-consensus) change: it
does not alter block validity, and it does not change the
difficulty-averaging rule that amplifies each minimum-difficulty block
into a large difficulty drop (tracked in zcash/zips#1321). The now-unused
public constant `EXTRA_TIME_TO_MINE_A_BLOCK` is removed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(state, rpc): cover the Testnet getblocktemplate minimum-difficulty adjustment
Add deterministic, fixed-clock unit tests for
`adjust_difficulty_and_time_for_testnet`, which previously had no direct
coverage:
- a candidate time inside the old eager window (previous + 300 .. + 450)
stays standard difficulty and is not future-dated;
- a candidate time past previous + 450 switches to minimum difficulty;
- the gap is a strict `>` (previous + 450 is standard, + 451 is minimum);
- the adjustment is a no-op on Mainnet and below the Testnet
minimum-difficulty start height.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit acaf1e1)
* docs(state): clarify the stale clamp comment in the Testnet min-difficulty adjustment
The "We don't need to undo the clamping here" comment referred to the caller's
`cur_time.clamp(min_time, max_time)` in `difficulty_time_and_history_tree`, but
#5925 later added internal `.clamp` calls directly below it without updating the
comment, so it read as though it described those. Reword it to name its real
referent and explain why the caller's clamp needs no undoing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Fix CHANGELOG typo
Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
0 commit comments