Skip to content

fix: accept coherent empty bookTicker side - #845

Merged
proerror77 merged 1 commit into
mainfrom
codex/book-ticker-coherent-side-844
Aug 11, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/book-ticker-coherent-side-844

Conversation

@proerror77

@proerror77 proerror77 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Change contract

Accept coherent empty bookTicker sides without restarting the collector: a
price/quantity pair is valid when both are zero or both are positive, while
negative, malformed, and mismatched pairs remain fail-closed.

Issue relationship

Closes #844

Out of scope

No schema, audit event, configuration, dependency, runtime, deployment, or
production changes.

Dependencies and merge order

None.

Focused validation

  • Exact CHIPUSD1 Spot payload with a=0 and A=0 parses as normal
    book_ticker.
  • Mismatched, negative, and malformed sides remain rejected.
  • Collector processes the zero-side bookTicker, then normal trade and depth on
    the same producer with no session action; manifest book_ticker count is 1
    and sequence gaps remain 0.
  • Strict artifact verifier and upload-only FakeOss triplet readback pass.
  • cargo test -p hft-data --locked (81 passed).
  • cargo test -p hft-collector --bin binance-lob-archiver --locked --no-fail-fast
    with a temporary macOS-only RUSAGE_THREAD -> RUSAGE_SELF test shim (96
    passed; shim restored byte-for-byte and is not in this PR).
  • Linux target check and scoped clippy for hft-data and hft-collector with
    -D warnings; git diff --check.

Rollout and rollback

None; code-only PR, no runtime action.

Scope exception

None.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 022d1be0-9ded-4687-a37b-899f90f3e333

📥 Commits

Reviewing files that changed from the base of the PR and between 99b622c and b8063cc.

📒 Files selected for processing (1)
  • rust_hft/tools/collector/src/bin/binance-lob-archiver.rs
📝 Walkthrough

Walkthrough

BookTicker parsing now accepts coherent zero price and quantity pairs while rejecting negative, malformed, and mismatched values. Spot archiving tests verify normal event handling, strict replay, gap-free segments, and successful artifact uploads.

Changes

Binance bookTicker validation and archiving

Layer / File(s) Summary
BookTicker pair validation
rust_hft/data-pipelines/core/src/binance_market_tape.rs
BookTicker fields use paired decimal validation. Matching zero values are accepted. Negative, malformed, and mismatched values remain rejected.
Spot archiving coverage
rust_hft/tools/collector/src/bin/binance-lob-archiver.rs
An end-to-end Spot test verifies zero-sided bookTicker processing, event archiving, gap-free strict replay, and successful artifact uploads.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #844 by accepting coherent zero pairs, preserving normal events, rejecting invalid pairs, and validating strict replay and archival behavior.
Out of Scope Changes check ✅ Passed The changes remain within the parser and collector test scope required by issue #844, with no unrelated runtime or deployment changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely describes the main parser change: accepting coherent empty bookTicker sides.
Description check ✅ Passed The description covers the required sections and clearly states the behavior, validation, scope, dependencies, and rollout details.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/book-ticker-coherent-side-844

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rust_hft/tools/collector/src/bin/binance-lob-archiver.rs`:
- Around line 6836-6848: Update the zero-sided BookTicker test around
process_event to snapshot the relevant OrderBookState fields before invocation,
then compare them afterward to assert they are unchanged. Keep the existing
ProcessAction::None assertion and ensure the comparison would detect mutation of
the bid quantity, including the ticker value 3946.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 418cea9a-9813-4c16-97e7-7cc3dd783ce1

📥 Commits

Reviewing files that changed from the base of the PR and between b4d39f9 and 99b622c.

📒 Files selected for processing (2)
  • rust_hft/data-pipelines/core/src/binance_market_tape.rs
  • rust_hft/tools/collector/src/bin/binance-lob-archiver.rs

Comment thread rust_hft/tools/collector/src/bin/binance-lob-archiver.rs
@proerror77
proerror77 force-pushed the codex/book-ticker-coherent-side-844 branch from 99b622c to b8063cc Compare August 11, 2026 23:01
@proerror77
proerror77 merged commit eda042c into main Aug 11, 2026
43 of 45 checks passed
@proerror77
proerror77 deleted the codex/book-ticker-coherent-side-844 branch August 11, 2026 23:10
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.

Accept coherent empty side in Binance bookTicker without restarting shard

1 participant