Module Mina_block.Validation
type ('time_received, 'genesis_state, 'proof, 'delta_block_chain, 'frontier_dependencies, 'staged_ledger_diff, 'protocol_versions)
t =
'time_received
* 'genesis_state
* 'proof
* 'delta_block_chain
* 'frontier_dependencies
* 'staged_ledger_diff
* 'protocol_versions
type ('time_received, 'genesis_state, 'proof, 'delta_block_chain, 'frontier_dependencies, 'staged_ledger_diff, 'protocol_versions)
with_block =
Mina_block__Block.Stable.V2.t Mina_base.State_hash.With_state_hashes.t
* ( 'time_received,
'genesis_state,
'proof,
'delta_block_chain,
'frontier_dependencies,
'staged_ledger_diff,
'protocol_versions )
t
val validation :
( 'a, 'b, 'c, 'd, 'e, 'f, 'g ) with_block ->
( 'a, 'b, 'c, 'd, 'e, 'f, 'g ) t
val block : ( _, _, _, _, _, _, _ ) with_block -> Mina_block__Block.Stable.V2.t
val validate_time_received :
precomputed_values:Precomputed_values.t ->
time_received:Block_time.t ->
( [ `Time_received ] * unit Truth.false_t, 'a, 'b, 'c, 'd, 'e, 'f )
with_block ->
( ( [ `Time_received ] * unit Truth.true_t, 'a, 'b, 'c, 'd, 'e, 'f )
with_block,
[> `Invalid_time_received of [ `Too_early | `Too_late of int64 ] ] )
Core_kernel.Result.t
val skip_time_received_validation :
[ `This_block_was_not_received_via_gossip ] ->
( [ `Time_received ] * unit Truth.false_t, 'a, 'b, 'c, 'd, 'e, 'f )
with_block ->
( [ `Time_received ] * unit Truth.true_t, 'a, 'b, 'c, 'd, 'e, 'f ) with_block
val validate_genesis_protocol_state :
genesis_state_hash:Mina_base.State_hash.t ->
( 'a, [ `Genesis_state ] * unit Truth.false_t, 'b, 'c, 'd, 'e, 'f )
with_block ->
( ( 'a, [ `Genesis_state ] * unit Truth.true_t, 'b, 'c, 'd, 'e, 'f )
with_block,
[> `Invalid_genesis_protocol_state ] )
Core_kernel.Result.t
val skip_genesis_protocol_state_validation :
[ `This_block_was_generated_internally ] ->
( 'a, [ `Genesis_state ] * unit Truth.false_t, 'b, 'c, 'd, 'e, 'f )
with_block ->
( 'a, [ `Genesis_state ] * unit Truth.true_t, 'b, 'c, 'd, 'e, 'f ) with_block
val reset_genesis_protocol_state_validation :
( 'a, [ `Genesis_state ] * unit Truth.true_t, 'b, 'c, 'd, 'e, 'f ) with_block ->
( 'a, [ `Genesis_state ] * unit Truth.false_t, 'b, 'c, 'd, 'e, 'f )
with_block
val validate_proofs :
verifier:Verifier.t ->
genesis_state_hash:Mina_base.State_hash.t ->
( 'a, 'b, [ `Proof ] * unit Truth.false_t, 'c, 'd, 'e, 'f ) with_block list ->
( ( 'a, 'b, [ `Proof ] * unit Truth.true_t, 'c, 'd, 'e, 'f ) with_block list,
[> `Invalid_proof | `Verifier_error of Core_kernel.Error.t ] )
Async_kernel.Deferred.Result.t
val validate_single_proof :
verifier:Verifier.t ->
genesis_state_hash:Mina_base.State_hash.t ->
( 'a, 'b, [ `Proof ] * unit Truth.false_t, 'c, 'd, 'e, 'f ) with_block ->
( ( 'a, 'b, [ `Proof ] * unit Truth.true_t, 'c, 'd, 'e, 'f ) with_block,
[> `Invalid_proof | `Verifier_error of Core_kernel.Error.t ] )
Async_kernel.Deferred.Result.t
val skip_proof_validation :
[ `This_block_was_generated_internally ] ->
( 'a, 'b, [ `Proof ] * unit Truth.false_t, 'c, 'd, 'e, 'f ) with_block ->
( 'a, 'b, [ `Proof ] * unit Truth.true_t, 'c, 'd, 'e, 'f ) with_block
val validate_delta_block_chain :
( 'a,
'b,
'c,
[ `Delta_block_chain ]
* Mina_base.State_hash.t Mina_stdlib.Nonempty_list.t Truth.false_t,
'd,
'e,
'f )
with_block ->
( ( 'a,
'b,
'c,
[ `Delta_block_chain ]
* Mina_base.State_hash.t Mina_stdlib.Nonempty_list.t Truth.true_t,
'd,
'e,
'f )
with_block,
[> `Invalid_delta_block_chain_proof ] )
Core_kernel.Result.t
val skip_delta_block_chain_validation :
[ `This_block_was_not_received_via_gossip ] ->
( 'a,
'b,
'c,
[ `Delta_block_chain ]
* Mina_base.State_hash.t Mina_stdlib.Nonempty_list.t Truth.false_t,
'd,
'e,
'f )
with_block ->
( 'a,
'b,
'c,
[ `Delta_block_chain ]
* Mina_base.State_hash.t Mina_stdlib.Nonempty_list.t Truth.true_t,
'd,
'e,
'f )
with_block
val validate_frontier_dependencies :
context:(module CONTEXT) ->
root_block:
Mina_block__Block.Stable.V2.t Mina_base.State_hash.With_state_hashes.t ->
get_block_by_hash:
( Mina_base.State_hash.t ->
Mina_block__Block.Stable.V2.t Mina_base.State_hash.With_state_hashes.t
option ) ->
( 'a, 'b, 'c, 'd, [ `Frontier_dependencies ] * unit Truth.false_t, 'e, 'f )
with_block ->
( ( 'a, 'b, 'c, 'd, [ `Frontier_dependencies ] * unit Truth.true_t, 'e, 'f )
with_block,
[> `Already_in_frontier
| `Not_selected_over_frontier_root
| `Parent_missing_from_frontier ] )
Core_kernel.Result.t
val skip_frontier_dependencies_validation :
[ `This_block_belongs_to_a_detached_subtree
| `This_block_was_loaded_from_persistence ] ->
( 'a, 'b, 'c, 'd, [ `Frontier_dependencies ] * unit Truth.false_t, 'e, 'f )
with_block ->
( 'a, 'b, 'c, 'd, [ `Frontier_dependencies ] * unit Truth.true_t, 'e, 'f )
with_block
val reset_frontier_dependencies_validation :
( 'a, 'b, 'c, 'd, [ `Frontier_dependencies ] * unit Truth.true_t, 'e, 'f )
with_block ->
( 'a, 'b, 'c, 'd, [ `Frontier_dependencies ] * unit Truth.false_t, 'e, 'f )
with_block
val validate_staged_ledger_diff :
?skip_staged_ledger_verification:[ `All | `Proofs ] ->
logger:Logger.t ->
precomputed_values:Genesis_proof.t ->
verifier:Verifier.t ->
parent_staged_ledger:Staged_ledger.t ->
parent_protocol_state:Mina_state.Protocol_state.Value.t ->
( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.false_t, 'f )
with_block ->
( [ `Just_emitted_a_proof of bool ]
* [ `Block_with_validation of
( 'a,
'b,
'c,
'd,
'e,
[ `Staged_ledger_diff ] * unit Truth.true_t,
'f )
with_block ]
* [ `Staged_ledger of Staged_ledger.t ],
[> `Staged_ledger_application_failed of Staged_ledger.Staged_ledger_error.t
| `Invalid_body_reference
| `Invalid_staged_ledger_diff of
[ `Incorrect_target_staged_ledger_hash
| `Incorrect_target_snarked_ledger_hash ]
list ] )
Async_kernel.Deferred.Result.t
val validate_staged_ledger_hash :
[ `Staged_ledger_already_materialized of Mina_base.Staged_ledger_hash.t ] ->
( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.false_t, 'f )
with_block ->
( ( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.true_t, 'f )
with_block,
[> `Staged_ledger_hash_mismatch ] )
Core_kernel.Result.t
val skip_staged_ledger_diff_validation :
[ `This_block_has_a_trusted_staged_ledger ] ->
( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.false_t, 'f )
with_block ->
( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.true_t, 'f )
with_block
val reset_staged_ledger_diff_validation :
( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.true_t, 'f )
with_block ->
( 'a, 'b, 'c, 'd, 'e, [ `Staged_ledger_diff ] * unit Truth.false_t, 'f )
with_block
val validate_protocol_versions :
( 'a, 'b, 'c, 'd, 'e, 'f, [ `Protocol_versions ] * unit Truth.false_t )
with_block ->
( ( 'a, 'b, 'c, 'd, 'e, 'f, [ `Protocol_versions ] * unit Truth.true_t )
with_block,
[> `Invalid_protocol_version | `Mismatched_protocol_version ] )
Core_kernel.Result.t
val skip_protocol_versions_validation :
[ `This_block_has_valid_protocol_versions ] ->
( 'a, 'b, 'c, 'd, 'e, 'f, [ `Protocol_versions ] * unit Truth.false_t )
with_block ->
( 'a, 'b, 'c, 'd, 'e, 'f, [ `Protocol_versions ] * unit Truth.true_t )
with_block