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.
val equal_select_status : select_status -> select_status -> bool
val select :
context:(module Intf.CONTEXT) ->
existing:
Data.Consensus_state.Value.t Mina_base.State_hash.With_state_hashes.t ->
candidate:
Data.Consensus_state.Value.t Mina_base.State_hash.With_state_hashes.t ->
select_status
* 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.
val get_epoch_data_for_vrf :
constants:Constants.t ->
Unix_timestamp.t ->
Data.Consensus_state.Value.t ->
local_state:Data.Local_state.t ->
logger:Logger.t ->
Data.Epoch_data_for_vrf.t * Data.Local_state.Snapshot.Ledger_snapshot.t
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.
val should_bootstrap :
context:(module Intf.CONTEXT) ->
existing:
Data.Consensus_state.Value.t Mina_base.State_hash.With_state_hashes.t ->
candidate:
Data.Consensus_state.Value.t Mina_base.State_hash.With_state_hashes.t ->
bool
* 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
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
module Make_state_hooks
(Blockchain_state : Intf.Blockchain_state)
(Protocol_state :
Intf.Protocol_state
with type blockchain_state := Blockchain_state.Value.t
and type blockchain_state_var := Blockchain_state.var
and type consensus_state := Data.Consensus_state.Value.t
and type consensus_state_var := Data.Consensus_state.var)
(Snark_transition :
Intf.Snark_transition
with type blockchain_state_var := Blockchain_state.var
and type consensus_transition_var := Data.Consensus_transition.var) :
Intf.State_hooks
with type blockchain_state := Blockchain_state.Value.t
and type protocol_state := Protocol_state.Value.t
and type protocol_state_var := Protocol_state.var
and type snark_transition_var := Snark_transition.var
and type consensus_state := Data.Consensus_state.Value.t
and type consensus_state_var := Data.Consensus_state.var
and type consensus_transition := Data.Consensus_transition.Value.t
and type block_data := Data.Block_data.t