Mavryk_store_shared.Block_reprBlock representation effectively stored on disk and its accessors.
type contents = {header : Mavryk_base.TzPervasives.Block_header.t;operations : Mavryk_base.TzPervasives.Operation.t list list;block_metadata_hash : Mavryk_base.TzPervasives.Block_metadata_hash.t option;operations_metadata_hashes : Mavryk_base.TzPervasives.Operation_metadata_hash.t
                               list
                               list
                               option;}The type for the effective contents of a block is its header and the operations it contains. Their metadata hashes are also present.
type metadata = {message : string option;max_operations_ttl : int;last_preserved_block_level : Stdlib.Int32.t;block_metadata : Mavryk_base.TzPervasives.Bytes.t;operations_metadata : Mavryk_validation.Block_validation.operation_metadata
                        list
                        list;}The type for a block's metadata stored on disk. This representation is tightly linked to Mavryk_validation.Block_validation.result which also has a strong dependency to Mavryk_protocol_environment.validation_result.
Some fields exposed by Mavryk_validation.Block_validation.result are unnecessary hence the lack of direct link.
type block = {hash : Mavryk_base.TzPervasives.Block_hash.t;contents : contents;mutable metadata : metadata option;}The type for a block stored on disk.
The hash of the block is also stored to improve efficiency by not forcing the user to hash the header. This also allows to store fake hashes (e.g. sandbox's genesis blocks) but should be prevented by the API.
The metadata might not be present. The mutability flag allows users to re-use the same structure to store freshly loaded metadata.
type t = blockval create_genesis_block : 
  genesis:Mavryk_base.TzPervasives.Genesis.t ->
  Mavryk_base.TzPervasives.Context_hash.t ->
  tcreate_genesis_block ~genesis context_hash creates a default genesis block for the given genesis and its context_hash that contains metadata.
val encoding : t Mavryk_base.TzPervasives.Data_encoding.tval pp_json : Stdlib.Format.formatter -> t -> unitpp_json pretty-print a block as JSON.
val descriptor : t -> Store_types.block_descriptordescriptor block returns the pair (hash x level) of block.
val hash : t -> Mavryk_base.TzPervasives.Block_hash.thash block returns the stored block's hash. It is not guaranteed to be the same as Block_header.hash (header block) (e.g. in sandbox, the genesis block might have a fake hash).
val operations : t -> Mavryk_base.TzPervasives.Operation.t list listoperations block returns the list of list of operations contained in the block.
val header : t -> Mavryk_base.TzPervasives.Block_header.tval shell_header : t -> Mavryk_base.TzPervasives.Block_header.shell_headerval level : t -> Stdlib.Int32.tval proto_level : t -> intval predecessor : t -> Mavryk_base.TzPervasives.Block_hash.tval timestamp : t -> Mavryk_base.TzPervasives.Time.Protocol.tval validation_passes : t -> intval operations_hash : t -> Mavryk_base.TzPervasives.Operation_list_list_hash.tval fitness : t -> Mavryk_base.TzPervasives.Fitness.tval context : t -> Mavryk_base.TzPervasives.Context_hash.tval protocol_data : t -> Mavryk_base.TzPervasives.Bytes.tval block_metadata_hash : 
  t ->
  Mavryk_base.TzPervasives.Block_metadata_hash.t optionval operations_metadata_hashes : 
  t ->
  Mavryk_base.TzPervasives.Operation_metadata_hash.t list list optionval message : metadata -> string optionval max_operations_ttl : metadata -> intval last_preserved_block_level : metadata -> Stdlib.Int32.tval block_metadata : metadata -> bytesval operations_metadata : 
  metadata ->
  Mavryk_validation.Block_validation.operation_metadata list listval check_block_consistency : 
  ?genesis_hash:Mavryk_base.TzPervasives.Block_hash.t ->
  ?pred_block:t ->
  t ->
  unit Mavryk_base.TzPervasives.tzresult Lwt.tcheck_block_consistency ?genesis_hash ?pred_block block checks that the stored data is consistent:
hash stored equals the result of Block_header.hash of its header and, if not, is this the stored genesis_hash?block a successor of pred_block with regards to its level and its predecessor's hash?val decode_metadata : string -> metadata optiondecode_metadata data decodes metadata from data encoded either with the new encoding or the legacy one.