Review report

core: PR #35989

🟠 Major

Reject high ranges that trigger billions of derivations (src/wallet/imports.cpp:62, head)

This check permits an exclusive end of INT32_MAX, so a range such as [2147483646, 2147483646] passes. However, DescriptorScriptPubKeyMan::TopUpWithDB generates cached entries from m_max_cached_index + 1 (initially 0) up to the exclusive end, rather than starting at the requested range start. Because the overflow guard leaves this end unchanged, importing this one-index range attempts roughly 2.1 billion derivations and can stall or exhaust the node. Either make wallet caching honor the requested start with consistent cache-index and reload bookkeeping, or reject such high starting indices with a wallet-specific bound.