Summary
This is a follow-up to #34342 (comment). This change adds -rpcmaxresponsesize to cap the total response size in bitcoin-cli.
In this change, the MAX_SIZE is set to uint64_t MAX_SIZE = 0x02000000 or 32 MB and can be set to -rpcmaxresponsesize=0 to be unbounded
Users might want to use this for several reasons, such as,
- Avoiding unbounded RAM usage when operating on low-resource machines (Raspberry Pi 2-4GB).
- Wanting to fail fast when having bounded resource usage in automation, or CI.
- Avoiding processing the response from large legitimate responses, such as
getrawmempool true,listsinceblockon a busy wallet.