This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
debug_traceTransaction
so that that the result can be chunked and sent to the caller instead of buffered in a JSON object first
#3998
We currently use a function called bufferify to convert "large" JSON objects into small Buffer chunks that can be
yield
ed and serialized for the wire as they are processed. This works around a node limitation withJSON.stringify
, as it can't handle strings greater than ~1GB in size (Buffer
s also have a similar limit). However, this approach is much slower thenJSON.stringify
, so we try to only do it on "large" traces. The number at which we choose to switch to bufferification is arbitrary and prone to issues where a trace with few steps still has too much data to JSON.stringify, causing the error. Here is an example: #3924We could try to
JSON.stringify
, and then fall back tobufferify
, but there is a better way: start sending the data as soon as it is available to send. Example: #3997However, this has some new problems:
debug_traceTransaction
implementation itself, what do we do forprovider
usage? It needs the JSON object itself, not Buffers or chunks of Buffers.JSON.stringify
might still be faster.A similar issue: #381
The text was updated successfully, but these errors were encountered: