Skip to content

Conversation

@TimEconometrics
Copy link

Two fixes for snapshot validation failures:

  1. Use price from book diff instead of order status for new orders

    • The BookDiff.px field contains the actual price the order entered the book at, which can differ from OrderStatus.limit_px (e.g., for triggered orders)
    • Added modify_px method to InnerOrder trait and InnerL4Order impl
    • Added px() getter to NodeDataOrderDiff
  2. Treat empty orderbooks as equivalent to non-existent in validation

    • Previously, if expected snapshot had an empty book for a coin that didn't exist in our state, validation would incorrectly fail with "Extra orderbooks detected"
    • Now filters out empty books before checking for extras

…tion

Two fixes for snapshot validation failures:

1. Use price from book diff instead of order status for new orders
   - The BookDiff.px field contains the actual price the order entered
     the book at, which can differ from OrderStatus.limit_px (e.g., for
     triggered orders)
   - Added modify_px method to InnerOrder trait and InnerL4Order impl
   - Added px() getter to NodeDataOrderDiff

2. Treat empty orderbooks as equivalent to non-existent in validation
   - Previously, if expected snapshot had an empty book for a coin that
     didn't exist in our state, validation would incorrectly fail with
     "Extra orderbooks detected"
   - Now filters out empty books before checking for extras

Tested on a non-validator node where the unfixed version crashes with
price mismatch errors while the fixed version runs stably.
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.

1 participant