Sponsored Content
Skip to content

refactor: Limit JSON array size - #7112

Merged
bthomee merged 1 commit into
XRPLF:developfrom
godexsoft:refactor/limit-json-size
May 13, 2026
Merged

refactor: Limit JSON array size#7112
bthomee merged 1 commit into
XRPLF:developfrom
godexsoft:refactor/limit-json-size

Conversation

@godexsoft

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR refactors the JSON parsing and adds a check for array size.

API Impact

No impact.

@pratikmankawde pratikmankawde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.38095% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.1%. Comparing base (779b49c) to head (eaabf6f).
⚠️ Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
src/libxrpl/protocol/STParsedJSON.cpp 52.4% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #7112     +/-   ##
=========================================
- Coverage     82.1%   82.1%   -0.0%     
=========================================
  Files         1010    1010             
  Lines        76070   76084     +14     
  Branches      7381    7380      -1     
=========================================
- Hits         62457   62449      -8     
- Misses       13613   13635     +22     
Files with missing lines Coverage Δ
include/xrpl/protocol/STParsedJSON.h 100.0% <ø> (ø)
src/libxrpl/protocol/STParsedJSON.cpp 89.9% <52.4%> (-1.9%) ⬇️

... and 5 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@godexsoft godexsoft added this to the 3.1.3 (develop) milestone May 11, 2026
{
return RPC::makeError(
RpcInvalidParams,
"Field '" + makeName(object, field) + "' exceeds allowed JSON array size of " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Maybe include the actual size in the error details to help with troubleshooting.

@vlntb vlntb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit. Otherwise LGTM.

@bthomee

bthomee commented May 12, 2026

Copy link
Copy Markdown
Collaborator

@godexsoft is this ready to merge?

@godexsoft godexsoft added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label May 13, 2026
@bthomee
bthomee added this pull request to the merge queue May 13, 2026
Merged via the queue into XRPLF:develop with commit e8bdbaa May 13, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants