P2: later
An appendix to the milestone.
P2: for later
-
Timestamp::fractionispub(crate)whilesecondsispub. Finding: a user who wants the fraction field writesbits() as u32; the documentation ofsecondspoints at an accessor that exists but stays hidden. Evidence:src/lib.rslines 157 to 166. Change: makefractionpublic. Door: two-way. Effort: XS. -
Nothing uses the two low-entropy items of the public surface. Finding:
Query::new(nonce equals the send time) and the low-bit randomizer (a dozen random bits) exist for a caller with no random source. No caller in the tree uses either; nife's client and the test server usewith_nonce. Keeping them publishes a weaker path next to a free stronger one, and the documentation has to spend two paragraphs steering readers away from it. Evidence:src/lib.rslines 218 to 236 and 613 to 622;grep -rn "Query::new"and a search for the low-bit randomizer finds no NTP caller. Change: remove both before the first publish, as Decision 3 decides, provisionally. Door: a public surface, two-way today. Effort: XS. -
Shortexposes its field whileTimestampandIntervalhide theirs. Finding:Short(pub u32); the other two fixed-point types go throughfrom_bits/bitsandfrom_ticks/ticks. The type's name is also a generic word (Decision 2). Evidence:src/lib.rslines 280 to 296. Change: private field,from_bitsandbits, with the three call sites in the test server updated. Door: two-way today. Effort: XS. -
destis an abbreviation in a public parameter. Finding:Query::accept(&self, wire: &[u8], dest: Timestamp); the naming rules apply to parameters, and the RFC's word is "destination timestamp". Evidence:src/lib.rsline 691. Change:destination. Door: two-way (parameter names are not part of the ABI). Effort: XS. -
The notes that describe the crate have drifted. Finding:
notes/ntp.mdsays "21 host tests and 7 Kani harnesses". There are 25 and 7. The same note andwhat-is-proved.mddescribe the solver timings on one machine. This review's run of the bounded harness took 25 s rather than 9 s. Evidence:notes/ntp.mdunder "Why the protocol is a crate".notes/ntp/what-is-proved.md. Change: in nife, state the present counts without a date, as the documents rule requires. In the new repository, let the README state whatcargo testprints rather than a count. Door: two-way. Effort: XS. -
The
Rejectdocumentation overstates the check order. Finding: theRejectexample says "the nonce check runs before any of the packet is believed";acceptreads and judges version and mode first. Theacceptdocumentation has the order right. Nothing leaks that matters, but a stranger comparing the two will stop. Evidence:src/lib.rslines 478 to 479 and 694 to 703. Change: "before anything in the packet beyond the two framing fields is believed". Door: two-way. Effort: XS. -
abs_ticksdoes not take std's spelling. Finding: it returnsself.0.unsigned_abs(), and the rule prefers std's spelling where std has one. No caller uses it. Evidence:src/lib.rslines 342 to 345. Change: drop it, as Decision 2 decides, provisionally. Door: public name, two-way today. Effort: XS.