Skip to content
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

Fix timestamp precondition #11577

Merged
merged 13 commits into from
Aug 1, 2022
Merged

Conversation

mitschabaude
Copy link
Contributor

@mitschabaude mitschabaude commented Jul 27, 2022

This is the Mina part of fixing timestamp preconditions in snarkyjs (o1-labs/o1js#180)

  • Adds methods to Block_time to convert from Time_ns.t
  • Uses those methods inside Indexed_pool > check_timestamp_predicate, to convert the current time to Block_time and compare it against the precondition (instead of converting the precondition to Time_ns.t as before, which has some issues)
  • Also, changes the logic in check_timestamp_predicate to fail if any of the parties has an unsatisfied precondition. The old logic only failed if all parties were invalid.

@mitschabaude mitschabaude added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Jul 27, 2022
@mitschabaude mitschabaude marked this pull request as ready for review July 29, 2022 12:53
@mitschabaude mitschabaude requested review from a team, imeckler and mrmr1993 as code owners July 29, 2022 12:53
@@ -249,8 +258,14 @@ module Time = struct

let to_uint64 : t -> UInt64.t = to_span_since_epoch

(* TODO: this serializes the max_value to "-1", which isn't very nice *)
let to_string = Fn.compose Int64.to_string to_int64
Copy link
Member

Choose a reason for hiding this comment

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

same here, an error if negative

Copy link
Member

@psteckler psteckler left a comment

Choose a reason for hiding this comment

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

See comments.

@mitschabaude mitschabaude merged commit 74f5299 into develop Aug 1, 2022
@mitschabaude mitschabaude deleted the feature/snarkyjs-compatible-hashing branch August 1, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants