importdescriptors aborts the node when the inclusive range end is 2147483647:
bitcoin-cli -regtest -rpcwallet=w importdescriptors \
'[{"desc":"wpkh(tpub.../0/*)#checksum","range":[2147483647,2147483647],"timestamp":"now"}]'
Assertion failed: (m_wallet_descriptor.GetEnd() - 1 == m_max_cached_index),
function TopUpWithDB, file scriptpubkeyman.cpp, line 1165.
WalletDescriptor keeps the exclusive range end in an int32_t, but ProcessDescriptorImport() computes it as int64_t and lets the narrowing happen implicitly when it constructs the descriptor. ParseDescriptorRange() only rejects an inclusive end of 2^31 and above, so INT32_MAX gets through and becomes an exclusive end of 2^31, which wraps to INT32_MIN.
TopUpWithDB() then does:
int32_t new_range_end = std::max(m_wallet_descriptor.GetNext() + (int32_t)target_size, m_wallet_descriptor.GetEnd());
That addition is int32_t too, so it overflows on its own once the next index gets within target_size of INT32_MAX. Either way new_range_end ends up negative, the loop below derives nothing, and the invariant on the next line doesn't hold.
The wrapped value is written to the wallet database before the abort, so the descriptor stays broken after a restart:
"range": [2147483647, -2147482650], "next_index": 2147483647
The first commit saturates the addition. The second rejects a range end that isn't representable as an int32_t, reusing the existing "End of range is too high" error.
deriveaddresses and scantxoutset aren't affected, since they walk the range as int64_t and never store it. I checked that both still accept [2147483647, 2147483647].
The new case in wallet_importdescriptors.py uses a descriptor the wallet can actually expand. My first attempt reused the sh(wpkh(xpriv/...)) descriptor the surrounding checks use, but in a watch-only wallet that one fails earlier with -4 and never reaches the code that crashes.
Without the fix the test dies with RemoteDisconnected and node1's stderr has the assertion above. With it, it passes. I also ran wallet_descriptor, wallet_keypool, wallet_keypool_topup, wallet_basic, rpc_deriveaddresses and rpc_scantxoutset.