Skip to content

Conversation

@lalvesl
Copy link

@lalvesl lalvesl commented Jul 26, 2025

First of all, a huge thanks to all the contributors for this great library!

Changes:

Arithmetic Operations for Timestamp

  • Implemented the Add, Sub, and Div traits for the Timestamp type.
  • Added comprehensive unit tests and formal verification tests using the Kani verifier to ensure correctness

Enhanced chrono Interoperability, with chrono feature

  • Added support for into() and try_into() to enable lossless, round-trip conversions between Timestamp and the following chrono types:
    • DateTime;
    • NaiveDateTime;
    • NaiveDate;
  • Full test coverage is provided for these conversions, including both automated unit tests and Kani verification.

Nix Development Environment Update

  • The Nix configuration has been updated. Running nix develop .#rust_minimum_version now correctly sets up a development shell with the appropriate Minimum Supported Rust Version (MSRV) required by Tokio.

A Note on the README

I have updated the README.md to include documentation for the new Nix command. However, I noticed that the check-readme CI job is configured to fail automatically on any modification to the README.

This pull request introduces NO breaking changes.

lalvesl added 7 commits July 11, 2025 03:39
…other develop rust_minimum_version for tests
 - Implement Add, Sub and Div math operations;

 - Create unitary testes for Ops;

 - Create kani tests for ops;

 - Update kani tests for chrono conversions;

 - Add unitary testes for chrono conversions.
 - Add support for MSRV tokio with `nix develop .#rust_minimum_version`;

 - Update readme, with this nix command.
Copy link
Contributor

@caspermeijn caspermeijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the code changes. Please split into three PRs so that I can review them separately.

/// `Timestamp`s are likely representable on 64-bit Unix-like platforms, but other platforms,
/// such as Windows and 32-bit Linux, may not be able to represent the full range of
/// `Timestamp`s.
#[cfg(feature = "std")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a breaking change

}

#[cfg(feature = "chrono")]
mod p_chrono {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not abbreviate short words: proof_chrono

mod p_chrono {
use super::*;
use ::chrono::{DateTime, NaiveDate, NaiveDateTime};
//Why does it limit? In testing, it was left for more than 2 hours and not completed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this comment mean?

let seconds = kani::any();
let nanos = kani::any();

kani::assume(i64::MAX / 3 < seconds);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why divide by 3? Please explain the the code

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.

2 participants