Repository navigation
Conversation
The promise is an HMAC over the opening fee params in which valid_until enters as chrono's to_rfc3339(), e.g. "2026-11-05T12:00:00.123+00:00". That string is not the LSPS0 wire format and no spec fixes it, but formatting it any differently voids every offer an LSP handed out and hasn't sold yet. Pin it before chrono is replaced, so a replacement has to reproduce it. The vectors are the ones blsp's lsps2-service pins, which verifies promises this plugin issued, so the two stay in agreement. Changelog-None
core/lsps2/mod.rs doesn't declare it, so it isn't compiled. The live LSPS2 service handler is in core/lsps2/service.rs and the HTLC handling in core/lsps2/htlc.rs. Changelog-None
chrono is unmaintained (RUSTSEC-2026-0543). lsps-types exposed it in
its API through DateTime::as_chrono() and the conversions to and from
chrono::DateTime<Utc>. Those are gone. jiff is a private dependency, so
callers only see DateTime and std types:
- DateTime::now(), DateTime::from_unix_millis(), DateTime::unix_millis()
- DateTime::checked_add(std::time::Duration)
- TryFrom<SystemTime> for DateTime and TryFrom<DateTime> for SystemTime
- FromStr, which parses like deserializing
- DateTime::to_rfc3339(), the format of chrono's to_rfc3339()
- DateTimeError for parse and range errors
Values built locally are still truncated to milliseconds and serialize
as "YYYY-MM-DDThh:mm:ss.uuuZ". Parsed values still keep full precision
and echo the string they came from.
DateTime holds a jiff::civil::DateTime in UTC rather than a
jiff::Timestamp: a Timestamp ends at 9999-12-30T22:00:00Z, and
datetimes up to the end of the year 9999 must keep parsing.
Parsing now takes exactly an RFC 3339 date-time, YYYY-MM-DDThh:mm:ss
with up to nine fractional digits and Z or a +hh:mm/-hh:mm offset ("t"
or a space for "T" and "z" for "Z" allowed). chrono also accepted leap
seconds, offsets without a colon and more than nine fractional digits.
Those are now rejected. Display now writes RFC 3339 in UTC
("2023-02-23T08:47:30.511Z") instead of chrono's
"2023-02-23 08:47:30.511 UTC".
The LSPS2 promise hashes valid_until as chrono's to_rfc3339() wrote
it, so the plugin now uses DateTime::to_rfc3339(), which writes the
same string. The pinned promise vectors pass unchanged. The plugin
moves off chrono as well, which removes it from the workspace.
lsps-types goes to 0.8.0.
Changelog-Changed: lsps-plugin: datetimes in LSPS messages must be RFC 3339. Leap seconds and offsets without a colon are no longer accepted.
This branch has not been deployed
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.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgradeFixes #9752.
chrono is unmaintained (RUSTSEC-2026-0543, informational).
lsps-typesexposed it in its public API, so this replaces it with jiff as a private dependency and bumpslsps-typesto 0.8.0. The only known users oflsps-typesare the CLN LSPS plugin and the blsp LSPS2 service, so this is a clean break without a compatibility feature.API changes in
lsps-typesRemoved:
DateTime::as_chrono()and the conversions to and fromchrono::DateTime<Utc>.Added:
DateTime::now(),DateTime::from_unix_millis(),DateTime::unix_millis()DateTime::checked_add(std::time::Duration)TryFrom<SystemTime> for DateTimeandTryFrom<DateTime> for SystemTimeFromStr, which parses like deserializingDateTime::to_rfc3339(), which writes the same string as chrono'sto_rfc3339()and is meant for the promise HMACDateTimeErrorUnchanged: local values are truncated to milliseconds and serialize as
YYYY-MM-DDThh:mm:ss.uuuZ. Parsed values keep full precision and echo the string they came from.Behaviour changes
Zor a+hh:mm/-hh:mmoffset. Leap seconds, offsets without a colon (+0200) and more than nine fractional digits were accepted by chrono and are now rejected.Displaywrites2023-02-23T08:47:30.511Zinstead of chrono's2023-02-23 08:47:30.511 UTC. This shows up in a few plugin error messages.DateTimestores ajiff::civil::DateTimein UTC rather than ajiff::Timestamp, because aTimestampends at9999-12-30T22:00:00Zand datetimes up to the end of the year 9999 must keep parsing. The fields of the fixed RFC 3339 layout are parsed directly, and jiff does the calendar validation and arithmetic. jiff is built without its time zone features, everything is UTC.