Skip to content

Commit 03f100c

Browse files
authored
Merge branch 'compatible' into dkijania/remove_unused_oses
2 parents a9d26c0 + fe57c27 commit 03f100c

File tree

12 files changed

+68
-50
lines changed

12 files changed

+68
-50
lines changed

buildkite/src/Constants/ContainerImages.dhall

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
-- NOTE: minaToolchainBookworm is also used for building Ubuntu Jammy packages in CI
55
{ toolchainBase = "codaprotocol/ci-toolchain-base:v3"
66
, minaToolchainBookworm =
7-
"gcr.io/o1labs-192920/mina-toolchain@sha256:15cf59fad0cc42bb3da010e1c994e027a77fa365e1db8eeffee0a7517e479e38"
7+
"gcr.io/o1labs-192920/mina-toolchain@sha256:844efb68c890524938b3cac30b2f41a43cb0a24f1eed6d5a9b5912a72cf4ad71"
88
, minaToolchainBullseye =
9-
"gcr.io/o1labs-192920/mina-toolchain@sha256:224be4d785c8adbcf4961ba61a850eee6a46f1282bfd77314edbb08e242088e1"
9+
"gcr.io/o1labs-192920/mina-toolchain@sha256:bbeaa957443357adf132951fe780600821d817c40cfbc6c71a04eba5e97df97f"
1010
, minaToolchainNoble =
11-
"gcr.io/o1labs-192920/mina-toolchain@sha256:53605f649176a07cba5e8e924950c6f3af4c803b891c13c2f77ca014703ff669"
11+
"gcr.io/o1labs-192920/mina-toolchain@sha256:9eb216d62a319ba9ef9670e7b753d76f24db8f86ad638992e5095839348b401a"
1212
, minaToolchain =
13-
"gcr.io/o1labs-192920/mina-toolchain@sha256:224be4d785c8adbcf4961ba61a850eee6a46f1282bfd77314edbb08e242088e1"
13+
"gcr.io/o1labs-192920/mina-toolchain@sha256:bbeaa957443357adf132951fe780600821d817c40cfbc6c71a04eba5e97df97f"
1414
, postgres = "postgres:12.4-alpine"
1515
, xrefcheck =
1616
"dkhamsing/awesome_bot@sha256:a8adaeb3b3bd5745304743e4d8a6d512127646e420544a6d22d9f58a07f35884"

opam.export

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ opam-version: "2.0"
33
# - dockerfiles/1-build-deps
44
# - opam.export
55
# - scripts/update_opam_switch.sh
6-
compiler: ["ocaml-base-compiler.4.14.2"]
6+
compiler: [
7+
"base-bigarray.base"
8+
"base-threads.base"
9+
"base-unix.base"
10+
"ocaml.4.14.2"
11+
"ocaml-base-compiler.4.14.2"
12+
"ocaml-config.2"
13+
"ocaml-options-vanilla.1"
14+
]
715
roots: [
816
"alcotest.1.1.0"
917
"alcotest-async.1.1.0"
@@ -31,7 +39,7 @@ roots: [
3139
"ocamlgraph.1.8.8"
3240
"ocp-browser.1.3.3"
3341
"ocp-indent.1.7.0"
34-
"odoc.2.1.0"
42+
"odoc.2.1.1"
3543
"ppx_bitstring.4.1.0"
3644
"ppx_deriving.5.2.1"
3745
"ppx_deriving_yojson.3.6.1"
@@ -90,13 +98,14 @@ installed: [
9098
"conduit.4.0.0"
9199
"conduit-async.4.0.0"
92100
"conf-g++.1.0"
93-
"conf-gmp.2"
101+
"conf-gmp.5"
94102
"conf-libbz2.1"
95103
"conf-libffi.2.0.0"
104+
"conf-libssl.4"
96105
"conf-m4.1"
97-
"conf-perl.1"
98-
"conf-pkg-config.1.1"
99-
"conf-postgresql.1"
106+
"conf-perl.2"
107+
"conf-pkg-config.4"
108+
"conf-postgresql.2"
100109
"conf-which.1"
101110
"conf-zlib.1"
102111
"core.v0.14.1"
@@ -106,7 +115,7 @@ installed: [
106115
"core_unix.v0.14.0"
107116
"cppo.1.6.7"
108117
"cppo_ocamlbuild.1.6.7"
109-
"crunch.3.0.0"
118+
"crunch.3.2.0"
110119
"csexp.1.5.1"
111120
"cstruct.6.0.1"
112121
"ctypes.0.17.1"
@@ -184,7 +193,7 @@ installed: [
184193
"ocp-index.1.3.3"
185194
"ocplib-endian.1.0"
186195
"octavius.1.2.2"
187-
"odoc.2.1.0"
196+
"odoc.2.1.1"
188197
"odoc-parser.1.0.0"
189198
"opam-core.2.1.2"
190199
"opam-file-format.2.1.4"

src/lib/exit_handlers/exit_handlers.ml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,8 @@ open Core_kernel
44
open Async_kernel
55
open Async_unix
66

7-
(* register a thunk to be called at exit; log registration and execution *)
8-
let register_handler ~logger ~description (f : unit -> unit) =
9-
[%log info] "Registering exit handler: $description"
10-
~metadata:[ ("description", `String description) ] ;
11-
let logging_thunk () =
12-
[%log info] "Running exit handler: $description"
13-
~metadata:[ ("description", `String description) ] ;
14-
(* if there's an exception, log it, allow other handlers to run *)
15-
try f ()
16-
with exn ->
17-
[%log info] "When running exit handler: $description, got exception $exn"
18-
~metadata:
19-
[ ("description", `String description)
20-
; ("exn", `String (Exn.to_string exn))
21-
]
22-
in
23-
Stdlib.at_exit logging_thunk
24-
25-
(* register a Deferred.t thunk to be called at Async shutdown; log registration and execution *)
7+
(* register a Deferred.t thunk to be called at Async shutdown; log registration
8+
and execution *)
269
let register_async_shutdown_handler ~logger ~description
2710
(f : unit -> unit Deferred.t) =
2811
[%log debug] "Registering async shutdown handler: $description"

src/lib/network_pool/batcher.ml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,17 @@ module Snark_pool = struct
425425
426426
type t = (proof_envelope, partial, unit) batcher [@@deriving sexp]
427427
428-
let verify (t : t) (p : proof_envelope) : bool Deferred.Or_error.t =
429-
let open Deferred.Or_error.Let_syntax in
430-
match%map verify t p with Ok () -> true | Error _ -> false
428+
let verify (t : t) (p : proof_envelope) :
429+
(unit, [> `Crash of Error.t | `Invalid of Verifier.invalid ]) result
430+
Deferred.t =
431+
let%map.Deferred verification_result = verify t p in
432+
match verification_result with
433+
| Ok (Ok ()) ->
434+
Ok ()
435+
| Ok (Error invalid) ->
436+
Error (`Invalid invalid)
437+
| Error e ->
438+
Error (`Crash e)
431439
432440
let create ~proof_cache_db ~logger verifier : t =
433441
create
@@ -474,13 +482,16 @@ module Snark_pool = struct
474482
end
475483
476484
let verify' (t : t) ps =
477-
let open Deferred.Or_error.Let_syntax in
485+
let open Deferred.Let_syntax in
478486
let%map invalid =
479-
Deferred.Or_error.List.filter_map ps ~f:(fun p ->
480-
match%map verify t p with true -> None | false -> Some p )
487+
Deferred.List.filter_map ps ~f:(fun p ->
488+
match%map verify t p with
489+
| Ok () ->
490+
None
491+
| Error e ->
492+
Some (Work_key.of_proof_envelope p, e) )
481493
in
482-
`Invalid
483-
(Work_key.Set.of_list (List.map invalid ~f:Work_key.of_proof_envelope))
494+
`Invalid (Work_key.Map.of_alist_exn invalid)
484495
485496
let%test_module "With valid and invalid proofs" =
486497
( module struct
@@ -539,9 +550,11 @@ module Snark_pool = struct
539550
let run_test proof_lists =
540551
let batcher = create ~proof_cache_db ~logger verifier in
541552
Deferred.List.iter proof_lists ~f:(fun (invalid_proofs, proof_list) ->
542-
let%map r = verify' batcher proof_list in
543-
let (`Invalid ps) = Or_error.ok_exn r in
544-
assert (Work_key.Set.equal ps invalid_proofs) )
553+
let%map (`Invalid pfs_and_reasons) = verify' batcher proof_list in
554+
assert (
555+
Work_key.Set.equal
556+
(Work_key.Map.key_set pfs_and_reasons)
557+
invalid_proofs ) )
545558
546559
let gen ~(valid_count : [ `Any | `Count of int ])
547560
~(invalid_count : [ `Any | `Count of int ]) =

src/lib/network_pool/batcher.mli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ module Snark_pool : sig
1515
-> Verifier.t
1616
-> t
1717

18-
val verify : t -> proof_envelope -> bool Deferred.Or_error.t
18+
val verify :
19+
t
20+
-> proof_envelope
21+
-> (unit, [> `Crash of Error.t | `Invalid of Verifier.invalid ]) Result.t
22+
Deferred.t
1923
end
2024

2125
type ('initial, 'partially_validated, 'result) t

src/lib/network_pool/snark_pool.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,14 @@ struct
446446
invalid "invalid key"
447447
| Some _ -> (
448448
match%bind Batcher.Snark_pool.verify t.batcher proof_env with
449-
| Ok true ->
449+
| Ok () ->
450450
Deferred.Result.return ()
451-
| Ok false ->
451+
| Error (`Invalid invalid) ->
452+
let invalid_err = Verifier.invalid_to_error invalid in
452453
(* if this proof is in the set of invalid proofs*)
453-
let e = Error.of_string "Invalid proof" in
454-
let%bind () = log e in
455-
invalid "invalid proof"
456-
| Error e ->
454+
let%map () = log invalid_err in
455+
Error (Invalid invalid_err)
456+
| Error (`Crash e) ->
457457
(* Verifier crashed or other errors at our end. Don't punish the peer*)
458458
let%map () = log ~punish:false e in
459459
Error (Failure e) )

src/lib/rocksdb/database.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(* rocksdb.ml -- expose RocksDB operations for Mina *)
2+
open Core_kernel
23

34
type t = { uuid : Uuid.Stable.V1.t; db : (Rocks.t[@sexp.opaque]) }
45
[@@deriving sexp]

src/lib/rocksdb/database.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
open Core_kernel
2+
13
type uuid := Uuid.Stable.V1.t
24

35
type key := Bigstring.t

src/lib/rocksdb/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(name rocksdb)
33
(public_name rocksdb)
44
(library_flags -linkall)
5-
(flags -open Core_kernel)
5+
(flags (:standard -warn-error +a))
66
(libraries
77
;; opam libraries
88
async

src/lib/rocksdb/intf.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
open Core_kernel
2+
13
module Key = struct
24
module type S = sig
35
type 'a t

0 commit comments

Comments
 (0)