Repository navigation
Feature/protocol correctness audit - #18
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new Parquet end-to-end test likely builds &str values via get_string(..).unwrap().clone() despite declaring Vec<(String, String)>, which can cause a compilation/type mismatch.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR tightens protocol correctness across capture parsing and DNS transaction matching, while restoring throughput via routing optimizations, and updates docs/benchmarks to reflect the new correctness contract.
Changes:
- Fix PCAPNG stdin timestamp handling (word ordering, full binary/decimal
if_tsresol, signedif_tsoffset) while keeping structural validation and bounded buffering. - Improve DNS correctness: derive direction from DNS QR (including UDP/53 on both ends), include QCLASS/OPCODE in matcher identity, retain pending retries for non-monotonic captures, and harden IPv6/TSIG/QNAME handling.
- Preserve unknown QTYPE/RCODE values end-to-end (CSV/Parquet/serde) and reduce routing overhead by buffering flow-hash writes while preserving shard assignment/output order.
File summaries
| File | Description |
|---|---|
| tests/end_to_end.rs | Adds an end-to-end CSV/Parquet round-trip test for unknown QTYPE/RCODE formatting. |
| src/test_support.rs | Adjusts DNS test packet helper to set QR for packets sourced from UDP/53. |
| src/parquet_writer.rs | Writes protocol text columns using Cow to avoid forcing allocations for known values. |
| src/packet_parser.rs | Introduces a parser-owned PCAPNG stdin reader for correct timestamp conversion and maintains structural validation. |
| src/packet_parser_wire_tests.rs | Adds independent wire-level PCAPNG fixtures/tests covering timestamp/resolution/offset/validation edge cases. |
| src/dns_processor/types.rs | Extends matcher identity (QCLASS/OPCODE) and adds retry retention payload plus mutable timeline access. |
| src/dns_processor/tests.rs | Updates matcher tests for new identity fields and adds regression coverage for retry regrouping behavior. |
| src/dns_processor/pipeline.rs | Buffers flow-hash writes (SeaHash) to reduce routing overhead; adds regression and hash-equivalence tests. |
| src/dns_processor/parser.rs | Enforces QR-based direction and port validation, supports IPv6 extension chains/atomic fragments, consumes TSIG Other Data, and tightens compression-pointer boundaries. |
| src/dns_processor/matcher.rs | Preserves pending retries for non-monotonic captures and repartitions earlier-attempt regressions without reopening finalized transactions. |
| src/custom_types.rs | Preserves unknown QTYPE/RCODE numeric identity in formatting and serde round-trips via Cow. |
| README.md | Updates user-facing protocol/matcher behavior and export formatting guarantees. |
| docs/rfc/0005-dual-path-pcap-parsing.md | Documents PCAPNG timestamp ownership and new IPv6 boundary behavior. |
| docs/rfc/0004-forward-only-matcher.md | Documents updated matcher identity, retry regrouping behavior, and determinism constraints. |
| docs/architecture.md | Updates architecture notes for buffered flow hashing, PCAPNG stdin parsing, IPv6 traversal, and retry retention. |
| Cargo.toml | Bumps crate version and adds byteorder_slice dependency used for stateless pcapng decoding. |
| Cargo.lock | Locks updated crate version and new dependency. |
| benches/README.md | Adds benchmark/report doc entry for the audit. |
| benches/protocol-correctness-audit.md | Adds benchmark results and validation notes for the final audit implementation. |
Review details
- Files reviewed: 18/19 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+742
to
+745
| ( | ||
| row.get_string(6).unwrap().clone(), | ||
| row.get_string(7).unwrap().clone(), | ||
| ) |
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.
Fix capture timestamp handling and DNS matching correctness, while restoring throughput with targeted routing optimizations.