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

Revamped bump up jsoo and alcotest and dune #13777

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5585e87
Bump up dune, alcotest and js_of_ocaml
dannywillems Jul 28, 2023
9e13ccc
Fix build error related to upgrade
dannywillems Jul 28, 2023
1a7c4c2
Bump up container images
dannywillems Jul 28, 2023
d3fa40f
Pickles: expose Ro module for testing
dannywillems Jul 28, 2023
053c92f
Pickles: implement consistency check for Ro
dannywillems Jul 28, 2023
6440544
Scripts: remove trailing whitespaces
dannywillems Jul 28, 2023
402e7a7
OPAM: bump up digestif to 1.1.4
dannywillems Jul 28, 2023
f1bfaa5
Pickles: update Digestif use, 1.1.4 compatibility
dannywillems Jul 28, 2023
23bf817
Updating snarkyjs changing ledger from class to object
dannywillems Jul 31, 2023
f65b590
Update src/lib/mina_metrics/prometheus_metrics/mina_metrics.ml
dannywillems Jul 31, 2023
e2e70f8
fixup! Pickles: implement consistency check for Ro
dannywillems Jul 31, 2023
2cf1e06
fixup! Update src/lib/mina_metrics/prometheus_metrics/mina_metrics.ml
dannywillems Jul 31, 2023
b2e2edb
Base58_check: move to alcotest + add test vectors
dannywillems Jul 31, 2023
5a47db2
Base58_check: activate tests for JavaScript
dannywillems Jul 31, 2023
3ffe6b3
Bump up snarkyjs
dannywillems Jul 31, 2023
1b6a286
Merge branch 'develop' into dannywillems/revamped-bump-up-jsoo
dannywillems Aug 1, 2023
9570934
fixup! Bump up container images
dannywillems Aug 1, 2023
bf2c803
Merge branch 'develop' into dannywillems/revamped-bump-up-jsoo
dannywillems Aug 2, 2023
cf11400
Replace deprecated Arg.env_var
dannywillems Aug 2, 2023
c29397d
Test_executive: fix deprecated warnings
dannywillems Aug 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions buildkite/src/Constants/ContainerImages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
-- NOTE: minaToolchain is the default image for various jobs, set to minaToolchainBullseye
-- NOTE: minaToolchainBullseye is also used for building Ubuntu Focal packages in CI
-- NOTE: minaToolchainBookworm is also used for building Ubuntu Jammy packages in CI
{
toolchainBase = "codaprotocol/ci-toolchain-base:v3",
minaToolchainBuster = "gcr.io/o1labs-192920/mina-toolchain@sha256:c3320cb0f75727d5f1e98c138dcf2c4cca29862413b4acfa529828793a650042",
minaToolchainBullseye = "gcr.io/o1labs-192920/mina-toolchain@sha256:1e2feaebd47c330e990fe3c4e0681d16ad42bfa642937c4c5142793da06c890b",
minaToolchainBookworm = "gcr.io/o1labs-192920/mina-toolchain@sha256:1e2feaebd47c330e990fe3c4e0681d16ad42bfa642937c4c5142793da06c890b",
minaToolchain = "gcr.io/o1labs-192920/mina-toolchain@sha256:1e2feaebd47c330e990fe3c4e0681d16ad42bfa642937c4c5142793da06c890b",
delegationBackendToolchain = "gcr.io/o1labs-192920/delegation-backend-production@sha256:8ca5880845514ef56a36bf766a0f9de96e6200d61b51f80d9f684a0ec9c031f4",
elixirToolchain = "elixir:1.10-alpine",
nodeToolchain = "node:14.13.1-stretch-slim",
ubuntu2004 = "ubuntu:20.04",
xrefcheck = "serokell/xrefcheck@sha256:8fbb35a909abc353364f1bd3148614a1160ef3c111c0c4ae84e58fdf16019eeb"
{ toolchainBase = "codaprotocol/ci-toolchain-base:v3"
, minaToolchainBuster =
"gcr.io/o1labs-192920/mina-toolchain@sha256:f4e8034792c6322fa0a93fa5d5ab1cdd4d97a51d21fa4ed286d3326878cd2f19"
, minaToolchainBullseye =
"gcr.io/o1labs-192920/mina-toolchain@sha256:05b7676b81288cec768fa9f913e127e45ede9c70f48615738a44b443dad44fce"
, minaToolchainBookworm =
"gcr.io/o1labs-192920/mina-toolchain@sha256:05b7676b81288cec768fa9f913e127e45ede9c70f48615738a44b443dad44fce"
, minaToolchain =
"gcr.io/o1labs-192920/mina-toolchain@sha256:05b7676b81288cec768fa9f913e127e45ede9c70f48615738a44b443dad44fce"
, delegationBackendToolchain =
"gcr.io/o1labs-192920/delegation-backend-production@sha256:8ca5880845514ef56a36bf766a0f9de96e6200d61b51f80d9f684a0ec9c031f4"
, elixirToolchain = "elixir:1.10-alpine"
, nodeToolchain = "node:14.13.1-stretch-slim"
, ubuntu2004 = "ubuntu:20.04"
, xrefcheck =
"serokell/xrefcheck@sha256:8fbb35a909abc353364f1bd3148614a1160ef3c111c0c4ae84e58fdf16019eeb"
}
34 changes: 19 additions & 15 deletions opam.export
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
opam-version: "2.0"
compiler: ["ocaml-base-compiler.4.14.0"]
roots: [
"alcotest.1.1.0"
"alcotest.1.7.0"
"angstrom.0.15.0"
"async_ssl.v0.14.0"
"bignum.v0.14.0"
Expand All @@ -16,9 +17,9 @@ roots: [
"graphql-cohttp.0.13.0"
"graphql-lwt.0.13.0"
"graphql_ppx.1.2.2"
"js_of_ocaml.4.0.0"
"js_of_ocaml-ppx.4.0.0"
"js_of_ocaml-toplevel.4.0.0"
"js_of_ocaml.5.4.0"
"js_of_ocaml-ppx.5.4.0"
"js_of_ocaml-toplevel.5.4.0"
"lmdb.1.0"
"menhir.20210419"
"merlin.4.5-414"
Expand All @@ -41,7 +42,7 @@ roots: [
"yojson.1.7.0"
]
installed: [
"alcotest.1.1.0"
"alcotest.1.7.0"
"angstrom.0.15.0"
"asetmap.0.8.1"
"astring.0.8.5"
Expand Down Expand Up @@ -74,7 +75,7 @@ installed: [
"caqti-driver-postgresql.1.5.1"
"charInfo_width.1.1.0"
"check_opam_switch.~dev"
"cmdliner.1.0.3"
"cmdliner.1.2.0"
"cohttp.5.0.0"
"cohttp-async.5.0.0"
"conduit.4.0.0"
Expand All @@ -101,36 +102,38 @@ installed: [
"cstruct.6.0.1"
"ctypes.0.17.1"
"ctypes-foreign.0.4.0"
"digestif.0.9.0"
"digestif.1.1.4"
"domain-name.0.3.0"
"dot-merlin-reader.4.2"
"dune.3.3.1"
"dune.3.9.2"
"dune-build-info.3.1.1"
"dune-configurator.2.8.2"
"dune-private-libs.2.6.2"
"duration.0.2.1"
"easy-format.1.3.2"
"either.1.0.0"
"eqaf.0.9"
"extlib.1.7.8"
"fieldslib.v0.14.0"
"fix.20201120"
"fmt.0.8.6"
"fmt.0.9.0"
"fpath.0.7.3"
"gen.1.1"
"graphql.0.13.0"
"graphql-async.0.13.0"
"graphql-cohttp.0.13.0"
"graphql-lwt.0.13.0"
"graphql_parser.0.12.2"
"graphql_parser.0.14.0"
"graphql_ppx.1.2.2"
"incremental.v0.14.0"
"integers.0.4.0"
"ipaddr.5.0.1"
"ipaddr-sexp.5.0.1"
"jane-street-headers.v0.14.0"
"js_of_ocaml.4.0.0"
"js_of_ocaml-compiler.4.0.0"
"js_of_ocaml-ppx.4.0.0"
"js_of_ocaml-toplevel.4.0.0"
"js_of_ocaml.5.4.0"
"js_of_ocaml-compiler.5.4.0"
"js_of_ocaml-ppx.5.4.0"
"js_of_ocaml-toplevel.5.4.0"
"jsonm.1.0.1"
"jst-config.v0.14.1"
"lambda-term.3.1.0"
Expand All @@ -150,8 +153,8 @@ installed: [
"mew.0.1.0"
"mew_vi.0.5.0"
"minicli.5.0.2"
"mirage-crypto-ec.0.11.0"
"mirage-crypto.0.11.0"
"mirage-crypto-ec.0.11.0"
"mirage-crypto-rng.0.11.0"
"mirage-crypto-rng-async.0.11.0"
"mmap.1.1.0"
Expand Down Expand Up @@ -231,6 +234,7 @@ installed: [
"result.1.5"
"rpc_parallel.v0.14.0"
"rresult.0.6.0"
"sedlex.2.5"
"seq.base"
"sexp_diff_kernel.v0.14.0"
"sexplib.v0.14.0"
Expand Down
10 changes: 5 additions & 5 deletions scripts/testone.sh
dannywillems marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -e

# File assumes tat you are running the program at the program at the root directory of the coda repo
# File assumes tat you are running the program at the program at the root directory of the mina repo

if [[ "$#" -eq "0" ]]; then
if [[ "$#" -eq "0" ]]; then
echo "This script needs at least one argument, TEST-FILE, to run"
exit 1
fi
Expand All @@ -22,9 +22,9 @@ DIRPATH=$(dirname "$TEST_FILE")
LIBRARY_NAME=$(basename "$DIRPATH")

TEST_RUNNER_PROG="$DIRPATH/.$LIBRARY_NAME.inline-tests/inline_test_runner_$LIBRARY_NAME.exe"
if [[ "$#" -eq "1" ]]; then
TEST_CASE="$TEST_FILE"
else
if [[ "$#" -eq "1" ]]; then
TEST_CASE="$TEST_FILE"
else
TEST_CASE="$TEST_FILE:$2"
fi
( ulimit -s 65532 || true ) && \
Expand Down
4 changes: 2 additions & 2 deletions src/app/logproc/logproc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,6 @@ let () =
, {|logproc -f '.message match /broadcast/ && .metadata.peer.host == "182.9.63.3" || .metadata.peer.discover_port == 8302|}
) ]
in
Term.info ~version:"0.1" ~doc ~exits:Term.default_exits ~man "logproc"
Cmd.info ~version:"0.1" ~doc ~man "logproc"
in
Term.(exit @@ eval (main_term, main_info))
Stdlib.exit @@ Cmd.eval @@ Cmd.v main_info main_term
2 changes: 1 addition & 1 deletion src/lib/mina_metrics/prometheus_metrics/mina_metrics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module TextFormat_0_0_4 = struct
| None ->
(label_names, label_values)
| Some (label_name, label_value) ->
let label_value_str = Fmt.strf "%a" output_value label_value in
let label_value_str = Fmt.str "%a" output_value label_value in
dannywillems marked this conversation as resolved.
Show resolved Hide resolved
(label_name :: label_names, label_value_str :: label_values)
in
Fmt.pf f "%a%s%a %a@." MetricName.pp base ext
Expand Down
1 change: 1 addition & 0 deletions src/lib/pickles/pickles.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module Make_str (_ : Wire_types.Concrete) = struct
module Cache_handle = Cache_handle
module Step_main_inputs = Step_main_inputs
module Step_verifier = Step_verifier
module Ro = Ro

exception Return_digest = Compile.Return_digest

Expand Down
1 change: 1 addition & 0 deletions src/lib/pickles/pickles_intf.mli
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module type S = sig
module Types_map = Types_map
module Step_verifier = Step_verifier
module Common = Common
module Ro = Ro

exception Return_digest of Md5.t

Expand Down
6 changes: 4 additions & 2 deletions src/lib/pickles/ro.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ open Backend
open Import

let bits_random_oracle =
let h = Digestif.blake2s 32 in
let module Blake2s = Digestif.Make_BLAKE2S (struct
let digest_size = 32
end) in
fun ~length s ->
Digestif.digest_string h s |> Digestif.to_raw_string h |> String.to_list
Blake2s.digest_string s |> Blake2s.to_raw_string |> String.to_list
|> List.concat_map ~f:(fun c ->
let c = Char.to_int c in
List.init 8 ~f:(fun i -> (c lsr i) land 1 = 1) )
Expand Down
3 changes: 3 additions & 0 deletions src/lib/pickles/tests/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(tests
(names test_ro)
(libraries alcotest core_kernel pickles))
20 changes: 20 additions & 0 deletions src/lib/pickles/tests/test_ro.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(* initially written to see the consistency between updates of digestif *)
let test_bits_random_oracle_consistency_check () =
let s = "BitsRandomOracle" in
let exp_output_str =
"01000001101110001111111100011000011000100010100011010010110110010011101101101000001110001110100101010100001000001110101110111010"
in
let exp_output =
List.map (fun i -> i = '1') (List.of_seq (String.to_seq exp_output_str))
dannywillems marked this conversation as resolved.
Show resolved Hide resolved
in
let output = Pickles.Ro.bits_random_oracle ~length:128 s in
dannywillems marked this conversation as resolved.
Show resolved Hide resolved
assert (List.for_all2 Bool.equal exp_output output)

let () =
let open Alcotest in
run "Pickles Random Oracle"
[ ( "bits_random_oracle"
, [ test_case "consistency_check" `Quick
test_bits_random_oracle_consistency_check
] )
]
2 changes: 1 addition & 1 deletion src/lib/snarkyjs