Skip to content

fix: DEFAULT_MAX_DEPTH = 512#690

Merged
anthony-swirldslabs merged 1 commit intomainfrom
664-defaultMaxDepth
Nov 18, 2025
Merged

fix: DEFAULT_MAX_DEPTH = 512#690
anthony-swirldslabs merged 1 commit intomainfrom
664-defaultMaxDepth

Conversation

@anthony-swirldslabs
Copy link
Copy Markdown
Contributor

Description:
Introducing int Codec.DEFAULT_MAX_DEPTH = 512 and using it instead of Integer.MAX_VALUE. Ideally we'd just remove Codec methods w/o the maxDepth argument, but it appears to be impractical because we use the convenience methods in too many places.

The 512 limit is way safer than the MAX_VALUE. It may seem a bit high, but then again, it should be safe for us to be able to parse all our existing data. We could consider lowering it in the future if/when we have more data points on the maxDepth in real life.

Related issue(s):

Fixes #664

Notes for reviewer:
All tests should pass.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
@anthony-swirldslabs anthony-swirldslabs self-assigned this Nov 18, 2025
@anthony-swirldslabs anthony-swirldslabs requested review from a team as code owners November 18, 2025 22:41
@github-actions
Copy link
Copy Markdown

JUnit Test Report

   78 files  ±0     78 suites  ±0   3m 51s ⏱️ -14s
1 350 tests ±0  1 346 ✅ ±0   4 💤 ±0  0 ❌ ±0 
7 227 runs  ±0  7 207 ✅ ±0  20 💤 ±0  0 ❌ ±0 

Results for commit 1102b3d. ± Comparison against base commit f5bb21d.

@github-actions
Copy link
Copy Markdown

Integration Test Report

    410 files  ±0      410 suites  ±0   17m 37s ⏱️ - 2m 40s
114 861 tests ±0  114 861 ✅ ±0  0 💤 ±0  0 ❌ ±0 
115 102 runs  ±0  115 102 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 1102b3d. ± Comparison against base commit f5bb21d.

@anthony-swirldslabs anthony-swirldslabs merged commit 7060326 into main Nov 18, 2025
12 checks passed
@anthony-swirldslabs anthony-swirldslabs deleted the 664-defaultMaxDepth branch November 18, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revisit default maxDepth in Codec

2 participants