Skip to content

Regtest block time advances ~90 minutes per block, outrunning a following zcashd sidecar #200

Description

@arya2

When building a block template, cur_time is unconditionally clamped to [median-time-past + 1, median-time-past + 90 min]:

let cur_time = cur_time.clamp(min_time, max_time);

A fresh regtest chain starts from the 2011-era genesis, so real time is always far above the clamp ceiling and every mined block gets pinned to median-time-past + 90 min — chain time advances ~90 minutes per block regardless of real time. After roughly 40 blocks, the block timestamps exceed a following zcashd's future-block window and it rejects them ("timestamp ... too far ahead of local time"), stalling its sync. zcashd's own regtest miner advances block time minimally instead.

Regtest-only; no mainnet impact (on mainnet the clamp is the correct consensus behavior, since real time and chain time agree). Like the regtest difficulty issue, this blocks any sidecar test flow that mines ~40+ blocks.

Reproduce: mine ~45 regtest blocks on zakurad with a zcashd sidecar following; the sidecar stalls around height 40–44 rejecting blocks as too far ahead of local time.

Fix reference: fixed upstream in Zebra (ZcashFoundation/zebra#10952, commit c7691893e): on Regtest, advance block time minimally (just above the median-time-past) instead of clamping now().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions