Skip to content

Commit b990aed

Browse files
committed
Snark Worker: Replace Snark_worker.Time_span_with_json ->
Mina_stdlib.Time.Span
1 parent 2d90d4a commit b990aed

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

src/lib/snark_worker/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
error_json
4646
mina_node_config.unconfigurable_constants
4747
mina_state
48+
mina_stdlib
4849
transaction_protocol_state
4950
ppx_version.runtime)
5051
(preprocess

src/lib/snark_worker/entry.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let dispatch rpc shutdown_on_disconnect query address =
4747
let emit_proof_metrics
4848
(metrics :
4949
( Ledger_proof.Stable.Latest.t
50-
* Time_span_with_json.t
50+
* Mina_stdlib.Time.Span.t
5151
* [ `Merge | `Transition ] )
5252
One_or_two.t ) txns logger =
5353
One_or_two.iter (One_or_two.zip_exn metrics txns)

src/lib/snark_worker/events.ml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
open Core
22

3-
module Time_span_with_json = struct
4-
type t = Time.Span.t
5-
6-
let to_yojson total = `String (Time.Span.to_string_hum total)
7-
8-
let of_yojson = function
9-
| `String time ->
10-
Ok (Time.Span.of_string time)
11-
| _ ->
12-
Error "Snark_worker.Functor: Could not parse timespan"
13-
end
14-
153
(*FIX: register_event fails when adding base types to the constructors*)
164
module String_with_json = struct
175
type t = string
@@ -38,12 +26,12 @@ module Int_with_json = struct
3826
end
3927

4028
type Structured_log_events.t +=
41-
| Merge_snark_generated of { time : Time_span_with_json.t }
29+
| Merge_snark_generated of { time : Mina_stdlib.Time.Span.t }
4230
[@@deriving register_event { msg = "Merge SNARK generated in $time" }]
4331

4432
type Structured_log_events.t +=
4533
| Base_snark_generated of
46-
{ time : Time_span_with_json.t
34+
{ time : Mina_stdlib.Time.Span.t
4735
; transaction_type : String_with_json.t
4836
; zkapp_command_count : Int_with_json.t
4937
; proof_zkapp_command_count : Int_with_json.t

0 commit comments

Comments
 (0)