Module Consensus.Hooks

val is_genesis_epoch : constants:Constants.t -> Block_time.t -> bool
val received_at_valid_time : constants:Constants.t -> Data.Consensus_state.Value.t -> time_received:Unix_timestamp.t -> ( unit, [ `Too_early | `Too_late of int64 ] ) Core_kernel.result

* Check that a consensus state was received at a valid time.

type select_status = [
| `Keep
| `Take
]
val equal_select_status : select_status -> select_status -> bool

* Select between two ledger builder controller tips given the consensus * states for the two tips. Returns `\`Keep` if the first tip should be * kept, or `\`Take` if the second tip should be taken instead.

Data required to evaluate VRFs for an epoch

val get_block_data : slot_won:Data.Slot_won.t -> ledger_snapshot:Data.Local_state.Snapshot.Ledger_snapshot.t -> coinbase_receiver:Coinbase_receiver.t -> Data.Block_data.t
val frontier_root_transition : Data.Consensus_state.Value.t -> Data.Consensus_state.Value.t -> local_state:Data.Local_state.t -> snarked_ledger:Mina_ledger.Ledger.Db.t -> genesis_ledger_hash:Mina_base.Frozen_ledger_hash.t -> unit

* A hook for managing local state when the locked tip is updated.

* Indicator of when we should bootstrap

val get_epoch_ledger : constants:Constants.t -> consensus_state:Data.Consensus_state.Value.t -> local_state:Data.Local_state.t -> Data.Local_state.Snapshot.Ledger_snapshot.t
val epoch_end_time : constants:Constants.t -> Mina_numbers.Length.t -> Block_time.t
type local_state_sync

Data needed to synchronize the local state.

val local_state_sync_to_yojson : local_state_sync -> Yojson.Safe.t
val required_local_state_sync : constants:Constants.t -> consensus_state:Data.Consensus_state.Value.t -> local_state:Data.Local_state.t -> local_state_sync option

* Predicate indicating whether or not the local state requires synchronization.

val sync_local_state : context:(module Intf.CONTEXT) -> trust_system:Trust_system.t -> local_state:Data.Local_state.t -> glue_sync_ledger: ( preferred:Network_peer.Peer.t list -> (Mina_base.Frozen_ledger_hash.t * Mina_ledger.Sync_ledger.Query.t) Pipe_lib.Linear_pipe.Reader.t -> (Mina_base.Frozen_ledger_hash.t * Mina_ledger.Sync_ledger.Query.t * Mina_ledger.Sync_ledger.Answer.t Network_peer.Envelope.Incoming.t) Async.Pipe.Writer.t -> unit ) -> local_state_sync -> unit Async.Deferred.Or_error.t

* Synchronize local state over the network.

* glue_sync_ledger is Mina_networking.glue_sync_ledger, with the Mina_networking.t argument already supplied