package octez-shell-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file snapshots_events.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
(*****************************************************************************)
(*                                                                           *)
(* Open Source License                                                       *)
(* Copyright (c) 2019 Dynamic Ledger Solutions, Inc. <contact@tezos.com>     *)
(* Copyright (c) 2019-2021 Nomadic Labs. <nomadic@tezcore.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.                                                 *)
(*                                                                           *)
(*****************************************************************************)

open Store_types

module Event = struct
  include Internal_event.Simple

  let section = ["node"; "snapshots"]

  (* Notice *)
  let export_info =
    declare_3
      ~section
      ~level:Notice
      ~name:"export_info"
      ~msg:
        "exporting a snapshot (v{version}) in {history_mode} mode, targeting \
         block hash {block}"
      ~pp1:Format.pp_print_int
      ("version", Data_encoding.int31)
      ~pp2:History_mode.pp_short
      ("history_mode", History_mode.encoding)
      ~pp3:pp_block_descriptor
      ("block", block_descriptor_encoding)

  let export_success =
    declare_1
      ~section
      ~level:Notice
      ~name:"export_success"
      ~msg:"successful export: {filename}"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)

  let cleaning_tmp_export_directory =
    declare_1
      ~section
      ~level:Notice
      ~name:"cleaning_tmp_export_directory"
      ~msg:"cleaning leftover export directory '{filename}'"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)

  let import_info =
    declare_2
      ~section
      ~level:Notice
      ~name:"import_info"
      ~msg:"importing data from snapshot {filename}: {header}"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)
      ~pp2:Format.pp_print_string
      ("header", Data_encoding.(string))

  let import_unspecified_hash =
    declare_0
      ~section
      ~level:Notice
      ~name:"import_unspecified_hash"
      ~msg:
        "you may consider using the --block <block_hash> argument to ensure \
         that the block imported is the one you expected"
      ()

  let import_loading =
    declare_0
      ~section
      ~level:Notice
      ~name:"import_loading"
      ~msg:
        "retrieving and validating data. This can take a while, please bear \
         with us"
      ()

  let import_success =
    declare_1
      ~section
      ~level:Notice
      ~name:"import_succes"
      ~msg:"successful import from file {filename}"
      ~pp1:Format.pp_print_string
      ("filename", Data_encoding.string)

  let cleaning_after_failure =
    declare_0
      ~section
      ~level:Notice
      ~name:"cleaning_after_failure"
      ~msg:"cleaning up artifacts after failure"
      ()

  let suggest_no_check =
    declare_0
      ~section
      ~level:Notice
      ~name:"suggest_no_check"
      ~msg:
        "Note: the import of a snapshot can be sped up using the '--no-check' \
         option. Only use this option if you fully trust the snapshot source."
      ()

  (* Info *)
  let validate_protocol_sources =
    declare_1
      ~section
      ~level:Notice
      ~name:"validate_protocol_sources"
      ~msg:"validating protocol {hash} against sources"
      ~pp1:Protocol_hash.pp
      ("hash", Protocol_hash.encoding)

  (* Warning *)
  let warn_no_check =
    declare_0
      ~section
      ~level:Warning
      ~name:"warn_no_check"
      ~msg:
        "Warning: to speed up the import, the consistency of the imported data \
         will not be fully checked. It is not recommended to use this option \
         with a snapshot downloaded from an untrusted source"
      ()

  let warn_tar_corruption =
    declare_1
      ~section
      ~level:Warning
      ~name:"warn_tar_corruption"
      ~msg:
        "Warning: the snapshot being imported is in version {version} and \
         using the tar format: some internal files might be corrupted. If the \
         snapshot import fails, please import using a snapshot that is a least \
         version 7."
      ~pp1:Format.pp_print_int
      ("version", Data_encoding.int31)

  (* Debug *)
  let restoring_context =
    declare_0
      ~section
      ~level:Debug
      ~name:"restoring_context"
      ~msg:"restoring the context from the snapshot"
      ()

  let context_restored =
    declare_0
      ~section
      ~level:Debug
      ~name:"context_restored"
      ~msg:"context was successfully restored"
      ()

  let applying_target_block =
    declare_0
      ~section
      ~level:Debug
      ~name:"applying_target_block"
      ~msg:"applying the block targeted by the snapshot"
      ()

  let target_block_applied =
    declare_0
      ~section
      ~level:Debug
      ~name:"target_block_applied"
      ~msg:"block target was successfully applied"
      ()

  let restoring_protocols =
    declare_0
      ~section
      ~level:Debug
      ~name:"restoring_protocols"
      ~msg:"restoring protocols from snapshot"
      ()

  let protocols_restored =
    declare_0
      ~section
      ~level:Debug
      ~name:"protocols_restored"
      ~msg:"protocols were successfully restored"
      ()

  let restoring_cemented_indexes =
    declare_0
      ~section
      ~level:Debug
      ~name:"restoring_cemented_indexes"
      ~msg:"restoring cemented indexes"
      ()

  let restoring_cemented_cycles =
    declare_0
      ~section
      ~level:Debug
      ~name:"restoring_cemented_cycles"
      ~msg:"restoring cemented cycles"
      ()

  let cemented_cycles_restored =
    declare_0
      ~section
      ~level:Debug
      ~name:"cemented_cycles_restored"
      ~msg:"cemented cycles were successfully restored"
      ()

  let checking_cycles_consistency =
    declare_0
      ~section
      ~level:Debug
      ~name:"checking_cycles_consistency"
      ~msg:"checking cemented cycles consistency"
      ()

  let cycles_consistency_checked =
    declare_0
      ~section
      ~level:Debug
      ~name:"cycles_consistency_checked"
      ~msg:"cemented cycles consistency checked"
      ()

  let restoring_floating_blocks =
    declare_0
      ~section
      ~level:Debug
      ~name:"restoring_floating_blocks"
      ~msg:"restoring floating blocks"
      ()

  let floating_blocks_restored =
    declare_0
      ~section
      ~level:Debug
      ~name:"floating_blocks_restored"
      ~msg:"floating blocks were successfully restored"
      ()

  let exporting_cemented_cycles =
    declare_0
      ~section
      ~level:Debug
      ~name:"exporting_cemented_cycles"
      ~msg:"exporting cemented cycles"
      ()

  let cemented_cycles_exported =
    declare_0
      ~section
      ~level:Debug
      ~name:"cemented_cycles_exported"
      ~msg:"cemented cycles were successfully exported"
      ()

  let exporting_context =
    declare_0
      ~section
      ~level:Debug
      ~name:"exporting_context"
      ~msg:"exporting context"
      ()

  let context_exported =
    declare_0
      ~section
      ~level:Debug
      ~name:"exported_context"
      ~msg:"context was successfully exported"
      ()

  let exporting_floating_blocks =
    declare_0
      ~section
      ~level:Debug
      ~name:"exporting_floating_blocks"
      ~msg:"exporting floating blocks"
      ()

  let floating_blocks_exported =
    declare_0
      ~section
      ~level:Debug
      ~name:"floating_blocks_exported"
      ~msg:"floating blocks were successfully exported"
      ()

  let exporting_protocols =
    declare_0
      ~section
      ~level:Debug
      ~name:"exporting_protocols"
      ~msg:"exporting protocols"
      ()

  let protocols_exported =
    declare_0
      ~section
      ~level:Debug
      ~name:"protocols_exported"
      ~msg:"protocols were successfully exported"
      ()
end
OCaml

Innovation. Community. Security.