extension icon indicating copy to clipboard operation
extension copied to clipboard

Improve handling when hitting API "Too many history entries" limit

Open 314159265359879 opened this issue 11 months ago • 14 comments

A user is experiencing this issue where no balance is shown in the wallet for bitcoin: image Other assets such as STX, Stacks NFT's are displayed normally.

bc1qpyjutel6d4gj50dscphjrqcp29ljtfjel7ccap does have balance as seen on mempool.space explorer image

I have seen this issue before and often it is due to local restrictions, firewall, vpn etc. this time it looks like there is a different cause.

Console displays a error 400 for the blockstream API image

The API checked manually shows this https://blockstream.info/api/address/bc1qpyjutel6d4gj50dscphjrqcp29ljtfjel7ccap/utxo image "Too many history entries"

I think we need better error handling for this. Preferably also a way to display the balance anyway.

314159265359879 avatar Sep 20 '23 19:09 314159265359879

Needs design input for how we visually display the error cc/ @mica000 @fabric-8

kyranjamie avatar Sep 21 '23 12:09 kyranjamie

Another wallet affected by this issue, 16,725 transactions bc1qwafz80ygxpurl9fqmldp4x2z7z5g2p3ned68lf

https://mempool.space/address/bc1qwafz80ygxpurl9fqmldp4x2z7z5g2p3ned68lf

https://blockstream.info/api/address/bc1qwafz80ygxpurl9fqmldp4x2z7z5g2p3ned68lf/utxo image

Will we work around this issue in the future. Would it require running a local node /API server for example?

314159265359879 avatar Jan 18 '24 14:01 314159265359879

Would be great to discuss constraints & possibilities here to better understand what's feasible from a design perspective cc @markmhendrickson

fabric-8 avatar Jan 18 '24 15:01 fabric-8

I noticed this issue is similar: https://github.com/leather-wallet/extension/issues/3631#issuecomment-1941071023 Mark suggested a possible solution there.

another wallet affected by this today: image https://blockstream.info/api/address/bc1qke8cq9kkvpwvm74rrvd7lhxl3d0faw4qau8lzn/utxo

314159265359879 avatar Feb 17 '24 13:02 314159265359879

Can we use blockchain.info as a backup e.g. https://blockchain.info/balance?active=bc1qke8cq9kkvpwvm74rrvd7lhxl3d0faw4qau8lzn ?

markmhendrickson avatar Feb 20 '24 14:02 markmhendrickson

This might help us display the balance, but nothing else would work, sending txs, showing transactions etc

kyranjamie avatar Feb 20 '24 14:02 kyranjamie

Even with a node, getting all the utxos of a given address isn't supported well.

Solutions like Quicknode also don't have a the full suite of RPC commands, and misses the ones we'd need e.g. listunspent. It does however have a paid add-on that supports querying utxos, Blockbook.

If we take this approach, we'll need to investigate the rate limiting tooling they also offer, to avoid abuse of our key that would always be public.

kyranjamie avatar Feb 22 '24 13:02 kyranjamie

Another case like this https://blockstream.info/api/address/bc1qc4a54g4y7pyq5mcqys8xp4k4k7rkumv9zyt980/utxo image

https://blockstream.info/api/address/bc1qc4a54g4y7pyq5mcqys8xp4k4k7rkumv9zyt980 image

314159265359879 avatar Mar 14 '24 08:03 314159265359879

If we switch to BIS, would that resolve this issue?

Another address affected (for mocking/retesting): https://mempool.space/address/bc1qvvlpmskgaq0uulja7nj0wu7m6sk46vearwxwyf

314159265359879 avatar Apr 06 '24 18:04 314159265359879

If we switch to BIS, would that resolve this issue?

This is unrelated to BIS since it involves Blockstream, not Hiro or Ordinals APIs generally

markmhendrickson avatar Apr 10 '24 10:04 markmhendrickson

@markmhendrickson do you have an estimate when a fix for this could be live?

314159265359879 avatar May 15 '24 15:05 314159265359879

Not yet, since it hasn't been prioritized

markmhendrickson avatar May 17 '24 09:05 markmhendrickson

Another report from one of our partners telegram-cloud-photo-size-5-6231204167708426214-y

brandonmarshall-tm avatar May 23 '24 14:05 brandonmarshall-tm

I'm moving to our dev backlog and assigning @alter-eggo to investigate solutions, presumably by implementing an alternative to Blockstream for the relevant query/ies

markmhendrickson avatar May 24 '24 09:05 markmhendrickson

The build on https://github.com/leather-io/extension/pull/5690 resolves this issue for me.

markmhendrickson avatar Aug 01 '24 14:08 markmhendrickson

@markmhendrickson which wallet/address are you using that triggers this error?

kyranjamie avatar Aug 01 '24 14:08 kyranjamie

https://github.com/leather-io/extension/issues/3631#issuecomment-2258312130

markmhendrickson avatar Aug 01 '24 14:08 markmhendrickson

Ah fantastic, I see it's fixed since using paid Mempool space plan.

kyranjamie avatar Aug 02 '24 07:08 kyranjamie