Skip to content

Upgrade sqlx 0.9.1, patch actix-http, replace chrono with time - #12

Merged
Kenbak merged 2 commits into
mainfrom
new/cipherpay-status-improvements-68308f
Nov 21, 2026
Merged

Kenbak merged 2 commits into
mainfrom
new/cipherpay-status-improvements-68308f

Conversation

@Kenbak

@Kenbak Kenbak commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

What

  1. sqlx 0.9.0 → 0.9.1. This allows libsqlite3-sys 0.40.0, which bundles SQLite 3.54.1 and fixes RUSTSEC-2026-0459. The --ignore RUSTSEC-2026-0459 line is removed from audit.yml.
  2. actix-http 3.21.0 → 3.22.0. Fixes RUSTSEC-2026-0552, 0553 and 0554 (published 2026-11-16): chunked trailers, chunk extensions, and a keep-alive header-timeout bypass. Main has them too.
  3. chrono → time 0.3. chrono is unmaintained (RUSTSEC-2026-0543), and cargo audit --deny unmaintained failed on it. sqlx's unused chrono feature is dropped as well. chrono, iana-time-zone and their platform crates leave Cargo.lock.

How the chrono swap keeps behaviour

Timestamps are stored as TEXT and compared lexically in SQL, so the output strings must not change. The new src/timefmt.rs reproduces each format chrono produced:

  • format_z: %Y-%m-%dT%H:%M:%SZ
  • format_naive: %Y-%m-%dT%H:%M:%S
  • to_rfc3339: AutoSi fraction plus +00:00
  • Secs/Millis …Z variants
  • The serde output for ZecRates.updated_at

Its parsers match chrono's leniency for:

  • RFC 3339: T/t/space separator, any number of fraction digits, ±HH:MM offsets below 24 h
  • parse_from_str formats: one-digit fields

The golden tests come from chrono 0.4.45 output. Call sites are a mechanical rename (.format_z(), .whole_seconds(), .unix_timestamp(), …). The previous naive-UTC comparisons now compare UTC OffsetDateTimes, which gives the same instants.

Known differences, all on inputs we don't produce:

  • A leap second (:60) parses as the end of :59.
  • parse_from_str rejects a leading space, a + year, or a year that isn't four digits.
  • time caps years at 9999. User-supplied durations are capped at 365 days, or 365 × 365 days for subscriptions, so this can't be reached.

Checks (local)

  • cargo test --locked: 143 passed (3 of them new golden tests), 3 ignored.
  • cargo audit --deny unmaintained --deny unsound (with only the two existing RSA/atomic-polyfill ignores): clean.
  • scripts/check-dependency-exposure.py passes.
  • Smoke start on a fresh SQLite database (testnet config): migrations run, /api/health returns ok, and /api/rates returns updated_at as 2026-11-21T12:19:28.703971Z, the same format chrono's serializer wrote.

Payment amounts and SQL are unchanged. Not deployed.

kenbak wan added 2 commits November 21, 2026 08:56
sqlx 0.9.1 allows libsqlite3-sys 0.40.0, which bundles SQLite 3.54.1 and
fixes the WAL page-size disclosure, so the audit exemption is removed.

Also bump actix-http 3.21.0 -> 3.22.0 for RUSTSEC-2026-0552/0553/0554
(chunked-trailer, chunk-extension and keep-alive header-timeout issues,
published 2026-11-16).

libsqlite3-sys keeps the same feature set (bundled, unlock_notify). New
lock entries (libredox, objc2-*, etcetera) are not compiled for any target.
chrono is flagged unmaintained and cargo audit --deny unmaintained fails
on it. Timestamps are stored as TEXT and compared lexically in SQL, so a
new src/timefmt.rs keeps every string byte-for-byte:

- format_z: %Y-%m-%dT%H:%M:%SZ (whole seconds, UTC)
- format_naive / format_naive_minutes: %Y-%m-%dT%H:%M[:%S]
- to_rfc3339: chrono's AutoSi fraction with +00:00
- rfc3339_secs_z / rfc3339_millis_z: to_rfc3339_opts(Secs|Millis, true)
- serialize_rfc3339_z: chrono's serde output for ZecRates.updated_at
- parse_rfc3339 / parse_z / parse_naive: chrono's parser leniency for
  T/t/space separators, extra fraction digits, ±HH:MM offsets and
  one-digit fields in parse_from_str formats

Golden tests were captured from chrono 0.4.45. Known differences: a leap
second (:60) parses as the end of :59, and parse_from_str inputs with a
leading space, a '+' year or a non-four-digit year are rejected.

sqlx's unused chrono feature is dropped. chrono, iana-time-zone and
their platform crates leave Cargo.lock.
@Kenbak Kenbak changed the title Upgrade sqlx to 0.9.1, drop RUSTSEC-2026-0459 ignore, patch actix-http Upgrade sqlx 0.9.1, patch actix-http, replace chrono with time Nov 21, 2026
@Kenbak
Kenbak merged commit e3ac069 into main Nov 21, 2026
4 checks passed
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