Skip to content

Commit 7284a78

Browse files
committed
push sig kind out of txn router and bootstrap controller
1 parent f83a28a commit 7284a78

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

src/lib/bootstrap_controller/bootstrap_controller.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ let download_snarked_ledger ~trust_system ~preferred_peers ~transition_graph
288288
let run_cycle ~context:(module Context : CONTEXT) ~trust_system ~verifier
289289
~network ~consensus_local_state ~network_transition_pipe ~preferred_peers
290290
~persistent_root ~persistent_frontier ~initial_root_transition ~catchup_mode
291-
previous_cycles =
291+
~signature_kind previous_cycles =
292292
let open Context in
293293
(* The short-lived pipe allocated here will be closed
294294
when a follow-up pipe is allocated: in the next cycle of bootstrap
@@ -446,8 +446,7 @@ let run_cycle ~context:(module Context : CONTEXT) ~trust_system ~verifier
446446
|> Blockchain_state.snarked_local_state)
447447
~verifier ~constraint_constants ~scan_state
448448
~snarked_ledger:temp_mask ~expected_merkle_root
449-
~pending_coinbases ~get_state
450-
~signature_kind:Mina_signature_kind.t_DEPRECATED
449+
~pending_coinbases ~get_state ~signature_kind
451450
in
452451
ignore
453452
( Ledger.Maskable.unregister_mask_exn ~loc:__LOC__ temp_mask
@@ -679,14 +678,15 @@ let run_cycle ~context:(module Context : CONTEXT) ~trust_system ~verifier
679678
let run ~context:(module Context : CONTEXT) ~trust_system ~verifier ~network
680679
~consensus_local_state ~network_transition_pipe ~preferred_peers
681680
~persistent_root ~persistent_frontier ~initial_root_transition ~catchup_mode
682-
=
681+
~signature_kind =
683682
let open Context in
684683
let run_cycle =
685684
run_cycle
686685
~context:(module Context : CONTEXT)
687686
~trust_system ~verifier ~network ~consensus_local_state
688687
~network_transition_pipe ~preferred_peers ~persistent_root
689688
~persistent_frontier ~initial_root_transition ~catchup_mode
689+
~signature_kind
690690
in
691691
O1trace.thread "bootstrap"
692692
@@ fun () ->
@@ -905,7 +905,8 @@ let%test_module "Bootstrap_controller tests" =
905905
~trust_system ~verifier ~network:my_net.network ~preferred_peers:[]
906906
~consensus_local_state:my_net.state.consensus_local_state
907907
~network_transition_pipe ~persistent_root ~persistent_frontier
908-
~catchup_mode:`Super ~initial_root_transition )
908+
~catchup_mode:`Super ~initial_root_transition
909+
~signature_kind:Mina_signature_kind.t_DEPRECATED )
909910

910911
let assert_transitions_increasingly_sorted ~root
911912
(incoming_transitions : Transition_cache.element list) =

