-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace chrono with time 0.3 (backport to 0.23.x) #1036
Commits on Nov 29, 2021
-
Replace dependency on chrono with time 0.3
Changes in tendermint: Change Time implementation to crate time. chrono has soundness issues (see RUSTSEC-2020-0159) and does not seem to be actively maintained. Ensure Time can only have values that are valid for Google protobuf Timestamp messages. Add ErrorDetail variant DateOutOfRange to report when this restriction is not met. Remove conversions between Time and chrono::DateTime, replacing them with conversions from/to time::OffsetDateTime. Conversion from time::OffsetDateTime is made fallible with a TryFrom impl. Add Time methods checked_add and checked_sub. These should be used instead of the overloaded operators that broke the operator convention by returning a Result. Changes in tendermint-pbt-gen: Change the time stragegies and helpers to produce time::OffsetDateTime values. Add strategies to generate date-time values and RFC 3339 strings in the range valid for protobuf Timestamp messages. Changes in tendermint-proto: Provide another helper in the serializers::timestamp module, one that formats into a provided fmt::Write object. Changes in tendermint-rpc: Use `OffsetDateTime` and `Date` types provided by the `time` crate in query operands instead of their `chrono` counterparts.
Configuration menu - View commit details
-
Copy full SHA for 73ba36e - Browse repository at this point
Copy the full SHA 73ba36eView commit details
Commits on Nov 30, 2021
-
Harden Timestamp conversions and serde
Require the timestamp to be in the validity range (years 1-9999 in UTC) and the nanosecond member value to not exceed 999_999_999. Rename ErrorDetail::TimestampOverflow to TimestampNanosOutOfRange, because the old variant was not very informative (the chained TryFromIntError did not help) and we also use it for the above-range case now which is not an overflow.
Configuration menu - View commit details
-
Copy full SHA for 28d1f98 - Browse repository at this point
Copy the full SHA 28d1f98View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae72117 - Browse repository at this point
Copy the full SHA ae72117View commit details
Commits on Dec 2, 2021
-
Restore nanosecond range check in Time::from_unix_timestamp
Add a unit test to exercise the check.
Configuration menu - View commit details
-
Copy full SHA for 225c179 - Browse repository at this point
Copy the full SHA 225c179View commit details -
proto: Improve timestamp::fmt_as_rfc3339_nanos
- More ergonomic signature - A non-allocating implementation
Configuration menu - View commit details
-
Copy full SHA for dcd6ea5 - Browse repository at this point
Copy the full SHA dcd6ea5View commit details
Commits on Dec 7, 2021
-
Fix component name in changelog for 1030-remove-chrono
Co-authored-by: Thane Thomson <thane@informal.systems>
Configuration menu - View commit details
-
Copy full SHA for 88b4594 - Browse repository at this point
Copy the full SHA 88b4594View commit details -
time: Use Self instead of the type name in methods
Co-authored-by: Thane Thomson <thane@informal.systems>
Configuration menu - View commit details
-
Copy full SHA for a6542d4 - Browse repository at this point
Copy the full SHA a6542d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for c7f2ddb - Browse repository at this point
Copy the full SHA c7f2ddbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 56fdfe1 - Browse repository at this point
Copy the full SHA 56fdfe1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2498607 - Browse repository at this point
Copy the full SHA 2498607View commit details