-
Notifications
You must be signed in to change notification settings - Fork 738
Closed
Labels
Description
Currently, if the server generates an extremely long response, it simply returns an error message, such as
{ message: 'response too large (at least 1021611 bytes)', code: -32600 }
If the client receives this message, it will just hang indefinitely while attempting to sync.
Proposed Solution
Implement pagination in relevant methods, using block heights as a range. This has a couple advantages:
- Allow handling of very active addresses
- During sync, allow clients to only fetch transactions after where they left off, instead of fetching the entirety of their history. Same goes for getting tx inputs. This could conceivably lead to issues with a reorg, but the client could just fetch transactions starting from
last height - n
wheren
is e.g. 6
Affected RPC Methods
blockchain.address.get_history
blockchain.address.get_mempool
blockchain.address.listunspent
blockchain.scripthash.get_history
blockchain.scripthash.listunspent
It seems to me like the simplest solution would be to bump the protocol version number, and add optional pagination parameters to each of these methods. The version bump would allow clients to detect support for this, and thus be able to opt to get only the new txs during sync.
AdamSEY, luggs-co, willguxy, janoside and wlk