Summary
ErrorKind::TooPopular has the display string "Too many history entries" (src/errors.rs#L22-L25), but it is raised from two unrelated checks:
- Electrum history queries — when results exceed
--electrum-txs-limit (src/electrum/server.rs#L1011, #L414). The message is accurate here.
- UTXO set computation — when the UTXO set exceeds
--utxos-limit during history replay (src/new_index/schema.rs#L873-L876). The message is wrong here: the failing condition is utxos.len() > limit and has nothing to do with history entry count.
Both limits default to 500, but they measure different quantities and are configured independently. On a deployment where --electrum-txs-limit has been raised but --utxos-limit is left at its default, an address with more than 500 UTXOs serves its full history without complaint while GET /address/:addr/utxo and blockchain.scripthash.listunspent fail with "Too many history entries" — a reason the server just demonstrated is not the problem.
The REST layer returns the error string verbatim as an HTTP 400 body (src/rest.rs#L543), so the misleading message is customer-visible and sends anyone debugging toward the wrong limit.
Observed behavior (signet address with 523 history entries, ~522 UTXOs)
| Request |
Result |
GET /address/{addr} |
200 OK |
GET /address/{addr}/txs |
200 OK |
blockchain.scripthash.get_history |
200 OK — 523 entries |
blockchain.scripthash.get_balance |
200 OK |
GET /address/{addr}/utxo |
400 — "Too many history entries" |
blockchain.scripthash.listunspent |
Error — "Too many history entries" |
A related source of confusion: the UTXO check aborts when the set exceeds the limit at any point during replay (deliberately — the server must still materialize the peak-size map), so an address whose current balance is zero can also be refused with "Too many history entries". With a message naming the actual condition, that behavior would at least be interpretable.
Suggested fix
Add a distinct error kind and raise it from utxo_delta, leaving TooPopular for the Electrum history checks:
TooManyUtxos {
description("Too many unspent outputs")
display("Too many unspent outputs")
}
Summary
ErrorKind::TooPopularhas the display string"Too many history entries"(src/errors.rs#L22-L25), but it is raised from two unrelated checks:--electrum-txs-limit(src/electrum/server.rs#L1011, #L414). The message is accurate here.--utxos-limitduring history replay (src/new_index/schema.rs#L873-L876). The message is wrong here: the failing condition isutxos.len() > limitand has nothing to do with history entry count.Both limits default to 500, but they measure different quantities and are configured independently. On a deployment where
--electrum-txs-limithas been raised but--utxos-limitis left at its default, an address with more than 500 UTXOs serves its full history without complaint whileGET /address/:addr/utxoandblockchain.scripthash.listunspentfail with "Too many history entries" — a reason the server just demonstrated is not the problem.The REST layer returns the error string verbatim as an HTTP 400 body (src/rest.rs#L543), so the misleading message is customer-visible and sends anyone debugging toward the wrong limit.
Observed behavior (signet address with 523 history entries, ~522 UTXOs)
GET /address/{addr}GET /address/{addr}/txsblockchain.scripthash.get_historyblockchain.scripthash.get_balanceGET /address/{addr}/utxoblockchain.scripthash.listunspentA related source of confusion: the UTXO check aborts when the set exceeds the limit at any point during replay (deliberately — the server must still materialize the peak-size map), so an address whose current balance is zero can also be refused with "Too many history entries". With a message naming the actual condition, that behavior would at least be interpretable.
Suggested fix
Add a distinct error kind and raise it from
utxo_delta, leavingTooPopularfor the Electrum history checks: