Source file injector_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
open Injector_worker_types
module Make (Rollup : Injector_sigs.PARAMETERS) = struct
module Tags = Injector_tags.Make (Rollup.Tag)
include Internal_event.Simple
let section = Rollup.events_section
let declare_1 ~name ~msg ~level ?pp1 enc1 =
declare_3
~section
~name
~msg:("[{signer}: {tags}] " ^ msg)
~level
("signer", Tezos_crypto.Signature.Public_key_hash.encoding)
("tags", Tags.encoding)
enc1
~pp1:Tezos_crypto.Signature.Public_key_hash.pp_short
~pp2:Tags.pp
?pp3:pp1
let declare_2 ~name ~msg ~level ?pp1 ?pp2 enc1 enc2 =
declare_4
~section
~name
~msg:("[{signer}: {tags}] " ^ msg)
~level
("signer", Tezos_crypto.Signature.Public_key_hash.encoding)
("tags", Tags.encoding)
enc1
enc2
~pp1:Tezos_crypto.Signature.Public_key_hash.pp_short
~pp2:Tags.pp
?pp3:pp1
?pp4:pp2
let declare_3 ~name ~msg ~level ?pp1 ?pp2 ?pp3 enc1 enc2 enc3 =
declare_5
~section
~name
~msg:("[{signer}: {tags}] " ^ msg)
~level
("signer", Tezos_crypto.Signature.Public_key_hash.encoding)
("tags", Tags.encoding)
enc1
enc2
enc3
~pp1:Tezos_crypto.Signature.Public_key_hash.pp_short
~pp2:Tags.pp
?pp3:pp1
?pp4:pp2
?pp5:pp3
let request_failed =
declare_3
~name:"request_failed"
~msg:"request {view} failed ({worker_status}): {errors}"
~level:Warning
("view", Request.encoding)
~pp1:Request.pp
("worker_status", Worker_types.request_status_encoding)
~pp2:Worker_types.pp_status
("errors", Error_monad.trace_encoding)
~pp3:Error_monad.pp_print_trace
let request_completed_notice =
declare_2
~name:"request_completed_notice"
~msg:"{view} {worker_status}"
~level:Notice
("view", Request.encoding)
("worker_status", Worker_types.request_status_encoding)
~pp1:Request.pp
~pp2:Worker_types.pp_status
let request_completed_debug =
declare_2
~name:"request_completed_debug"
~msg:"{view} {worker_status}"
~level:Debug
("view", Request.encoding)
("worker_status", Worker_types.request_status_encoding)
~pp1:Request.pp
~pp2:Worker_types.pp_status
let new_tezos_head =
declare_1
~name:"new_tezos_head"
~msg:"processing new Tezos head {head}"
~level:Debug
("head", Block_hash.encoding)
let injecting_pending =
declare_1
~name:"injecting_pending"
~msg:"Injecting {count} pending operations"
~level:Notice
("count", Data_encoding.int31)
let pp_operations_list ppf operations =
Format.fprintf
ppf
"@[%a@]"
(Format.pp_print_list L1_operation.pp)
operations
let pp_operations_hash_list ppf operations =
Format.fprintf
ppf
"@[%a@]"
(Format.pp_print_list L1_operation.Hash.pp)
operations
let injecting_operations =
declare_1
~name:"injecting_operations"
~msg:"Injecting operations: {operations}"
~level:Notice
("operations", Data_encoding.list L1_operation.encoding)
~pp1:pp_operations_list
let simulating_operations =
declare_2
~name:"simulating_operations"
~msg:"Simulating operations (force = {force}): {operations}"
~level:Debug
("operations", Data_encoding.list L1_operation.encoding)
("force", Data_encoding.bool)
~pp1:pp_operations_list
let dropping_operation =
declare_2
~name:"dropping_operation"
~msg:"Dropping operation {operation} failing with {error}"
~level:Notice
("operation", L1_operation.encoding)
~pp1:L1_operation.pp
("error", Environment.Error_monad.trace_encoding)
~pp2:Environment.Error_monad.pp_trace
let injected =
declare_2
~name:"injected"
~msg:"Injected {nb} operations in {oph}"
~level:Notice
("nb", Data_encoding.int31)
("oph", Operation_hash.encoding)
let add_pending =
declare_1
~name:"add_pending"
~msg:"Add {operation} to pending"
~level:Notice
("operation", L1_operation.encoding)
~pp1:L1_operation.pp
let retry_operation =
declare_1
~name:"retry_operation"
~msg:"Retry {operation}"
~level:Notice
("operation", L1_operation.encoding)
~pp1:L1_operation.pp
let included =
declare_3
~name:"included"
~msg:"Included operations of {block} at level {level}: {operations}"
~level:Notice
("block", Block_hash.encoding)
("level", Data_encoding.int32)
("operations", Data_encoding.list L1_operation.Hash.encoding)
~pp3:pp_operations_hash_list
let revert_operations =
declare_1
~name:"revert_operations"
~msg:"Reverting operations: {operations}"
~level:Notice
("operations", Data_encoding.list L1_operation.Hash.encoding)
~pp1:pp_operations_hash_list
let confirmed_level =
declare_1
~name:"confirmed_level"
~msg:"Confirmed Tezos level {level}"
~level:Notice
("level", Data_encoding.int32)
let confirmed_operations =
declare_2
~name:"confirmed_operations"
~msg:"Confirmed operations of level {level}: {operations}"
~level:Notice
("level", Data_encoding.int32)
("operations", Data_encoding.list L1_operation.Hash.encoding)
~pp2:pp_operations_hash_list
let loaded_from_disk =
declare_2
~name:"loaded_from_disk"
~msg:"Loaded {nb} elements in {kind} from disk"
~level:Notice
("nb", Data_encoding.int31)
("kind", Data_encoding.string)
let corrupted_operation_on_disk =
declare_2
~name:"corrupted_operation_on_disk"
~msg:"Ignoring unreadable file {file} on disk: {error}"
~level:Warning
("file", Data_encoding.string)
("error", Error_monad.trace_encoding)
~pp1:Format.pp_print_string
~pp2:Error_monad.pp_print_trace
let inject_wait =
declare_1
~name:"inject_wait"
~msg:"Waiting {delay} seconds to trigger injection"
~level:Notice
("delay", Data_encoding.float)
end