The previous upper bound for setmocktime was std::chrono::nanoseconds::max() converted to seconds (~year 2262). This was too permissive in two ways:
Paths that add an offset to the mocked time can overflow
int64_t(caught by UBSan). For example,ContextualCheckBlockHeaderadds a constant to the current time for its future-time check. (see comment)Paths that assign the mocked time to a
uint32_tfield silently truncate it (caught by the integer sanitizer). For example,miner.cppassignsNodeClock::now()directly topblock->nTime. (see comment)
UINT32_MAX is the natural ceiling since block header nTime is uint32_t, making mocked values beyond it meaningless for anything consensus-related.