Context
The same Howard Hinnant civil-date algorithm is hand-rolled three times in three files:
crates/relayburn-sdk/src/ledger/writer.rs:26 now_iso — though the function name is misleading, see #(forthcoming bug-bundle issue).crates/relayburn-sdk/src/ingest/pending_stamps.rs:477-489 format_iso_8601, :491-530 parse_iso_ms, :638+ civil_from_unix_seconds / unix_seconds_from_civil.crates/relayburn-sdk/src/query_verbs.rs:117-142 format_iso_z / days_to_ymd.
Plus a fourth ~240-line copy in crates/relayburn-cli/src/commands/compare.rs:258-495 — covered separately as "switch compare.rs to SDK normalize_since".
Proposed fix
Add time = "0.3" to relayburn-sdk/Cargo.toml (zero-runtime, no feature gates needed for the formatting we use). Replace all three implementations with OffsetDateTime / Date operations. The functions become 1-2 liners.
Verify byte-identical output against the existing golden tests + the conformance gate. The TS sibling uses ISO-8601 / millisecond precision; time::format_description::well_known::Iso8601 matches.
Estimated removal: ~250 LOC.
Out of scope
- Whole
chrono adoption — time is sufficient for what we need and has fewer transitive deps. - Touching
compare.rs — that's covered by the separate normalize_since migration issue.
References
- Ingest+ledger review notes from the May 2026 Rust review.
Context
The same Howard Hinnant civil-date algorithm is hand-rolled three times in three files:
crates/relayburn-sdk/src/ledger/writer.rs:26 now_iso— though the function name is misleading, see #(forthcoming bug-bundle issue).crates/relayburn-sdk/src/ingest/pending_stamps.rs:477-489 format_iso_8601,:491-530 parse_iso_ms,:638+ civil_from_unix_seconds/unix_seconds_from_civil.crates/relayburn-sdk/src/query_verbs.rs:117-142 format_iso_z/days_to_ymd.Plus a fourth ~240-line copy in
crates/relayburn-cli/src/commands/compare.rs:258-495— covered separately as "switch compare.rs to SDK normalize_since".Proposed fix
Add
time = "0.3"torelayburn-sdk/Cargo.toml(zero-runtime, no feature gates needed for the formatting we use). Replace all three implementations withOffsetDateTime/Dateoperations. The functions become 1-2 liners.Verify byte-identical output against the existing golden tests + the conformance gate. The TS sibling uses ISO-8601 / millisecond precision;
time::format_description::well_known::Iso8601matches.Estimated removal: ~250 LOC.
Out of scope
chronoadoption —timeis sufficient for what we need and has fewer transitive deps.compare.rs— that's covered by the separatenormalize_sincemigration issue.References