common: increase jsonrpc_io buffer size temporarily to aggrevate perf issues.
What changed, and why it matters
This commit is a temporary debugging change that increases an internal buffer size from 2 KB to 1 MB. The author explicitly states it is meant to expose and measure performance problems caused by large JSON-RPC requests, not to fix a security bug. By itself, it makes the node slower when handling big requests, but it does not introduce a clear vulnerability such as a crash or memory corruption.
Treat this commit as a temporary instrumentation change rather than a security patch. Review the follow-up commit referenced in the message to confirm performance and resource-usage regressions are resolved before any release. If this commit were to remain in a release branch, consider adding request-size limits or backpressure to prevent unbounded memory growth from many concurrent large JSON-RPC requests.
Security signals we found
Large buffer increase in network-facing JSON-RPC I/O path
Author acknowledges performance degradation under large client requests
No bounds checking, quota, or rate-limit changes accompany the buffer increase
Commit is explicitly described as temporary and diagnostic
Evidence from the diff
The single-line change raises READ_CHUNKSIZE in common/jsonrpc_io.c from 2048 bytes to 1024*1024 bytes. The commit message says this is a deliberate temporary step to ‘aggrevate [aggravate] perf issues’ that a client can already trigger by sending a large request. The author includes benchmark numbers showing a roughly 2x slowdown and a large latency spike, and points to a follow-up patch that restores performance. The diff does not alter parsing logic, allocation limits, or authentication checks.
Changed components
common/jsonrpc_io.cJSON-RPC I/O read bufferInspect captured patch +1 / −1
diff --git a/common/jsonrpc_io.c b/common/jsonrpc_io.c
index ab7255a9..e302434e 100644
--- a/common/jsonrpc_io.c
+++ b/common/jsonrpc_io.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <unistd.h>
-#define READ_CHUNKSIZE 2048
+#define READ_CHUNKSIZE (1024*1024)
struct jsonrpc_io {
MEMBUF(char) membuf;
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.