Skip to content

Add deterministic order book delta validation#5

Open
Soengkit wants to merge 2 commits into
Peter7896:mainfrom
Soengkit:codex/ws-delta-validation-4
Open

Add deterministic order book delta validation#5
Soengkit wants to merge 2 commits into
Peter7896:mainfrom
Soengkit:codex/ws-delta-validation-4

Conversation

@Soengkit

Copy link
Copy Markdown

Summary

Adds deterministic order book snapshot and delta validation coverage for #4, including state-preservation checks for malformed, stale, out-of-order, and checksum-mismatched payloads.

Changes

  • Added DepthDelta, DepthDeltaLevel, ApplySnapshot, and ApplyDelta helpers for local order book delta handling.
  • Added deterministic checksum support for post-delta book validation.
  • Added tests covering valid snapshot + delta application, malformed symbol/side/price/quantity payloads, stale and out-of-order sequence rejection, and checksum mismatch rejection without mutating the current book.
  • Included diagnostic/build-182f71ab.json and diagnostic/build-182f71ab.logd from the required build run.

Testing

  • cd market && go test ./orderbook ./matching ./ws - pass
  • python3 build.py - 8/10 modules pass; market passes. Existing unrelated local failures remain in frailbox on macOS (MAP_HUGETLB) and openapi-haskell due missing Haskell packages (Data.Yaml / related modules). Diagnostic artifacts were generated successfully.

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

Closes #4

Notime02 added a commit to Notime02/zeroeye that referenced this pull request Jun 19, 2026
@Peter7896

Copy link
Copy Markdown
Owner

Thanks for the PR. This is the current candidate for the WebSocket/order book delta validation bounty.

Before this can be forwarded for upstream bounty review, I need to verify the diagnostic bundle and scope. Please keep the PR focused on issue #4, make sure the diagnostic files are exactly what python3 build.py generated on this branch, and avoid manual edits to generated diagnostic output.

If this PR remains fork-only, an upstream PR against lobster-trap/Kickama will still be needed for merge and payout review.

@Soengkit

Copy link
Copy Markdown
Author

Thanks for the clarification. I opened the upstream PR here for merge and payout review:

I also rechecked the scope: the candidate diff is limited to market/orderbook/delta.go, market/orderbook/delta_test.go, and the required diagnostic pair. The committed diagnostic files are the python3 build.py generated pair for the code commit (diagnostic/build-182f71ab.json and diagnostic/build-182f71ab.logd), and I have not hand-edited the generated diagnostic output. Targeted validation passes with:

cd market && go test ./orderbook ./matching ./ws

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.

[$45 BOUNTY] [Go] Add WebSocket order book delta validation tests

2 participants