tick decode: step over a tick too wide to read, rather than dropping the message (ibx#302) - #358
Open
userFRM wants to merge 1 commit into
Open
tick decode: step over a tick too wide to read, rather than dropping the message (ibx#302)#358userFRM wants to merge 1 commit into
userFRM wants to merge 1 commit into
Conversation
…the message An extended entry states its width in a full byte, so it can name a value wider than this decoder returns. That entry is lost either way — but the decoder abandoned the whole message at that point, so every tick after it went with it, including the other server tags in the same 35=P. A quote update sitting behind one simply never arrived, and nothing recorded that it had. The field is now stepped over and decoding continues. The entry itself is still dropped rather than guessed at, and a genuinely truncated message still ends where it did. Stepping over needs a `skip` on the bit reader. Its width comes off the wire, so it is bounded by what is actually left rather than by an addition that wraps in release and rewinds the reader instead of stopping it. It is private: only this decoder steps. The test payload builder gained the ability to emit a field wider than a `u64`, which is what building one of these requires. Closes deepentropy#302.
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
35=Pentry states its width in a full byte, so it can name a value wider than this decoder returns. The decoder abandoned the whole message at that point, so every tick after it went with it — including the other server tags in the same message.Why
A quote update sitting behind one of these simply never arrived, and nothing recorded that it had. One entry the decoder cannot represent should cost that entry, not the rest of the message.
Closes #302.
Notes
Stepping over needs a
skipon the bit reader. Its width comes off the wire, so it is bounded by what is actually left rather than by an addition that wraps in release and rewinds the reader instead of stopping it. It is private — only this decoder steps.The test payload builder gained the ability to emit a field wider than a
u64, which is what building one of these requires.Test plan
cargo test --offline --lib— 804 passed. The 2 failures areconfig::expiry_tests::{named_zone_converts_with_dst, instant_round_trips_to_wire}, which fail on the base commit too (fixed separately in config: resolve the legacy timezone names IB states its times in (ibx#335) #336).cargo check --offlineclean on every target:--lib,--features python,--bins,--examples, and each of the eighttests/*.rstargets individually.tests/ib_paper_compatunchanged from base — identical sorted diagnostic sets, not merely equal counts.returnfailsa_tick_too_wide_to_read_does_not_discard_the_rest_of_the_message; makingskipadd unchecked failsskipping_past_the_end_refuses_rather_than_wrapping. Both by name.🤖 Generated with Claude Code