Skip to content

Commit

Permalink
Merge pull request #16090 from MinaProtocol/merge-back-to-develop-202…
Browse files Browse the repository at this point in the history
…4-09-19

Merge back to develop
  • Loading branch information
mrmr1993 committed Sep 19, 2024
2 parents e9d723d + a29d6dd commit fb1c3c0
Show file tree
Hide file tree
Showing 73 changed files with 1,176 additions and 478 deletions.
15 changes: 13 additions & 2 deletions src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,10 @@ let setup_daemon logger ~itn_features ~default_snark_worker_fee =
~proof_level:Genesis_constants.Compiled.proof_level config_files
~genesis_constants ~constraint_constants ~cli_proof_level
in

constraint_constants.block_window_duration_ms |> Float.of_int
|> Time.Span.of_ms |> Mina_metrics.initialize_all ;

let rev_daemon_configs =
List.rev_filter_map config_jsons
~f:(fun (config_file, config_json) ->
Expand Down Expand Up @@ -1290,6 +1294,7 @@ Pass one of -peer, -peer-list-file, -seed, -peer-list-url.|} ;
; time_controller
; pubsub_v1
; pubsub_v0
; block_window_duration = compile_config.block_window_duration
}
in
let net_config =
Expand Down Expand Up @@ -1769,6 +1774,9 @@ let internal_commands logger =
and format =
flag "--format" ~aliases:[ "-format" ] (optional string)
~doc:"sexp/json the format to parse input in"
and limit =
flag "--limit" ~aliases:[ "-limit" ] (optional int)
~doc:"limit the number of proofs taken from the file"
in
fun () ->
let open Async in
Expand Down Expand Up @@ -1857,11 +1865,14 @@ let internal_commands logger =
~conf_dir:(Some conf_dir) ()
in
let%bind result =
let cap lst =
Option.value_map ~default:Fn.id ~f:(Fn.flip List.take) limit lst
in
match input with
| `Transaction input ->
Verifier.verify_transaction_snarks verifier input
input |> cap |> Verifier.verify_transaction_snarks verifier
| `Blockchain input ->
Verifier.verify_blockchain_snarks verifier input
input |> cap |> Verifier.verify_blockchain_snarks verifier
in
match result with
| Ok (Ok ()) ->
Expand Down
8 changes: 6 additions & 2 deletions src/app/cli/src/init/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1612,12 +1612,14 @@ let generate_libp2p_keypair_do privkey_path =
(let open Deferred.Let_syntax in
(* FIXME: I'd like to accumulate messages into this logger and only dump them out in failure paths. *)
let logger = Logger.null () in
let compile_config = Mina_compile_config.Compiled.t in
(* Using the helper only for keypair generation requires no state. *)
File_system.with_temp_dir "mina-generate-libp2p-keypair" ~f:(fun tmpd ->
match%bind
Mina_net2.create ~logger ~conf_dir:tmpd ~all_peers_seen_metric:false
~pids:(Child_processes.Termination.create_pid_table ())
~on_peer_connected:ignore ~on_peer_disconnected:ignore ()
~on_peer_connected:ignore ~on_peer_disconnected:ignore
~block_window_duration:compile_config.block_window_duration ()
with
| Ok net ->
let%bind me = Mina_net2.generate_random_keypair net in
Expand All @@ -1644,12 +1646,14 @@ let dump_libp2p_keypair_do privkey_path =
Deferred.ignore_m
(let open Deferred.Let_syntax in
let logger = Logger.null () in
let compile_config = Mina_compile_config.Compiled.t in
(* Using the helper only for keypair generation requires no state. *)
File_system.with_temp_dir "mina-dump-libp2p-keypair" ~f:(fun tmpd ->
match%bind
Mina_net2.create ~logger ~conf_dir:tmpd ~all_peers_seen_metric:false
~pids:(Child_processes.Termination.create_pid_table ())
~on_peer_connected:ignore ~on_peer_disconnected:ignore ()
~on_peer_connected:ignore ~on_peer_disconnected:ignore
~block_window_duration:compile_config.block_window_duration ()
with
| Ok net ->
let%bind () = Mina_net2.shutdown net in
Expand Down
11 changes: 9 additions & 2 deletions src/lib/bootstrap_controller/bootstrap_controller.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module type CONTEXT = sig
val constraint_constants : Genesis_constants.Constraint_constants.t

val consensus_constants : Consensus.Constants.t

val compile_config : Mina_compile_config.t
end

type Structured_log_events.t += Bootstrap_complete
Expand Down Expand Up @@ -712,6 +714,8 @@ let%test_module "Bootstrap_controller tests" =

let constraint_constants = precomputed_values.constraint_constants

let compile_config = Mina_compile_config.For_unit_tests.t

module Context = struct
let logger = Logger.create ()

Expand All @@ -721,6 +725,8 @@ let%test_module "Bootstrap_controller tests" =
Genesis_constants.For_unit_tests.Constraint_constants.t

let consensus_constants = precomputed_values.consensus_constants

let compile_config = compile_config
end

let verifier =
Expand Down Expand Up @@ -769,7 +775,8 @@ let%test_module "Bootstrap_controller tests" =
let%bind fake_network =
Fake_network.Generator.(
gen ~precomputed_values ~verifier ~max_frontier_length
[ fresh_peer; fresh_peer ] ~use_super_catchup:false)
~compile_config [ fresh_peer; fresh_peer ]
~use_super_catchup:false)
in
let%map make_branch =
Transition_frontier.Breadcrumb.For_tests.gen_seq ~precomputed_values
Expand Down Expand Up @@ -899,7 +906,7 @@ let%test_module "Bootstrap_controller tests" =
Quickcheck.test ~trials:1
Fake_network.Generator.(
gen ~precomputed_values ~verifier ~max_frontier_length
~use_super_catchup:false
~use_super_catchup:false ~compile_config
[ fresh_peer
; peer_with_branch
~frontier_branch_size:((max_frontier_length * 2) + 2)
Expand Down
2 changes: 2 additions & 0 deletions src/lib/bootstrap_controller/bootstrap_controller.mli
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module type CONTEXT = sig
val constraint_constants : Genesis_constants.Constraint_constants.t

val consensus_constants : Consensus.Constants.t

val compile_config : Mina_compile_config.t
end

type Structured_log_events.t += Bootstrap_complete [@@deriving register_event]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ open Kimchi_backend_common

module Rounds : sig
open Pickles_types

module Wrap : Nat.Add.Intf_transparent
module Wrap = Nat.N15

module Wrap_vector : Vector.With_version(Wrap).S

module Step : Nat.Add.Intf_transparent
module Step = Nat.N16

module Step_vector : Vector.With_version(Step).S
end = struct
Expand Down
Loading

0 comments on commit fb1c3c0

Please sign in to comment.