123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2020-2021 Nomadic Labs, <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)openStore_typesincludeInternal_event.Simpleletsection=["node";"store"](* Info *)letset_head=declare_1~section~level:Info~name:"set_head"~msg:"{block} set as new head"~pp1:pp_block_descriptor("block",block_descriptor_encoding)letset_checkpoint=declare_1~section~level:Info~name:"set_checkpoint"~msg:"checkpoint updated to {new_checkpoint}"~pp1:pp_block_descriptor("new_checkpoint",block_descriptor_encoding)letset_target=declare_1~section~level:Debug~name:"set_target"~msg:"the target was updated to {new_target}"~pp1:pp_block_descriptor("new_target",block_descriptor_encoding)letset_savepoint=declare_1~section~level:Info~name:"set_savepoint"~msg:"the savepoint was updated to {new_savepoint}"~pp1:pp_block_descriptor("new_savepoint",block_descriptor_encoding)letset_caboose=declare_1~section~level:Info~name:"set_caboose"~msg:"the caboose was updated to {new_caboose}"~pp1:pp_block_descriptor("new_caboose",block_descriptor_encoding)letstore_block=declare_1~section~level:Info~name:"store_block"~msg:"block {block} was stored"~pp1:pp_block_descriptor("block",block_descriptor_encoding)letstore_validated_block=declare_1~section~level:Info~name:"store_validated_block"~msg:"validated block {block} was stored"~pp1:pp_block_descriptor("block",block_descriptor_encoding)letstart_updating_floating_stores=declare_0~section~level:Info~name:"start_updating_floating_stores"~msg:"updating floating stores"()letstart_cementing_blocks=declare_0~section~level:Info~name:"start_cementing_blocks"~msg:"cementing blocks"()letstart_cementing_blocks_metadata=declare_0~section~level:Info~name:"start_cementing_blocks_metadata"~msg:"cementing blocks metadata"()letstart_merging_thread=declare_0~section~level:Info~name:"start_merging_thread"~msg:"running merging thread"()letend_merging_thread=declare_0~section~level:Info~name:"end_merging_thread"~msg:"merging thread ended"()letstart_store_garbage_collection=declare_0~section~level:Info~name:"start_store_garbage_collection"~msg:"garbage-collecting the cemented store"()letstart_merge_finalizer=declare_0~section~level:Info~name:"start_merge_finalizer"~msg:"triggering merge finalizer"()letstart_retreiving_predecessors=declare_0~section~level:Info~name:"start_retreiving_predecessors"~msg:"retrieving predecessors from floating store"()letstart_retreiving_cycles=declare_0~section~level:Info~name:"start_retreiving_cycles"~msg:"retrieving cycles from floating store"()letstore_is_consistent=declare_0~section~level:Debug~name:"store_is_consistent"~msg:"the store is consistent"()letmetadata_read_error=declare_1~section~level:Debug~name:"error_while_reading_cemented_metadata"~msg:"unexpected error while reading cemented metadata: {exc}"~pp1:Format.pp_print_string("exc",Data_encoding.string)(* Notice *)letfork_testchain=declare_4~section~level:Notice~name:"fork_testchain"~msg:"the test chain {chain_id} for protocol {protocol_hash} with genesis \
block hash {genesis_hash} was initialized from {fork_block} and is now \
registered in the store"~pp1:Chain_id.pp("chain_id",Chain_id.encoding)~pp2:Protocol_hash.pp("protocol_hash",Protocol_hash.encoding)~pp3:Block_hash.pp("genesis_hash",Block_hash.encoding)~pp4:pp_block_descriptor("fork_block",block_descriptor_encoding)letpp_int32fmti=Format.fprintffmt"%ld"iletstart_merging_stores=declare_1~section~level:Notice~name:"start_merging_stores"~msg:"merging store up to block level {lafl}"~pp1:pp_int32("lafl",Data_encoding.int32)letend_merging_stores=declare_1~section~level:Notice~name:"end_merging_stores"~msg:"store was successfully merged in {time}"~pp1:Time.System.Span.pp_hum("time",Time.System.Span.encoding)letstart_context_gc=declare_1~section~level:Info~name:"start_context_gc"~msg:"removing old contexts below block {block}"~pp1:pp_block_descriptor("block",block_descriptor_encoding)letstart_context_split=declare_1~section~level:Info~name:"start_context_split"~msg:"splitting context into a new chunk at level {level}"~pp1:pp_int32("level",Data_encoding.int32)letcontext_gc_is_not_allowed=declare_0~section~level:Warning~name:"gc_is_not_allowed"~msg:"garbage collection is not fully enabled on this data directory: context \
cannot be garbage collected. Please read the documentation or import a \
snapshot to enable it"()lettry_waiting_for_merge_termination=declare_0~section~level:Notice~name:"try_waiting_for_merge_termination"~msg:"try waiting for the store's merge completion"()letswitch_history_mode=declare_2~section~level:Notice~name:"switch_history_mode"~msg:"history mode successfully switched from {old} to {new}"~pp1:History_mode.pp("old",History_mode.encoding)~pp2:History_mode.pp("new",History_mode.encoding)letinconsistent_store=declare_1~section~level:Notice~name:"inconsistent_store"~msg:"the store is in an inconsistent state: {errs}"~pp1:(funppf->Format.fprintfppf"%a"Error_monad.pp_print_trace)("errs",Error_monad.trace_encoding)letfix_store=declare_0~section~level:Notice~name:"fix_store"~msg:"attempting to restore the store's consistency..."()letfix_floating_stores=declare_0~section~level:Notice~name:"fix_floating_stores"~msg:"the consistency of the floating stores was restored"()letfix_head=declare_2~section~level:Notice~name:"fix_head"~msg:"updating head (previously {prev}) with the fittest block present in the \
store: {new}"~pp1:(Format.pp_print_option~none:(funfmt()->Format.fprintffmt"missing")(funfmt->Format.fprintffmt"%a"pp_block_descriptor))("prev",Data_encoding.optionblock_descriptor_encoding)~pp2:pp_block_descriptor("new",block_descriptor_encoding)letfix_cementing_highwatermark=letpp_cemented_highwatermark=Format.pp_print_option~none:(funfmt()->Format.fprintffmt"None")(funfmt->Format.fprintffmt"%ld")indeclare_2~section~level:Notice~name:"fix_cementing_highwatermark"~msg:"updating cementing highwatermark (previously {prev}) with: {new}"~pp1:pp_cemented_highwatermark("prev",Data_encoding.(optionint32))~pp2:pp_cemented_highwatermark("new",Data_encoding.(optionint32))letfix_checkpoint=declare_2~section~level:Notice~name:"fix_checkpoint"~msg:"updating checkpoint (previously {prev}) with: {new}"~pp1:(Format.pp_print_option~none:(funfmt()->Format.fprintffmt"missing")(funfmt->Format.fprintffmt"%a"pp_block_descriptor))("prev",Data_encoding.optionblock_descriptor_encoding)~pp2:pp_block_descriptor("new",block_descriptor_encoding)letfix_savepoint=declare_2~section~level:Notice~name:"fix_savepoint"~msg:"updating savepoint (previously {prev}) with the lowest block with \
metadata found in the store: {new}"~pp1:(Format.pp_print_option~none:(funfmt()->Format.fprintffmt"missing")(funfmt->Format.fprintffmt"%a"pp_block_descriptor))("prev",Data_encoding.optionblock_descriptor_encoding)~pp2:pp_block_descriptor("new",block_descriptor_encoding)letfix_caboose=declare_2~section~level:Notice~name:"fix_caboose"~msg:"updating caboose (previously {prev}) with the lowest block found in the \
store: {new}"~pp1:(Format.pp_print_option~none:(funfmt()->Format.fprintffmt"missing")(funfmt->Format.fprintffmt"%a"pp_block_descriptor))("prev",Data_encoding.optionblock_descriptor_encoding)~pp2:pp_block_descriptor("new",block_descriptor_encoding)letstore_was_fixed=declare_0~section~level:Notice~name:"store_was_fixed"~msg:"the store was successfully fixed!"()letrecover_merge=declare_0~section~level:Notice~name:"recovering_merge"~msg:"recovering from an interrupted store merge"()letrestore_protocols_table=declare_0~section~level:Notice~name:"restore_protocols_table"~msg:"restoring protocols table"()letrestore_protocol_activation=declare_2~section~level:Notice~name:"restore_protocol_activation"~msg:"protocol {protocol_level} ({protocol_hash}) was successfully restored"("protocol_level",Data_encoding.int31)~pp2:Protocol_hash.pp("protocol_hash",Protocol_hash.encoding)letupdate_protocol_table=declare_4~section~level:Notice~name:"update_protocol_table"~msg:"the protocol table was updated: protocol {proto_hash} (level \
{proto_level}) was activated on block {block_hash} (level \
{block_level})"("proto_hash",Protocol_hash.encoding)~pp1:Protocol_hash.pp_short("proto_level",Data_encoding.int31)("block_hash",Block_hash.encoding)~pp3:Block_hash.pp("block_level",Data_encoding.int32)~pp4:pp_int32letrestore_history_mode=declare_1~section~level:Notice~name:"restore_history_mode"~msg:"history mode was successfully restored to {history_mode}, based on the \
configuration file or command line argument"("history_mode",History_mode.encoding)~pp1:History_mode.ppletrestore_inferred_history_mode=declare_1~section~level:Notice~name:"restore_inferred_history_mode"~msg:"history mode was successfully restored to {history_mode}. Warning: this \
history mode may differ from the one preceding the restore procedure \
and you may need to restart the node to explicitly force the history \
mode switch"("history_mode",History_mode.encoding)~pp1:History_mode.pp(* Warning *)letwarning_missing_metadata=declare_2~level:Warning~section~name:"missing_metadata"~msg:"the storage is missing some metadata for cycle \
{start_level}-{end_level}. Please consider restoring a consistent \
storage"("start_level",Data_encoding.int32)("end_level",Data_encoding.int32)(* Error *)letmerge_error=declare_3~section~level:Error~name:"merge_error"~msg:"merge from {start} to {end} failed: {message}"~pp1:pp_int32("start",Data_encoding.int32)~pp2:pp_int32("end",Data_encoding.int32)~pp3:Format.pp_print_string("message",Data_encoding.string)letnotify_merge_error=declare_1~section~level:Error~name:"notify_merge_error"~msg:"store merge has failed, restart the node to restore the consistency: \
{errs}"~pp1:(funppf->Format.fprintfppf"%a"Error_monad.pp_print_trace)("errs",Error_monad.trace_encoding)letupgrade_store_failed=declare_0~section~level:Error~name:"upgrade_store_failed"~msg:"store upgrade failed, cleaning up temporary files"()letupgrade_store_started=declare_0~section~level:Notice~name:"upgrade_store_started"~msg:"upgrading the store"()