Source file baking_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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
open Protocol
open Alpha_context
let section = [Protocol.name; "baker"]
let pp_int32 fmt n = Format.fprintf fmt "%ld" n
let pp_int64 fmt n = Format.fprintf fmt "%Ld" n
module State_transitions = struct
include Internal_event.Simple
let section = section @ ["transitions"]
let new_valid_proposal =
declare_3
~section
~name:"new_valid_proposal"
~level:Notice
~msg:"received new proposal {block} at level {level}, round {round}"
~pp1:Block_hash.pp
("block", Block_hash.encoding)
~pp2:pp_int32
("level", Data_encoding.int32)
~pp3:Round.pp
("round", Round.encoding)
let new_head =
declare_3
~section
~name:"new_head"
~level:Notice
~msg:"received new head {block} at level {level}, round {round}"
~pp1:Block_hash.pp
("block", Block_hash.encoding)
~pp2:pp_int32
("level", Data_encoding.int32)
~pp3:Round.pp
("round", Round.encoding)
let new_head_with_increasing_level =
declare_0
~section
~name:"new_head_with_increasing_level"
~level:Info
~msg:"received new head with level increasing"
()
let new_forge_event =
let open Baking_state in
declare_1
~section
~name:"new_forge_event"
~level:Notice
~msg:"received new forge event: {event}"
~pp1:pp_forge_event
("event", forge_event_encoding)
let no_proposal_slot =
declare_3
~section
~name:"no_proposal_slot"
~level:Info
~msg:
"end of round {current_round}; no proposal slot at level {level}, \
round {next_round}"
~pp1:Round.pp
("current_round", Round.encoding)
~pp2:pp_int32
("level", Data_encoding.int32)
~pp3:Round.pp
("next_round", Round.encoding)
let proposal_slot =
declare_4
~section
~name:"proposal_slot"
~level:Info
~msg:
"end of round {current_round}; proposal slot at level {level}, round \
{next_round} for {delegate}"
~pp1:Round.pp
("current_round", Round.encoding)
~pp2:pp_int32
("level", Data_encoding.int32)
~pp3:Round.pp
("next_round", Round.encoding)
~pp4:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let new_head_while_waiting_for_qc =
declare_0
~section
~name:"new_head_while_waiting_for_qc"
~level:Info
~msg:"received new head while waiting for a quorum"
()
let applied_expected_proposal_received =
declare_1
~section
~name:"applied_expected_proposal_received"
~level:Info
~msg:"received the expected application notice for {proposal}"
~pp1:Block_hash.pp
("proposal", Block_hash.encoding)
let unexpected_new_head_while_waiting_for_application =
declare_0
~section
~name:"unexpected_new_head_while_waiting_for_application"
~level:Info
~msg:"received new head while waiting for another proposal's application"
()
let new_valid_proposal_while_waiting_for_qc =
declare_0
~section
~name:"new_valid_proposal_while_waiting_for_qc"
~level:Info
~msg:"received new valid proposal while waiting for a quorum"
()
let valid_proposal_received_after_application =
declare_0
~section
~name:"valid_proposal_received_after_application"
~level:Info
~msg:"received valid proposal for a block already applied"
()
let unexpected_proposal_round =
declare_2
~section
~name:"unexpected_proposal_round"
~level:Info
~msg:
"unexpected proposal round, expected: {expected_round}, got: \
{proposal_round}"
~pp1:Round.pp
("expected_round", Round.encoding)
~pp2:Round.pp
("proposal_round", Round.encoding)
let proposal_for_round_already_seen =
declare_3
~section
~name:"proposal_for_round_already_seen"
~level:Warning
~msg:
"proposal {new_proposal} for current round ({current_round}) has \
already been seen {previous_proposal}"
~pp1:Block_hash.pp
("new_proposal", Block_hash.encoding)
~pp2:Round.pp
("current_round", Round.encoding)
~pp3:Block_hash.pp
("previous_proposal", Block_hash.encoding)
let updating_latest_proposal =
declare_1
~section
~name:"updating_latest_proposal"
~msg:"updating latest proposal to {block_hash}"
~level:Info
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let baker_is_ahead_of_node =
declare_2
~section
~name:"baker_is_ahead"
~level:Info
~msg:
"baker (level: {baker_level}) is ahead of the node (level: \
{node_level})"
~pp1:pp_int32
("baker_level", Data_encoding.int32)
~pp2:pp_int32
("node_level", Data_encoding.int32)
let new_proposal_is_on_another_branch =
declare_2
~section
~name:"new_proposal_is_on_another_branch"
~level:Info
~msg:
"received a proposal on another branch - current: current \
pred{current_branch}, new pred {new_branch}"
~pp1:Block_hash.pp
("current_branch", Block_hash.encoding)
~pp2:Block_hash.pp
("new_branch", Block_hash.encoding)
let switching_branch =
declare_0
~section
~name:"switching_branch"
~level:Info
~msg:"switching branch"
()
let branch_proposal_has_better_fitness =
declare_0
~section
~name:"branch_proposal_has_better_fitness"
~level:Info
~msg:"different branch proposal has a better fitness than us"
()
let branch_proposal_has_no_prequorum =
declare_0
~section
~name:"branch_proposal_has_no_prequorum"
~level:Info
~msg:"different branch proposal has no prequorum but we do"
()
let branch_proposal_has_lower_prequorum =
declare_0
~section
~name:"branch_proposal_has_lower_prequorum"
~level:Info
~msg:"different branch proposal has a lower prequorum than us"
()
let branch_proposal_has_better_prequorum =
declare_0
~section
~name:"branch_proposal_has_better_prequorum"
~level:Info
~msg:"different branch proposal has a better prequorum"
()
let branch_proposal_has_same_prequorum =
declare_0
~section
~name:"branch_proposal_has_same_prequorum"
~level:Error
~msg:"different branch proposal has the same prequorum"
()
let attempting_preattest_proposal =
declare_1
~section
~name:"attempting_preattest_proposal"
~level:Info
~msg:"attempting to preattest proposal {block_hash}"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let attempting_vote_proposal =
declare_1
~section
~name:"attempting_vote_proposal"
~level:Info
~msg:"attempting to vote for proposal {block_hash}"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let skipping_invalid_proposal =
declare_0
~section
~name:"skipping_invalid_proposal"
~level:Info
~msg:"invalid proposal, skipping"
()
let outdated_proposal =
declare_1
~section
~name:"outdated_proposal"
~level:Debug
~msg:"outdated proposal {block_hash}"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let preparing_fresh_block =
declare_2
~section
~name:"preparing_fresh_block"
~level:Info
~msg:"preparing fresh block for {delegate} at round {round}"
~pp1:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp2:Round.pp
("round", Round.encoding)
let no_attestable_payload_fresh_block =
declare_0
~section
~name:"no_attestable_payload_fresh_block"
~level:Info
~msg:"no attestable payload, proposing fresh block"
()
let repropose_block =
declare_1
~section
~name:"repropose_block"
~level:Info
~msg:"repropose block with payload {payload}"
~pp1:Block_payload_hash.pp
("payload", Block_payload_hash.encoding)
let unexpected_prequorum_received =
declare_2
~section
~name:"unexpected_prequorum_received"
~level:Info
~msg:
"unexpected prequorum received for {received_hash} instead of \
{expected_hash}"
~pp1:Block_hash.pp
("received_hash", Block_hash.encoding)
~pp2:Block_hash.pp
("expected_hash", Block_hash.encoding)
let unexpected_quorum_received =
declare_2
~section
~name:"unexpected_quorum_received"
~level:Info
~msg:
"unexpected quorum received for {received_hash} instead of \
{expected_hash}"
~pp1:Block_hash.pp
("received_hash", Block_hash.encoding)
~pp2:Block_hash.pp
("expected_hash", Block_hash.encoding)
let step_current_phase =
declare_2
~section
~name:"step_current_phase"
~level:Debug
~msg:"automaton step: current phase {phase}, event {event}"
~pp1:Baking_state.pp_phase
("phase", Baking_state.phase_encoding)
~pp2:Baking_state.pp_event
("event", Baking_state.event_encoding)
let discarding_attestation =
declare_3
~section
~name:"discarding_attestation"
~level:Info
~msg:
"discarding outdated attestation for {delegate} at level {level}, \
round {round}"
~pp1:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp2:pp_int32
("level", Data_encoding.int32)
~pp3:Round.pp
("round", Round.encoding)
end
module Node_rpc = struct
include Internal_event.Simple
let section = section @ ["rpc"]
let error_while_monitoring_heads =
declare_1
~section
~name:"error_while_monitoring_heads"
~level:Error
~msg:"error while monitoring heads {trace}"
~pp1:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let error_while_monitoring_valid_proposals =
declare_1
~section
~name:"error_while_monitoring_valid_proposals"
~level:Error
~msg:"error while monitoring valid proposals {trace}"
~pp1:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
end
module Scheduling = struct
include Internal_event.Simple
let section = section @ ["scheduling"]
let error_while_baking =
declare_1
~section
~name:"error_while_baking"
~level:Warning
~msg:"error while baking {trace}"
~pp1:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let waiting_for_new_head =
declare_0
~section
~name:"waiting_for_new_head"
~level:Info
~msg:"no possible timeout, waiting for a new head to arrive..."
()
let compute_next_timeout_elected_block =
declare_2
~section
~name:"compute_next_timeout_elected_block"
~level:Debug
~msg:
"found an elected block at level {level}, round {round}... checking \
baking rights"
~pp1:pp_int32
("level", Data_encoding.int32)
~pp2:Round.pp
("round", Round.encoding)
let proposal_already_injected =
declare_0
~section
~name:"proposal_already_injected"
~level:Debug
~msg:"proposal already injected for next level, skipping..."
()
let next_potential_slot =
declare_4
~section
~name:"next_potential_slot"
~level:Info
~msg:
"next potential slot for level {level} is at round {round} at \
{timestamp} for {delegate}"
~pp1:pp_int32
("level", Data_encoding.int32)
~pp2:Round.pp
("round", Round.encoding)
~pp3:Timestamp.pp
("timestamp", Timestamp.encoding)
~pp4:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let waiting_end_of_round =
declare_3
~section
~name:"waiting_end_of_round"
~level:Info
~msg:"waiting {timespan} until end of round {round} at {timestamp}"
~pp1:Ptime.Span.pp
("timespan", Time.System.Span.encoding)
~pp2:pp_int32
("round", Data_encoding.int32)
~pp3:Timestamp.pp
("timestamp", Timestamp.encoding)
let waiting_delayed_end_of_round =
declare_4
~section
~name:"waiting_delayed_end_of_round"
~level:Info
~msg:
"waiting {timespan} until {timestamp} (end of round {round} plus \
{delay}s delay)"
~pp1:Ptime.Span.pp
("timespan", Time.System.Span.encoding)
~pp2:pp_int32
("round", Data_encoding.int32)
~pp3:Timestamp.pp
("timestamp", Timestamp.encoding)
~pp4:pp_int64
("delay", Data_encoding.int64)
let waiting_time_to_bake =
declare_2
~section
~name:"waiting_time_to_bake"
~level:Info
~msg:"waiting {timespan} until it's time to bake at {timestamp}"
~pp1:Ptime.Span.pp
("timespan", Time.System.Span.encoding)
~pp2:Timestamp.pp
("timestamp", Timestamp.encoding)
let no_need_to_wait_for_proposal =
declare_0
~section
~name:"no_need_to_wait_for_proposal"
~level:Info
~msg:"no need to wait to propose a block"
()
let state_synchronized_to_round =
declare_1
~section
~name:"state_synchronized_to_round"
~level:Debug
~msg:"state synchronized to round {round}"
~pp1:Round.pp
("round", Round.encoding)
let proposal_in_the_future =
declare_1
~section
~name:"proposal_in_the_future"
~level:Debug
~msg:"received proposal in the future {block_hash}"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let process_proposal_in_the_future =
declare_1
~section
~name:"process_proposal_in_the_future"
~level:Debug
~msg:"process proposal received in the future with hash {block_hash}"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let waiting_to_forge_block =
declare_2
~section
~name:"waiting_to_forge_block"
~level:Info
~msg:"waiting {timespan} until it's time to forge block at {timestamp}"
~pp1:Ptime.Span.pp
("timespan", Time.System.Span.encoding)
~pp2:Timestamp.pp
("timestamp", Timestamp.encoding)
let no_need_to_wait_to_forge_block =
declare_0
~section
~name:"no_need_to_wait_to_forge_block"
~level:Info
~msg:"no need to wait to forge a block"
()
let first_baker_of_next_level =
declare_0
~section
~name:"first_baker_of_next_level"
~level:Info
~msg:
"first baker of next level found among delegates. pre-emptively \
forging block."
()
end
module Lib = struct
include Internal_event.Simple
let section = section @ ["lib"]
let attempting_to_vote_for_proposal =
declare_2
~section
~name:"attempting_preattest_proposal"
~level:Debug
~msg:"attempting to {action} proposal {proposal}"
("action", Baking_state.consensus_vote_kind_encoding)
~pp1:
(fun fmt -> function
| Baking_state.Preattestation -> Format.fprintf fmt "preattest"
| Attestation -> Format.fprintf fmt "attest")
("proposal", Baking_state.proposal_encoding)
~pp2:Baking_state.pp_proposal
end
module Actions = struct
include Internal_event.Simple
let section = section @ ["actions"]
let skipping_consensus_vote =
declare_5
~section
~name:"skipping_consensus_vote"
~level:Error
~msg:
"unable to sign {vote_kind} for {delegate} at level {level}, round \
{round} -- {trace}"
~pp1:Baking_state.pp_consensus_vote_kind
("vote_kind", Baking_state.consensus_vote_kind_encoding)
~pp2:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp3:pp_int32
("level", Data_encoding.int32)
~pp4:Round.pp
("round", Round.encoding)
~pp5:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let failed_to_get_dal_attestations =
declare_2
~section
~name:"failed_to_get_attestations"
~level:Error
~msg:"unable to get DAL attestation for {delegate} -- {trace}"
~pp1:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp2:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let failed_to_get_dal_attestations_in_time =
declare_2
~section
~name:"failed_to_get_attestations_in_time"
~level:Error
~msg:
"unable to get DAL attestation for {delegate} within the {timeout}s \
timeout"
~pp1:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp2:Format.pp_print_float
("timeout", Data_encoding.float)
let failed_to_inject_consensus_vote =
declare_3
~section
~name:"failed_to_inject_consensus_vote"
~level:Error
~msg:"failed to inject {vote_kind} for {delegate} -- {trace}"
~pp1:Baking_state.pp_consensus_vote_kind
("vote_kind", Baking_state.consensus_vote_kind_encoding)
~pp2:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp3:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let failed_to_forge_block =
declare_2
~section
~name:"failed_to_forge_block"
~level:Error
~msg:"failed to forge block for {delegate} -- {trace}"
~pp1:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp2:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let potential_double_baking =
declare_2
~section
~name:"potential_double_baking"
~level:Warning
~msg:"potential double baking detected at level {level}, round {round}"
~pp1:pp_int32
~pp2:Round.pp
("level", Data_encoding.int32)
("round", Round.encoding)
let consensus_vote_injected =
declare_5
~section
~name:"consensus_vote_injected"
~level:Notice
~msg:
"injected {vote_kind} {ophash} for {delegate} for level {level}, round \
{round}"
~pp1:Baking_state.pp_consensus_vote_kind
("vote_kind", Baking_state.consensus_vote_kind_encoding)
~pp2:Operation_hash.pp
("ophash", Operation_hash.encoding)
~pp3:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp4:pp_int32
("level", Data_encoding.int32)
~pp5:Round.pp
("round", Round.encoding)
let attach_dal_attestation =
declare_5
~section
~name:"attach_dal_attestation"
~level:Notice
~msg:
"ready to attach DAL attestation for level {attestation_level}, round \
{round}, with bitset {bitset} for {delegate} to attest slots \
published at level {published_level}"
~pp1:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp2:Z.pp_print
("bitset", Data_encoding.n)
("published_level", Data_encoding.int32)
("attestation_level", Data_encoding.int32)
("round", Round.encoding)
let synchronizing_round =
declare_1
~section
~name:"synchronizing_round"
~level:Info
~msg:"synchronizing round after block {block}"
~pp1:Block_hash.pp
("block", Block_hash.encoding)
let prepare_forging_block =
declare_3
~section
~name:"prepare_forging_block"
~level:Debug
~msg:
"prepare forging block at level {level}, round {round} for {delegate}"
~pp1:pp_int32
~pp2:Round.pp
~pp3:Baking_state.pp_consensus_key_and_delegate
("level", Data_encoding.int32)
("round", Round.encoding)
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let forging_block =
declare_3
~section
~name:"forging_block"
~level:Info
~msg:"forging block at level {level}, round {round} for {delegate}"
~pp1:pp_int32
~pp2:Round.pp
~pp3:Baking_state.pp_consensus_key_and_delegate
("level", Data_encoding.int32)
("round", Round.encoding)
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let delayed_block_injection =
declare_4
~section
~name:"delayed_block_injection"
~level:Debug
~msg:
"waiting {delay} before injecting block at level {level}, round \
{round} for {delegate}"
("delay", Time.System.Span.encoding)
~pp1:Time.System.Span.pp_hum
("level", Data_encoding.int32)
~pp2:pp_int32
("round", Round.encoding)
~pp3:Round.pp
("delegate", Baking_state.consensus_key_and_delegate_encoding)
~pp4:Baking_state.pp_consensus_key_and_delegate
let injecting_block =
declare_3
~section
~name:"injecting_block"
~level:Debug
~msg:"injecting block at level {level}, round {round} for {delegate}"
~pp1:pp_int32
~pp2:Round.pp
~pp3:Baking_state.pp_consensus_key_and_delegate
("level", Data_encoding.int32)
("round", Round.encoding)
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let block_injected =
declare_4
~section
~name:"block_injected"
~level:Notice
~msg:
"block {block} at level {level}, round {round} injected for {delegate}"
~pp1:Block_hash.pp
~pp2:pp_int32
~pp3:Round.pp
~pp4:Baking_state.pp_consensus_key_and_delegate
("block", Block_hash.encoding)
("level", Data_encoding.int32)
("round", Round.encoding)
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let block_injection_failed =
declare_2
~section
~name:"block_injection_failed"
~level:Error
~msg:"failed to inject block {block_hash} -- {trace}"
("block_hash", Block_hash.encoding)
~pp1:Block_hash.pp
("trace", Error_monad.trace_encoding)
~pp2:Error_monad.pp_print_trace
let signing_consensus_vote =
declare_2
~section
~name:"signing_consensus_vote"
~level:Info
~msg:"signing {vote_kind} for {delegate}"
~pp1:Baking_state.pp_consensus_vote_kind
("vote_kind", Baking_state.consensus_vote_kind_encoding)
~pp2:Baking_state.pp_consensus_key_and_delegate
("delegate", Baking_state.consensus_key_and_delegate_encoding)
let invalid_json_file =
declare_1
~section
~name:"invalid_json_file"
~level:Warning
~msg:"{filename} is not a valid JSON file"
("filename", Data_encoding.string)
let no_operations_found_in_file =
declare_1
~section
~name:"no_operations_found_in_file"
~level:Warning
~msg:"no operations found in file {filename}"
("filename", Data_encoding.string)
let cannot_fetch_operations =
declare_1
~section
~name:"cannot_fetch_operations"
~level:Error
~msg:"cannot fetch operations: {errs}"
("errs", Error_monad.(TzTrace.encoding error_encoding))
let vote_for_liquidity_baking_toggle =
declare_1
~section
~name:"vote_for_liquidity_baking_toggle"
~level:Notice
~msg:"Voting {value} for liquidity baking toggle vote"
( "value",
Protocol.Alpha_context.Per_block_votes.liquidity_baking_vote_encoding )
let vote_for_adaptive_issuance =
declare_1
~section
~name:"vote_for_adaptive_issuance"
~level:Notice
~msg:"Voting {value} for adaptive issuance vote"
( "value",
Protocol.Alpha_context.Per_block_votes.adaptive_issuance_vote_encoding
)
let no_dal_node =
declare_0
~section
~name:"no_dal_node"
~level:Notice
~msg:
"DAL feature enabled, but no DAL node specified: cannot fetch \
attestations"
()
end
module VDF = struct
include Internal_event.Simple
let section = section @ ["vdf"]
let vdf_revelation_injected =
declare_3
~section
~name:"vdf_revelation_injected"
~level:Notice
~msg:
"Injected VDF revelation for cycle {cycle} (chain {chain} with \
operation {ophash})"
~pp1:pp_int32
("cycle", Data_encoding.int32)
~pp2:Format.pp_print_string
("chain", Data_encoding.string)
~pp3:Operation_hash.pp
("ophash", Operation_hash.encoding)
let vdf_daemon_error =
declare_2
~section
~name:"vdf_daemon_error"
~level:Error
~msg:"{worker}: error while running VDF daemon: {errors}"
~pp1:Format.pp_print_string
("worker", Data_encoding.string)
~pp2:pp_print_top_error_of_trace
("errors", Error_monad.(TzTrace.encoding error_encoding))
let vdf_daemon_connection_lost =
declare_1
~section
~name:"vdf_daemon_connection_lost"
~level:Error
~msg:"Connection to node lost, VDF daemon {worker} exiting"
~pp1:Format.pp_print_string
("worker", Data_encoding.string)
let vdf_daemon_cannot_kill_computation =
declare_1
~section
~name:"vdf_daemon_cannot_kill_computation"
~level:Error
~msg:"Error when killining running computation: {error}"
~pp1:Format.pp_print_string
("error", Data_encoding.string)
let vdf_info =
declare_1
~section
~name:"vdf_internal"
~level:Notice
~msg:"{msg}"
~pp1:Format.pp_print_string
("msg", Data_encoding.string)
end
module Nonces = struct
include Internal_event.Simple
let section = section @ ["nonces"]
let found_nonce_to_reveal =
declare_2
~section
~name:"found_nonce_to_reveal"
~level:Notice
~msg:"found nonce to reveal for block {block}, level {level}"
~pp1:Block_hash.pp
("block", Block_hash.encoding)
~pp2:Raw_level.pp
("level", Raw_level.encoding)
let revealing_nonce =
declare_3
~section
~name:"revealing_nonce"
~level:Notice
~msg:
"revealing nonce of level {level} (chain {chain} with operation \
{ophash})"
~pp1:pp_int32
("level", Data_encoding.int32)
~pp2:Format.pp_print_string
("chain", Data_encoding.string)
~pp3:Operation_hash.pp
("ophash", Operation_hash.encoding)
let cannot_fetch_chain_head_level =
declare_0
~section
~name:"cannot_fetch_chain_head_level"
~level:Error
~msg:"cannot fetch chain head level, aborting nonces filtering"
()
let incoherent_nonce =
declare_1
~section
~name:"incoherent_nonce"
~level:Error
~msg:"incoherent nonce for level {level}"
~pp1:(fun fmt -> Format.fprintf fmt "%a" Raw_level.pp)
("level", Raw_level.encoding)
let cannot_read_nonces =
declare_1
~section
~name:"cannot_read_nonces"
~level:Error
~msg:"cannot read nonces {trace}"
~pp1:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let cannot_retrieve_unrevealed_nonces =
declare_1
~section
~name:"cannot_retrieve_unrevealed_nonces"
~level:Error
~msg:"cannot retrieve unrevealed nonces {trace}"
~pp1:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let cannot_inject_nonces =
declare_1
~section
~name:"cannot_inject_nonces"
~level:Error
~msg:"cannot inject nonces {trace}"
~pp1:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let =
declare_2
~section
~name:"cant_retrieve_block_header_for_nonce"
~level:Warning
~msg:"cannot retrieve block header {header} associated with nonce {trace}"
("header", Data_encoding.string)
~pp2:Error_monad.pp_print_trace
("trace", Error_monad.trace_encoding)
let registering_nonce =
declare_1
~section
~name:"registering_nonce"
~level:Info
~msg:"registering nonce for block {block}"
~pp1:Block_hash.pp
("block", Block_hash.encoding)
let nothing_to_reveal =
declare_1
~section
~name:"nothing_to_reveal"
~level:Info
~msg:"nothing to reveal for block {block}"
~pp1:Block_hash.pp
("block", Block_hash.encoding)
let revelation_worker_started =
declare_0
~section
~name:"revelation_worker_started"
~level:Info
~msg:"revelation worker started"
()
let success_migrate_nonces =
declare_0
~section
~name:"success_migrate_nonces"
~level:Notice
~msg:"successfully migrated nonces: legacy nonces are safe to delete"
()
let ignore_failed_nonce_migration =
declare_1
~section
~name:"ignore_failed_nonce_migration"
~level:Warning
~msg:
"There is not enough block history to complete the migration. Try \
starting from an older snapshot or providing more block history. The \
nonces from the following blocks will not be migrated:\n\
{failed} "
~pp1:(Format.pp_print_list Block_hash.pp)
("failed", Data_encoding.list Block_hash.encoding)
let outdated_nonce =
declare_1
~section
~name:"outdated_nonce"
~level:Info
~msg:"outdated nonce for block {block_hash} is safe to delete"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let unexpected_nonce =
declare_1
~section
~name:"unexpected_nonce"
~level:Info
~msg:"unexpected nonce for block {block_hash} is safe to delete"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
let revealed_nonce =
declare_1
~section
~name:"revealed_nonce"
~level:Info
~msg:"revealed nonce for block {block_hash} is safe to delete"
~pp1:Block_hash.pp
("block_hash", Block_hash.encoding)
end
module Per_block_votes = struct
include Internal_event.Simple
let reading_per_block_votes =
declare_1
~section
~name:"reading_per_block_votes"
~level:Notice
~msg:"reading votes file: {path}"
("path", Data_encoding.string)
let liquidity_baking_toggle_vote =
declare_1
~section
~name:"read_liquidity_baking_toggle_vote"
~level:Notice
~msg:"read liquidity baking toggle vote = {value}"
( "value",
Protocol.Alpha_context.Per_block_votes.liquidity_baking_vote_encoding )
let per_block_vote_file_fail =
declare_1
~section
~name:"per_block_vote_file_error"
~level:Error
~msg:"Error reading the block vote file: {errors}"
~pp1:pp_print_top_error_of_trace
("errors", Error_monad.(TzTrace.encoding error_encoding))
let adaptive_issuance_vote =
declare_1
~section
~name:"read_adaptive_issuance_vote"
~level:Notice
~msg:"read adaptive issuance vote = {value}"
( "value",
Protocol.Alpha_context.Per_block_votes.adaptive_issuance_vote_encoding
)
end
module Selection = struct
include Internal_event.Simple
let section = section @ ["operation_selection"]
let invalid_operation_filtered =
declare_2
~section
~name:"invalid_operation_filtered"
~level:Warning
~msg:"filtered invalid operation {op}: {errors}"
~pp1:Operation_hash.pp
("op", Operation_hash.encoding)
~pp2:pp_print_top_error_of_trace
("errors", Error_monad.(TzTrace.encoding error_encoding))
let cannot_serialize_operation_metadata =
declare_1
~section
~name:"cannot_serialize_operation_metadata"
~level:Warning
~msg:"cannot serialize operation {op} metadata"
~pp1:Operation_hash.pp
("op", Operation_hash.encoding)
end
module Forge_worker = struct
include Internal_event.Simple
let section = section @ ["forge_worker"]
let error_while_processing_forge_request =
declare_1
~section
~name:"error_while_processing_forge_request"
~level:Warning
~msg:"error while processing forge request: {errors}"
("errors", Error_monad.(TzTrace.encoding error_encoding))
~pp1:pp_print_top_error_of_trace
let error_while_authorizing_consensus_votes =
declare_1
~section
~name:"error_while_authorizing_consensus_votes"
~level:Error
~msg:"error while authorizing consensus votes: {errors}"
("errors", Error_monad.(TzTrace.encoding error_encoding))
~pp1:pp_print_top_error_of_trace
end