Repository navigation
build: migrate off chrono (RUSTSEC-2026-0543) - #2166
Conversation
The RustSec advisory DB picked up RUSTSEC-2026-0543 (chrono unmaintained) on 2026-11-17, turning 'cargo deny' red on every branch. The chrono maintainer confirmed the deprecation is deliberate and recommended migrating; this removes chrono from the workspace entirely: - first-party code (common, wallet-cli-commands, node-gui, storage-test-suite) now uses jiff 1.0, which the ecosystem is coordinating on; the Time display/debug formats are byte-identical - until_time parsing in the wallet CLI is now strict RFC 3339 - the transitive users are served by overlay forks until upstream releases allow dropping them: * file-rotate: chrono made optional (upstream PR kstrafe/file-rotate#40) * reedline: chrono dropped from the non-sqlite build (reedline >= 0.53 dropped it upstream but needs MSRV 1.95 > ours) * serde_with: optional chrono integration removed; its weak feature references otherwise force chrono into every consumer's lockfile - iced_aw: the unused date/time picker default features (the only chrono users) are no longer enabled - cargo-vet exemptions added for the new/updated crates
|
🔍 OpenCodeReview found 8 issue(s) in this PR.
📄
|
| file-rotate = "0.7" | ||
| # Overlay fork with chrono made optional (RUSTSEC-2026-0543); see | ||
| # https://github.com/kstrafe/file-rotate/pull/40 — revert to a released version once it ships. | ||
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", branch = "chrono-optional-0.7", default-features = false } |
There was a problem hiding this comment.
This git dependency is pinned only by a mutable branch name ("chrono-optional-0.7") with no rev or tag, so builds are not reproducible: the branch owner can force-push and every subsequent build resolves to different code. Unlike the existing iced_glyphon patch which pins an immutable rev, this is a supply-chain risk. Pin a specific commit rev and keep the branch name in a comment for the revert-to-crates.io note.
Suggestion:
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", branch = "chrono-optional-0.7", default-features = false } | |
| +file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", rev = "<commit-sha>", default-features = false } |
| reedline = "0.38" | ||
| # Overlay fork without chrono (RUSTSEC-2026-0543); revert to a released version once our | ||
| # MSRV allows reedline >= 0.53 (which dropped chrono upstream). | ||
| reedline = { git = "https://github.com/nullPointerEnjoyer/reedline.git", branch = "chrono-free-0.38" } |
There was a problem hiding this comment.
Same concern as the file-rotate override: this dependency is pinned to a mutable branch ("chrono-free-0.38") rather than an immutable rev. Since it also does not set default-features = false explicitly, feature resolution depends on the fork's manifest and can silently change if the branch is updated. Pin a commit hash for reproducibility.
Suggestion:
| reedline = { git = "https://github.com/nullPointerEnjoyer/reedline.git", branch = "chrono-free-0.38" } | |
| +reedline = { git = "https://github.com/nullPointerEnjoyer/reedline.git", rev = "<commit-sha>" } |
| # Overlay fork without the optional chrono integration (RUSTSEC-2026-0543); the weak | ||
| # feature references otherwise force chrono into the lockfile even when unused. | ||
| # Revert to a released version when the advisory is resolved upstream. | ||
| serde_with = { git = "https://github.com/nullPointerEnjoyer/serde_with.git", branch = "no-chrono" } |
There was a problem hiding this comment.
serde_with is overridden with an unpinned branch ("no-chrono"). A mutable branch reference is non-reproducible — anyone rebuilding later may get different code, and the fork's crate-level manifest could change dependencies/features without notice. Pin a specific rev like the existing iced_glyphon/iced_aw overrides do.
Suggestion:
| serde_with = { git = "https://github.com/nullPointerEnjoyer/serde_with.git", branch = "no-chrono" } | |
| +serde_with = { git = "https://github.com/nullPointerEnjoyer/serde_with.git", rev = "<commit-sha>" } |
| let subsec = format!("{subsec_nanos:09}"); | ||
| write!(f, "{base}.{} UTC", subsec.trim_end_matches('0')) |
There was a problem hiding this comment.
The trailing-zero trimming does not replicate chrono's Display format for all subsecond values. chrono's Display uses an auto-precision fractional format: it prints 3 digits for milliseconds, 6 digits for microseconds, and 9 digits for nanoseconds (e.g. nanos = 100 → chrono shows ".000000100", nanos = 10_000 → ".000010"). This implementation trims all trailing zeros, producing ".0000001" and ".00001" respectively, which changes the Display output relative to the previous behavior the comment claims to preserve. Consider using jiff's precision-controlled formatting (e.g. strftime with an explicit %.9f / span formatting) or trimming to the nearest 3-digit group to match chrono.
Suggestion:
| let subsec = format!("{subsec_nanos:09}"); | |
| write!(f, "{base}.{} UTC", subsec.trim_end_matches('0')) | |
| let subsec = format!("{subsec_nanos:09}"); | |
| let trimmed = subsec.trim_end_matches('0'); | |
| let padded_len = ((trimmed.len() + 2) / 3) * 3; | |
| write!(f, "{base}.{} UTC", format!("{trimmed:<0width$}", width = padded_len)) |
| # Temporary overlay of file-rotate (chrono made optional, RUSTSEC-2026-0543) until | ||
| # https://github.com/kstrafe/file-rotate/pull/40 is released. | ||
| "nullPointerEnjoyer", |
There was a problem hiding this comment.
This allowlist entry trusts every repository under the personal 'nullPointerEnjoyer' account, not just the file-rotate fork, so any code published under that account bypasses source auditing. This is especially risky because the fork is referenced by branch name (branch = "chrono-optional-0.7") in Cargo.toml, allowing the trusted set to drift via force-pushes on future cargo update runs even though Cargo.lock currently pins commit 642a9d0a. Consider pinning the dependency by rev (rev = "642a9d0a262912798e7edb5d2970d0129123d48b") to reduce the trust surface, and ensure this overlay is removed once kstrafe/file-rotate#40 is released (the comment says 'temporary' but nothing enforces it).
Suggestion:
| # Temporary overlay of file-rotate (chrono made optional, RUSTSEC-2026-0543) until | |
| # https://github.com/kstrafe/file-rotate/pull/40 is released. | |
| "nullPointerEnjoyer", | |
| # TODO: remove once kstrafe/file-rotate#40 is released and the git dependency is reverted. |
| [[exemptions.jiff]] | ||
| version = "1.0.1" | ||
| criteria = "safe-to-deploy" |
There was a problem hiding this comment.
These are blanket 'safe-to-deploy' exemptions with no corresponding reviewed entries in supply-chain/audits.toml (audits.toml has no entries for jiff, base64, or file-rotate). That is the accepted escape hatch for new dependency versions, but it silently marks unreviewed code as safe to deploy. Consider scheduling these crates for proper review, and prune stale version entries (e.g., jiff 0.2.x line vs 1.0.x, darling_core 0.23.0 vs 0.24.1) once dependencies converge on a single version line.
- rev-pin the three overlay fork dependencies (branch refs could be moved by any writer on the fork account; the locked commits are now pinned in the manifest itself, matching the repo's git-dep convention) - deny.toml: replace the org-wide sources allowlist expansion with exact-URL allow-git entries - cargo-vet: exemption rows for the fork versions in the x@git:rev convention, stale rows pruned (iana-time-zone, chrono trust entry, orphaned imports.lock publishers) - Time Display: replicate chrono's 3/6/9-digit subsecond grouping (trailing-zero trimming was a formatting regression), pinned by tests - until_time parsing: pin both strictness directions with tests (unpadded rejected, space-separator accepted, bare epoch rejected) and describe the actual parser behavior in the CHANGELOG - untangle the duplicated sentences in the pre-existing Node CLI CHANGELOG entry touched by this PR
| file-rotate = "0.7" | ||
| # Overlay fork with chrono made optional (RUSTSEC-2026-0543); see | ||
| # https://github.com/kstrafe/file-rotate/pull/40 — revert to a released version once it ships. | ||
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", rev = "642a9d0a262912798e7edb5d2970d0129123d48b", default-features = false } |
There was a problem hiding this comment.
This pin points to a fork under a personal GitHub account (nullPointerEnjoyer/file-rotate), unlike the other git overlays in this workspace (iced-glyphon, parity-scale-codec) which live under organization-controlled repos. Since rev pins do not protect against the referenced repository being deleted or rewritten (a fetch will re-resolve and fail), an org-hosted fork would be more durable and easier to audit. At minimum, make sure this fork is reflected in supply-chain config / cargo-vet policy.
Suggestion:
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", rev = "642a9d0a262912798e7edb5d2970d0129123d48b", default-features = false } | |
| +file-rotate = { git = "https://github.com/mintlayer/file-rotate.git", rev = "642a9d0a262912798e7edb5d2970d0129123d48b", default-features = false } |
| allow-git = [ | ||
| "https://github.com/nullPointerEnjoyer/file-rotate", | ||
| "https://github.com/nullPointerEnjoyer/reedline", | ||
| "https://github.com/nullPointerEnjoyer/serde_with", | ||
| ] |
There was a problem hiding this comment.
Allowing git sources from the personal nullPointerEnjoyer account grants that account's repos (or any future repo on it) the ability to inject code into production builds if the allow-git list is later widened. The trust anchor here is a third-party account, not the org — an account takeover or a malicious fork update means untrusted code ships as safe-to-deploy. Consider (a) restricting trust to the exact rev-pinned URLs/commits where tooling supports it, (b) documenting in-repo the reviewed diff of each fork vs upstream, and (c) ensuring removal is tracked by an issue rather than only comments. Deny.toml also permits any commit on these URLs; today the Cargo.toml pins by rev, but nothing mechanizes that coupling.
Suggestion:
| allow-git = [ | |
| "https://github.com/nullPointerEnjoyer/file-rotate", | |
| "https://github.com/nullPointerEnjoyer/reedline", | |
| "https://github.com/nullPointerEnjoyer/serde_with", | |
| ] | |
| allow-git = [ | |
| "https://github.com/nullPointerEnjoyer/file-rotate", | |
| "https://github.com/nullPointerEnjoyer/reedline", | |
| "https://github.com/nullPointerEnjoyer/serde_with", | |
| ] | |
| # NOTE: keep each Cargo.toml dependency pinned by exact `rev`, and record the | |
| # reviewed upstream diff for each fork commit in supply-chain/audits.toml or a | |
| # tracked issue so these overlays cannot silently change commits. |
| [[exemptions.file-rotate]] | ||
| version = "0.7.6" | ||
| version = "0.7.6@git:642a9d0a262912798e7edb5d2970d0129123d48b" | ||
| criteria = "safe-to-deploy" |
There was a problem hiding this comment.
These git-pinned exemption entries mark unreviewed fork code as safe-to-deploy and there is no expiry, diff reference, or provenance record tying @git:<rev> to the reviewed upstream delta. Future PRs could swap the commit hash and re-exempt new, unreviewed code without review friction. Consider adding a short comment per entry (or in a README for supply-chain/) pointing to the fork's upstream issue/PR (e.g. kstrafe/file-rotate#40) and stating the review date, so removal follows the deny.toml comment's plan.
Suggestion:
| [[exemptions.file-rotate]] | |
| version = "0.7.6" | |
| version = "0.7.6@git:642a9d0a262912798e7edb5d2970d0129123d48b" | |
| criteria = "safe-to-deploy" | |
| # Temporary fork overlay (chrono made optional, RUSTSEC-2026-0543); | |
| # upstream: https://github.com/kstrafe/file-rotate/pull/40 — remove when released. | |
| [[exemptions.file-rotate]] | |
| version = "0.7.6@git:642a9d0a262912798e7edb5d2970d0129123d48b" | |
| criteria = "safe-to-deploy" |
| let date_time = arg | ||
| .parse::<chrono::DateTime<chrono::Utc>>() | ||
| .parse::<jiff::Timestamp>() | ||
| .map_err(|_| ParseError::InvalidTime(arg.to_owned()))?; |
There was a problem hiding this comment.
Migrating to jiff::Timestamp makes timestamp parsing stricter than chrono: non-zero-padded inputs like until_time(2024-3-5T9:0:0Z) that were previously accepted are now rejected. This is an intentional, test-documented breaking change, but the resulting ParseError::InvalidTime / ParseError::BadTime messages don't guide users to the now-required format. Consider updating the Display impls (e.g. "Invalid time: {0}; expected an RFC 3339 timestamp like 2024-01-12T10:00:00Z") so CLI users hitting the new rejection get an actionable hint. Note also that fractional-second inputs (previously parseable by chrono) now fail with BadTime since Time::from_absolute_time requires whole seconds.
Suggestion:
| let date_time = arg | |
| .parse::<chrono::DateTime<chrono::Utc>>() | |
| .parse::<jiff::Timestamp>() | |
| .map_err(|_| ParseError::InvalidTime(arg.to_owned()))?; | |
| let date_time = arg | |
| .parse::<jiff::Timestamp>() | |
| .map_err(|_| ParseError::InvalidTime(arg.to_owned()))?; | |
| // Consider enriching ParseError::InvalidTime's Display with the | |
| // required RFC 3339 format, since jiff rejects previously-accepted | |
| // non-padded and fractional-second inputs. |
- cargo-vet: record explicit audit-as-crates-io=false policies for the three overlay forks, per the house convention for non-crates.io sources; the previous commit's message inaccurately described exemption rows being added, while 'cargo vet prune' had in fact removed the fork rows (git-sourced crates are outside the crates.io audit scope by default) - the policies make that state an explicit, recorded decision - CHANGELOG: note the Bad-time error message now rendering timestamps in RFC 3339 form (accepted user-visible drift) - until_time boundary tests: pin the exact error stage (InvalidTime) - user-facing strings: RFC 3339 -> RFC 3339-style, matching the actual (Temporal-hybrid) parser acceptance set - .gitignore: drop the two local-agent-workspace lines (long-tracked hygiene item)
cargo-vet's store consistency check requires [policy.*] entries in alphabetical order within the policy block, not appended at the end of the file.
- group the nanosecond literal consistently - drop a useless try_into on an i8 day value Clippy with --all-targets is now part of the pre-push local battery.
| @@ -52,5 +52,3 @@ target-debian/ | |||
| /Mintlayer_Node_win_*_Setup.exe | |||
| /Mintlayer_Node_GUI_win_*_Setup.exe | |||
There was a problem hiding this comment.
This change removes the .opencode/ ignore entry with no replacement rule. Local agent-workspace files (scratch code, cached state, potentially credentials/API tokens used by local tooling) can now be accidentally committed. If the directory no longer exists that's fine, but if the tooling is still in local use, keeping the ignore entry (or moving it to a developer-local .git/info/exclude) is safer.
Suggestion:
| /Mintlayer_Node_GUI_win_*_Setup.exe | |
| /Mintlayer_Node_GUI_win_*_Setup.exe | |
| # local agent workspace | |
| .opencode/ |
| # Overlay fork with chrono made optional (RUSTSEC-2026-0543); see | ||
| # https://github.com/kstrafe/file-rotate/pull/40 — revert to a released version once it ships. | ||
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", rev = "642a9d0a262912798e7edb5d2970d0129123d48b", default-features = false } |
There was a problem hiding this comment.
This swaps file-rotate, reedline, and serde_with to git forks under the personal nullPointerEnjoyer account, pinned only by rev. While rev pins prevent force-push drift, the forks themselves are unaudited third-party code compiled into production builds, and supply-chain/config.toml marks them audit-as-crates-io = false, removing them from cargo-vet coverage entirely. Combined with the new deny.toml allow-list entries, this creates a meaningful supply-chain trust expansion for a security remediation. Consider: (1) verifying the fork diffs against upstream are minimal (chrono removal only), (2) adding a real audit entry for the fork code instead of disabling audit-as-crates-io, or (3) at minimum referencing a tracked issue that mandates reverting to released versions.
Suggestion:
| # Overlay fork with chrono made optional (RUSTSEC-2026-0543); see | |
| # https://github.com/kstrafe/file-rotate/pull/40 — revert to a released version once it ships. | |
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", rev = "642a9d0a262912798e7edb5d2970d0129123d48b", default-features = false } | |
| # Overlay fork with chrono made optional (RUSTSEC-2026-0543); see | |
| # https://github.com/kstrafe/file-rotate/pull/40 — revert to a released version once it ships. | |
| # Tracked by <issue-link>; diff vs upstream verified to contain only the chrono-optionalization. | |
| file-rotate = { git = "https://github.com/nullPointerEnjoyer/file-rotate.git", rev = "642a9d0a262912798e7edb5d2970d0129123d48b", default-features = false } |
| reedline = "0.38" | ||
| # Overlay fork without chrono (RUSTSEC-2026-0543); revert to a released version once our | ||
| # MSRV allows reedline >= 0.53 (which dropped chrono upstream). | ||
| reedline = { git = "https://github.com/nullPointerEnjoyer/reedline.git", rev = "1747ab50dacb0d476666cfd072afa73b5283db82" } |
There was a problem hiding this comment.
The reedline fork dependency does not set default-features = false, unlike the file-rotate entry which does. This is inconsistent and risks re-enabling heavy default features (and potentially other integrations) in the fork, partially defeating the stated goal of the RUSTSEC-2026-0543 remediation. If the defaults are intentionally required, a comment saying so would clarify; otherwise consider default-features = false plus explicit feature lists, as done for file-rotate and iced_aw.
| [[exemptions.jiff-static]] | ||
| version = "1.0.1" | ||
| criteria = "safe-to-deploy" |
There was a problem hiding this comment.
The [[exemptions.*]] entries here (base64 0.23.1, the jiff family, portable-atomic-util, darling 0.24.1 bumps) grant safe-to-deploy to newly introduced, unaudited crates via blanket exemption rather than a trust/audit entry. jiff and its -static/-tzdb subcrates are compile-time-heavy and security-relevant; consider writing real audits for jiff-core/jiff-static (or trusting them via the mozilla/zcash imports once published) instead of long-lived exemptions.
Suggestion:
| [[exemptions.jiff-static]] | |
| version = "1.0.1" | |
| criteria = "safe-to-deploy" | |
| # TODO: replace these exemptions with real audits / trusted entries once jiff reviews land. | |
| [[exemptions.jiff-static]] | |
| version = "1.0.1" | |
| criteria = "safe-to-deploy" |
The previous attempt was lost to an aborted edit script, and the local default clippy (1.98) does not fire inconsistent_digit_grouping on the old literal while CI's 1.92 toolchain does. Verified this time with cargo +1.92.0 clippy --all-targets; pinning the CI toolchain version in the local pre-push battery.
| // `jiff::Timestamp`'s Display renders RFC 3339 (e.g. "2024-01-12T12:54:52Z"), | ||
| // which is what the Debug output looked like with `chrono`. | ||
| write!(f, "{time}") |
There was a problem hiding this comment.
The doc comment claims jiff's Display output "is what the Debug output looked like with chrono", but that's not accurate: chrono's Debug for DateTime<Utc> delegates to its Display, i.e. "2024-01-12 12:54:52.123 UTC", while jiff::Timestamp's Display renders RFC 3339 ("2024-01-12T12:54:52.123Z"). This is a silent behavioral change to the Debug format of Time (log lines, tracing output, tests that snapshot debug strings) — if backwards-compatible output is intended (as it is for Display below), Debug should format the same way; otherwise the comment and any consumers relying on the old format should be updated.
Suggestion:
| // `jiff::Timestamp`'s Display renders RFC 3339 (e.g. "2024-01-12T12:54:52Z"), | |
| // which is what the Debug output looked like with `chrono`. | |
| write!(f, "{time}") | |
| // Preserve chrono's Debug format ("2024-01-12 12:54:52 UTC"). | |
| write!(f, "{time}") // or reuse the Display formatting logic |
- drop a Duration import left unused by the jiff migration - drop a useless try_into on an i8 day value Verified with cargo +1.92.0 clippy --all-targets and its real exit code (the previous check read the exit code of a pipeline tail and could not fail).
| [policy.file-rotate] | ||
| audit-as-crates-io = false |
There was a problem hiding this comment.
Setting audit-as-crates-io = false for these crates means cargo vet treats them as git sources not subject to the crates.io audit policy, and there are no [[trusted]] entries covering the fork revs in audits.toml (only the chrono trusted entry was removed). As a result the fork code is deployed with zero audit coverage while the project generally requires audits for deployed dependencies. If these policies are intentional temporary measures, please note that in a comment; otherwise audit the pinned revs and record trust entries.
The code checker requires workspace dependency versions to be major.minor without a patch component; the lockfile still pins jiff 1.0.1 exactly.
|
Addressing the review notes from the automated pass (all severity-low): 1–2.
|
The RustSec advisory DB picked up RUSTSEC-2026-0543 (chrono unmaintained) on 2026-11-17, turning
cargo denyred on every branch (including #2095's CI and master's next run). The chrono maintainer confirmed in chronotope/chrono#1768 that the deprecation is deliberate and migration is the intended path, timed to the jiff 1.0 release.Rather than ignoring the advisory, this removes chrono from the workspace entirely:
First-party migration to jiff 1.0:
common: theTimeconversion boundary (as_absolute_time/from_absolute_time) and its Display/Debug impls now usejiff::Timestamp— output formats are byte-identicalwallet-cli-commands:until_timeparsing now requires strict RFC 3339 (some non-zero-padded variants were accepted before — noted in the CHANGELOG)node-gui,storage-test-suite: display formatting / test-container naming portednode-gui/backend: unused chrono dep droppedTransitive uses — overlay forks until upstream releases allow dropping them:
file-rotate: chrono made optional behind a default-ontimestampfeature — upstream PR: feat: make the chrono dependency optional kstrafe/file-rotate#40reedline: chrono dropped from the non-sqlite build (upstream dropped it in 0.53, which needs MSRV 1.95 > our 1.92)serde_with: the optional chrono integration removed — its weak feature references (chrono_0_4?/...) force chrono into every consumer's lockfile even when never activatediced_aw: unused date/time picker default features (the only chrono users) no longer enabledVerification:
cargo tree -i chrono→ not found (lockfile fully clean);cargo deny check→ advisories/bans/licenses/sources all ok;cargo vet check --lockedok (17 new exemptions); common 535/535, wallet-cli-commands 84/84, node-lib 21/21; fmt clean.The overlays are tracked for removal: file-rotate once #40 ships a release, reedline once our MSRV allows 0.53+, serde_with once chrono's status is resolved upstream.