Add ApiConfig::validateJson to skip WebsocketMessageParser's DOM validation pass - #158
Merged
Merged
Conversation
…dation pass crack() runs a full simdjson DOM parse ahead of its on-demand parse purely to guarantee malformed input is rejected as a catchable error rather than hitting an internal simdjson ondemand assertion (issue #109). That's a real cost on every non-fast-pathed message. Set validateJson=false once the feed is trusted to skip it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Le73N2EZjGLsCqmCScAse
Owner
Author
Latency impactMeasured with hyperliquid-md-benchmark — its replay harness times
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
=======================================
Coverage 70.28% 70.29%
=======================================
Files 54 54
Lines 8898 8900 +2
Branches 539 539
=======================================
+ Hits 6254 6256 +2
Misses 2639 2639
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WebsocketMessageParser::crack()runs a full simdjson DOM parse ahead of its on-demand parse, solely to guarantee malformed input is rejected as a catchable error rather than hitting an internal simdjson ondemand assertion (Malformed JSON in parseAllPerpMetas can abort the process via a simdjson internal assertion #109).ApiConfig::validateJson(defaulttrue, non-breaking) to skip that extra pass once the feed is trusted.Test plan
ctest(29/29 passing, includingwebsocket_parser_test)hyperliquid-md-benchmark(results in PR comment)🤖 Generated with Claude Code
https://claude.ai/code/session_018Le73N2EZjGLsCqmCScAse