-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathbootstrap_controller.mli
47 lines (40 loc) · 1.77 KB
/
bootstrap_controller.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
open Async_kernel
open Pipe_lib
open Network_peer
module Transition_cache = Transition_cache
module type CONTEXT = sig
val logger : Logger.t
val precomputed_values : Precomputed_values.t
val constraint_constants : Genesis_constants.Constraint_constants.t
val consensus_constants : Consensus.Constants.t
end
type Structured_log_events.t += Bootstrap_complete [@@deriving register_event]
(** The entry point function for bootstrap controller. When bootstrap finished
it would return a transition frontier with the root breadcrumb and a list
of transitions collected during bootstrap.
Bootstrap controller would do the following steps to contrust the
transition frontier:
1. Download the root snarked_ledger.
2. Download the scan state and pending coinbases.
3. Construct the staged ledger from the snarked ledger, scan state and
pending coinbases.
4. Synchronize the consensus local state if necessary.
5. Close the old frontier and reload a new one from disk.
*)
val run :
context:(module CONTEXT)
-> trust_system:Trust_system.t
-> verifier:Verifier.t
-> network:Mina_networking.t
-> consensus_local_state:Consensus.Data.Local_state.t
-> transition_reader:
( [ `Block of Mina_block.initial_valid_block Envelope.Incoming.t
| `Header of Mina_block.initial_valid_header Envelope.Incoming.t ]
* [ `Valid_cb of Mina_net2.Validation_callback.t option ] )
Strict_pipe.Reader.t
-> preferred_peers:Network_peer.Peer.t list
-> persistent_root:Transition_frontier.Persistent_root.t
-> persistent_frontier:Transition_frontier.Persistent_frontier.t
-> initial_root_transition:Mina_block.Validated.t
-> catchup_mode:[ `Normal | `Super ]
-> (Transition_frontier.t * Transition_cache.element list) Deferred.t