src/lib/bootstrap_controller/bootstrap_controller.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ val run :
5252
-> persistent_frontier:Transition_frontier.Persistent_frontier.t
5353
-> initial_root_transition:Mina_block.Validated.t
5454
-> catchup_mode:[ `Super ]
55+
-> signature_kind:Mina_signature_kind.t
5556
-> (Transition_frontier.t * Transition_cache.element list) Deferred.t

src/lib/mina_intf/transition_frontier_components_intf.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ module type Transition_router_intf = sig
341341
-> catchup_mode:[ `Super ]
342342
-> notify_online:(unit -> unit Deferred.t)
343343
-> ledger_backing:Mina_ledger.Ledger.Root.Config.backing_type
344+
-> signature_kind:Mina_signature_kind.t
344345
-> unit
345346
-> ( [ `Transition of Mina_block.Validated.t ]
346347
* [ `Source of [ `Gossip | `Catchup | `Internal ] ]

src/lib/mina_lib/mina_lib.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,8 @@ let create ~commit_id ?wallets (config : Config.t) =
21772177
~most_recent_valid_block_writer
21782178
~get_completed_work:
21792179
(Network_pool.Snark_pool.get_completed_work snark_pool)
2180-
~notify_online ~transaction_pool_proxy ~ledger_backing ()
2180+
~notify_online ~transaction_pool_proxy ~ledger_backing
2181+
~signature_kind:Mina_signature_kind.t_DEPRECATED ()
21812182
in
21822183
let ( valid_transitions_for_network
21832184
, valid_transitions_for_api

src/lib/mina_lib/tests/tests.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ let%test_module "Epoch ledger sync tests" =
363363
~network_transition_reader:block_reader ~producer_transition_reader
364364
~get_most_recent_valid_block ~most_recent_valid_block_writer
365365
~notify_online ?transaction_pool_proxy:None ~ledger_backing:Stable_db
366-
()
366+
~signature_kind:Mina_signature_kind.t_DEPRECATED ()
367367
in
368368
let%bind () = Ivar.read initialization_finish_signal in
369369
let tr_tm1 = Unix.gettimeofday () in

src/lib/transition_router/transition_router.ml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ let start_bootstrap_controller ~context:(module Context : CONTEXT) ~trust_system
142142
~producer_transition_writer_ref ~verified_transition_writer ~clear_reader
143143
~network_transition_pipe ~consensus_local_state ~frontier_w
144144
~initial_root_transition ~persistent_root ~persistent_frontier
145-
~cache_exceptions ~best_seen_transition ~catchup_mode =
145+
~cache_exceptions ~best_seen_transition ~catchup_mode ~signature_kind =
146146
let open Context in
147147
[%str_log info] Starting_bootstrap_controller ;
148148
producer_transition_writer_ref := None ;
@@ -165,7 +165,7 @@ let start_bootstrap_controller ~context:(module Context : CONTEXT) ~trust_system
165165
~context:(module Context)
166166
~trust_system ~verifier ~network ~consensus_local_state
167167
~network_transition_pipe ~persistent_frontier ~persistent_root
168-
~initial_root_transition ~preferred_peers ~catchup_mode )
168+
~initial_root_transition ~preferred_peers ~catchup_mode ~signature_kind )
169169
(fun (new_frontier, collected_transitions) ->
170170
start_transition_frontier_controller
171171
~context:(module Context)
@@ -372,7 +372,7 @@ let initialize ~transaction_pool_proxy ~context:(module Context : CONTEXT)
372372
~producer_transition_writer_ref ~clear_reader ~verified_transition_writer
373373
~cache_exceptions ~most_recent_valid_block_writer ~persistent_root
374374
~persistent_frontier ~consensus_local_state ~catchup_mode ~notify_online
375-
~network_transition_pipe =
375+
~network_transition_pipe ~signature_kind =
376376
let open Context in
377377
[%log info] "Initializing transition router" ;
378378
let%bind () =
@@ -410,6 +410,7 @@ let initialize ~transaction_pool_proxy ~context:(module Context : CONTEXT)
410410
~initial_root_transition ~catchup_mode
411411
~best_seen_transition:
412412
(Option.map ~f:(fun x -> `Block x) best_seen_transition)
413+
~signature_kind
413414
| Some best_tip, Some frontier
414415
when is_transition_for_bootstrap
415416
~context:(module Context)
@@ -438,6 +439,7 @@ let initialize ~transaction_pool_proxy ~context:(module Context : CONTEXT)
438439
~frontier_w ~initial_root_transition ~persistent_root
439440
~persistent_frontier ~cache_exceptions ~catchup_mode
440441
~best_seen_transition:(Some (`Block best_tip))
442+
~signature_kind
441443
| best_tip_opt, Some frontier ->
442444
let collected_transitions =
443445
match best_tip_opt with
@@ -547,7 +549,7 @@ let run ?(sync_local_state = true) ?(cache_exceptions = false)
547549
~frontier_broadcast_writer:frontier_w ~network_transition_reader
548550
~producer_transition_reader ~get_most_recent_valid_block
549551
~most_recent_valid_block_writer ~get_completed_work ~catchup_mode
550-
~notify_online ~ledger_backing () =
552+
~notify_online ~ledger_backing ~signature_kind () =
551553
let open Context in
552554
[%log info] "Starting transition router" ;
553555
let initialization_finish_signal = Ivar.create () in
@@ -641,7 +643,9 @@ let run ?(sync_local_state = true) ?(cache_exceptions = false)
641643
~producer_transition_writer_ref ~clear_reader
642644
~verified_transition_writer ~most_recent_valid_block_writer
643645
~consensus_local_state ~notify_online ~network_transition_pipe
646+
~signature_kind
644647
in
648+
645649
Ivar.fill_if_empty initialization_finish_signal () ;
646650

647651
let valid_transition_reader1, valid_transition_reader2 =
@@ -700,7 +704,8 @@ let run ?(sync_local_state = true) ?(cache_exceptions = false)
700704
~clear_reader ~network_transition_pipe
701705
~consensus_local_state ~frontier_w ~persistent_root
702706
~persistent_frontier ~initial_root_transition
703-
~best_seen_transition:(Some b_or_h) ~catchup_mode )
707+
~best_seen_transition:(Some b_or_h) ~catchup_mode
708+
~signature_kind )
704709
else Deferred.unit
705710
| None ->
706711
Deferred.unit

0 commit comments

Comments
 (0)